generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: replace custom test fixture with global setup
- Loading branch information
1 parent
68d6ba3
commit c7c66ee
Showing
10 changed files
with
52 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { type FullConfig, chromium } from '@playwright/test' | ||
|
||
const globalSetup = async (config: FullConfig) => { | ||
console.log('Waiting for server to be available...') | ||
|
||
const browser = await chromium.launch({ headless: false }) | ||
const context = await browser.newContext() | ||
const page = await context.newPage() | ||
await page.goto('http://localhost:8892/modules') | ||
|
||
console.log('Waiting for modules to load...') | ||
await page.waitForFunction( | ||
() => { | ||
const moduleNames = ['time', 'echo', 'cron', 'fsm', 'http', 'pubsub'] | ||
|
||
return moduleNames.every((module) => document.querySelector(`li#module-tree-module-${module}`) !== null) | ||
}, | ||
{ timeout: 120000 }, | ||
) | ||
console.log('Modules loaded!') | ||
|
||
await browser.close() | ||
} | ||
|
||
export default globalSetup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters