set Playwright actionTimeout to 15 seconds (#3115)
* set playwright actionTimeout to 15 seconds * enabled screenshot on failure and html reporter to easily see individual test duration * extend timeout when waiting for console * removed duplicated html reporter --------- Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> Co-authored-by: ryanrosello-og <ry@zoo.dev>
This commit is contained in:
@ -246,14 +246,17 @@ export const getMovementUtils = (opts: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function waitForAuthAndLsp(page: Page) {
|
async function waitForAuthAndLsp(page: Page) {
|
||||||
const waitForLspPromise = page.waitForEvent('console', async (message) => {
|
const waitForLspPromise = page.waitForEvent('console', {
|
||||||
// it would be better to wait for a message that the kcl lsp has started by looking for the message message.text().includes('[lsp] [window/logMessage]')
|
predicate: async (message) => {
|
||||||
// but that doesn't seem to make it to the console for macos/safari :(
|
// it would be better to wait for a message that the kcl lsp has started by looking for the message message.text().includes('[lsp] [window/logMessage]')
|
||||||
if (message.text().includes('start kcl lsp')) {
|
// but that doesn't seem to make it to the console for macos/safari :(
|
||||||
await new Promise((resolve) => setTimeout(resolve, 200))
|
if (message.text().includes('start kcl lsp')) {
|
||||||
return true
|
await new Promise((resolve) => setTimeout(resolve, 200))
|
||||||
}
|
return true
|
||||||
return false
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
timeout: 45_000,
|
||||||
})
|
})
|
||||||
if (process.env.CI) {
|
if (process.env.CI) {
|
||||||
await waitForPageLoadWithRetry(page)
|
await waitForPageLoadWithRetry(page)
|
||||||
|
@ -32,6 +32,8 @@ export default defineConfig({
|
|||||||
|
|
||||||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
||||||
trace: 'retain-on-failure',
|
trace: 'retain-on-failure',
|
||||||
|
actionTimeout: 15000,
|
||||||
|
screenshot: 'only-on-failure',
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Configure projects for major browsers */
|
/* Configure projects for major browsers */
|
||||||
|
Reference in New Issue
Block a user