diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index ef6278d..91dfefe 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -6,6 +6,18 @@ on: branches: [ main, master ] jobs: test: + services: + postgres: + image: postgres:latest + env: + POSTGRES_USER: test + POSTGRES_PASSWORD: test + POSTGRES_DB: db + POSTGRESQL_FSYNC: "off" + ports: + - 5432:5432 + # needed because the postgres container does not provide a healthcheck + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 timeout-minutes: 10 runs-on: ubuntu-latest steps: diff --git a/playwright.config.ts b/playwright.config.ts index 06e92f3..b7930d4 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -21,7 +21,7 @@ export default defineConfig({ /* 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://127.0.0.1:3000', + baseURL: 'http://127.0.0.1:3001', /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ trace: 'on-first-retry', @@ -66,9 +66,9 @@ export default defineConfig({ ], /* Run your local dev server before starting the tests */ - /* webServer: { + webServer: { command: 'npm run build', - url: 'http://127.0.0.1:3000', + url: 'http://127.0.0.1:3001', reuseExistingServer: !process.env.CI, - }, */ + }, }); diff --git a/tests/signup.spec.ts b/tests/signup.spec.ts index daa5ab8..f411e14 100644 --- a/tests/signup.spec.ts +++ b/tests/signup.spec.ts @@ -8,8 +8,8 @@ test.describe('Signup page', () => { signUpPage = new SignUpPage(page) }) - test('Signup page is loading and has the basic elements', async ({ page }) => { - await signUpPage.goto('http://localhost:3000/signup') + test('Signup page is loading and has the basic elements', async () => { + await signUpPage.goto('/signup') await signUpPage.hasH1() await signUpPage.hasPresidentQuote()