Skip to content

Commit c95eda2

Browse files
committed
test(runner): resolve ui-test timing issues
1 parent fa38366 commit c95eda2

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

packages/extester-runner/src/ui-test/01_extension.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ describe('ExTester Runner', function () {
4444
*/
4545
before(async function () {
4646
driver = VSBrowser.instance.driver;
47+
await driver.sleep(3_000); // give vscode workbench some time to load properly
4748
await waitUntilExtensionIsActivated(driver, `${pjson.displayName}`);
4849
});
4950

packages/extester-runner/src/ui-test/03_extersterTreeProvider.test.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ describe('Parser test suite', function () {
5858
this.timeout(30000);
5959

6060
const browser = VSBrowser.instance;
61-
await browser.openResources(EXAMPLE_PROJECT);
61+
await browser.openResources(EXAMPLE_PROJECT, async () => {
62+
await browser.driver.sleep(3_000);
63+
});
6264

6365
await updateSettings(TEST_FILE_GLOB_SETTINGS_ID, TEST_FILE_GLOB);
6466
});
@@ -84,7 +86,7 @@ describe('Parser test suite', function () {
8486
const runnerView = await (await new ActivityBar().getViewControl(EXTESTER_RUNNER))?.openView();
8587
assert.ok(runnerView, 'Runner view not found');
8688

87-
const content = await runnerView.getContent();
89+
const content = runnerView.getContent();
8890
assert.ok(content, 'Content not found');
8991

9092
const sections = await content.getSections();
@@ -131,7 +133,7 @@ describe('Parser test suite', function () {
131133
const runnerView = await (await new ActivityBar().getViewControl(EXTESTER_RUNNER))?.openView();
132134
assert.ok(runnerView, 'Runner view not found');
133135

134-
const content = await runnerView.getContent();
136+
const content = runnerView.getContent();
135137
assert.ok(content, 'Content not found');
136138

137139
const sections = await content.getSections();
@@ -178,7 +180,7 @@ describe('Parser test suite', function () {
178180
const runnerView = await (await new ActivityBar().getViewControl(EXTESTER_RUNNER))?.openView();
179181
assert.ok(runnerView, 'Runner view not found');
180182

181-
const content = await runnerView.getContent();
183+
const content = runnerView.getContent();
182184
assert.ok(content, 'Content not found');
183185

184186
const sections = await content.getSections();
@@ -227,7 +229,7 @@ describe('Parser test suite', function () {
227229
const runnerView = await (await new ActivityBar().getViewControl(EXTESTER_RUNNER))?.openView();
228230
assert.ok(runnerView, 'Runner view not found');
229231

230-
const content = await runnerView.getContent();
232+
const content = runnerView.getContent();
231233
assert.ok(content, 'Content not found');
232234

233235
const sections = await content.getSections();
@@ -255,12 +257,12 @@ describe('Parser test suite', function () {
255257
assert.strictEqual(firstDescribeLabel.trim(), EXPECTED_DESCRIBE_1);
256258

257259
// first describe first test
258-
const firstDesribeIts = await firstDescribe.getChildren();
259-
assert.ok(firstDesribeIts?.length === 1, 'First describe should have exactly one it');
260+
const firstDescribeIts = await firstDescribe.getChildren();
261+
assert.ok(firstDescribeIts?.length === 1, 'First describe should have exactly one it');
260262

261-
const firstDesribeFirstIt = firstDesribeIts[0];
262-
const firstDesribeFirstItLabel = await firstDesribeFirstIt.getLabel();
263-
assert.strictEqual(firstDesribeFirstItLabel.trim(), EXPECTED_TEST_1);
263+
const firstDescribeFirstIt = firstDescribeIts[0];
264+
const firstDescribeFirstItLabel = await firstDescribeFirstIt.getLabel();
265+
assert.strictEqual(firstDescribeFirstItLabel.trim(), EXPECTED_TEST_1);
264266

265267
// second describe
266268
const secondDescribe = describes[1];

packages/extester-runner/src/ui-test/utils/testUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export async function extensionIsActivated(displayName: string): Promise<boolean
113113
*/
114114
export async function getSection(sectionIndex: number): Promise<ViewSection> {
115115
const runnerView = await (await new ActivityBar().getViewControl(EXTESTER_RUNNER))?.openView();
116-
const content = await (await runnerView?.getContent())?.getSections();
116+
const content = await runnerView?.getContent()?.getSections();
117117
if (!content) {
118118
throw new Error('Content sections not found');
119119
}

0 commit comments

Comments
 (0)