mirror of https://github.com/coder/code-server.git
Attempt to fix Firefox e2e test with context menus
This commit is contained in:
parent
150942dc10
commit
df09d5f607
|
@ -16,10 +16,7 @@ describe("Downloads (enabled)", ["--disable-workspace-trust"], {}, async () => {
|
||||||
await fs.writeFile(tmpFilePath, "hello world")
|
await fs.writeFile(tmpFilePath, "hello world")
|
||||||
|
|
||||||
// Action
|
// Action
|
||||||
const fileInExplorer = await codeServerPage.page.waitForSelector("text=unique-file.txt")
|
await codeServerPage.openContextMenu("text=unique-file.txt")
|
||||||
await fileInExplorer.click({
|
|
||||||
button: "right",
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(await codeServerPage.page.isVisible("text=Download...")).toBe(true)
|
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")
|
await fs.writeFile(tmpFilePath, "Hello World")
|
||||||
|
|
||||||
// Action
|
// Action
|
||||||
const fileInExplorer = await codeServerPage.page.waitForSelector("text=unique-file.txt")
|
await codeServerPage.openContextMenu("text=unique-file.txt")
|
||||||
await fileInExplorer.click({
|
|
||||||
button: "right",
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(await codeServerPage.page.isVisible("text=Download...")).toBe(false)
|
expect(await codeServerPage.page.isVisible("text=Download...")).toBe(false)
|
||||||
})
|
})
|
||||||
|
|
|
@ -555,6 +555,19 @@ export class CodeServerPage {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open context menu on the specified selector.
|
||||||
|
*/
|
||||||
|
async openContextMenu(selector: string): Promise<void> {
|
||||||
|
// Firefox appears to have an issue with right clicking to show the context
|
||||||
|
// menu. It seems to be related to VS Code trying to handle the clipboard
|
||||||
|
// although I am not sure why it presents in the file menu. To work around
|
||||||
|
// it, left click and open the context menu using Shift+F10 instead.
|
||||||
|
const el = await this.page.waitForSelector(selector)
|
||||||
|
await el.click({ button: "left" })
|
||||||
|
await this.page.keyboard.press("Shift+F10")
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute a command in the root of the instance's workspace directory.
|
* Execute a command in the root of the instance's workspace directory.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue