mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-25 05:34:35 +00:00
Add support for running in-browser tests via playwright in GitHub CLI (#7820)
* Add support for running in-browser tests via playwright in GitHub CLI * `ci.yml` was updated to store the report so that it can be inspected on failure * `ci-test.sh` was added as an expansion to `test.sh` which installs and runs playwright * `playwright.spec.js` does the actual verification of opening the test TW edition in browser, waiting for the tests to finish and then verifying it has indeed passed * `playwright.config.js` Playwrifht configuration * Add support for running in-browser tests via playwright in GitHub CLI * `ci.yml` was updated to store the report so that it can be inspected on failure * `ci-test.sh` was added as an expansion to `test.sh` which installs and runs playwright * `playwright.spec.js` does the actual verification of opening the test TW edition in browser, waiting for the tests to finish and then verifying it has indeed passed * `playwright.config.js` Playwrifht configuration * Fix file permissions for `ci-test.sh` * Increased node version for github actions to support playwright * Add installation of the required @playwright/test library during CI test execution
This commit is contained in:
46
playwright.config.js
Normal file
46
playwright.config.js
Normal file
@@ -0,0 +1,46 @@
|
||||
const { defineConfig, devices } = require('@playwright/test');
|
||||
|
||||
/**
|
||||
* @see https://playwright.dev/docs/test-configuration
|
||||
*/
|
||||
module.exports = defineConfig({
|
||||
testDir: './editions/test/',
|
||||
|
||||
// Allow parallel tests
|
||||
fullyParallel: true,
|
||||
|
||||
// Prevent accidentally committed "test.only" from wrecking havoc
|
||||
forbidOnly: !!process.env.CI,
|
||||
|
||||
// Do not retry tests on failure
|
||||
retries: 0,
|
||||
|
||||
// How many parallel workers
|
||||
workers: process.env.CI ? 1 : undefined,
|
||||
|
||||
// Reporter to use. See https://playwright.dev/docs/test-reporters
|
||||
reporter: 'html',
|
||||
|
||||
// Settings shared with all the tests
|
||||
use: {
|
||||
// Take a screenshot when the test fails
|
||||
screenshot: {
|
||||
mode: 'only-on-failure',
|
||||
fullPage: true
|
||||
}
|
||||
},
|
||||
|
||||
/* Configure projects for major browsers */
|
||||
projects: [
|
||||
{
|
||||
name: 'chromium',
|
||||
use: { ...devices['Desktop Chrome'] },
|
||||
},
|
||||
|
||||
{
|
||||
name: 'firefox',
|
||||
use: { ...devices['Desktop Firefox'] },
|
||||
}
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user