Skip to content

Commit

Permalink
frontend: Add playwright app test
Browse files Browse the repository at this point in the history
Add working scripts

Signed-off-by: Vincent T <[email protected]>
  • Loading branch information
vyncent-t committed Oct 24, 2024
1 parent 87c7253 commit 1eb401b
Show file tree
Hide file tree
Showing 8 changed files with 332 additions and 488 deletions.
5 changes: 4 additions & 1 deletion app/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"name": "e2e-tests",
"version": "1.0.0",
"main": "index.js",
"scripts": {},
"scripts": {
"test-app": "export PLAYWRIGHT_TEST_MODE=app playwright test",
"test-web": "export PLAYWRIGHT_TEST_MODE=web playwright test"
},
"keywords": [],
"author": "",
"license": "ISC",
Expand Down
42 changes: 10 additions & 32 deletions app/e2e-tests/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,21 @@ import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests',
/* Run tests in files in parallel */
fullyParallel: true,
timeout: 60 * 1000,
expect: {
/**
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 120000,
},
fullyParallel: false,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
workers: 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
Expand All @@ -38,36 +46,6 @@ export default defineConfig({
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},

{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},

{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* Run your local dev server before starting the tests */
Expand Down
Loading

0 comments on commit 1eb401b

Please sign in to comment.