summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2022-12-15 11:04:52 +0100
committerOskar Nyberg <oskar@mullvad.net>2022-12-15 16:05:38 +0100
commitbb2bcb87945f93d9451be7bfc2894d4fcb490a5c (patch)
tree2207bb032d86a05012d970bda8905d9d94d8656d
parent0982a4a55e692797cee18f82cd1ffe753e02da33 (diff)
downloadmullvadvpn-bb2bcb87945f93d9451be7bfc2894d4fcb490a5c.tar.xz
mullvadvpn-bb2bcb87945f93d9451be7bfc2894d4fcb490a5c.zip
Improve npm alias for running e2e tests against installed app
The tests for an installed version of the app isn't possible to run in sequence. A lot of them requires the daemon to be in a specific state, and some require the daemon to change state during the test. This means that for the tests to be useful they have to be run individually when the daemon is in the correct state. The `e2e:installed` alias has been replaced with `e2e:sequential` which can be used to run tests against the installed app by running `npm run e2e:sequential installed/<test>`.
-rw-r--r--gui/README.md4
-rw-r--r--gui/package.json4
-rw-r--r--gui/test/e2e/installed/state-dependent/disconnected.spec.ts2
3 files changed, 5 insertions, 5 deletions
diff --git a/gui/README.md b/gui/README.md
index 068b5dd70e..f26495426a 100644
--- a/gui/README.md
+++ b/gui/README.md
@@ -25,11 +25,11 @@ The app has unit tests and integration tests located in test/:
The tests in **test/e2e/installed** are run against the already installed app using the currently
running daemon. It's possible to run these tests on any machine with the app installed by running
```
-npm run e2e:installed
+npm run e2e:sequential installed/<test>
```
or without building by running
```
-npm run e2e:installed:no-build
+npm run e2e:sequential:no-build installed/<test>
```
It is also possible to build these tests along with all its dependencies into an executable that can
diff --git a/gui/package.json b/gui/package.json
index 2c7f860987..5153c85d45 100644
--- a/gui/package.json
+++ b/gui/package.json
@@ -97,8 +97,8 @@
"tsc": "tsc -p . --noEmit",
"e2e": "npm run build && npm run e2e:no-build",
"e2e:no-build": "xvfb-maybe -- playwright test mocked",
- "e2e:installed": "npm run build && npm run e2e:installed:no-build",
- "e2e:installed:no-build": "xvfb-maybe -- playwright test --workers 1",
+ "e2e:sequential": "npm run build && npm run e2e:sequential:no-build",
+ "e2e:sequential:no-build": "xvfb-maybe -- playwright test --workers 1",
"e2e:update-snapshots": "npm run e2e:no-build -- --update-snapshots",
"develop": "gulp develop",
"test": "cross-env NODE_ENV=test electron-mocha --renderer --reporter spec --require ts-node/register --require \"test/unit/setup/renderer.ts\" \"test/unit/**/*.{ts,tsx}\"",
diff --git a/gui/test/e2e/installed/state-dependent/disconnected.spec.ts b/gui/test/e2e/installed/state-dependent/disconnected.spec.ts
index 7fa853099e..a26b61279c 100644
--- a/gui/test/e2e/installed/state-dependent/disconnected.spec.ts
+++ b/gui/test/e2e/installed/state-dependent/disconnected.spec.ts
@@ -18,5 +18,5 @@ test.afterAll(async () => {
});
test('App should show disconnected tunnel state', async () => {
- await assertDisconnected(page)
+ await assertDisconnected(page);
});