diff --git a/.env.example b/.env.example index 065976bc5..44baac9c8 100644 --- a/.env.example +++ b/.env.example @@ -15,6 +15,11 @@ NEXT_PRIVATE_DATABASE_URL="postgres://documenso:password@127.0.0.1:54320/documen # Defines the URL to use for the database when running migrations and other commands that won't work with a connection pool. NEXT_PRIVATE_DIRECT_DATABASE_URL="postgres://documenso:password@127.0.0.1:54320/documenso" +# [[E2E Tests]] +E2E_TEST_AUTHENTICATE_USERNAME="Test User" +E2E_TEST_AUTHENTICATE_USER_EMAIL="testuser@mail.com" +E2E_TEST_AUTHENTICATE_USER_PASSWORD="test_password" + # [[STORAGE]] # OPTIONAL: Defines the storage transport to use. Available options: database (default) | s3 NEXT_PUBLIC_UPLOAD_TRANSPORT="database" diff --git a/package-lock.json b/package-lock.json index 05c267d9f..09985288c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20335,7 +20335,8 @@ "start-server-and-test": "^2.0.1" }, "devDependencies": { - "@playwright/test": "^1.38.1", + "@documenso/web": "*", + "@playwright/test": "^1.18.1", "@types/node": "^20.8.2" } }, diff --git a/packages/web-tests/e2e/test-auth-flow.spec.ts b/packages/web-tests/e2e/test-auth-flow.spec.ts index 544bdf48f..c53a9577f 100644 --- a/packages/web-tests/e2e/test-auth-flow.spec.ts +++ b/packages/web-tests/e2e/test-auth-flow.spec.ts @@ -10,9 +10,9 @@ test.use({ storageState: { cookies: [], origins: [] } }); */ test.describe.configure({ mode: 'serial' }); -const username = 'Test user'; -const email = 'testuser@gmail.com'; -const password = '12345678910'; +const username = E2E_TEST_AUTHENTICATE_USERNAME; +const email = E2E_TEST_AUTHENTICATE_USER_EMAIL; +const password = E2E_TEST_AUTHENTICATE_USER_PASSWORD; test('user can sign up with email and password', async ({ page }: { page: Page }) => { await page.goto('/signup'); diff --git a/turbo.json b/turbo.json index 368c3a880..10ff74735 100644 --- a/turbo.json +++ b/turbo.json @@ -72,6 +72,9 @@ "POSTGRES_URL", "DATABASE_URL", "POSTGRES_PRISMA_URL", - "POSTGRES_URL_NON_POOLING" + "POSTGRES_URL_NON_POOLING", + "E2E_TEST_AUTHENTICATE_USERNAME", + "E2E_TEST_AUTHENTICATE_USER_EMAIL", + "E2E_TEST_AUTHENTICATE_USER_PASSWORD" ] }