From 3175787336738adc553e9b3cd568b5af42cc8f0e Mon Sep 17 00:00:00 2001 From: Baivab Sarkar Date: Tue, 11 Aug 2026 19:02:45 +0530 Subject: [PATCH 1/3] test(e2e): publish shared Playwright suite and CI --- .github/workflows/playwright.yml | 90 ++ .gitignore | 6 - .nvmrc | 1 + CHANGELOG.md | 8 + desktop-app/resources/index.html | 76 +- desktop-app/resources/js/script.js | 473 ++++++++--- index.html | 10 +- package-lock.json | 343 ++++++++ package.json | 35 + playwright.config.js | 53 ++ script.js | 18 +- tests/README.md | 67 ++ tests/e2e/document-sidebar.spec.js | 300 +++++++ tests/e2e/editor.spec.js | 121 +++ tests/e2e/export.spec.js | 59 ++ tests/e2e/github-import.spec.js | 913 +++++++++++++++++++++ tests/e2e/responsive-storage.spec.js | 431 ++++++++++ tests/e2e/review-mode.spec.js | 283 +++++++ tests/e2e/rich-content.spec.js | 181 ++++ tests/e2e/share-live.spec.js | 147 ++++ tests/e2e/smoke.spec.js | 32 + tests/e2e/status-toolbar-followup.spec.js | 173 ++++ tests/e2e/tab-split-sidebar-update.spec.js | 470 +++++++++++ tests/e2e/ui-toolbar-redesign.spec.js | 324 ++++++++ tests/e2e/workspace-redesign.spec.js | 61 ++ tests/fixtures/abc.md | 10 + tests/fixtures/basic.md | 9 + tests/fixtures/d2.md | 7 + tests/fixtures/export.md | 8 + tests/fixtures/gfm.md | 21 + tests/fixtures/graphviz.md | 8 + tests/fixtures/imported-file.md | 3 + tests/fixtures/long-document.md | 45 + tests/fixtures/markmap.md | 8 + tests/fixtures/mermaid.md | 7 + tests/fixtures/plantuml.md | 8 + tests/fixtures/share.md | 6 + tests/fixtures/stl.md | 13 + tests/fixtures/vega-lite.md | 16 + tests/fixtures/wavedrom.md | 8 + tests/helpers/app.js | 640 +++++++++++++++ tests/helpers/static-build-check.mjs | 137 ++++ tests/helpers/static-server.mjs | 79 ++ wiki/Contributing.md | 13 +- 44 files changed, 5566 insertions(+), 155 deletions(-) create mode 100644 .github/workflows/playwright.yml create mode 100644 .nvmrc create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 playwright.config.js create mode 100644 tests/README.md create mode 100644 tests/e2e/document-sidebar.spec.js create mode 100644 tests/e2e/editor.spec.js create mode 100644 tests/e2e/export.spec.js create mode 100644 tests/e2e/github-import.spec.js create mode 100644 tests/e2e/responsive-storage.spec.js create mode 100644 tests/e2e/review-mode.spec.js create mode 100644 tests/e2e/rich-content.spec.js create mode 100644 tests/e2e/share-live.spec.js create mode 100644 tests/e2e/smoke.spec.js create mode 100644 tests/e2e/status-toolbar-followup.spec.js create mode 100644 tests/e2e/tab-split-sidebar-update.spec.js create mode 100644 tests/e2e/ui-toolbar-redesign.spec.js create mode 100644 tests/e2e/workspace-redesign.spec.js create mode 100644 tests/fixtures/abc.md create mode 100644 tests/fixtures/basic.md create mode 100644 tests/fixtures/d2.md create mode 100644 tests/fixtures/export.md create mode 100644 tests/fixtures/gfm.md create mode 100644 tests/fixtures/graphviz.md create mode 100644 tests/fixtures/imported-file.md create mode 100644 tests/fixtures/long-document.md create mode 100644 tests/fixtures/markmap.md create mode 100644 tests/fixtures/mermaid.md create mode 100644 tests/fixtures/plantuml.md create mode 100644 tests/fixtures/share.md create mode 100644 tests/fixtures/stl.md create mode 100644 tests/fixtures/vega-lite.md create mode 100644 tests/fixtures/wavedrom.md create mode 100644 tests/helpers/app.js create mode 100644 tests/helpers/static-build-check.mjs create mode 100644 tests/helpers/static-server.mjs diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml new file mode 100644 index 00000000..921c491c --- /dev/null +++ b/.github/workflows/playwright.yml @@ -0,0 +1,90 @@ +name: Playwright Tests + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: playwright-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + e2e: + name: Chromium end-to-end + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - name: Check out repository + uses: actions/checkout@v6 + + - name: Set up Node.js + uses: actions/setup-node@v6 + with: + node-version-file: .nvmrc + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Install Chromium + run: npx playwright install --with-deps chromium + + - name: Run static and end-to-end checks + run: npm run test:ci + + - name: Upload Playwright diagnostics + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v5 + with: + name: playwright-report-chromium + path: | + playwright-report/ + test-results/ + if-no-files-found: ignore + retention-days: 14 + + cross-browser-smoke: + name: ${{ matrix.browser }} smoke + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + browser: [chromium, firefox, webkit] + + steps: + - name: Check out repository + uses: actions/checkout@v6 + + - name: Set up Node.js + uses: actions/setup-node@v6 + with: + node-version-file: .nvmrc + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Install ${{ matrix.browser }} + run: npx playwright install --with-deps ${{ matrix.browser }} + + - name: Run smoke tests + run: npx playwright test tests/e2e/smoke.spec.js --project=${{ matrix.browser }} + + - name: Upload Playwright diagnostics + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v5 + with: + name: playwright-report-${{ matrix.browser }}-smoke + path: | + playwright-report/ + test-results/ + if-no-files-found: ignore + retention-days: 14 diff --git a/.gitignore b/.gitignore index ec8061cc..85fe151d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,12 +10,6 @@ test-results/ .pytest_cache/ __pycache__/ -# Local-only generated test harness -/package.json -/package-lock.json -/playwright.config.* -/tests/ - # Local AI/tooling state .agents/ diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..2bd5a0a9 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c1625b0..bf7884cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ All notable code changes to **Markdown Viewer** are documented here. Non-code commits (documentation, planning, README-only updates) are excluded. +## Unreleased + +- **Testing & CI:** Published the root Playwright harness with locked dependencies, cross-platform test server, static validation, contributor documentation, Chromium end-to-end coverage, cross-browser smoke coverage, and failure artifacts in GitHub Actions. +- **Security & Compatibility:** Updated DOMPurify and js-yaml to patched releases, switched deterministic browser assets to valid integrity-checked CDN endpoints, kept the desktop offline bundle synchronized, and restored WebKit support for local HTTP development. +- **Reliability:** Added an explicit application-ready lifecycle signal and made Markdown clipboard feedback wait for the actual copy result. + +--- + ## v3.10.0 - **Description:** Introduced scalable local document storage, complete workspace backup and recovery, and a rebuilt GitHub importer with secure private-repository access. diff --git a/desktop-app/resources/index.html b/desktop-app/resources/index.html index 354bdbd5..ef73df36 100644 --- a/desktop-app/resources/index.html +++ b/desktop-app/resources/index.html @@ -3,7 +3,7 @@ - + @@ -19,7 +19,7 @@ - + @@ -27,10 +27,10 @@ - + - +
@@ -95,7 +95,7 @@

Markdown Viewer - Online Markd