Skip to content

Commit 30dc833

Browse files
committed
Switch from Spectron to Playwright for e2e tests
1 parent 1cc128d commit 30dc833

File tree

12 files changed

+2728
-2911
lines changed

12 files changed

+2728
-2911
lines changed

.vsts/win/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ steps:
1010
- powershell: |
1111
. .vsts/win/exec.ps1
1212
$ErrorActionPreference = "Stop"
13-
$env:SPECTRON_AAD_USER_EMAIL = "$(uiTestingAccountEmail)"
14-
$env:SPECTRON_AAD_USER_PASSWORD = "$(uiTestingAccountPassword)"
15-
npm run spectron
16-
displayName: Running spectron
13+
$env:BE_TEST_AAD_USER_EMAIL = "$(uiTestingAccountEmail)"
14+
$env:BE_TEST_AAD_USER_PASSWORD = "$(uiTestingAccountPassword)"
15+
npm run test-e2e
16+
displayName: End to end tests
1717
1818
- template: ./security-analysis.yml
1919

docs/e2etests.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Run end-to-end test with Playwright
2+
3+
[Playwright](https://playwright.dev) is a framework for web application end-to-end (e2e) testing.
4+
5+
When to use e2e tests vs unit tests:
6+
7+
* Test functionality that cannot be tested with the unit test mocking APIs
8+
* Test multi window interaction
9+
10+
## Prerequisite
11+
12+
* Set `BE_TEST_AAD_USER_EMAIL` with the user email
13+
* Set `BE_TEST_AAD_USER_PASSWORD` with the user password
14+
15+
Build the executable
16+
17+
```bash
18+
npm run build-and-pack
19+
```
20+
21+
## Run
22+
23+
```bash
24+
npm run test-e2e
25+
26+
# Run Playwright in debug mode to step through tests
27+
npm run test-e2e:debug
28+
```
29+
30+
## Write tests
31+
32+
End-to-end tests are in the `test/e2e` directory
33+
34+
## Issues with Playwright
35+
36+
* Currently doesn't test the final built package, but rather the stock Electron executable.

docs/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* [Components](components.md)
1010
* [Models](models.md)
1111
* [Testing](testing.md)
12-
* [Spectron E2E tests](spectron.md)
12+
* [E2E tests](e2etests.md)
1313
* [Controls](core/Readme.md)
1414

1515
## How to

docs/run-spectron.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)