Add NX commands to twenty-e2e-testing package (#9222)

Related to #8469
This commit is contained in:
BOHEUS
2024-12-31 14:49:52 +00:00
committed by GitHub
parent 2c7f40ab1d
commit 6e0002b874
4 changed files with 110 additions and 22 deletions

View File

@ -1,39 +1,43 @@
# Twenty e2e Testing
# Twenty end-to-end (E2E) Testing
## Prerequisite
Installing the browsers:
```
yarn playwright install
npx nx setup twenty-e2e-testing
```
### Run end-to-end tests
```
yarn run test:e2e
npx nx test twenty-e2e-testing
```
### Start the interactive UI mode
```
yarn run test:e2e:ui
```
### Run test only on Desktop Chrome
```
yarn run test:e2e:chrome
npx nx test:ui twenty-e2e-testing
```
### Run test in specific file
```
yarn run test:e2e <filename>
npx nx test twenty-e2e-testing <filename>
```
Example (location of the test must be specified from the root of `twenty-e2e-testing` package):
```
npx nx test twenty-e2e-testing tests/login.spec.ts
```
### Runs the tests in debug mode.
```
yarn run test:e2e:debug
npx nx test:debug twenty-e2e-testing
```
### Show report after tests
```
npx nx test:report twenty-e2e-testing
```
## Q&A

View File

@ -1,14 +1,11 @@
{
"name": "twenty-e2e-testing",
"version": "0.40.0-canary",
"description": "",
"author": "",
"private": true,
"license": "AGPL-3.0",
"devDependencies": {
"@playwright/test": "^1.46.0"
},
"scripts": {
"test:e2e:setup": "yarn playwright install",
"test:e2e": "yarn playwright test",
"test:e2e:ui": "yarn playwright test --ui",
"test:e2e:chrome": "yarn playwright test --project=chromium",
"test:e2e:debug": "yarn playwright test --debug",
"test:e2e:report": "yarn playwright show-report"
"@playwright/test": "^1.49.0"
}
}

View File

@ -0,0 +1,52 @@
{
"name": "twenty-e2e-testing",
"projectType": "application",
"tags": ["scope:testing"],
"targets": {
"setup": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/twenty-e2e-testing",
"commands": [
"yarn playwright install"
]
}
},
"test": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/twenty-e2e-testing",
"commands": [
"yarn playwright test"
]
}
},
"test:ui": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/twenty-e2e-testing",
"commands": [
"yarn playwright test --ui"
]
}
},
"test:debug": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/twenty-e2e-testing",
"commands": [
"yarn playwright test --debug"
]
}
},
"test:report": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/twenty-e2e-testing",
"commands": [
"yarn playwright show-report"
]
}
}
}
}