Skip to content

Commit abd7d81

Browse files
committed
Update extensionUITest.ts
1 parent e1670cd commit abd7d81

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

test/ui-test/extensionUITest.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,28 @@ export function extensionUIAssetsTest(): void {
3333
);
3434
// wait a bit for sections to load
3535
await new Promise((resolve) => setTimeout(resolve, 3000));
36-
section = (await sideBar.getContent().getSection('Installed')) as ExtensionsViewSection;
37-
await section.expand();
38-
yamlItem = await driver.wait(
36+
section = await driver.wait(
3937
async () => {
40-
return await section.findItem(`@installed ${YamlConstants.YAML_NAME}`);
38+
try {
39+
const content = sideBar.getContent();
40+
try {
41+
const sec = (await content.getSection('Installed')) as ExtensionsViewSection;
42+
return sec;
43+
} catch {
44+
// ignore and fall back below
45+
}
46+
47+
// pick the first available section
48+
const sections = await content.getSections();
49+
return (sections?.[0] as ExtensionsViewSection) ?? null;
50+
} catch {
51+
return null;
52+
}
4153
},
4254
15000,
43-
'There were not visible items available under installed section'
55+
'Could not find extensions section'
4456
);
57+
await section.expand();
4558
yamlItem = await driver.wait(
4659
async () => {
4760
return await section.findItem(`@installed ${YamlConstants.YAML_NAME}`);

0 commit comments

Comments
 (0)