Skip to content

Commit

Permalink
make playwright as standalone workspace package
Browse files Browse the repository at this point in the history
  • Loading branch information
framitdavid committed Dec 11, 2023
1 parent 4a9975f commit 5d333e7
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 6 deletions.
1 change: 1 addition & 0 deletions frontend/testing/playwright/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO WRITE DOCS!
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test as setup } from '@playwright/test';
import { LoginPage } from "./Pages/LoginPage";
import { LoginPage } from "../pages/LoginPage";


setup('authenticate user', async ({page}) => {

Check failure on line 5 in frontend/testing/playwright/integration/auth.setup.ts

View workflow job for this annotation

GitHub Actions / Typechecking and linting

A space is required after '{'

Check failure on line 5 in frontend/testing/playwright/integration/auth.setup.ts

View workflow job for this annotation

GitHub Actions / Typechecking and linting

A space is required before '}'
Expand Down
12 changes: 12 additions & 0 deletions frontend/testing/playwright/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "playwright-studio",
"private": true,
"version": "1.0.0",
"packageManager": "[email protected]",
"devDependencies": {
"@playwright/test": "^1.40.1"
},
"scripts": {
"test:all": "playwright test --config ./playwright.config.ts"
}
}
4 changes: 2 additions & 2 deletions frontend/testing/playwright/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ export default defineConfig({
},

projects: [
{ name: 'setup', testMatch: /.*\.setup\.ts/ },
{ name: "setup", testMatch: /.*\.setup\.ts/ },
{
name: 'chromium',
dependencies: ['setup'],
use: {
...devices['Desktop Chrome'],
baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL,
storageState: '.playwright/auth/user.json',
headless: false
},
dependencies: ['setup']
},
],
});
3 changes: 3 additions & 0 deletions frontend/testing/playwright/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../tsconfig.json"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"devDependencies": {
"@emotion/react": "11.11.1",
"@emotion/styled": "11.11.0",
"@playwright/test": "^1.40.1",
"@redux-saga/is": "1.1.3",
"@redux-saga/symbols": "1.1.3",
"@svgr/webpack": "8.1.0",
Expand Down Expand Up @@ -106,7 +105,7 @@
"test": "jest --maxWorkers=50% --config=frontend/jest.config.js",
"test:ci": "jest --ci --coverage --max-workers=2 --cacheDirectory=$(yarn config get cacheFolder) --config=frontend/jest.config.js",
"typecheck": "yarn workspaces foreach -A run typecheck",
"playwright-e2e": "playwright test --config ./frontend/testing/playwright/playwright.config.ts"
"playwright:test:all": "yarn workspace playwright-studio test:all"
},
"syncpack": {
"semverRange": ""
Expand All @@ -121,6 +120,7 @@
"frontend/studio-root",
"frontend/testing/mockend",
"frontend/testing/cypress",
"frontend/testing/playwright",
"frontend/packages/schema-editor",
"frontend/packages/schema-model",
"frontend/packages/shared",
Expand Down
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5579,7 +5579,6 @@ __metadata:
"@microsoft/applicationinsights-web": "npm:3.0.3"
"@microsoft/signalr": "npm:7.0.12"
"@navikt/aksel-icons": "npm:5.9.2"
"@playwright/test": "npm:^1.40.1"
"@redux-saga/is": "npm:1.1.3"
"@redux-saga/symbols": "npm:1.1.3"
"@svgr/webpack": "npm:8.1.0"
Expand Down Expand Up @@ -13642,6 +13641,14 @@ __metadata:
languageName: node
linkType: hard

"playwright-studio@workspace:frontend/testing/playwright":
version: 0.0.0-use.local
resolution: "playwright-studio@workspace:frontend/testing/playwright"
dependencies:
"@playwright/test": "npm:^1.40.1"
languageName: unknown
linkType: soft

"playwright@npm:1.40.1":
version: 1.40.1
resolution: "playwright@npm:1.40.1"
Expand Down

0 comments on commit 5d333e7

Please sign in to comment.