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 ## Prerequisite
Installing the browsers: Installing the browsers:
``` ```
yarn playwright install npx nx setup twenty-e2e-testing
``` ```
### Run end-to-end tests ### Run end-to-end tests
``` ```
yarn run test:e2e npx nx test twenty-e2e-testing
``` ```
### Start the interactive UI mode ### Start the interactive UI mode
``` ```
yarn run test:e2e:ui npx nx test:ui twenty-e2e-testing
```
### Run test only on Desktop Chrome
```
yarn run test:e2e:chrome
``` ```
### Run test in specific file ### 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. ### 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 ## Q&A

View File

@ -1,14 +1,11 @@
{ {
"name": "twenty-e2e-testing", "name": "twenty-e2e-testing",
"version": "0.40.0-canary",
"description": "",
"author": "",
"private": true,
"license": "AGPL-3.0",
"devDependencies": { "devDependencies": {
"@playwright/test": "^1.46.0" "@playwright/test": "^1.49.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"
} }
} }

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"
]
}
}
}
}

View File

@ -9707,6 +9707,17 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@playwright/test@npm:^1.49.0":
version: 1.49.1
resolution: "@playwright/test@npm:1.49.1"
dependencies:
playwright: "npm:1.49.1"
bin:
playwright: cli.js
checksum: 10c0/2fca0bb7b334f7a23c7c5dfa5dbe37b47794c56f39b747c8d74a2f95c339e7902a296f2f1dd32c47bdd723cfa92cee05219f1a5876725dc89a1871b9137a286d
languageName: node
linkType: hard
"@polka/url@npm:^1.0.0-next.24": "@polka/url@npm:^1.0.0-next.24":
version: 1.0.0-next.25 version: 1.0.0-next.25
resolution: "@polka/url@npm:1.0.0-next.25" resolution: "@polka/url@npm:1.0.0-next.25"
@ -38583,6 +38594,15 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"playwright-core@npm:1.49.1":
version: 1.49.1
resolution: "playwright-core@npm:1.49.1"
bin:
playwright-core: cli.js
checksum: 10c0/990b619c75715cd98b2c10c1180a126e3a454b247063b8352bc67792fe01183ec07f31d30c8714c3768cefed12886d1d64ac06da701f2baafc2cad9b439e3919
languageName: node
linkType: hard
"playwright@npm:1.46.0, playwright@npm:^1.14.0, playwright@npm:^1.46.0": "playwright@npm:1.46.0, playwright@npm:^1.14.0, playwright@npm:^1.46.0":
version: 1.46.0 version: 1.46.0
resolution: "playwright@npm:1.46.0" resolution: "playwright@npm:1.46.0"
@ -38598,6 +38618,21 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"playwright@npm:1.49.1":
version: 1.49.1
resolution: "playwright@npm:1.49.1"
dependencies:
fsevents: "npm:2.3.2"
playwright-core: "npm:1.49.1"
dependenciesMeta:
fsevents:
optional: true
bin:
playwright: cli.js
checksum: 10c0/2368762c898920d4a0a5788b153dead45f9c36c3f5cf4d2af5228d0b8ea65823e3bbe998877950a2b9bb23a211e4633996f854c6188769dc81a25543ac818ab5
languageName: node
linkType: hard
"plugin-error@npm:^1.0.1": "plugin-error@npm:^1.0.1":
version: 1.0.1 version: 1.0.1
resolution: "plugin-error@npm:1.0.1" resolution: "plugin-error@npm:1.0.1"
@ -44872,7 +44907,7 @@ __metadata:
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "twenty-e2e-testing@workspace:packages/twenty-e2e-testing" resolution: "twenty-e2e-testing@workspace:packages/twenty-e2e-testing"
dependencies: dependencies:
"@playwright/test": "npm:^1.46.0" "@playwright/test": "npm:^1.49.0"
languageName: unknown languageName: unknown
linkType: soft linkType: soft