The Open Source DocuSign Alternative.
TypeScript digital-signaturedocument-signingdocusign-alternativee-signatureesignesignaturenext-authnextjsopen-sourcepades-standardpdfpdf-signpdf-signaturepostgresqlprismaself-hostedsigningtypescript
feat: add playwright
pit00546c12902a
diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.ymlnew file mode 100644index 000000000..ecd1d1d1a--- /dev/null+++ b/.github/workflows/e2e-tests.yml@@ -0,0 +1,51 @@+name: Playwright Tests+on:+ push:+ branches: [feat/refresh, feat/add-e2e-testing-playwright]+ pull_request:+ branches: [feat/refresh, feat/add-e2e-testing-playwright]+jobs:+ e2e_tests:+ timeout-minutes: 60+ runs-on: ubuntu-latest+ services:+ postgres:+ image: postgres+ env:+ POSTGRES_USER: postgres+ POSTGRES_PASSWORD: postgres+ options: >-+ --health-cmd pg_isready+ --health-interval 10s+ --health-timeout 5s+ --health-retries 5+ ports:+ - 5432:5432+ env:+ NEXT_PRIVATE_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/documenso+ NEXT_PRIVATE_DIRECT_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/documenso+ steps:+ - uses: actions/checkout@v3+ - uses: actions/setup-node@v3+ with:+ node-version: 18+ - name: Generate package-lock.json+ run: npm cache clean --force && npm install+ - name: Install dependencies+ run: npm ci+ - name: Install Playwright Browsers+ run: npx playwright install --with-deps+ - name: Install Prisma Client+ run: npm install @prisma/client+ - name: Generate Prisma Client+ run: npm run prisma:generate -w @documenso/prisma+ - name: Create the database+ run: npm run prisma:migrate-dev -w @documenso/prisma+ - name: Run Playwright tests+ run: npm run ci+ - uses: actions/upload-artifact@v3+ if: always()+ with:+ name: playwright-report+ path: playwright-report/+ retention-days: 30diff --git a/package-lock.json b/package-lock.jsonindex 32fffca09..eea6e5463 100644--- a/package-lock.json+++ b/package-lock.json@@ -2462,6 +2462,19 @@"node": ">=6"}},+ "node_modules/@hapi/hoek": {+ "version": "9.3.0",+ "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz",+ "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ=="+ },+ "node_modules/@hapi/topo": {+ "version": "5.1.0",+ "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz",+ "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==",+ "dependencies": {+ "@hapi/hoek": "^9.0.0"+ }+ },"node_modules/@hookform/resolvers": {"version": "3.3.0","resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-3.3.0.tgz",@@ -3916,6 +3929,21 @@"url": "https://opencollective.com/unts"}},+ "node_modules/@playwright/test": {+ "version": "1.38.1",+ "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.38.1.tgz",+ "integrity": "sha512-NqRp8XMwj3AK+zKLbZShl0r/9wKgzqI/527bkptKXomtuo+dOjU9NdMASQ8DNC9z9zLOMbG53T4eihYr3XR+BQ==",+ "dev": true,+ "dependencies": {+ "playwright": "1.38.1"+ },+ "bin": {+ "playwright": "cli.js"+ },+ "engines": {+ "node": ">=16"+ }+ },"node_modules/@prisma/client": {"version": "5.3.1","resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.3.1.tgz",@@ -5565,6 +5593,24 @@"url": "https://ko-fi.com/killymxi"}},+ "node_modules/@sideway/address": {+ "version": "4.1.4",+ "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz",+ "integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==",+ "dependencies": {+ "@hapi/hoek": "^9.0.0"+ }+ },+ "node_modules/@sideway/formula": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz",+ "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg=="+ },+ "node_modules/@sideway/pinpoint": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz",+ "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ=="+ },"node_modules/@sindresorhus/slugify": {"version": "2.2.1","resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-2.2.1.tgz",@@ -7758,6 +7804,14 @@"url": "https://github.com/sponsors/wooorm"}},+ "node_modules/check-more-types": {+ "version": "2.24.0",+ "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz",+ "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==",+ "engines": {+ "node": ">= 0.8.0"+ }+ },"node_modules/chokidar": {"version": "3.5.3","resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",@@ -9272,6 +9326,11 @@"node": ">=12"}},+ "node_modules/duplexer": {+ "version": "0.1.2",+ "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz",+ "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg=="+ },"node_modules/duplexer2": {"version": "0.1.4","resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz",@@ -10476,6 +10535,20 @@"node": ">=0.10.0"}},+ "node_modules/event-stream": {+ "version": "3.3.4",+ "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz",+ "integrity": "sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g==",+ "dependencies": {+ "duplexer": "~0.1.1",+ "from": "~0",+ "map-stream": "~0.1.0",+ "pause-stream": "0.0.11",+ "split": "0.3",+ "stream-combiner": "~0.0.4",+ "through": "~2.3.1"+ }+ },"node_modules/eventemitter3": {"version": "4.0.7","resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",@@ -10885,6 +10958,11 @@}}},+ "node_modules/from": {+ "version": "0.1.7",+ "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz",+ "integrity": "sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g=="+ },"node_modules/fs-constants": {"version": "1.0.0","resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",@@ -12347,6 +12425,18 @@"resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz","integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA=="},+ "node_modules/joi": {+ "version": "17.10.2",+ "resolved": "https://registry.npmjs.org/joi/-/joi-17.10.2.tgz",+ "integrity": "sha512-hcVhjBxRNW/is3nNLdGLIjkgXetkeGc2wyhydhz8KumG23Aerk4HPjU5zaPAMRqXQFc0xNqXTC7+zQjxr0GlKA==",+ "dependencies": {+ "@hapi/hoek": "^9.0.0",+ "@hapi/topo": "^5.0.0",+ "@sideway/address": "^4.1.3",+ "@sideway/formula": "^3.0.1",+ "@sideway/pinpoint": "^2.0.0"+ }+ },"node_modules/jose": {"version": "4.14.4","resolved": "https://registry.npmjs.org/jose/-/jose-4.14.4.tgz",@@ -12581,6 +12671,14 @@"language-subtag-registry": "~0.3.2"}},+ "node_modules/lazy-ass": {+ "version": "1.6.0",+ "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz",+ "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==",+ "engines": {+ "node": "> 0.8"+ }+ },"node_modules/leac": {"version": "0.6.0","resolved": "https://registry.npmjs.org/leac/-/leac-0.6.0.tgz",@@ -13128,6 +13226,11 @@"url": "https://github.com/sponsors/sindresorhus"}},+ "node_modules/map-stream": {+ "version": "0.1.0",+ "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz",+ "integrity": "sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g=="+ },"node_modules/markdown-extensions": {"version": "1.1.1","resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-1.1.1.tgz",@@ -15181,6 +15284,14 @@"node": ">=8"}},+ "node_modules/pause-stream": {+ "version": "0.0.11",+ "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz",+ "integrity": "sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==",+ "dependencies": {+ "through": "~2.3"+ }+ },"node_modules/pdf-lib": {"version": "1.17.1","resolved": "https://registry.npmjs.org/pdf-lib/-/pdf-lib-1.17.1.tgz",@@ -15279,6 +15390,36 @@"node": ">= 6"}},+ "node_modules/playwright": {+ "version": "1.38.1",+ "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.38.1.tgz",+ "integrity": "sha512-oRMSJmZrOu1FP5iu3UrCx8JEFRIMxLDM0c/3o4bpzU5Tz97BypefWf7TuTNPWeCe279TPal5RtPPZ+9lW/Qkow==",+ "dev": true,+ "dependencies": {+ "playwright-core": "1.38.1"+ },+ "bin": {+ "playwright": "cli.js"+ },+ "engines": {+ "node": ">=16"+ },+ "optionalDependencies": {+ "fsevents": "2.3.2"+ }+ },+ "node_modules/playwright-core": {+ "version": "1.38.1",+ "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.38.1.tgz",+ "integrity": "sha512-tQqNFUKa3OfMf4b2jQ7aGLB8o9bS3bOY0yMEtldtC2+spf8QXG9zvXLTXUeRsoNuxEYMgLYR+NXfAa1rjKRcrg==",+ "dev": true,+ "bin": {+ "playwright-core": "cli.js"+ },+ "engines": {+ "node": ">=16"+ }+ },"node_modules/postcss": {"version": "8.4.27","resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.27.tgz",@@ -15829,6 +15970,20 @@"resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz","integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q=="},+ "node_modules/ps-tree": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz",+ "integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==",+ "dependencies": {+ "event-stream": "=3.3.4"+ },+ "bin": {+ "ps-tree": "bin/ps-tree.js"+ },+ "engines": {+ "node": ">= 0.10"+ }+ },"node_modules/pump": {"version": "3.0.0","resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",@@ -17518,6 +17673,14 @@"resolved": "https://registry.npmjs.org/rusha/-/rusha-0.8.14.tgz","integrity": "sha512-cLgakCUf6PedEu15t8kbsjnwIFFR2D4RfL+W3iWFJ4iac7z4B0ZI8fxy4R3J956kAI68HclCFGL8MPoUVC3qVA=="},+ "node_modules/rxjs": {+ "version": "7.8.1",+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",+ "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",+ "dependencies": {+ "tslib": "^2.1.0"+ }+ },"node_modules/sade": {"version": "1.8.1","resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz",@@ -17893,6 +18056,17 @@"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz","integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w=="},+ "node_modules/split": {+ "version": "0.3.3",+ "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz",+ "integrity": "sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA==",+ "dependencies": {+ "through": "2"+ },+ "engines": {+ "node": "*"+ }+ },"node_modules/split2": {"version": "3.2.2","resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz",@@ -17924,6 +18098,121 @@"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz","integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="},+ "node_modules/start-server-and-test": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-2.0.1.tgz",+ "integrity": "sha512-8PFo4DLLLCDMuS51/BEEtE1m9CAXw1LNVtZSS1PzkYQh6Qf9JUwM4huYeSoUumaaoAyuwYBwCa9OsrcpMqcOdQ==",+ "dependencies": {+ "arg": "^5.0.2",+ "bluebird": "3.7.2",+ "check-more-types": "2.24.0",+ "debug": "4.3.4",+ "execa": "5.1.1",+ "lazy-ass": "1.6.0",+ "ps-tree": "1.2.0",+ "wait-on": "7.0.1"+ },+ "bin": {+ "server-test": "src/bin/start.js",+ "start-server-and-test": "src/bin/start.js",+ "start-test": "src/bin/start.js"+ },+ "engines": {+ "node": ">=16"+ }+ },+ "node_modules/start-server-and-test/node_modules/arg": {+ "version": "5.0.2",+ "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz",+ "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg=="+ },+ "node_modules/start-server-and-test/node_modules/bluebird": {+ "version": "3.7.2",+ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",+ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg=="+ },+ "node_modules/start-server-and-test/node_modules/execa": {+ "version": "5.1.1",+ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",+ "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",+ "dependencies": {+ "cross-spawn": "^7.0.3",+ "get-stream": "^6.0.0",+ "human-signals": "^2.1.0",+ "is-stream": "^2.0.0",+ "merge-stream": "^2.0.0",+ "npm-run-path": "^4.0.1",+ "onetime": "^5.1.2",+ "signal-exit": "^3.0.3",+ "strip-final-newline": "^2.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sindresorhus/execa?sponsor=1"+ }+ },+ "node_modules/start-server-and-test/node_modules/human-signals": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",+ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",+ "engines": {+ "node": ">=10.17.0"+ }+ },+ "node_modules/start-server-and-test/node_modules/is-stream": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",+ "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/start-server-and-test/node_modules/mimic-fn": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/start-server-and-test/node_modules/npm-run-path": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",+ "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",+ "dependencies": {+ "path-key": "^3.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/start-server-and-test/node_modules/onetime": {+ "version": "5.1.2",+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",+ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",+ "dependencies": {+ "mimic-fn": "^2.1.0"+ },+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/start-server-and-test/node_modules/strip-final-newline": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",+ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",+ "engines": {+ "node": ">=6"+ }+ },"node_modules/statuses": {"version": "1.5.0","resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",@@ -17932,6 +18221,14 @@"node": ">= 0.6"}},+ "node_modules/stream-combiner": {+ "version": "0.0.4",+ "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz",+ "integrity": "sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw==",+ "dependencies": {+ "duplexer": "~0.1.1"+ }+ },"node_modules/stream-shift": {"version": "1.0.1","resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz",@@ -18477,8 +18774,7 @@"node_modules/through": {"version": "2.3.8","resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",- "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==",- "dev": true+ "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="},"node_modules/through2": {"version": "4.0.2",@@ -19739,6 +20035,24 @@"d3-timer": "^3.0.1"}},+ "node_modules/wait-on": {+ "version": "7.0.1",+ "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-7.0.1.tgz",+ "integrity": "sha512-9AnJE9qTjRQOlTZIldAaf/da2eW0eSRSgcqq85mXQja/DW3MriHxkpODDSUEg+Gri/rKEcXUZHe+cevvYItaog==",+ "dependencies": {+ "axios": "^0.27.2",+ "joi": "^17.7.0",+ "lodash": "^4.17.21",+ "minimist": "^1.2.7",+ "rxjs": "^7.8.0"+ },+ "bin": {+ "wait-on": "bin/wait-on"+ },+ "engines": {+ "node": ">=12.0.0"+ }+ },"node_modules/watchpack": {"version": "2.4.0","resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",@@ -19776,6 +20090,10 @@"node": ">= 8"}},+ "node_modules/web-tests": {+ "resolved": "packages/web-tests",+ "link": true+ },"node_modules/webidl-conversions": {"version": "3.0.1","resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",@@ -20228,6 +20546,23 @@"react": "18.2.0","typescript": "^5.1.6"}+ },+ "packages/web-tests": {+ "version": "1.0.0",+ "license": "ISC",+ "dependencies": {+ "start-server-and-test": "^2.0.1"+ },+ "devDependencies": {+ "@playwright/test": "^1.38.1",+ "@types/node": "^20.8.2"+ }+ },+ "packages/web-tests/node_modules/@types/node": {+ "version": "20.8.2",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.2.tgz",+ "integrity": "sha512-Vvycsc9FQdwhxE3y3DzeIxuEJbWGDsnrxvMADzTDF/lcdR9/K+AQIeAghTQsHtotg/q0j3WEOYS/jQgSdWue3w==",+ "dev": true}}}diff --git a/package.json b/package.jsonindex d2c09052c..367ee1df3 100644--- a/package.json+++ b/package.json@@ -14,9 +14,7 @@"dx": "npm i && npm run dx:up && npm run prisma:migrate-dev","dx:up": "docker compose -f docker/compose-services.yml up -d","dx:down": "docker compose -f docker/compose-services.yml down",- "prisma:migrate-dev": "npm run with:env -- npm run prisma:migrate-dev -w @documenso/prisma",- "prisma:migrate-deploy": "npm run with:env -- npm run prisma:migrate-deploy -w @documenso/prisma",- "with:env": "dotenv -e .env -e .env.local --"+ "ci": "turbo run build test:e2e lint"},"engines": {"npm": ">=8.6.0",diff --git a/packages/web-tests/.gitignore b/packages/web-tests/.gitignorenew file mode 100644index 000000000..75e854d8d--- /dev/null+++ b/packages/web-tests/.gitignore@@ -0,0 +1,4 @@+node_modules/+/test-results/+/playwright-report/+/playwright/.cache/diff --git a/packages/web-tests/e2e/test-auth-flow.spec.ts b/packages/web-tests/e2e/test-auth-flow.spec.tsnew file mode 100644index 000000000..544bdf48f--- /dev/null+++ b/packages/web-tests/e2e/test-auth-flow.spec.ts@@ -0,0 +1,55 @@+import { type Page, expect, test } from '@playwright/test';++import { deleteUserAndItsData } from '@documenso/lib/server-only/user/delete-user-and-data';++test.use({ storageState: { cookies: [], origins: [] } });++/*+ Using them sequentially so the 2nd test+ uses the details from the 1st (registration) test+*/+test.describe.configure({ mode: 'serial' });++const username = 'Test user';+const email = '[email protected]';+const password = '12345678910';++test('user can sign up with email and password', async ({ page }: { page: Page }) => {+ await page.goto('/signup');+ await page.getByLabel('Name').fill(username);+ await page.getByLabel('Email').fill(email);+ await page.getByLabel('Password', { exact: true }).fill(password);++ const canvas = page.locator('canvas');+ const box = await canvas.boundingBox();++ if (box) {+ await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2);+ await page.mouse.down();+ await page.mouse.move(box.x + box.width / 4, box.y + box.height / 4);+ await page.mouse.up();+ }++ await page.getByRole('button', { name: 'Sign Up' }).click();+ await page.waitForURL('/documents');++ await expect(page).toHaveURL('/documents');+});++test('user can login with user and password', async ({ page }: { page: Page }) => {+ await page.goto('/signin');+ await page.getByLabel('Email').fill(email);+ await page.getByLabel('Password', { exact: true }).fill(password);+ await page.getByRole('button', { name: 'Sign In' }).click();++ await page.waitForURL('/documents');+ await expect(page).toHaveURL('/documents');+});++test.afterAll('Teardown', async () => {+ try {+ await deleteUserAndItsData(username);+ } catch (e) {+ throw new Error(`Error deleting user: ${e}`);+ }+});diff --git a/packages/web-tests/package.json b/packages/web-tests/package.jsonnew file mode 100644index 000000000..fdf2f3268--- /dev/null+++ b/packages/web-tests/package.json@@ -0,0 +1,21 @@+{+ "name": "web-tests",+ "version": "1.0.0",+ "description": "",+ "main": "index.js",+ "scripts": {+ "test:dev": "playwright test",+ "test:e2e": "start-server-and-test \"(cd ../../apps/web && npm run start)\" http://localhost:3000 \"playwright test\""+ },+ "keywords": [],+ "author": "",+ "license": "ISC",+ "devDependencies": {+ "@playwright/test": "^1.18.1",+ "@types/node": "^20.8.2",+ "@documenso/web": "*"+ },+ "dependencies": {+ "start-server-and-test": "^2.0.1"+ }+}diff --git a/packages/web-tests/playwright.config.ts b/packages/web-tests/playwright.config.tsnew file mode 100644index 000000000..463b6f97d--- /dev/null+++ b/packages/web-tests/playwright.config.ts@@ -0,0 +1,77 @@+import { defineConfig, devices } from '@playwright/test';++/**+ * Read environment variables from file.+ * https://github.com/motdotla/dotenv+ */+// require('dotenv').config();++/**+ * See https://playwright.dev/docs/test-configuration.+ */+export default defineConfig({+ testDir: './e2e',+ /* Run tests in files 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. See https://playwright.dev/docs/test-reporters */+ reporter: 'html',+ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */+ use: {+ /* Base URL to use in actions like `await page.goto('/')`. */+ baseURL: 'http://localhost:3000',++ /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */+ trace: 'on-first-retry',+ },++ /* Configure projects for major browsers */+ projects: [+ {+ name: 'chromium',+ use: { ...devices['Desktop Chrome'] },+ },++ // {+ // name: 'firefox',+ // use: { ...devices['Desktop Firefox'] },+ // },++ // {+ // name: 'webkit',+ // use: { ...devices['Desktop Safari'] },+ // },++ /* Test against mobile viewports. */+ // {+ // name: 'Mobile Chrome',+ // use: { ...devices['Pixel 5'] },+ // },+ // {+ // name: 'Mobile Safari',+ // use: { ...devices['iPhone 12'] },+ // },++ /* Test against branded browsers. */+ // {+ // name: 'Microsoft Edge',+ // use: { ...devices['Desktop Edge'], channel: 'msedge' },+ // },+ // {+ // name: 'Google Chrome',+ // use: { ...devices['Desktop Chrome'], channel: 'chrome' },+ // },+ ],++ /* Run your local dev server before starting the tests */+ // webServer: {+ // command: 'npm run start',+ // url: 'http://127.0.0.1:3000',+ // reuseExistingServer: !process.env.CI,+ // },+});diff --git a/turbo.json b/turbo.jsonindex 0fc3d8f9c..368c3a880 100644--- a/turbo.json+++ b/turbo.json@@ -2,13 +2,8 @@"$schema": "https://turbo.build/schema.json","pipeline": {"build": {- "dependsOn": [- "^build"- ],- "outputs": [- ".next/**",- "!.next/cache/**"- ]+ "dependsOn": ["^build"],+ "outputs": [".next/**", "!.next/cache/**"]},"lint": {},"clean": {@@ -17,11 +12,15 @@"dev": {"cache": false,"persistent": true+ },+ "dev:test": {+ "cache": false+ },+ "test:e2e": {+ "dependsOn": ["^build"]}},- "globalDependencies": [- "**/.env.*local"- ],+ "globalDependencies": ["**/.env.*local"],"globalEnv": ["APP_VERSION","NEXTAUTH_URL",