chore: use env vars for tests

This commit is contained in:
pit
2023-10-05 09:12:56 +03:00
parent 4f5976479a
commit 39ff11a59d
4 changed files with 14 additions and 5 deletions

View File

@ -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. # 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" 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]] # [[STORAGE]]
# OPTIONAL: Defines the storage transport to use. Available options: database (default) | s3 # OPTIONAL: Defines the storage transport to use. Available options: database (default) | s3
NEXT_PUBLIC_UPLOAD_TRANSPORT="database" NEXT_PUBLIC_UPLOAD_TRANSPORT="database"

3
package-lock.json generated
View File

@ -20335,7 +20335,8 @@
"start-server-and-test": "^2.0.1" "start-server-and-test": "^2.0.1"
}, },
"devDependencies": { "devDependencies": {
"@playwright/test": "^1.38.1", "@documenso/web": "*",
"@playwright/test": "^1.18.1",
"@types/node": "^20.8.2" "@types/node": "^20.8.2"
} }
}, },

View File

@ -10,9 +10,9 @@ test.use({ storageState: { cookies: [], origins: [] } });
*/ */
test.describe.configure({ mode: 'serial' }); test.describe.configure({ mode: 'serial' });
const username = 'Test user'; const username = E2E_TEST_AUTHENTICATE_USERNAME;
const email = 'testuser@gmail.com'; const email = E2E_TEST_AUTHENTICATE_USER_EMAIL;
const password = '12345678910'; const password = E2E_TEST_AUTHENTICATE_USER_PASSWORD;
test('user can sign up with email and password', async ({ page }: { page: Page }) => { test('user can sign up with email and password', async ({ page }: { page: Page }) => {
await page.goto('/signup'); await page.goto('/signup');

View File

@ -72,6 +72,9 @@
"POSTGRES_URL", "POSTGRES_URL",
"DATABASE_URL", "DATABASE_URL",
"POSTGRES_PRISMA_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"
] ]
} }