-
Notifications
You must be signed in to change notification settings - Fork 51
56 lines (56 loc) · 1.96 KB
/
cypress.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Cypress
on: [push]
jobs:
cypress:
name: Cypress
runs-on: ubuntu-22.04
env:
MAAS_URL: http://localhost:5240
steps:
- uses: actions/checkout@main
- name: Get branch name
uses: nelonoel/[email protected]
- name: Setup MAAS
uses: canonical/setup-maas@main
with:
maas-url: ${{env.MAAS_URL}}/MAAS
- name: Install Cypress
uses: cypress-io/github-action@v4
with:
runTests: false
- name: Run Cypress tests without a user
uses: cypress-io/github-action@v4
with:
config: baseUrl=${{env.MAAS_URL}},pageLoadTimeout=100000
install: false
spec: "cypress/e2e/no-users/**/*.spec.ts"
wait-on: "${{env.MAAS_URL}}/MAAS/r/machines"
- name: Create MAAS admin
run: sudo maas createadmin --username=admin --password=test [email protected]
- name: Create MAAS non-admin user
run: |
export API_KEY=`sudo maas apikey --username=admin`
maas login admin http://localhost:5240/MAAS $API_KEY
maas admin users create username=user password=test [email protected] is_superuser=0
- name: Run Cypress tests with a user
uses: cypress-io/github-action@v4
with:
config: baseUrl=${{env.MAAS_URL}},pageLoadTimeout=100000
install: false
spec: "cypress/e2e/with-users/**/*.spec.ts"
wait-on: "${{env.MAAS_URL}}/MAAS/r/machines"
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- name: Create issue on failure
if: failure()
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
RUN_ID: ${{ github.run_id }}
with:
filename: .github/ISSUE_TEMPLATE/cypress-failure.md
update_existing: true