Same fix for upload tests

This commit is contained in:
Asher 2024-09-19 00:00:58 -08:00
parent 1676fd99a7
commit dea5e8d9a9
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
3 changed files with 4 additions and 10 deletions

View File

@ -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)
})

View File

@ -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")
}
/**

View File

@ -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)
})