diff --git a/test/ui-test/contentAssistTest.ts b/test/ui-test/contentAssistTest.ts index 5e94d624..7aec8d06 100644 --- a/test/ui-test/contentAssistTest.ts +++ b/test/ui-test/contentAssistTest.ts @@ -16,16 +16,16 @@ export function contentAssistSuggestionTest(): void { const yamlFilePath = path.join(homeDir, yamlFileName); before(async function setup() { - this.timeout(20000); + this.timeout(80000); driver = VSBrowser.instance.driver; editor = await createCustomFile(yamlFilePath); await driver.wait(async () => { return await getSchemaLabel(yamlFileName); - }, 18000); + }, 45000); }); it('Content assist suggests right suggestion', async function () { - this.timeout(15000); + this.timeout(45000); editor = new TextEditor(); await editor.setText('api'); const contentAssist = await editor.toggleContentAssist(true); diff --git a/test/ui-test/customTagsTest.ts b/test/ui-test/customTagsTest.ts index 486a0757..57ec7769 100644 --- a/test/ui-test/customTagsTest.ts +++ b/test/ui-test/customTagsTest.ts @@ -18,17 +18,17 @@ export function customTagsTest(): void { let editorView: EditorView; before(async function setup() { - this.timeout(20000); + this.timeout(80000); driver = VSBrowser.instance.driver; editorView = new EditorView(); await createCustomFile(yamlFilePath); await driver.wait(async () => { return await getSchemaLabel(yamlFileName); - }, 18000); + }, 45000); }); it('YAML custom tags works as expected', async function () { - this.timeout(30000); + this.timeout(60000); const settingsEditor = await new Workbench().openSettings(); const setting = await settingsEditor.findSetting('Custom Tags', 'Yaml'); @@ -37,7 +37,21 @@ export function customTagsTest(): void { await hardDelay(2000); const textSettingsEditor = (await editorView.openEditor('settings.json')) as TextEditor; if (process.platform === 'darwin') { - await driver.actions().sendKeys(' "customTag1"').perform(); + const fullText = await textSettingsEditor.getText(); + const lines = fullText.split('\n'); + + // find the line with "yaml.customTags" + let targetLine = -1; + for (let i = 0; i < lines.length; i++) { + if (lines[i].includes('"yaml.customTags"') && lines[i].includes('[')) { + targetLine = i + 2; // position on the line after the opening bracket + break; + } + } + if (targetLine === -1) { + expect.fail('Could not find yaml.customTags in settings.json'); + } + await textSettingsEditor.typeTextAt(targetLine, 5, ' "customTag1"'); } else { const coor = await textSettingsEditor.getCoordinates(); await textSettingsEditor.typeTextAt(coor[0], coor[1], ' "customTag1"'); diff --git a/test/ui-test/extensionUITest.ts b/test/ui-test/extensionUITest.ts index d3243751..db1dd868 100644 --- a/test/ui-test/extensionUITest.ts +++ b/test/ui-test/extensionUITest.ts @@ -22,28 +22,53 @@ export function extensionUIAssetsTest(): void { let yamlItem: ExtensionsViewItem; before(async function () { - this.timeout(20000); + this.timeout(100000); driver = VSBrowser.instance.driver; view = await new ActivityBar().getViewControl('Extensions'); sideBar = await view.openView(); - driver.wait( + await driver.wait( async () => !(await sideBar.getContent().hasProgress()), - 5000, + 30000, "Progress bar hasn't been hidden within the timeout" ); - section = (await sideBar.getContent().getSection('Installed')) as ExtensionsViewSection; + // wait a bit for sections to load + await new Promise((resolve) => setTimeout(resolve, 10000)); + section = await driver.wait( + async () => { + try { + const content = sideBar.getContent(); + const sections = await content.getSections(); + for (const sectionName of ['Installed', 'INSTALLED', 'installed']) { + try { + const sec = await content.getSection(sectionName); + if (sec) return sec as ExtensionsViewSection; + } catch { + // try next name + } + } + if (sections.length > 0) { + return sections[0] as ExtensionsViewSection; + } + return null; + } catch { + return null; + } + }, + 40000, + 'Could not find extensions section' + ); await section.expand(); yamlItem = await driver.wait( async () => { return await section.findItem(`@installed ${YamlConstants.YAML_NAME}`); }, - 5000, + 20000, 'There were not visible items available under installed section' ); }); it('YAML extension is installed', async function () { - this.timeout(5000); + this.timeout(10000); expect(yamlItem).not.undefined; let author: string; let name: string; @@ -62,7 +87,8 @@ export function extensionUIAssetsTest(): void { expect(author).to.equal('Red Hat'); }); - after(async () => { + after(async function () { + this.timeout(5000); if (sideBar && (await sideBar.isDisplayed()) && view) { await view.closeView(); }