-
Notifications
You must be signed in to change notification settings - Fork 122
HAR-10176 - SuperDoc automated testing demo gallery apps #823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
harbournick
merged 5 commits into
develop
from
feature/har-10176-2-superdoc-automated-testing-demo-gallery-apps
Aug 30, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3bc0dc3
feat: added initial tests for the example apps
chittolinag 74a1b57
feat: added workflow to run example tests
chittolinag 8b265a6
fix: added missing changes
chittolinag 2b087f8
chore: enable pull_request
chittolinag 17a037e
chore: small changes on test setup
chittolinag File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| name: Run tests for example apps | ||
|
|
||
| on: | ||
| workflow_call: | ||
| # TODO: Enable this when we test this workflow manually | ||
| # pull_request: | ||
| # branches: | ||
| # - develop | ||
|
|
||
| jobs: | ||
| run-tests-example-apps: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: npm | ||
|
|
||
| - name: Install dependencies | ||
| run: cd examples/tests && npm ci | ||
|
|
||
| - name: Install Playwright browsers | ||
| run: cd examples/tests && npx playwright install --with-deps | ||
|
|
||
| - name: Run tests | ||
| run: cd examples/tests && npm test | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,6 @@ | |
| }, | ||
| "devDependencies": { | ||
| "@vitejs/plugin-react": "^4.0.4", | ||
| "vite": "^7.0.5" | ||
| "vite": "^6.2.0" | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| playwright-report |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "name": "demo-gallery-tests", | ||
| "version": "1.0.0", | ||
| "description": "Automated tests suites for all examples on the demo gallery", | ||
| "main": "index.js", | ||
| "scripts": { | ||
| "test": "npx playwright test" | ||
| }, | ||
| "author": "", | ||
| "license": "ISC", | ||
| "devDependencies": { | ||
| "@playwright/test": "^1.55.0", | ||
| "playwright": "^1.55.0" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| import { defineConfig, devices } from '@playwright/test'; | ||
| import testConfig from './test-config.js'; | ||
|
|
||
| const foldersToTest = testConfig.include; | ||
|
|
||
| export default defineConfig({ | ||
| testMatch: '**/*.spec.js', | ||
|
|
||
| // Run all tests in parallel. | ||
| fullyParallel: true, | ||
|
|
||
| // Fail the build on CI if you accidentally left test.only in the source code. | ||
| forbidOnly: !!process.env.CI, | ||
|
|
||
| // Retry on CI only. | ||
| retries: process.env.CI ? 2 : 0, | ||
|
|
||
| // Opt out of parallel tests on CI. | ||
| workers: process.env.CI ? 1 : undefined, | ||
|
|
||
| // Reporter to use | ||
| reporter: 'html', | ||
|
|
||
| use: { | ||
| // Base URL to use in actions like `await page.goto('/')`. | ||
| baseURL: 'http://localhost:5173', | ||
|
|
||
| // Collect trace when retrying the failed test. | ||
| trace: 'on-first-retry', | ||
| }, | ||
| // Configure projects for major browsers. | ||
| projects: [ | ||
| { | ||
| name: 'chromium', | ||
| use: { ...devices['Desktop Chrome'] }, | ||
| }, | ||
| ], | ||
|
|
||
| // Open every example in a separate server | ||
| webServer: testConfig.include.map(({name, command}, i) => { | ||
| return { | ||
| command: `${command} -- --port ${5173 + i}`, | ||
| url: `http://localhost:${5173 + i}`, | ||
| reuseExistingServer: !process.env.CI, | ||
| timeout: 120 * 1000, // 2 minutes timeout for server startup | ||
| } | ||
| }) | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| export default { | ||
| include: [ | ||
| { | ||
| name: "cdn-example", | ||
| command: 'cd ../cdn-example && npm run start', | ||
| }, | ||
| { | ||
| name: "external-plugin-dynamic-content", | ||
| command: 'cd ../external-plugin-dynamic-content && npm install && npm run dev', | ||
| }, | ||
| { | ||
| name: "next-js-ssr", | ||
| command: 'cd ../next-js-ssr && npm install && npm run dev', | ||
| }, | ||
| { | ||
| name: "programmatic-text-selection", | ||
| command: 'cd ../programmatic-text-selection && npm install && npm run dev', | ||
| }, | ||
| { | ||
| name: "react-example", | ||
| command: 'cd ../react-example && npm install && npm run dev', | ||
| }, | ||
| { | ||
| name: "typescript-example", | ||
| command: 'cd ../typescript-example && npm install && npm run dev', | ||
| }, | ||
| { | ||
| name: "vanilla-example", | ||
| command: 'cd ../vanilla-example && npm install && npm run dev', | ||
| }, | ||
| { | ||
| name: "vue-custom-mark", | ||
| command: 'cd ../vue-custom-mark && npm install && npm run dev', | ||
| }, | ||
| { | ||
| name: "vue-docx-from-html", | ||
| command: 'cd ../vue-docx-from-html && npm install && npm run dev', | ||
| }, | ||
| { | ||
| name: "vue-example", | ||
| command: 'cd ../vue-example && npm install && npm run dev', | ||
| }, | ||
| { | ||
| name: "vue-fields-example", | ||
| command: 'cd ../vue-fields-example && npm install && npm run dev', | ||
| }, | ||
| { | ||
| name: "vue-linked-editor-sections", | ||
| command: 'cd ../vue-linked-editor-sections && npm install && npm run dev', | ||
| }, | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
| import testConfig from './test-config.js'; | ||
| const PORT = 5173; | ||
| const foldersToTest = testConfig.include; | ||
|
|
||
| foldersToTest.forEach(({name}, i) => { | ||
| test.describe(name, () => { | ||
| test('should open the main page', async ({ page }) => { | ||
| // Should open the main page | ||
| await page.goto(`http://localhost:${PORT + i}`); | ||
|
|
||
| await page.waitForSelector('div.super-editor', { | ||
| timeout: 5_000, | ||
| }); | ||
|
|
||
| // Compare the screenshot with the reference screenshot | ||
| await expect(page).toHaveScreenshot({ | ||
| fullPage: true, | ||
| }); | ||
| }); | ||
| }); | ||
| }); |
Binary file added
BIN
+22.7 KB
...s.spec.js-snapshots/cdn-example-should-open-the-main-page-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+234 KB
...external-plugin-dynamic-content-should-open-the-main-page-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+30.1 KB
...s.spec.js-snapshots/next-js-ssr-should-open-the-main-page-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.6 KB
...ots/programmatic-text-selection-should-open-the-main-page-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+20.5 KB
...spec.js-snapshots/react-example-should-open-the-main-page-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24 KB
...js-snapshots/typescript-example-should-open-the-main-page-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24 KB
...ec.js-snapshots/vanilla-example-should-open-the-main-page-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+38.7 KB
...ec.js-snapshots/vue-custom-mark-should-open-the-main-page-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.4 KB
...js-snapshots/vue-docx-from-html-should-open-the-main-page-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.1 KB
...s.spec.js-snapshots/vue-example-should-open-the-main-page-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+50.4 KB
...js-snapshots/vue-fields-example-should-open-the-main-page-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+62.7 KB
...hots/vue-linked-editor-sections-should-open-the-main-page-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.