Headless E2E tests for ECP-9465 #196
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: E2E test workflow | |
run-name: Headless E2E tests for ${{ github.event.pull_request.head.ref }} | |
on: | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
php-version: ["8.2"] | |
magento-version: ["2.4.6-p8"] | |
runs-on: | |
group: larger-runners | |
labels: ubuntu-latest-8-cores | |
timeout-minutes: 10 | |
env: | |
PHP_VERSION: ${{ matrix.php-version }} | |
MAGENTO_VERSION: ${{ matrix.magento-version }} | |
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}} | |
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}} | |
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}} | |
DEPLOY_SAMPLEDATA: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Magento | |
run: docker compose -f .github/docker-compose.yml run --rm web make magento | |
- name: Start web server in background | |
run: docker compose -f .github/docker-compose.yml up -d web | |
- name: Setup permissions | |
run: docker exec magento2-container make fs | |
- name: Check install | |
run: docker exec magento2-container make sys-check | |
- name: Install plugin | |
run: docker exec -u www-data magento2-container make plugin | |
- name: Kill Cron Jobs | |
run: docker exec magento2-container /etc/init.d/cron stop | |
- name: Switch to production mode | |
run: docker exec -u www-data magento2-container make production | |
- name: Setup permissions | |
run: docker exec magento2-container make fs | |
- name: Run E2E tests | |
run: docker compose -f .github/docker-compose.e2e.yml run --rm playwright /e2e.sh express-checkout | |
env: | |
INTEGRATION_TESTS_BRANCH: ${{ env.TEST_BRANCH }} | |
MAGENTO_ADMIN_USERNAME: ${{secrets.MAGENTO_ADMIN_USERNAME}} | |
MAGENTO_ADMIN_PASSWORD: ${{secrets.MAGENTO_ADMIN_PASSWORD}} | |
MAGENTO_BASE_URL: ${{secrets.MAGENTO_BASE_URL}} | |
PAYPAL_USERNAME: ${{secrets.PLAYWRIGHT_PAYPAL_USERNAME}} | |
PAYPAL_PASSWORD: ${{secrets.PLAYWRIGHT_PAYPAL_PASSWORD}} | |
GOOGLE_USERNAME: ${{secrets.PLAYWRIGHT_GOOGLE_USERNAME}} | |
GOOGLE_PASSWORD: ${{secrets.PLAYWRIGHT_GOOGLE_PASSWORD}} | |
WEBHOOK_USERNAME: admin | |
WEBHOOK_PASSWORD: 1234 | |
CI: TRUE | |
- name: Archive test result artifacts | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: html-report | |
path: test-report |