diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 7a2398d169b..d763e2b51d9 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -24,6 +24,9 @@ env: E2E_BLOG_TOKEN: ${{ secrets.E2E_BLOG_TOKEN }} E2E_USER_TOKEN: ${{ secrets.E2E_USER_TOKEN }} E2E_RETEST: 1 + WC_E2E_SCREENSHOTS: 1 + E2E_SLACK_CHANNEL: ${{ secrets.E2E_SLACK_CHANNEL }} + E2E_SLACK_TOKEN: ${{ secrets.E2E_SLACK_TOKEN }} jobs: wcpay-e2e-tests: @@ -125,9 +128,12 @@ jobs: - name: Run E2E Tests run: npm run test:e2e - # Upload screenshots if any - - name: Upload screenshots + # Archive screenshots if any + - name: Archive e2e test screenshots + if: ${{ always() }} uses: actions/upload-artifact@v2 with: - name: screenshots - path: screenshots + name: e2e-screenshots + path: tests/e2e/screenshots + if-no-files-found: ignore + retention-days: 5 diff --git a/tests/e2e/config/jest.config.js b/tests/e2e/config/jest.config.js index f04617e5845..62e78edf149 100644 --- a/tests/e2e/config/jest.config.js +++ b/tests/e2e/config/jest.config.js @@ -1,6 +1,6 @@ const path = require( 'path' ); const { config } = require( 'dotenv' ); -const { jestConfig } = require( '@automattic/puppeteer-utils' ); +const { useE2EJestConfig } = require( '@woocommerce/e2e-environment' ); const fs = require( 'fs' ); config( { path: path.resolve( __dirname, '.env' ) } ); @@ -47,16 +47,15 @@ if ( process.env.E2E_GROUP ) { } ); } -module.exports = { - ...jestConfig, +// eslint-disable-next-line react-hooks/rules-of-hooks +const testConfig = useE2EJestConfig( { + setupFiles: [], rootDir: path.resolve( __dirname, '../../../' ), roots: allowedPaths, - setupFilesAfterEnv: [ - path.resolve( __dirname, '../setup/jest-setup.js' ), - ...jestConfig.setupFilesAfterEnv, - ], testSequencer: path.resolve( __dirname, '../config/jest-custom-sequencer.js' ), -}; +} ); + +module.exports = testConfig; diff --git a/tests/e2e/setup/jest-setup.js b/tests/e2e/config/jest.setup.js similarity index 100% rename from tests/e2e/setup/jest-setup.js rename to tests/e2e/config/jest.setup.js