Skip to content

Added UI Tests

Added UI Tests #37

Workflow file for this run

name: UI Tests
on:
## Check each PR
push:
pull_request:
## Manual execution on branch
workflow_dispatch:
## Nightly
### Needs secrets
#### GC_PROJECT_ID
#### GC_SERVICE_KEY
#### NIGHTLY_TOKEN
schedule:
- cron: '0 0 * * *'
jobs:
ui_test:
name: UI Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ps-version:
- '8.0.5'
- '8.1.3'
- 'nightly'
env:
PS_VERSION: ${{ matrix.ps-version }}
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
- uses: actions/setup-node@v3
with:
node-version: 14
- name: Build
run: npm install && npm run build
- name: Start containers
working-directory: tests/UI/
run: |
docker-compose -f "docker-compose.yml" up -d --build
while ! nc -z localhost 80; do sleep 1; done;
- name: Install dependencies
working-directory: tests/UI/
run: npm ci
- name: Install Playwright Browsers
working-directory: tests/UI/
run: npx playwright install chromium --with-deps
- name: Run Playwright tests
working-directory: tests/UI/
run: npx playwright test
- name: Upload artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path:
tests/UI/reports/
tests/UI/report.json
retention-days: 30
# Nightly : Rename file
- name: "Nightly : Rename file"
working-directory: tests/UI/
if: ${{ github.event_name == 'schedule' }}
run: |
mkdir -p nightly
REPORT_NAME="blockwishlist_$(date +%Y-%m-%d)-${{ env.PS_VERSION }}"
mv report.json nightly/${REPORT_NAME}.json
# Nightly : Auth GCP
- name: "Nightly : Auth GCP"
uses: google-github-actions/auth@v1
if: ${{ github.event_name == 'schedule' }}
with:
credentials_json: ${{ secrets.GC_SERVICE_KEY }}
project_id: ${{ secrets.GC_PROJECT_ID }}
# Nightly : Setup GCP
- name: "Nightly : Setup GCP"
uses: google-github-actions/setup-gcloud@v1
if: ${{ github.event_name == 'schedule' }}
# Nightly : Upload to Google Cloud Storage (GCS)
- name: "Nightly : Upload to Google Cloud Storage (GCS)"
working-directory: tests/UI/
if: ${{ github.event_name == 'schedule' }}
run: gsutil cp -r "nightly/**" gs://prestashop-core-nightly/reports
# Nightly : Push Report
- name: "Nightly : Push Report"
if: ${{ github.event_name == 'schedule' }}
run: |
REPORT_NAME="blockwishlist_$(date +%Y-%m-%d)-${{ env.PS_VERSION }}"
curl -v "https://api-nightly.prestashop-project.org/import/report/playwright?token=${{ secrets.NIGHTLY_TOKEN }}&filename=${REPORT_NAME}.json"