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"
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
17 changes: 15 additions & 2 deletions .github/workflows/run-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

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

- name: Install dependencies
run: |
Expand All @@ -53,6 +53,19 @@ jobs:
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
Expand Down Expand Up @@ -86,7 +99,7 @@ jobs:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: "23.x"
node-version: "22.x"

- name: Install dependencies
run: yarn install
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
3 changes: 3 additions & 0 deletions tests/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,16 @@ export default defineConfig({
viewport: { width: 1920, height: 1080 }
}
},
// WebKit on CI is flaky, so we run it only locally
/*
{
name: 'webkit',
use: {
...devices['Desktop Safari'],
viewport: { width: 1920, height: 1080 }
}
}
*/
],
outputDir: 'test-results',
timeout: 60_000,
Expand Down
6 changes: 5 additions & 1 deletion tests/e2e/tests/edit/edit_corner_cases.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ for (const editorName of editors) {
})

test(`MTHTML-97 Validate formula edition on styled text blocks: ${editorName} editor`, async ({ page }) => {
test.skip(editorName === 'generic' && test.info().project.name === 'firefox', 'Not possible to apply styles with shortcuts in generic editor on Firefox')

const { editor, wirisEditor } = await setupEditor(page, editorName)

await editor.open()
Expand Down Expand Up @@ -83,7 +85,9 @@ for (const editorName of editors) {
expect(isTextAfterEquation).toBeTruthy()
})

test(`MTHTML-100 User edits a formula deleted during edition: ${editorName} editor`, async ({ page }) => {
test(`MTHTML-100 User edits a formula deleted during edition: ${editorName} editor`, {tag: editorName === 'ckeditor5' ? ['@knownIssue'] : []}, async ({ page }) => {
test.fail(editorName === 'ckeditor5', 'Known issue in CKEditor5')

const { editor, wirisEditor } = await setupEditor(page, editorName)

await editor.open()
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/insert/insert_corner_cases.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ for (const editorName of editors) {
await wirisEditor.waitUntilLoaded()
await wirisEditor.insertEquationUsingEntryForm(Equations.singleNumber.mathml)
await editor.waitForEquation(Equations.singleNumber)
await editor.type('12')
await editor.type('11')

const equationsInHTMLEditor = await editor.getEquations()
const isEquationPresent = equationsInHTMLEditor.some((equation: Equation) => equation.altText === Equations.singleNumber.altText)
Expand Down
Loading