mirror of
https://github.com/documenso/documenso.git
synced 2025-11-16 01:32:06 +10:00
chore: updated GitHub Action
This commit is contained in:
27
apps/web/.github/workflows/playwright.yml
vendored
27
apps/web/.github/workflows/playwright.yml
vendored
@ -1,27 +0,0 @@
|
||||
name: Playwright Tests
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
pull_request:
|
||||
branches: [ main, master ]
|
||||
jobs:
|
||||
test:
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Install Playwright Browsers
|
||||
run: npx playwright install --with-deps
|
||||
- name: Run Playwright tests
|
||||
run: npx playwright test
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
@ -1,6 +1,10 @@
|
||||
import { deleteUser } from '@documenso/lib/server-only/user/delete-user';
|
||||
|
||||
async function teardown() {
|
||||
if (!process.env.E2E_TEST_USERNAME) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await deleteUser(process.env.E2E_TEST_USERNAME);
|
||||
} catch (e) {
|
||||
|
||||
@ -8,7 +8,8 @@
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
"copy:pdfjs": "node ../../scripts/copy-pdfjs.cjs"
|
||||
"copy:pdfjs": "node ../../scripts/copy-pdfjs.cjs",
|
||||
"e2e:test": "start-server-and-test \"npm run start\" http://localhost:3000 \"playwright test\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@documenso/ee": "*",
|
||||
@ -40,7 +41,8 @@
|
||||
"sharp": "0.32.5",
|
||||
"ts-pattern": "^5.0.5",
|
||||
"typescript": "5.1.6",
|
||||
"zod": "^3.21.4"
|
||||
"zod": "^3.21.4",
|
||||
"start-server-and-test": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.38.0",
|
||||
|
||||
@ -25,18 +25,14 @@ test.describe('Document upload test', () => {
|
||||
await expect(page.locator('canvas')).toBeVisible();
|
||||
});
|
||||
|
||||
test('user can add 1 signer', async ({ documentsPage }) => {
|
||||
await documentsPage.addSigner(signer_email, signer_name);
|
||||
});
|
||||
|
||||
test('user can add signature field', async ({ documentsPage }) => {
|
||||
await documentsPage.addSigner(signer_email, signer_name);
|
||||
await documentsPage.addSignatureField(signer_name);
|
||||
});
|
||||
|
||||
test('user can add subject and message', async ({ documentsPage }) => {
|
||||
test('user can send the document for signing succesfully', async ({ documentsPage, page }) => {
|
||||
await documentsPage.addSigner(signer_email, signer_name);
|
||||
await documentsPage.addSignatureField(signer_name);
|
||||
await documentsPage.addSubjectAndMessage(signing_subject, signing_message);
|
||||
|
||||
await expect(page).toHaveURL('/documents');
|
||||
await expect(page.getByRole('status').locator('div').nth(2)).toHaveText(
|
||||
'Your document has been sent successfully.',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@ -5,6 +5,7 @@ export class DocumentsPage {
|
||||
private readonly subject: Locator;
|
||||
private readonly message: Locator;
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
constructor(public readonly page: Page) {
|
||||
this.fileInput = this.page.locator('input[type=file]');
|
||||
this.subject = this.page
|
||||
|
||||
Reference in New Issue
Block a user