Commit ab23fd7
merge: #3477
3477: feat: add target for cypress e2e tests into BUCK r=johnrwatson a=johnrwatson
This PR adds a new toolchain into our BUCK build system to allow us to execute Cypress end to end tests via BUCK directly.
In a follow up PR, the test will then be executed in CI.
The added target is runnable and buildable, depending on how you would like to execute it.
You can explicitly invoke as follows:
`buck2 run app/web:e2e-test -- --tests 'cypress/e2e/**' --web-endpoint http://localhost:8080`
This will run all our e2e tests against your local stack. These values are the defaults and can be excluded entirely on invocation if you desire, i.e.
`buck2 run app/web:e2e-test`
When executed, the target will check a few things before executing, these are listed below:
- The stack is responsive on the given `--web-endpoint` within 60s
- Cypress installation is valid
- You are on an supported OS / Architecture
During execution, it will then output the log contents and videos from cypress into the BUCK out path, which is usually something in the form of:
`si/buck-out/v2/gen/root/<uuid>/app/web/__e2e-test__/<content here>`
**Variables**
Some variables are required to allow these tests to execute successfully and each test has slightly differing requirements. In the header of each of the cypress typescript test files you will see a block like follows:
```
const AUTH0_USERNAME = Cypress.env('VITE_AUTH0_USERNAME') || import.meta.env.VITE_AUTH0_USERNAME;
const AUTH0_PASSWORD = Cypress.env('VITE_AUTH0_PASSWORD') || import.meta.env.VITE_AUTH0_PASSWORD;
const AUTH_API_URL = Cypress.env('VITE_AUTH_API_URL') || import.meta.env.VITE_AUTH_API_URL;
const SI_WORKSPACE_ID = Cypress.env('VITE_SI_WORKSPACE_ID') || import.meta.env.VITE_SI_WORKSPACE_ID;
```
This basically means, either have the variables in your local shell environment or within the .env files for vite, i.e. `.env.local` usually. I've included some psuedocode in `app/web/cypress/support/commands.ts` as to how we might refactor this to centralise the variables in one place, but I got into a bit of a tizzy with cypress coinage so I may have to come back to this in a follow up PR to implement the new test into CI.
Co-authored-by: John Watson <[email protected]>File tree
21 files changed
+562
-105
lines changed- app/web
- cypress
- e2e
- authentication
- modelling-functionality
- web-functionality
- workspace-management
- support
- src
- components/AttributesPanel
- store
- prelude-si
- e2e
- macros
- toolchains
21 files changed
+562
-105
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
2 | 9 | | |
3 | 10 | | |
4 | 11 | | |
5 | 12 | | |
6 | 13 | | |
7 | 14 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
11 | 18 | | |
12 | | - | |
| 19 | + | |
| 20 | + | |
13 | 21 | | |
14 | 22 | | |
15 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
2 | 8 | | |
3 | 9 | | |
4 | 10 | | |
5 | | - | |
| 11 | + | |
6 | 12 | | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
10 | | - | |
11 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
12 | 19 | | |
13 | 20 | | |
14 | 21 | | |
15 | 22 | | |
16 | 23 | | |
17 | | - | |
18 | | - | |
| 24 | + | |
19 | 25 | | |
20 | 26 | | |
21 | | - | |
| 27 | + | |
Lines changed: 23 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
5 | 12 | | |
6 | 13 | | |
7 | | - | |
| 14 | + | |
| 15 | + | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
11 | | - | |
12 | | - | |
| 19 | + | |
| 20 | + | |
13 | 21 | | |
14 | 22 | | |
15 | 23 | | |
16 | | - | |
| 24 | + | |
17 | 25 | | |
18 | | - | |
| 26 | + | |
19 | 27 | | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
25 | | - | |
26 | | - | |
| 33 | + | |
| 34 | + | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
32 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
33 | 43 | | |
34 | 44 | | |
35 | | - | |
| 45 | + | |
36 | 46 | | |
37 | 47 | | |
38 | 48 | | |
| |||
46 | 56 | | |
47 | 57 | | |
48 | 58 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
Lines changed: 20 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
5 | 12 | | |
6 | 13 | | |
7 | | - | |
| 14 | + | |
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
11 | | - | |
12 | | - | |
| 18 | + | |
| 19 | + | |
13 | 20 | | |
14 | 21 | | |
15 | | - | |
| 22 | + | |
16 | 23 | | |
17 | | - | |
| 24 | + | |
18 | 25 | | |
19 | 26 | | |
20 | 27 | | |
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
25 | | - | |
| 32 | + | |
26 | 33 | | |
27 | 34 | | |
28 | 35 | | |
| |||
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
34 | | - | |
35 | | - | |
| 41 | + | |
| 42 | + | |
36 | 43 | | |
37 | 44 | | |
38 | 45 | | |
| |||
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
46 | | - | |
| 53 | + | |
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
| |||
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
Lines changed: 77 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
5 | 13 | | |
6 | 14 | | |
7 | | - | |
| 15 | + | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 19 | + | |
| 20 | + | |
14 | 21 | | |
15 | 22 | | |
16 | | - | |
17 | | - | |
18 | | - | |
| 23 | + | |
| 24 | + | |
19 | 25 | | |
20 | 26 | | |
21 | | - | |
| 27 | + | |
22 | 28 | | |
23 | | - | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
30 | 85 | | |
31 | 86 | | |
32 | 87 | | |
33 | 88 | | |
34 | | - | |
| 89 | + | |
35 | 90 | | |
36 | 91 | | |
37 | 92 | | |
| 93 | + | |
38 | 94 | | |
39 | 95 | | |
40 | 96 | | |
41 | 97 | | |
42 | 98 | | |
43 | 99 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 100 | | |
49 | 101 | | |
50 | 102 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 103 | + | |
| 104 | + | |
54 | 105 | | |
55 | 106 | | |
56 | 107 | | |
| |||
59 | 110 | | |
60 | 111 | | |
61 | 112 | | |
62 | | - | |
| 113 | + | |
63 | 114 | | |
64 | 115 | | |
65 | 116 | | |
66 | 117 | | |
67 | 118 | | |
68 | | - | |
| 119 | + | |
69 | 120 | | |
70 | | - | |
71 | | - | |
72 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
73 | 124 | | |
74 | 125 | | |
75 | 126 | | |
| |||
83 | 134 | | |
84 | 135 | | |
85 | 136 | | |
86 | | - | |
87 | | - | |
88 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
0 commit comments