From 212fa684b174ae706dabd7d5af9a275e46c6fbf1 Mon Sep 17 00:00:00 2001 From: Shamiul Mowla Date: Tue, 5 Nov 2024 16:14:58 -0500 Subject: [PATCH] Testcafe version 3.7.0 is still not supported by saucectl. --- .github/workflows/dev.yaml | 52 ++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index af03becbf..bb3487068 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -63,7 +63,7 @@ jobs: JOB_NUMBER: $GITHUB_JOB alloy-int-e2e: - name: "Dev Functional Test - Saucectl" + name: "Dev Functional Test - TestCafe" runs-on: ubuntu-latest needs: unit-test timeout-minutes: 60 @@ -80,7 +80,7 @@ jobs: id: npm-cache with: path: "**/node_modules" - key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}-${{ secrets.NPM_CACHE_VERSION }} # increment NPM_CACHE_VERSION secret to force cache reset + key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}-${{ secrets.NPM_CACHE_VERSION }} - name: Store Alloy version into env uses: nyaa8/package-version@v1 @@ -94,14 +94,46 @@ jobs: env: ALLOY_PROD_VERSION: ${{ env.PACKAGE_VERSION }} - - uses: saucelabs/saucectl-run-action@v4.3.0 + - name: Start Sauce Connect Tunnel + uses: saucelabs/sauce-connect-action@v2.3.7 env: GITHUB_TOKEN: ${{ github.token }} with: - sauce-username: ${{ secrets.SAUCE_USERNAME }} - sauce-access-key: ${{ secrets.SAUCE_ACCESS_KEY }} - env: | - ALLOY_PROD_VERSION=${{ env.PACKAGE_VERSION }} - NPM_PACKAGE_VERSION=${{ env.PACKAGE_VERSION }} - ALLOY_ENV=int - config-file: ./.sauce/dev.yml \ No newline at end of file + username: ${{ secrets.SAUCE_USERNAME }} + accessKey: ${{ secrets.SAUCE_ACCESS_KEY }} + tunnelIdentifier: ${{ env.SAUCE_TUNNEL_ID }} + + - name: Install TestCafe SauceLabs provider + run: npm install testcafe-browser-provider-saucelabs + + - name: Run TestCafe Tests + run: | + ALLOY_PROD_VERSION=${{ env.PACKAGE_VERSION }} \ + NPM_PACKAGE_VERSION=${{ env.PACKAGE_VERSION }} \ + ALLOY_ENV=int \ + EDGE_BASE_PATH=ee-pre-prd \ + npx testcafe "saucelabs:Chrome@latest:Windows 11" \ + "saucelabs:Firefox@latest:Windows 11" \ + "saucelabs:Safari@latest:macOS 13" \ + test/functional/specs/**/*.js \ + --reporter spec,saucelabs \ + --skip-js-errors \ + --disable-page-caching \ + --page-load-timeout 5000 \ + --speed 1 + env: + SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} + SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} + SAUCE_TUNNEL_ID: ${{ env.SAUCE_TUNNEL_ID }} + SAUCE_PROJECT_NAME: "Alloy SDK Int ee-pre-prd" + SAUCE_BUILD_NAME: "Build ${{ github.run_number }}" + SAUCE_CAPABILITIES_OVERRIDES_PATH: "sauceLabsCapabilities.json" + + - name: Handle Test Failures + if: failure() + uses: actions/github-script@v7 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + const handleTestFailures = require('./.github/scripts/handle-test-failures.js') + await handleTestFailures({ github, context }) \ No newline at end of file