Skip to content

Commit

Permalink
Revert couple of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shashwatahalder01 committed Dec 13, 2024
1 parent d016d87 commit 6b6b825
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 26 deletions.
31 changes: 12 additions & 19 deletions .github/workflows/e2e_api_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ env:
SHA: ${{ github.event.pull_request.head.sha }}
SYSTEM_INFO: ./tests/pw/playwright/systemInfo.json
API_TEST_RESULT: ./tests/pw/playwright-report/api/summary-report/results.json
E2E_TEST_RESULT: ./tests/pw/playwright-report/e2e/summary-report/results.json
API_COVERAGE: ./tests/pw/playwright-report/api/coverage-report/coverage.json
E2E_TEST_RESULT: ''
E2E_COVERAGE: ''
GROUP: ''
E2E_COVERAGE: ./tests/pw/playwright-report/e2e/coverage-report/coverage.json

jobs:
tests:
Expand Down Expand Up @@ -119,17 +118,17 @@ jobs:
cd tests/pw
npm run start:env
# # Set permalink structure
# - name: Set Permalink structure
# working-directory: tests/pw
# run: |
# npm run wp-env run tests-cli wp rewrite structure /%postname%/
# Set permalink structure
- name: Set Permalink structure
working-directory: tests/pw
run: |
npm run wp-env run tests-cli wp rewrite structure /%postname%/
# # Activate theme
# - name: Activate theme:Storefront
# working-directory: tests/pw
# run: |
# npm run wp-env run tests-cli wp theme activate storefront
# Activate theme
- name: Activate theme:Storefront
working-directory: tests/pw
run: |
npm run wp-env run tests-cli wp theme activate storefront
# Get Playwright version
- name: Get installed Playwright version
Expand Down Expand Up @@ -172,14 +171,8 @@ jobs:
working-directory: tests/pw
run: |
if [[ "${{ matrix.group }}" == "e2e_1" ]]; then
echo "E2E_TEST_RESULT=./tests/pw/playwright-report/e2e/${{ matrix.group }}/summary-report/results.json" >> $GITHUB_ENV
echo "E2E_COVERAGE=./tests/pw/playwright-report/e2e/${{ matrix.group }}/coverage-report/coverage.json" >> $GITHUB_ENV
echo "GROUP=${{ matrix.group }}" >> $GITHUB_ENV
npx playwright test --project="${{ matrix.group }}" --config=e2e.config.ts
elif [[ "${{ matrix.group }}" == "e2e_2" ]]; then
echo "E2E_TEST_RESULT=./tests/pw/playwright-report/e2e/${{ matrix.group }}/summary-report/results.json" >> $GITHUB_ENV
echo "E2E_COVERAGE=./tests/pw/playwright-report/e2e/${{ matrix.group }}/coverage-report/coverage.json" >> $GITHUB_ENV
echo "GROUP=${{ matrix.group }}" >> $GITHUB_ENV
npx playwright test --project="${{ matrix.group }}" --config=e2e.config.ts
fi
Expand Down
2 changes: 1 addition & 1 deletion tests/pw/api.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default defineConfig({
/* Configure reporters */
reporter: CI
? [
// ['github'],
['github'],
['html', { open: 'never', outputFolder: 'playwright-report/api/html-report' }],
// ['junit', { outputFile: 'playwright-report/api/junit-report/api-results.xml' }],
['list', { printSteps: true }],
Expand Down
4 changes: 2 additions & 2 deletions tests/pw/e2e.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig, devices, expect } from '@playwright/test';
import { customExpect } from '@utils/pwMatchers';
import 'dotenv/config';
const { CI, NON_HEADLESS, BASE_URL, SLOWMO, NO_SETUP, DOKAN_PRO, GROUP } = process.env;
const { CI, NON_HEADLESS, BASE_URL, SLOWMO, NO_SETUP, DOKAN_PRO } = process.env;

export default defineConfig({
/* test directory */
Expand Down Expand Up @@ -59,7 +59,7 @@ export default defineConfig({
['html', { open: 'never', outputFolder: 'playwright-report/e2e/html-report' }],
// ['junit', { outputFile: 'playwright-report/e2e/junit-report/e2e-results.xml' }],
['list', { printSteps: true }],
['./utils/summaryReporter.ts', { outputFile: `playwright-report/e2e/${GROUP}/summary-report/results.json` }],
['./utils/summaryReporter.ts', { outputFile: 'playwright-report/e2e/summary-report/results.json' }],
],

use: {
Expand Down
6 changes: 3 additions & 3 deletions tests/pw/tests/e2e/_coverage.teardown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fs from 'fs';
import path from 'path';
import { helpers } from '@utils/helpers';

const { DOKAN_PRO, GROUP } = process.env;
const { DOKAN_PRO } = process.env;

let executed_tests: string[] = [];

Expand All @@ -17,8 +17,8 @@ const uncoveredFeatures: string[] = [];

teardown.describe('get e2e test coverage', () => {
const feature_map = 'feature-map/feature-map.yml';
const outputFile = `playwright-report/e2e/${GROUP}/coverage-report/coverage.json`;
const testReport = `playwright-report/e2e/${GROUP}/summary-report/results.json`;
const outputFile = 'playwright-report/e2e/coverage-report/coverage.json';
const testReport = 'playwright-report/e2e/summary-report/results.json';

teardown('get coverage', { tag: ['@lite'] }, async () => {
executed_tests = helpers.readJson(testReport)?.tests;
Expand Down
1 change: 0 additions & 1 deletion tests/pw/types/environment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ declare global {
E2E_TEST_RESULT: string;
API_COVERAGE: string;
E2E_COVERAGE: string;
GROUP: string;
}
}
}

0 comments on commit 6b6b825

Please sign in to comment.