From 99a3541086f4c210f74146779f4de814f10ab8ab Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Wed, 15 Jan 2020 16:18:25 -0500 Subject: [PATCH 1/2] add Cypress starter workflow --- ci/cypress.yml | 45 +++++++++++++++++++++++++++ ci/properties/cypress.properties.json | 6 ++++ icons/cypress.svg | 16 ++++++++++ 3 files changed, 67 insertions(+) create mode 100644 ci/cypress.yml create mode 100644 ci/properties/cypress.properties.json create mode 100644 icons/cypress.svg diff --git a/ci/cypress.yml b/ci/cypress.yml new file mode 100644 index 0000000..99b4e25 --- /dev/null +++ b/ci/cypress.yml @@ -0,0 +1,45 @@ +name: Cypress + +on: [push] + +env: + CI: 1 # minimal progress output + TERM: xterm # good terminal rendering + +jobs: + e2e: + name: Cypress tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Cache NPM modules + uses: actions/cache@v1 + with: + path: ~/.npm + key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-npm- + - name: Cache Cypress binary + uses: actions/cache@v1 + with: + path: ~/.cache/Cypress + key: ${{ runner.os }}-cypress-${{ hashFiles('**/package.json') }} + restore-keys: | + ${{ runner.os }}-cypress- + - name: install Cypress + run: | + npm ci + npx cypress verify + - name: E2E tests + run: npx cypress run + # save any error screenshots as test artifacts + - uses: actions/upload-artifact@v1 + if: failure() + with: + name: screenshots + path: cypress/screenshots + # video should always be generated + - uses: actions/upload-artifact@v1 + with: + name: videos + path: cypress/videos diff --git a/ci/properties/cypress.properties.json b/ci/properties/cypress.properties.json new file mode 100644 index 0000000..0fae544 --- /dev/null +++ b/ci/properties/cypress.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Cypress", + "description": "Run end-to-end web application tests using Cypress.io", + "iconName": "cypress", + "categories": ["Testing", "Cypress"] +} diff --git a/icons/cypress.svg b/icons/cypress.svg new file mode 100644 index 0000000..3134aeb --- /dev/null +++ b/icons/cypress.svg @@ -0,0 +1,16 @@ + + + + + + + + From 17d9115a99dac60725eac49ccf37649356f19ad2 Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Wed, 15 Jan 2020 16:29:35 -0500 Subject: [PATCH 2/2] add comment about cypress gh action --- ci/cypress.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/cypress.yml b/ci/cypress.yml index 99b4e25..c42c930 100644 --- a/ci/cypress.yml +++ b/ci/cypress.yml @@ -7,6 +7,8 @@ env: TERM: xterm # good terminal rendering jobs: + # for simpler configuration you can use 3rd party action + # https://github.com/cypress-io/github-action e2e: name: Cypress tests runs-on: ubuntu-latest