Wait for SqlToolsService to start before running smoke tests (#15864)

This commit is contained in:
Charles Gagnon
2021-06-22 13:05:21 -07:00
committed by GitHub
parent 1dc4a437eb
commit ec2f2b19fb
2 changed files with 13 additions and 7 deletions

View File

@@ -146,10 +146,18 @@ export class Application {
await this.code.waitForWindowIds(ids => ids.length > 0);
await this.code.waitForElement('.monaco-workbench');
// {{SQL CARBON EDIT}} Wait for specified status bar items before considering the app ready - we wait for them together to avoid timing
// issues with the status bar items disappearing
const statusbarPromises: Promise<string>[] = [];
if (this.remote) {
await this.code.waitForTextContent('.monaco-workbench .statusbar-item[id="status.host"]', ' TestResolver', undefined, 2000);
statusbarPromises.push(this.code.waitForTextContent('.monaco-workbench .statusbar-item[id="status.host"]', ' TestResolver', undefined, 2000));
}
// Wait for SQL Tools Service to start before considering the app ready
statusbarPromises.push(this.code.waitForTextContent('.monaco-workbench .statusbar-item[id="Microsoft.mssql"]', 'SQL Tools Service Started', undefined, 30000));
await Promise.all(statusbarPromises);
// wait a bit, since focus might be stolen off widgets
// as soon as they open (e.g. quick access)
await new Promise(c => setTimeout(c, 1000));