1
- # Run the tests
2
- # Todo : reuse a build from another action, instead of rebuilding for nothing.
3
- # tchap modification : use "./scripts/tchap/install-yarn-linked-repositories.sh" instead of "./scripts/layered.sh"
1
+ # This is a tchap-specific file, inspired from the one in matrix-react-sdk
4
2
name : Cypress End to End Tests
5
3
on :
6
4
pull_request : {}
7
5
push :
8
6
branches : [develop_tchap, master_tchap]
9
- # repository_dispatch: # :TCHAP: we don't use this
10
- # types: [ element-web-notify ]
11
7
env :
12
- # :TCHAP: not needed for fetchdep.with.version.sh but leaving them otherwise it breaks.
13
- # These must be set for fetchdep.sh to get the right branch
8
+ # Removing this makes the job break.
14
9
REPOSITORY : ${{ github.repository }}
15
10
PR_NUMBER : ${{ github.event.pull_request.number }}
16
11
jobs :
@@ -29,28 +24,32 @@ jobs:
29
24
cache : " yarn"
30
25
node-version : ${{ steps.node_version.outputs.node_version }}
31
26
32
- - name : Install Dependencies
33
- run : " ./scripts/tchap/install-yarn-linked-repositories.sh"
27
+ - name : " Copy the config file at the right place"
28
+ run : " cp config.dev.json config.json" # todo we could make the choice of backend configurable.
29
+
30
+ - name : " Build the app, so that we can serve it from static files" # todo : fetch build from an artifact to avoid rebuilding for nothing
31
+ run : " yarn install && yarn build"
34
32
35
33
- name : Run Cypress tests
36
- uses : cypress-io/github-action@v4.1.1
34
+ uses : cypress-io/github-action@v6.5.0
37
35
with :
38
- # The built-in Electron runner seems to grind to a halt trying
36
+ install : false # disable the default install, we already installed and built.
37
+
38
+ # Serve with 'npx serve', a simple static webserver, so that it starts quickly. The dev server is slow and messy to start.
39
+ start : " npx serve -p 8080 -L webapp"
40
+ # Note : 'wait-on' caused issues where localhost was not found by cypress. Be careful if you want to use it.
41
+
42
+ # From matrix-react-sdk : The built-in Electron runner seems to grind to a halt trying
39
43
# to run the tests, so use chrome.
40
44
browser : chrome
41
- # install: false # disable the default install, we used layered.with.version already.
42
- start : yarn start
43
- # start: npx serve -p 8080 webapp # If you have downloaded a build artifact, it will be in webapp dir.
44
- wait-on : " http://localhost:8080"
45
- # wait for 3min, the build is long
46
- wait-on-timeout : 180
47
- # record: true # todo record to dashboard, see action's doc
45
+ # headed: true # tchap uses headless, since we don't record videos.
46
+
48
47
command : " yarn test:cypress"
48
+ # Note : 'working-directory' changes pwd, for everything. If you use it you need to change relative paths for everything, it's tricky.
49
49
env :
50
50
E2E_TEST_USER_EMAIL : ${{ secrets.E2E_TEST_USER_EMAIL }}
51
51
E2E_TEST_USER_PASSWORD : ${{ secrets.E2E_TEST_USER_PASSWORD }}
52
52
E2E_TEST_USER_SECURITY_KEY : ${{ secrets.E2E_TEST_USER_SECURITY_KEY }}
53
53
E2E_TEST_USER_HOMESERVER_URL : " https://matrix.agent1.tchap.incubateur.net"
54
54
E2E_TEST_USER_HOMESERVER_SHORT : " agent1.tchap.incubateur.net"
55
- # todo pass the Dashboard record key as an environment variable
56
- # CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
55
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # don't remember what this is for, can't hurt
0 commit comments