diff --git a/test/e2e/downloads.test.ts b/test/e2e/downloads.test.ts index 75b3d713f..0adcd68ff 100644 --- a/test/e2e/downloads.test.ts +++ b/test/e2e/downloads.test.ts @@ -18,7 +18,6 @@ describe("Downloads (enabled)", ["--disable-workspace-trust"], {}, async () => { // Action await codeServerPage.openContextMenu("text=unique-file.txt") - await codeServerPage.page.waitForSelector(".context-view-block") expect(await codeServerPage.page.isVisible("text=Download...")).toBe(true) }) @@ -73,7 +72,6 @@ describe("Downloads (disabled)", ["--disable-workspace-trust", "--disable-file-d // Action await codeServerPage.openContextMenu("text=unique-file.txt") - await codeServerPage.page.waitForSelector(".context-view-block") expect(await codeServerPage.page.isVisible("text=Download...")).toBe(false) }) diff --git a/test/e2e/models/CodeServer.ts b/test/e2e/models/CodeServer.ts index 7148c1932..2a03f9770 100644 --- a/test/e2e/models/CodeServer.ts +++ b/test/e2e/models/CodeServer.ts @@ -566,6 +566,7 @@ export class CodeServerPage { const el = await this.page.waitForSelector(selector) await el.click({ button: "left" }) await this.page.keyboard.press("Shift+F10") + await this.page.waitForSelector(".context-view-block") } /** diff --git a/test/e2e/uploads.test.ts b/test/e2e/uploads.test.ts index 55ebea947..80df808a4 100644 --- a/test/e2e/uploads.test.ts +++ b/test/e2e/uploads.test.ts @@ -16,10 +16,8 @@ describe("Uploads (enabled)", ["--disable-workspace-trust"], {}, () => { await fs.mkdir(tmpDirPath) // Action - const fileInExplorer = await codeServerPage.page.waitForSelector('span:has-text("test-directory")') - await fileInExplorer.click({ - button: "right", - }) + await codeServerPage.openContextMenu('span:has-text("test-directory")') + expect(await codeServerPage.page.isVisible("text=Upload...")).toBe(true) }) @@ -44,10 +42,7 @@ describe("Uploads (disabled)", ["--disable-workspace-trust", "--disable-file-upl await fs.mkdir(tmpDirPath) // Action - const fileInExplorer = await codeServerPage.page.waitForSelector('span:has-text("test-directory")') - await fileInExplorer.click({ - button: "right", - }) + await codeServerPage.openContextMenu('span:has-text("test-directory")') expect(await codeServerPage.page.isVisible("text=Upload...")).toBe(false) })