2021-04-02 01:57:44 +08:00
|
|
|
/// <reference types="jest-playwright-preset" />
|
2021-04-02 05:52:46 +08:00
|
|
|
import { CODE_SERVER_ADDRESS, STORAGE } from "../utils/constants"
|
2021-03-17 05:43:29 +08:00
|
|
|
|
|
|
|
describe("Open Help > About", () => {
|
2021-04-02 01:57:44 +08:00
|
|
|
beforeEach(async () => {
|
2021-03-17 05:43:29 +08:00
|
|
|
// Create a new context with the saved storage state
|
2021-04-02 05:52:46 +08:00
|
|
|
// so we don't have to logged in
|
2021-03-17 05:43:29 +08:00
|
|
|
const storageState = JSON.parse(STORAGE) || {}
|
2021-04-03 07:49:01 +08:00
|
|
|
await jestPlaywright.resetContext({
|
|
|
|
storageState,
|
|
|
|
})
|
2021-04-02 05:52:46 +08:00
|
|
|
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
|
2021-03-17 05:43:29 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
it("should see a 'Help' then 'About' button in the Application Menu that opens a dialog", async () => {
|
|
|
|
// Make sure the editor actually loaded
|
|
|
|
expect(await page.isVisible("div.monaco-workbench"))
|
|
|
|
|
|
|
|
// Click the Application menu
|
|
|
|
await page.click("[aria-label='Application Menu']")
|
|
|
|
// See the Help button
|
|
|
|
const helpButton = "a.action-menu-item span[aria-label='Help']"
|
|
|
|
expect(await page.isVisible(helpButton))
|
|
|
|
|
|
|
|
// Hover the helpButton
|
|
|
|
await page.hover(helpButton)
|
|
|
|
|
|
|
|
// see the About button and click it
|
|
|
|
const aboutButton = "a.action-menu-item span[aria-label='About']"
|
|
|
|
expect(await page.isVisible(aboutButton))
|
|
|
|
// NOTE: it won't work unless you hover it first
|
|
|
|
await page.hover(aboutButton)
|
|
|
|
await page.click(aboutButton)
|
|
|
|
|
|
|
|
const codeServerText = "text=code-server"
|
|
|
|
expect(await page.isVisible(codeServerText))
|
|
|
|
})
|
|
|
|
})
|