mirror of https://github.com/coder/code-server.git
feat: add logger to tests
This commit is contained in:
parent
f241e38907
commit
dd80eed5b0
|
@ -4,7 +4,12 @@
|
|||
// tests are running in multiple browsers
|
||||
describe("Browser gutcheck", () => {
|
||||
beforeEach(async () => {
|
||||
await jestPlaywright.resetBrowser()
|
||||
await jestPlaywright.resetBrowser({
|
||||
logger: {
|
||||
isEnabled: (name) => name === "browser",
|
||||
log: (name, severity, message, args) => console.log(`${name} ${message}`),
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
test("should display correct browser based on userAgent", async () => {
|
||||
|
|
|
@ -8,7 +8,13 @@ describe("globalSetup", () => {
|
|||
// Create a new context with the saved storage state
|
||||
// so we don't have to logged in
|
||||
const storageState = JSON.parse(STORAGE) || {}
|
||||
await jestPlaywright.resetContext({ storageState })
|
||||
await jestPlaywright.resetContext({
|
||||
storageState,
|
||||
logger: {
|
||||
isEnabled: (name, severity) => name === "browser",
|
||||
log: (name, severity, message, args) => console.log(`${name} ${message}`),
|
||||
},
|
||||
})
|
||||
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
|
||||
})
|
||||
|
||||
|
|
|
@ -3,7 +3,12 @@ import { CODE_SERVER_ADDRESS, PASSWORD } from "../utils/constants"
|
|||
|
||||
describe("login", () => {
|
||||
beforeEach(async () => {
|
||||
await jestPlaywright.resetBrowser()
|
||||
await jestPlaywright.resetBrowser({
|
||||
logger: {
|
||||
isEnabled: (name, severity) => name === "browser",
|
||||
log: (name, severity, message, args) => console.log(`${name} ${message}`),
|
||||
},
|
||||
})
|
||||
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
|
||||
})
|
||||
|
||||
|
|
|
@ -4,7 +4,12 @@ import { CODE_SERVER_ADDRESS } from "../utils/constants"
|
|||
|
||||
describe("login page", () => {
|
||||
beforeEach(async () => {
|
||||
await jestPlaywright.resetContext()
|
||||
await jestPlaywright.resetContext({
|
||||
logger: {
|
||||
isEnabled: (name, severity) => name === "browser",
|
||||
log: (name, severity, message, args) => console.log(`${name} ${message}`),
|
||||
},
|
||||
})
|
||||
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
|
||||
})
|
||||
|
||||
|
|
|
@ -3,7 +3,12 @@ import { CODE_SERVER_ADDRESS, PASSWORD } from "../utils/constants"
|
|||
|
||||
describe("logout", () => {
|
||||
beforeEach(async () => {
|
||||
await jestPlaywright.resetBrowser()
|
||||
await jestPlaywright.resetBrowser({
|
||||
logger: {
|
||||
isEnabled: (name, severity) => name === "browser",
|
||||
log: (name, severity, message, args) => console.log(`${name} ${message}`),
|
||||
},
|
||||
})
|
||||
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
|
||||
})
|
||||
|
||||
|
|
|
@ -6,7 +6,13 @@ describe("Open Help > About", () => {
|
|||
// Create a new context with the saved storage state
|
||||
// so we don't have to logged in
|
||||
const storageState = JSON.parse(STORAGE) || {}
|
||||
await jestPlaywright.resetContext({ storageState })
|
||||
await jestPlaywright.resetContext({
|
||||
storageState,
|
||||
logger: {
|
||||
isEnabled: (name, severity) => name === "browser",
|
||||
log: (name, severity, message, args) => console.log(`${name} ${message}`),
|
||||
},
|
||||
})
|
||||
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue