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
Copy file name to clipboardExpand all lines: explorer/e2e/testReadme.md
+17-16Lines changed: 17 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -7,33 +7,33 @@ Tests for a specific configuration are stored as `config_name/config_name-test_n
7
7
that Playwright actually runs, most test code is stored in `e2e/testFunctions.ts`. These functions contain the
8
8
code that runs for all tests, except for tests that are not reused between configurations and that only run in one tab. This allows tests to be repeated
9
9
for different tabs in different configurations without reusing code, and means that information that tests
10
-
depend on can be stored in one place to make adjusting tests to changes in userfacing content is straightforward.
11
-
Configspecific constants used for tests are kept in the `config_name/config_name-tabs.ts`, and use interfaces and
10
+
depend on can be stored in one place to make adjusting tests to changes in user-facing content straightforward.
11
+
Config-specific constants used for tests are kept in the `config_name/config_name-tabs.ts`, and use interfaces and
12
12
custom types in `testInterfaces.ts`.
13
13
14
-
### Running tests
14
+
### Running Tests
15
15
16
16
#### Running Locally
17
17
18
18
To run all tests locally, run `npm run test:anvil-cmg` or `npm run test:anvil-catalog`. If there is no server running
19
19
on `localhost:3000`, this will create a dev build of the correct configuration and run the tests on Chromium, Firefox, and Webkit (Safari). The tests may be flaky
20
-
if run on the `dev:config` version instead of a dev build, as the site will run too slow and they may time out. Traces
20
+
if run on the `dev:<config>` version instead of a dev build, as the site will run too slow and they may time out. Traces
21
21
and screenshots from any tests that fail will be output to `explorer/playwright-report`. To manually run an individual test file,
22
22
run `npx playwright test e2e/path-to/filename.spec.ts -c <config_file>`. The available config files are `playwright_anvil.config.ts`
23
23
and `playwright_anvil-catalog.config.ts`. To run an individual test, add the argument `-g <test_name>`. More information
24
24
about command line options for the test can be found in [Playwright's Documentation](https://playwright.dev/docs/test-cli).
25
25
To debug or write tests, it can be useful to use Playwright's UI mode with `npx playwright test --ui`, which allows you
26
-
to easily run individual tests, and view the actions Playwright takes step by step in and their result.
26
+
to easily run individual tests, and view the actions Playwright takes step by step and their result.
27
27
28
28
#### Running in GitHub
29
29
30
-
All tests are run automatically when a pull request is made, using GitHub Actions. These actions create a development build
30
+
All tests are run automatically when a pull request is made, using GitHub Actions. These actions create a dev build
31
31
for each configuration, then run the test. When a test passes, it will become visible on GitHub. If one fails, screenshots
32
32
and traces can be downloaded from GitHub. To view step by step what happened in the test, visit `trace.playwright.dev`
33
33
in a web browser and upload the `trace.zip` file. This web app, which runs entirely in browser, allows you to step
34
34
through the actions taken as part of the test and view the impact on the web page.
35
35
36
-
### Current tests
36
+
### Current Tests
37
37
38
38
#### AnVIL-CMG
39
39
@@ -42,20 +42,20 @@ through the actions taken as part of the test and view the impact on the web pag
42
42
- This filter runs on all tabs in `anviltabs.ts`
43
43
- Check that checking up to the first five entries in the first filter on the datasets tab works and that it does not remove all elements from the list of tabs
44
44
- Check that selecting a filter causes the selected checkbox entries to remain selected across all tabs
45
-
- Currently uses the 4th filter and starts on the "files" tab
45
+
- Currently uses the fourth filter and starts on the "files" tab
46
46
- Check that the counts next to the filter checkbox match the number of entries once the filter is selected
47
-
- Checks an arbitrary list of 6 filters on the datasets and activities tab
48
-
- Check that the blue filter buttons appear with the correct text when the filter is selected, and that they cause the filter to become deselected when clicked
49
-
- Checks an arbitrary list of 3 filters on the "files" and "biosamples" tabs
47
+
- Checks an arbitrary list of six filters on the datasets and activities tab
48
+
- Check that the filter tabs appear with the correct text when the filter is selected, and that they cause the filter to become deselected when clicked
49
+
- Checks an arbitrary list of three filters on the "files" and "biosamples" tabs
50
50
- Check that the clear all button deselects all filters, after an arbitrary list is selected
51
-
- Uses an arbitrary list of 3 filters and runs on the "files tab"
51
+
- Uses an arbitrary list of three filters and runs on the "files tab"
52
52
- Pagination (`anvil-pagination.spec.ts` and `anvil-pagination-content.spec.ts`)
53
53
- Check that, on the first page, the back button is disabled and the forward button is enabled
54
54
- Uses the "Donors" tab only
55
55
- Check that paginating forward on the donors tab keeps the currently displayed page number correct, and that on the last page the back button is enabled and the front page is enabled
56
56
- Uses the "Donors" tab only
57
57
- NOTE: this test may be problematic because it assumes there is relatively short number of pages on the "Donors" tab. This could potentially be resolved by adding filters or by limiting the number of tests run
58
-
- Check that paginating forwards by up to 5 pages changes the content on the first row of the table, and that paginating backwards causes that text to remain the same
58
+
- Check that paginating forwards by up to five pages changes the content on the first row of the table, and that paginating backwards causes that text to remain the same
59
59
- Uses the "BioSamples" tab only
60
60
- Sort (`anvil-sort.spec.ts`)
61
61
- Check that clicking each table header (the sort button) does not cause the first and last rows of the table to become empty
@@ -69,7 +69,7 @@ through the actions taken as part of the test and view the impact on the web pag
69
69
- Check that selecting a different tab changes the current url and that each tab has the correct data headers
70
70
- Runs from "Datasets" to "Activities", "Activities" to "Datasets", "Datasets" to "Files", "Datasets" to "Donors", "Datasets" to "Biosamples"
71
71
-`anvil-tabs-buttons.spec.ts`
72
-
- All tests rely on correct lists of tabs, columns, and filters in `testFunctions.ts`
72
+
- All tests rely on correct lists of tabs, columns, and filters in `anvil-tabs.ts`
73
73
74
74
#### AnVIL-Catalog
75
75
@@ -86,15 +86,16 @@ through the actions taken as part of the test and view the impact on the web pag
86
86
- Runs on all tabs
87
87
- Check that selecting all checkboxes in the Edit Columns menu adds the correct headets to the table
88
88
- Only runs on the "Consortia" tab (other tabs do not have editable columns)
89
+
- All tests rely on correct lists of tabs, columns, and filters in `anvilcatalog-tabs.ts`
89
90
90
91
### Candidate Additional Tests (anvil-cmg):
91
92
92
93
- File download
93
94
- File copy button
94
-
- Top Counts (# activities, files, biosamples)
95
+
- Top counts (# activities, files, biosamples)
95
96
- Sign in (probably smoke test / existence only for ease)
96
97
- "Contact Us" form
97
-
- Edit Columns Button (already on AnVIL-Catalog)
98
+
- Edit columns Button (already on AnVIL-Catalog)
98
99
- Datasets backpages
99
100
- Check that "Dataset details" match relevant fields in the table
0 commit comments