From 5bdf71ac24bd802e58cea15ec0018d307eef8fe8 Mon Sep 17 00:00:00 2001 From: Dave Haeffner Date: Tue, 12 Dec 2023 12:57:40 -0500 Subject: [PATCH 1/2] add cypress gh action --- .github/workflows/test-js-cypress.js.yml | 46 +++++++++++++++++++ ...um-test.js.yml => test-js-selenium.js.yml} | 0 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/test-js-cypress.js.yml rename .github/workflows/{js-selenium-test.js.yml => test-js-selenium.js.yml} (100%) diff --git a/.github/workflows/test-js-cypress.js.yml b/.github/workflows/test-js-cypress.js.yml new file mode 100644 index 0000000..183a8f7 --- /dev/null +++ b/.github/workflows/test-js-cypress.js.yml @@ -0,0 +1,46 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: test js cypresss + +on: + pull_request: + branches: [ "main" ] + workflow_dispatch: + + +jobs: + test: + runs-on: ubuntu-latest + + defaults: + run: + working-directory: ./js/selenium + + env: + APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }} + + strategy: + matrix: + # See supported Node.js release schedule at + # https://nodejs.org/en/about/releases/ + node-version: [16.x] + # as many jobs as you want, but less than numbers of tests + shard: [1,2,3,4,5,6,7,8,9,10,11,12,13,14] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache-dependency-path: ./js/selenium + cache: 'npm' + - uses: browser-actions/setup-chrome@latest + - run: chrome --version + - name: install deps + run: npm i + - name: find test files to be run + run: echo "SHARD_FILES=$(find test -type f -name "*.js" | grep -v helper | sed -n '${{matrix.shard}}~${{strategy.job-total}}p' | tr '\n' ' ')" >> $GITHUB_ENV + - name: run tests + run: npm run test ${{env.SHARD_FILES}} diff --git a/.github/workflows/js-selenium-test.js.yml b/.github/workflows/test-js-selenium.js.yml similarity index 100% rename from .github/workflows/js-selenium-test.js.yml rename to .github/workflows/test-js-selenium.js.yml From 136f53777049ec2ec0a1af3791d89da170cf45e0 Mon Sep 17 00:00:00 2001 From: Dave Haeffner Date: Tue, 12 Dec 2023 13:16:31 -0500 Subject: [PATCH 2/2] add cypress gh action --- .github/workflows/test-js-cypress.js.yml | 11 ++++++----- js/cypress | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-js-cypress.js.yml b/.github/workflows/test-js-cypress.js.yml index 183a8f7..73daf34 100644 --- a/.github/workflows/test-js-cypress.js.yml +++ b/.github/workflows/test-js-cypress.js.yml @@ -15,7 +15,7 @@ jobs: defaults: run: - working-directory: ./js/selenium + working-directory: ./js/cypress env: APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }} @@ -26,7 +26,8 @@ jobs: # https://nodejs.org/en/about/releases/ node-version: [16.x] # as many jobs as you want, but less than numbers of tests - shard: [1,2,3,4,5,6,7,8,9,10,11,12,13,14] + # e.g., shard: [1,2,3,4,5,6,7,8,9,10,11,12,13,14] + shard: [1,2,3,4] steps: - uses: actions/checkout@v3 @@ -34,13 +35,13 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache-dependency-path: ./js/selenium + cache-dependency-path: ./js/cypress cache: 'npm' - uses: browser-actions/setup-chrome@latest - run: chrome --version - name: install deps run: npm i - name: find test files to be run - run: echo "SHARD_FILES=$(find test -type f -name "*.js" | grep -v helper | sed -n '${{matrix.shard}}~${{strategy.job-total}}p' | tr '\n' ' ')" >> $GITHUB_ENV + run: echo "SHARD_FILES=$(find cypress/e2e -type f -name "*.js" | grep -v helper | sed -n '${{matrix.shard}}~${{strategy.job-total}}p' | tr '\n' ' ')" >> $GITHUB_ENV - name: run tests - run: npm run test ${{env.SHARD_FILES}} + run: npm run test -- --spec ${{env.SHARD_FILES}} diff --git a/js/cypress b/js/cypress index da9b31c..54b91e9 160000 --- a/js/cypress +++ b/js/cypress @@ -1 +1 @@ -Subproject commit da9b31cb4839cf16da00c1601d514425a9b31560 +Subproject commit 54b91e9974157345f71fb515eeae0bf491f31e5c