You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add initial unit testing framework via Vitest
- Reorganize e2e tests in their own folder
- Reorganize package.json scripts to distinguish between e2e tests and unit tests
- Update testing documentation
This document describes the testing development workflow. Tests in this repo are tested using the [Playwright](https://playwright.dev/) testing library.
3
+
This document describes the testing development workflow. End-to-end tests are run using the [Playwright](https://playwright.dev/) testing library. Unit tests are run using the [Vitest](https://vitest.dev/) library.
4
4
5
-
All tests assume a production build of the project is available:
5
+
## End-to-end
6
+
7
+
All end-to-end tests assume a production build of the project is available:
6
8
7
9
```sh
8
10
npm run build
9
11
```
10
12
11
-
All tests also assume all Aerie services are running and available on `localhost`. See the example [docker-compose-test.yml](../docker-compose-test.yml) for an example of how to run the complete Aerie system. Notice we disable authentication for simplicity when running our end-to-end tests. You can reference the [Aerie deployment documentation](https://github.com/NASA-AMMOS/aerie/tree/develop/deployment) for more detailed deployment information.
13
+
All end-to-end tests also assume all Aerie services are running and available on `localhost`. See the example [docker-compose-test.yml](../docker-compose-test.yml) for an example of how to run the complete Aerie system. Notice we disable authentication for simplicity when running our end-to-end tests. You can reference the [Aerie deployment documentation](https://github.com/NASA-AMMOS/aerie/tree/develop/deployment) for more detailed deployment information.
12
14
13
-
To execute tests normally (i.e. not in debug mode), use the following command:
15
+
To execute end-to-end tests normally (i.e. not in debug mode), use the following command:
14
16
15
17
```sh
16
-
npm test
18
+
npm run test:e2e
17
19
```
18
20
19
21
If this is your first time running the tests you may need to install the Playwright browser drivers:
@@ -24,19 +26,27 @@ npx playwright install
24
26
25
27
If something fails read the Playwright error carefully as it usually describes a quick fix. You can also look for the error in the [Playwright GitHub Issues](https://github.com/microsoft/playwright/issues) if you need more help.
26
28
27
-
## Debug
29
+
###Debug
28
30
29
31
The debug test script runs the [Playwright inspector](https://playwright.dev/docs/inspector), which runs in headed debug mode so you can step through tests and watch them as they execute.
30
32
31
33
```sh
32
-
npm run test:debug
34
+
npm run test:e2e:debug
33
35
```
34
36
35
-
## Codegen
37
+
###Codegen
36
38
37
39
The codegen test script runs the [Playwright test generator](https://playwright.dev/docs/codegen), which automatically generates [locators](https://playwright.dev/docs/locators) as you click elements on the page. It can greatly save test development time. The generator requires an instance of the application already running to select against.
0 commit comments