From 1a60279d3131e936f602fb89ae737c6016475846 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 19 Sep 2024 00:00:58 -0800 Subject: [PATCH] Same fix for upload tests --- test/e2e/downloads.test.ts | 2 -- test/e2e/models/CodeServer.ts | 1 + test/e2e/uploads.test.ts | 11 +++-------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/test/e2e/downloads.test.ts b/test/e2e/downloads.test.ts index 75b3d713f7b6..0adcd68ff83d 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 7148c19325f3..32301280222f 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 codeServerPage.page.waitForSelector(".context-view-block") } /** diff --git a/test/e2e/uploads.test.ts b/test/e2e/uploads.test.ts index 55ebea947a80..80df808a44e4 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) })