2021-01-27 00:44:23 +03:00
|
|
|
import { chromium, Page, Browser } from "playwright"
|
2021-03-10 02:33:01 +03:00
|
|
|
import { CODE_SERVER_ADDRESS } from "../utils/constants"
|
2021-01-27 00:44:23 +03:00
|
|
|
|
|
|
|
let browser: Browser
|
|
|
|
let page: Page
|
2021-01-28 02:04:37 +03:00
|
|
|
|
2021-01-27 00:44:23 +03:00
|
|
|
beforeAll(async () => {
|
|
|
|
browser = await chromium.launch()
|
|
|
|
})
|
|
|
|
afterAll(async () => {
|
|
|
|
await browser.close()
|
|
|
|
})
|
|
|
|
beforeEach(async () => {
|
|
|
|
page = await browser.newPage()
|
|
|
|
})
|
|
|
|
afterEach(async () => {
|
|
|
|
await page.close()
|
|
|
|
})
|
|
|
|
|
2021-01-28 02:04:37 +03:00
|
|
|
it("should see the login page", async () => {
|
2021-02-12 22:43:11 +03:00
|
|
|
await page.goto(CODE_SERVER_ADDRESS)
|
2021-01-28 02:04:37 +03:00
|
|
|
// It should send us to the login page
|
|
|
|
expect(await page.title()).toBe("code-server login")
|
2021-01-27 00:44:23 +03:00
|
|
|
})
|