Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/137 playwright setup #138

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions package-lock.json

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

4 changes: 4 additions & 0 deletions webapp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

# testing
/coverage
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
WULCAN marked this conversation as resolved.
Show resolved Hide resolved

# next.js
/.next/
Expand Down
27 changes: 27 additions & 0 deletions webapp/TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Testing

This contains information on how to run different tests and add new tests for Lyra.

We are using Playwright to test integration of features.
Read the documentation at [playwright.dev/docs](https://playwright.dev/docs)
henrycatalinismith marked this conversation as resolved.
Show resolved Hide resolved

Jest is used to write both integration and unit tests.
[jest.io/docs](https://jestjs.io/docs/getting-started)

## Integration Tests

Lyra uses Playwright together with Jest to test integration.

All integration tests resources are located in the `/integrationTesting` folder. New tests should be added in the `/tests` folder.

To run integration tests:

`npm run playwright`

## Unit tests

Unit tests are written in Jest and located paralell to the unit they are written for.

To run unit tests:

`npm run test`
1 change: 1 addition & 0 deletions webapp/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ module.exports = {
moduleNameMapper: {
'@/(.*)': '<rootDir>/src/$1',
},
modulePathIgnorePatterns: ['<rootDir>/integrationTesting'],
henrycatalinismith marked this conversation as resolved.
Show resolved Hide resolved
};
7 changes: 6 additions & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"lint:eslint": "eslint .",
"lint:eslint-fix": "eslint . --fix",
"lint": "next lint",
"test": "jest"
"test": "jest",
"playwright": "npx playwright test"
},
"dependencies": {
"@emotion/react": "^11.11.4",
Expand All @@ -28,5 +29,9 @@
"simple-git": "^3.20.0",
"yaml": "^2.3.3",
"zod": "^3.22.4"
},
"devDependencies": {
"@playwright/test": "^1.48.2",
"@types/node": "^22.8.1"
henrycatalinismith marked this conversation as resolved.
Show resolved Hide resolved
}
}
6 changes: 6 additions & 0 deletions webapp/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineConfig } from '@playwright/test';

export default defineConfig({
WULCAN marked this conversation as resolved.
Show resolved Hide resolved
reporter: [['html', { open: 'never' }]],
WULCAN marked this conversation as resolved.
Show resolved Hide resolved
testDir: './integrationTesting/tests',
WULCAN marked this conversation as resolved.
Show resolved Hide resolved
});