Skip to content

The open alternative to Salesforce, designed for AI.

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

BOHEUS6e0002b874fa
diff --git a/packages/twenty-e2e-testing/README.md b/packages/twenty-e2e-testing/README.md
index 4f39ca3c855..7372e35e385 100644
--- a/packages/twenty-e2e-testing/README.md
+++ b/packages/twenty-e2e-testing/README.md
@@ -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
+npx nx test:ui twenty-e2e-testing
```
-### Run test only on Desktop Chrome
-
+### Run test in specific file
```
-yarn run test:e2e:chrome
+npx nx test twenty-e2e-testing <filename>
```
-### Run test in specific file
+Example (location of the test must be specified from the root of `twenty-e2e-testing` package):
```
-yarn run test:e2e <filename>
+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
diff --git a/packages/twenty-e2e-testing/package.json b/packages/twenty-e2e-testing/package.json
index 6cef81f80c7..8f21de70c78 100644
--- a/packages/twenty-e2e-testing/package.json
+++ b/packages/twenty-e2e-testing/package.json
@@ -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"
}
}
diff --git a/packages/twenty-e2e-testing/project.json b/packages/twenty-e2e-testing/project.json
new file mode 100644
index 00000000000..9dd38917f8d
--- /dev/null
+++ b/packages/twenty-e2e-testing/project.json
@@ -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"
+ ]
+ }
+ }
+ }
+}
diff --git a/yarn.lock b/yarn.lock
index 0b46335c9ac..3351268d068 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -9707,6 +9707,17 @@ __metadata:
languageName: node
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":
version: 1.0.0-next.25
resolution: "@polka/url@npm:1.0.0-next.25"
@@ -38583,6 +38594,15 @@ __metadata:
languageName: node
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":
version: 1.46.0
resolution: "playwright@npm:1.46.0"
@@ -38598,6 +38618,21 @@ __metadata:
languageName: node
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":
version: 1.0.1
resolution: "plugin-error@npm:1.0.1"
@@ -44872,7 +44907,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "twenty-e2e-testing@workspace:packages/twenty-e2e-testing"
dependencies:
- "@playwright/test": "npm:^1.46.0"
+ "@playwright/test": "npm:^1.49.0"
languageName: unknown
linkType: soft