Skip to content

Commit

Permalink
feat: install playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalinDe committed Nov 22, 2023
1 parent 6413da5 commit da78b4a
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 3 deletions.
6 changes: 5 additions & 1 deletion web/frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ yarn-error.log*
.idea

.vscode

/test-results/
/tests-examples/
/playwright-report/
/blob-report/
/playwright/.cache/
71 changes: 71 additions & 0 deletions web/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions web/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"file-saver": "^2.0.5",
"i18next": "^21.6.10",
"i18next-browser-languagedetector": "^6.1.3",
"pg": "^8.11.1",
"prop-types": "^15.8.1",
"react": "^17.0.1",
"react-beautiful-dnd": "^13.1.0",
Expand All @@ -33,10 +34,10 @@
"react-scripts": "5.0.0",
"short-unique-id": "^4.4.4",
"web-vitals": "^2.1.4",
"yup": "^0.32.11",
"pg": "^8.11.1"
"yup": "^0.32.11"
},
"devDependencies": {
"@playwright/test": "^1.40.0",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.5",
"@types/file-saver": "^2.0.5",
Expand Down
77 changes: 77 additions & 0 deletions web/frontend/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests/integration',
/* Run tests in files in parallel */
fullyParallel: true,
/* 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,
/* 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. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},

/* Configure projects for major browsers */
projects: [
{
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 */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
});

0 comments on commit da78b4a

Please sign in to comment.