diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index 91a059ff27..630076517f 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -67,8 +67,11 @@ env: jobs: tests: - name: e2e_api tests + name: e2e_api tests-${{ matrix.group }} runs-on: ubuntu-latest + strategy: + matrix: + group: [e2e_1, e2e_2] steps: - name: Checkout testing repo @@ -161,29 +164,33 @@ jobs: # npm run pw:deps-only # Run e2e tests - - name: 🧪 Run e2e tests + - name: 🧪 Run e2e tests-${{ matrix.group }} id: e2e-test if: success() && (github.event_name != 'workflow_dispatch' || ( github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'E2E' || github.event.inputs.testsuite == 'All'))) - timeout-minutes: 40 + timeout-minutes: 30 working-directory: tests/pw run: | - npm run test:e2e + if [[ "${{ matrix.group }}" == "e2e_1" ]]; then + npx playwright test --project="${{ matrix.group }}" --config=e2e.config.ts + elif [[ "${{ matrix.group }}" == "e2e_2" ]]; then + npx playwright test --project="${{ matrix.group }}" --config=e2e.config.ts + fi # Run e2e coverage - name: 🧪 Run e2e coverage if: always() && (steps.e2e-test.outcome == 'success' || steps.e2e-test.outcome == 'failure') working-directory: tests/pw run: | - npm run test:e2e:coverage + npm run test:e2e:coverage # Run api tests - - name: 🧪 Run api tests - id: api-test - if: always() && steps.wp-env.outcome == 'success' && ( github.event_name != 'workflow_dispatch' || ( github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All'))) - timeout-minutes: 5 - working-directory: tests/pw - run: | - npm run test:api + # - name: 🧪 Run api tests + # id: api-test + # if: always() && steps.wp-env.outcome == 'success' && ( github.event_name != 'workflow_dispatch' || ( github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All'))) + # timeout-minutes: 5 + # working-directory: tests/pw + # run: | + # npm run test:api # Prepare test summary - name: Prepare test summary @@ -229,7 +236,7 @@ jobs: uses: actions/upload-artifact@v4 if: always() && steps.debug-log.outcome == 'success' with: - name: test-artifact + name: test-artifact-${{ matrix.group }} path: | tests/pw/wp-data tests/pw/playwright diff --git a/tests/pw/e2e.config.ts b/tests/pw/e2e.config.ts index afc051c1dd..792bd9c9b3 100644 --- a/tests/pw/e2e.config.ts +++ b/tests/pw/e2e.config.ts @@ -151,6 +151,23 @@ export default defineConfig({ // teardown: NO_SETUP ? undefined : 'coverage_report', }, + // e2e_tests + { + name: 'e2e_1', + testMatch: /.*\.spec\.ts/, + grep: [/@lite/], + dependencies: NO_SETUP ? [] : ['e2e_setup'], + }, + + // e2e_tests + { + name: 'e2e_2', + testMatch: /.*\.spec\.ts/, + grep: [/@pro/], + dependencies: NO_SETUP ? [] : ['e2e_setup'], + + }, + // coverage_report { name: 'coverage_report', diff --git a/tests/pw/tests/e2e/admin.spec.ts b/tests/pw/tests/e2e/admin.spec.ts index 5c18d0942d..aba5d67425 100644 --- a/tests/pw/tests/e2e/admin.spec.ts +++ b/tests/pw/tests/e2e/admin.spec.ts @@ -3,12 +3,12 @@ import { LoginPage } from '@pages/loginPage'; import { data } from '@utils/testData'; test.describe('Admin functionality test', () => { - test('admin can login', { tag: ['@lite', '@admin'] }, async ({ page }) => { + test('admin can login', { tag: ['@lite', '@admin', '@e2e_1'] }, async ({ page }) => { const loginPage = new LoginPage(page); await loginPage.adminLogin(data.admin); }); - test('admin can logout', { tag: ['@lite', '@admin'] }, async ({ page }) => { + test('admin can logout', { tag: ['@lite', '@admin', '@e2e_2'] }, async ({ page }) => { const loginPage = new LoginPage(page); await loginPage.adminLogin(data.admin); await loginPage.logoutBackend();