Skip to content

feat(testing): add e2e tests for code-server and terminal #3169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: fix tests to check visibility correctly
  • Loading branch information
jsjoeio committed Apr 23, 2021
commit 2bf0a0e76ed5a3d1ff0a464cad2696f51d147acd
2 changes: 1 addition & 1 deletion test/e2e/globalSetup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ test.describe("globalSetup", () => {
test("should keep us logged in using the storageState", options, async ({ page }) => {
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
// Make sure the editor actually loaded
expect(await page.isVisible("div.monaco-workbench"))
expect(await page.isVisible("div.monaco-workbench")).toBe(true)
})
})
2 changes: 1 addition & 1 deletion test/e2e/login.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test.describe("login", () => {
await page.click(".submit")
await page.waitForLoadState("networkidle")
// Make sure the editor actually loaded
expect(await page.isVisible("div.monaco-workbench"))
expect(await page.isVisible("div.monaco-workbench")).toBe(true)
})

test("should see an error message for missing password", options, async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/logout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ test.describe("logout", () => {
await page.click(".submit")
await page.waitForLoadState("networkidle")
// Make sure the editor actually loaded
expect(await page.isVisible("div.monaco-workbench"))
expect(await page.isVisible("div.monaco-workbench")).toBe(true)

// Click the Application menu
await page.click("[aria-label='Application Menu']")

// See the Log out button
const logoutButton = "a.action-menu-item span[aria-label='Log out']"
expect(await page.isVisible(logoutButton))
expect(await page.isVisible(logoutButton)).toBe(true)

await page.hover(logoutButton)
// TODO(@jsjoeio)
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/openHelpAbout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@ test.describe("Open Help > About", () => {
async ({ page }) => {
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
// Make sure the editor actually loaded
expect(await page.isVisible("div.monaco-workbench"))
expect(await page.isVisible("div.monaco-workbench")).toBe(true)

// 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))
expect(await page.isVisible(helpButton)).toBe(true)

// 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))
expect(await page.isVisible(aboutButton)).toBe(true)
// 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))
expect(await page.isVisible(codeServerText)).toBe(true)
},
)
})