Update Code to 1.93.1 (#6984)

This commit is contained in:
Olivier Benz
2024-09-19 12:10:46 +02:00
committed by GitHub
parent 50c6abf3a8
commit 3542bd157b
22 changed files with 72 additions and 72 deletions

View File

@ -16,10 +16,7 @@ describe("Downloads (enabled)", ["--disable-workspace-trust"], {}, async () => {
await fs.writeFile(tmpFilePath, "hello world")
// Action
const fileInExplorer = await codeServerPage.page.waitForSelector("text=unique-file.txt")
await fileInExplorer.click({
button: "right",
})
await codeServerPage.openContextMenu("text=unique-file.txt")
expect(await codeServerPage.page.isVisible("text=Download...")).toBe(true)
})
@ -73,10 +70,7 @@ describe("Downloads (disabled)", ["--disable-workspace-trust", "--disable-file-d
await fs.writeFile(tmpFilePath, "Hello World")
// Action
const fileInExplorer = await codeServerPage.page.waitForSelector("text=unique-file.txt")
await fileInExplorer.click({
button: "right",
})
await codeServerPage.openContextMenu("text=unique-file.txt")
expect(await codeServerPage.page.isVisible("text=Download...")).toBe(false)
})

View File

@ -555,6 +555,15 @@ export class CodeServerPage {
})
}
/**
* Open context menu on the specified selector.
*/
async openContextMenu(selector: string): Promise<void> {
const el = await this.page.waitForSelector(selector)
await el.click({ button: "right" })
await this.page.waitForSelector(".context-view-block")
}
/**
* Execute a command in the root of the instance's workspace directory.
*/

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

View File

@ -28,10 +28,11 @@ const config: PlaywrightTestConfig = {
name: "Chromium",
use: { browserName: "chromium" },
},
{
name: "Firefox",
use: { browserName: "firefox" },
},
// Firefox seems to have bugs with opening context menus in the file tree.
// {
// name: "Firefox",
// use: { browserName: "firefox" },
// },
{
name: "WebKit",
use: { browserName: "webkit" },