Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ lerna-debug.log*
coverage/
.nyc_output

# Playwright
test-results/
playwright-report/

# Misc
.env
.env.local
Expand Down
15 changes: 15 additions & 0 deletions e2e/add-signature.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
// SPDX-License-Identifier: AGPL-3.0-or-later

import { test, expect } from "@playwright/test";

test("add a signature element", async({page}) => {
await page.goto("/");
await page.getByRole("button", {name: "Load sample PDF"}).click();
await expect(page.locator("canvas").first()).toBeVisible();
await page.getByRole("button", {name: "Add Signature"}).click();
await expect(page.getByRole("button", {name: "Click to place"})).toBeVisible();
await page.locator(".overlay").first().click({position: {x:100,y:100}});
await expect(page.locator(".signature-box").first()).toBeVisible();

})
9 changes: 9 additions & 0 deletions e2e/demo.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
// SPDX-License-Identifier: AGPL-3.0-or-later

import { test, expect } from "@playwright/test";

test("demo loads", async({ page }) => {
await page.goto("/");
await expect(page.getByRole("button", {name: "Load sample PDF"})).toBeVisible();
})
10 changes: 10 additions & 0 deletions e2e/load-pdf.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
// SPDX-License-Identifier: AGPL-3.0-or-later

import { test, expect } from "@playwright/test";

test("load pdf", async({page}) => {
await page.goto("/");
await page.getByRole("button", {name: "Load sample PDF"}).click();
await expect(page.locator("canvas").first()).toBeVisible();
})
69 changes: 62 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
"prepack": "npm run build && npm run validate:dist",
"test": "vitest run",
"test:watch": "vitest",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui",
"lint": "eslint . --ext .vue,.ts,.js --max-warnings=0",
"lint:fix": "eslint . --ext .vue,.ts,.js --fix"
},
Expand All @@ -56,22 +58,23 @@
"devDependencies": {
"@eslint/js": "^10.0.1",
"@nextcloud/browserslist-config": "^3.1.2",
"@playwright/test": "^1.63.0",
"@types/node": "^26.4.1",
"@typescript-eslint/eslint-plugin": "^8.58.0",
"@typescript-eslint/parser": "^8.58.0",
"@vitejs/plugin-vue": "^6.0.4",
"@vitest/eslint-plugin": "^1.6.14",
"@vue/language-core": "^3.3.11",
"@vue/test-utils": "^2.4.6",
"eslint-plugin-vue": "^10.8.0",
"eslint": "^10.1.0",
"eslint-plugin-vue": "^10.8.0",
"globals": "^17.4.0",
"happy-dom": "^20.7.0",
"postcss": "^8.5.6",
"rollup-plugin-visualizer": "^7.0.0",
"typescript": "^6.0.2",
"vite-plugin-dts": "^5.0.3",
"vite": "^8.0.2",
"vite-plugin-dts": "^5.0.3",
"vitest": "^5.0.0",
"vue-eslint-parser": "^10.4.0",
"vue-tsc": "^3.2.4"
Expand Down
24 changes: 24 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
// SPDX-License-Identifier: AGPL-3.0-or-later

import { defineConfig, devices } from "@playwright/test";

export default defineConfig({
testDir: "e2e",
use: {
baseURL: "http://localhost:5173/",
trace: "on-first-retry"
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
webServer: {
command: "npm run dev",
url: "http://localhost:5173/",
reuseExistingServer: !process.env.CI
}

});
Loading