Skip to content

#7621: fixed monomer wizard navigation #7705

#7621: fixed monomer wizard navigation

#7621: fixed monomer wizard navigation #7705

name: Run Playwright Tests (Popup)
on:
push:
branches:
- master
- 'release/**'
pull_request:
branches:
- master
- 'release/**'
workflow_dispatch:
inputs:
update_snapshots:
description: 'Regenerate and commit linux PNG snapshots'
type: boolean
default: false
permissions:
contents: write
env:
# Warnings breaks build on CI
# See: https://github.com/orgs/community/discussions/25228#discussioncomment-3246960
CI: false
MODE: standalone
KETCHER_URL: http://127.0.0.1:4002
DOCKER: true
IGNORE_UNSTABLE_TESTS: true
CI_ENVIRONMENT: true
USE_SEPARATE_INDIGO_WASM: true
jobs:
build_ketcher:
runs-on: ubuntu-latest
container: node:24.14.1-bullseye-slim
steps:
- name: Install dependencies
run: apt-get update -y && apt-get install -y git
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Git safe
run: git config --global --add safe.directory '*'
- name: Install NPM dependencies
run: npm ci
- name: Build all packages
run: npm run build:packages && npm run build:example:standalone
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ketcher-dist-micro
path: example/dist
popup-part:
timeout-minutes: 120
runs-on: self-hosted-a
needs: build_ketcher
container: mcr.microsoft.com/playwright:v1.59.1-jammy
strategy:
fail-fast: false
matrix:
shardIndex: [1]
shardTotal: [1]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install dependencies
run: npm ci
- name: Create folder for dist
run: mkdir -p example/dist
- name: Download compiled ketcher
uses: actions/download-artifact@v4
with:
name: ketcher-dist-micro
path: example/dist/
- name: Create env file
run: |
cat > ketcher-autotests/.env << EOF
DOCKER=true
KETCHER_URL=$KETCHER_URL
MODE=$MODE
IGNORE_UNSTABLE_TESTS=$IGNORE_UNSTABLE_TESTS
CI_ENVIRONMENT=$CI_ENVIRONMENT
USE_SEPARATE_INDIGO_WASM=$USE_SEPARATE_INDIGO_WASM
EOF
- name: Run tests
run: |
cd example/ && nohup npm run serve:standalone > /dev/null 2>&1 &
cd ketcher-autotests/
npm i
npx playwright install chromium
UPDATE_FLAG=""
if [ "${{ github.event.inputs.update_snapshots }}" = "true" ]; then
UPDATE_FLAG="--update-snapshots"
fi
npx playwright test --project=chromium-popup --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} $UPDATE_FLAG
- name: Commit updated snapshots
if: always()
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git config --global --add safe.directory '*'
find ketcher-autotests/tests/specs -name '*linux.png' -print0 | xargs -0 git add
if git diff --cached --quiet; then
echo "No snapshot changes to commit"
else
git commit -m "chore: update linux playwright snapshots [skip ci]"
git push origin HEAD:${{ github.ref_name }}
fi
- uses: actions/upload-artifact@v4
# run even if previous steps fails
if: always()
with:
name: pw-report-popup-${{ matrix.shardIndex }}
path: ketcher-autotests/playwright-report/
retention-days: 5
merge_reports:
if: ${{ !cancelled() }}
needs: [popup-part]
runs-on: ubuntu-latest
container: node:24.14.1-bullseye-slim
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install dependencies
run: npm ci
- name: Download Playwright blob reports
uses: actions/download-artifact@v4
with:
path: ketcher-autotests/playwright-report/
pattern: pw-report-*
merge-multiple: true
- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./ketcher-autotests/playwright-report/blob
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: html-report
path: playwright-report/
retention-days: 5