Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/ci-baselines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Generates Playwright visual baseline images in CI and uploads them to S3
#
# This workflow builds the project, runs Playwright to produce fresh baselines,
# and pushes them to S3. Use this when baselines need to be regenerated from
# scratch in a clean CI environment.
#
name: CI Baselines Generate & Upload

on:
workflow_dispatch:
workflow_call:
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_READONLY_TOKEN }}
CKEDITOR5_LICENSE_KEY: ${{ secrets.CKEDITOR5_LICENSE_KEY }}

jobs:
upload:
name: Generate and upload baselines to S3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- uses: actions/setup-node@v6
with:
node-version: ${{ vars.NODE_VERSION }}

- name: Install root dependencies
run: npm install

- name: Build
run: npm run build

- name: Install E2E test dependencies
run: |
npm install
npx playwright install --with-deps
working-directory: ./tests

- name: Generate baseline images
run: npx playwright test -g "MTHTML-23 Validate formula alignment" --update-snapshots
working-directory: ./tests

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_STAGING }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_STAGING }}
aws-region: eu-west-2

- name: Upload baselines to S3
run: |
aws s3 sync tests/fixtures/ s3://wiris-integrations-staging-html/html/baselines/ci \
--delete \
--exclude "*" \
--include "*.png"
echo "Baselines uploaded successfully"

- name: Generate and upload manifest
run: |
find tests/fixtures/ -name "*.png" -printf "%P\n" | sort > manifest.txt
aws s3 cp manifest.txt s3://wiris-integrations-staging-html/html/baselines/ci/manifest.txt
echo "Manifest uploaded successfully"
146 changes: 0 additions & 146 deletions .github/workflows/cypress-Run-tests-with-npm-packages.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
node-version: 22.x

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
node-version: 22.x

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down
122 changes: 122 additions & 0 deletions .github/workflows/run-e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: E2E Tests - All Editors

on:
push:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
# Matrix strategy to enable per html editor parallelization
e2e-tests:
name: E2E Tests - ${{ matrix.editor }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
editor:
- generic
- ckeditor4
- ckeditor5
- froala
- tinymce5
- tinymce6
- tinymce7
- tinymce8

steps:
- uses: actions/checkout@v5

- uses: actions/setup-node@v4
with:
node-version: "22.x"

- name: Install dependencies
run: |
yarn install
yarn playwright install --with-deps

- name: Build ${{ matrix.editor }} package
if: matrix.editor != 'tinymce8'
run: |
yarn nx build ${{ matrix.editor }}
yarn nx build html-${{ matrix.editor }}
env:
CKEDITOR4_API_KEY: ${{ secrets.CKEDITOR4_API_KEY }}
FROALA_API_KEY: ${{ secrets.FROALA_API_KEY }}

- name: Build tinymce8 packages
if: matrix.editor == 'tinymce8'
run: |
yarn nx build tinymce7
yarn nx build html-tinymce8

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_STAGING }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_STAGING }}
aws-region: eu-west-2

- name: Download baseline images from S3
run: |
aws s3 sync s3://wiris-integrations-staging-html/html/baselines/ci/ tests/fixtures/ \
--exclude "*" \
--include "*${{ matrix.editor }}*.png"

- name: Run E2E tests for ${{ matrix.editor }}
id: e2e
run: HTML_EDITOR=${{ matrix.editor }} PLAYWRIGHT_BLOB_OUTPUT_NAME=report-${{ matrix.editor }}.zip yarn test:e2e
continue-on-error: true
env:
CKEDITOR4_API_KEY: ${{ secrets.CKEDITOR4_API_KEY }}
FROALA_API_KEY: ${{ secrets.FROALA_API_KEY }}
CK5_LICENSE_KEY: ${{ secrets.CK5_LICENSE_KEY }}

- name: Publish test results for ${{ matrix.editor }}
uses: dorny/test-reporter@d61b558e8df85cb60d09ca3e5b09653b4477cea7 # v2.0.0
with:
name: E2E Tests - ${{ matrix.editor }}
path: tests/e2e/test-results/results.xml
reporter: java-junit
fail-on-error: ${{ steps.e2e.outcome == 'failure' }}
continue-on-error: true

- name: Upload blob report for ${{ matrix.editor }}
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.editor }}
path: blob-report
retention-days: 1

merge-reports:
if: always()
needs: [e2e-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: "22.x"

- name: Install dependencies
run: yarn install

- name: Download all blobs
uses: actions/download-artifact@v4
with:
path: all-blob-reports
pattern: blob-report-*
merge-multiple: true

- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./all-blob-reports

- name: Upload Final HTML Report
uses: actions/upload-artifact@v4
with:
name: final-playwright-report
path: playwright-report/
retention-days: 2
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
package-lock.json
packages/*/yarn.lock

# Cypress
cypress/screenshots
cypress/videos

node_modules

# Verdaccio
Expand Down
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"ms-vsliveshare.vsliveshare", // Live Share
"visualstudioexptteam.vscodeintellicode", // IntelliCode
"thundergang.thunder-client", // Thunder Client
"ms-playwright.playwright", // Playwright

// GITHUB
"eamodio.gitlens", // GitLens
Expand Down
8 changes: 0 additions & 8 deletions cypress.json

This file was deleted.

Loading
Loading