Skip to content

Commit

Permalink
Merge pull request #875 from Codeinwp/fix/e2e
Browse files Browse the repository at this point in the history
Fixes E2E tests and moves them to playwright
  • Loading branch information
abaicus authored Feb 21, 2025
2 parents 287d7f3 + 9a07b25 commit 36f4f64
Show file tree
Hide file tree
Showing 44 changed files with 625 additions and 40,717 deletions.
5 changes: 2 additions & 3 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ composer.lock
npm-debug.log
bin
key.enc
cypress
cypress.json
node_modules
logs
grunt
Expand All @@ -36,9 +34,10 @@ assets/src
.wporg
.nvmrc
.github
cypress.config.js
.eslintrc
postcss.config.js
tailwind.config.js
phpstan.neon
development.php
playwright.config.ts
test-results
47 changes: 12 additions & 35 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,23 @@ on:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
cancel-in-progress: true
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

jobs:
e2e:
if: ( github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name ) && ( github.actor != 'dependabot[bot]' )
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 16
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Configure Composer cache
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
cache: 'npm'
- name: Install dependencies
run: |
npm ci
composer install --no-dev --prefer-dist --no-progress --no-suggest
npx playwright install
- name: Make build
run: |
npm run build
Expand All @@ -48,23 +37,11 @@ jobs:
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_PATH: ${{ secrets.SSH_PATH }}
run: ./bin/run-e2e-tests.sh
- name: E2E tests chrome
uses: cypress-io/github-action@v6
with:
env: host=testing.optimole.com
config-file: cypress.config.js
browser: chrome
e2eFirefox:
needs: e2e
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 16
- uses: cypress-io/github-action@v6
with:
env: host=testing.optimole.com
config-file: cypress.config.js
browser: firefox
- name: Run E2E tests
id: run_tests
run: |
npm run e2e:run
continue-on-error: false
- name: Check test results
if: steps.run_tests.outcome != 'success'
run: exit 1
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ node_modules
logs
dist
artifact
cypress/videos
cypress/fixtures
vendor
code_quality
build
.DS_Store
cc-test-reporter
assets/build
assets/build
test-results
15 changes: 0 additions & 15 deletions cypress.config.js

This file was deleted.

34 changes: 0 additions & 34 deletions cypress/.eslintrc.json

This file was deleted.

9 changes: 0 additions & 9 deletions cypress/.prettierrc.json

This file was deleted.

21 changes: 0 additions & 21 deletions cypress/e2e/test_amp.js

This file was deleted.

61 changes: 0 additions & 61 deletions cypress/e2e/test_beaver_builder_background_lazyload.js

This file was deleted.

106 changes: 0 additions & 106 deletions cypress/e2e/test_divi_background_lazyload.js

This file was deleted.

Loading

0 comments on commit 36f4f64

Please sign in to comment.