|
| 1 | +name: E2E Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + |
| 8 | +jobs: |
| 9 | + install: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + container: |
| 12 | + # if you need to change image please make sure use the same version in all places |
| 13 | + # (here and in cypress/Dockerfile) |
| 14 | + image: cypress/browsers:node16.16.0-chrome107-ff107-edge |
| 15 | + options: --user 1001 |
| 16 | + |
| 17 | + # Install YARN dependencies, cache them correctly |
| 18 | + steps: |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@v3 |
| 21 | + |
| 22 | + - name: Use Node.js 18.x |
| 23 | + uses: actions/setup-node@v3 |
| 24 | + with: |
| 25 | + node-version: 18.x |
| 26 | + |
| 27 | + - name: Run yarn install |
| 28 | + |
| 29 | + with: |
| 30 | + cmd: install # will run `yarn install` command |
| 31 | + |
| 32 | + cypress-run-chrome: |
| 33 | + timeout-minutes: 15 |
| 34 | + runs-on: ubuntu-latest |
| 35 | + container: |
| 36 | + image: cypress/browsers:node16.16.0-chrome107-ff107-edge |
| 37 | + options: --user 1001 |
| 38 | + needs: install |
| 39 | + |
| 40 | + steps: |
| 41 | + - name: Checkout |
| 42 | + uses: actions/checkout@v3 |
| 43 | + |
| 44 | + - name: Use Node.js 18.x |
| 45 | + uses: actions/setup-node@v3 |
| 46 | + with: |
| 47 | + node-version: 18.x |
| 48 | + |
| 49 | + - name: Cypress run all tests |
| 50 | + uses: cypress-io/[email protected] # use the explicit version number |
| 51 | + with: |
| 52 | + start: npm start |
| 53 | + wait-on: "http://localhost:4200" |
| 54 | + wait-on-timeout: 120 |
| 55 | + browser: chrome |
| 56 | + |
| 57 | + - name: Archive cypress artifacts |
| 58 | + if: success() || failure() |
| 59 | + uses: actions/upload-artifact@v3 |
| 60 | + with: |
| 61 | + name: cypress generated files - chrome |
| 62 | + path: | |
| 63 | + cypress/videos/ |
| 64 | + cypress/screenshots/ |
| 65 | +
|
| 66 | + cypress-run-firefox: |
| 67 | + timeout-minutes: 15 |
| 68 | + runs-on: ubuntu-latest |
| 69 | + container: |
| 70 | + image: cypress/browsers:node16.16.0-chrome107-ff107-edge |
| 71 | + options: --user 1001 |
| 72 | + needs: install |
| 73 | + |
| 74 | + steps: |
| 75 | + - name: Checkout |
| 76 | + uses: actions/checkout@v3 |
| 77 | + |
| 78 | + - name: Use Node.js 18.x |
| 79 | + uses: actions/setup-node@v3 |
| 80 | + with: |
| 81 | + node-version: 18.x |
| 82 | + |
| 83 | + - name: Cypress run all tests |
| 84 | + uses: cypress-io/[email protected] # use the explicit version number |
| 85 | + with: |
| 86 | + start: npm start |
| 87 | + wait-on: "http://localhost:4200" |
| 88 | + wait-on-timeout: 120 |
| 89 | + browser: firefox |
| 90 | + |
| 91 | + - name: Archive cypress artifacts |
| 92 | + if: success() || failure() |
| 93 | + uses: actions/upload-artifact@v3 |
| 94 | + with: |
| 95 | + name: cypress generated files - firefox |
| 96 | + path: | |
| 97 | + cypress/videos/ |
| 98 | + cypress/screenshots/ |
| 99 | +
|
| 100 | + cypress-run-webkit: |
| 101 | + timeout-minutes: 15 |
| 102 | + runs-on: ubuntu-latest |
| 103 | + needs: install |
| 104 | + |
| 105 | + steps: |
| 106 | + - name: Checkout |
| 107 | + uses: actions/checkout@v3 |
| 108 | + |
| 109 | +# commented because if we use it here, we face with that problem: |
| 110 | +# "http://localhost:4200 timed out on retry 151 of 5, elapsed 150449ms, limit 150000ms |
| 111 | +# Error: connect ECONNREFUSED 127.0.0.1:4200" |
| 112 | + |
| 113 | +# - name: Use Node.js 18.x |
| 114 | +# uses: actions/setup-node@v3 |
| 115 | +# with: |
| 116 | +# node-version: 18.x |
| 117 | + |
| 118 | + - name: Use Node.js 16.x |
| 119 | + uses: actions/setup-node@v3 |
| 120 | + with: |
| 121 | + node-version: 16.x |
| 122 | + |
| 123 | + # https://docs.cypress.io/guides/guides/launching-browsers#Linux-Dependencies |
| 124 | + - name: Install additional dependencies |
| 125 | + run: npx playwright install --with-deps webkit |
| 126 | + |
| 127 | + - name: Cypress run all tests |
| 128 | + uses: cypress-io/[email protected] # use the explicit version number |
| 129 | + with: |
| 130 | + start: npm start |
| 131 | + wait-on: "http://localhost:4200" |
| 132 | + wait-on-timeout: 120 |
| 133 | + browser: webkit |
| 134 | + |
| 135 | + - name: Archive cypress artifacts |
| 136 | + if: success() || failure() |
| 137 | + uses: actions/upload-artifact@v3 |
| 138 | + with: |
| 139 | + name: cypress generated files - webkit |
| 140 | + path: | |
| 141 | + cypress/videos/ |
| 142 | + cypress/screenshots/ |
0 commit comments