diff --git a/e2e-testing-playwright/playwright.config.ts b/e2e-testing-playwright/playwright.config.ts index 41f021c..f1478d7 100644 --- a/e2e-testing-playwright/playwright.config.ts +++ b/e2e-testing-playwright/playwright.config.ts @@ -72,8 +72,8 @@ export default defineConfig({ /* Run your local dev server before starting the tests */ webServer: { - command: 'cd .. && docker-compose up -d', - // command: 'cd ../front && npm run dev', + // command: 'cd .. && docker-compose up -d', + command: 'cd ../front && npm run dev', url: 'http://localhost:3016', reuseExistingServer: !process.env.CI, }, diff --git a/e2e-testing-playwright/tests/login.spec.ts b/e2e-testing-playwright/tests/login.spec.ts index 1c46f95..0f1e7da 100644 --- a/e2e-testing-playwright/tests/login.spec.ts +++ b/e2e-testing-playwright/tests/login.spec.ts @@ -28,4 +28,15 @@ describe("Login form", () => { await expect(page.getByText(/^Wrong credentials.*$/)).toBeVisible(); }) + + test("log in redirects to another page if credentials are correct", async ({ page }) => { + await page.goto('http://localhost:3016/'); + await page.getByRole("textbox", { name: "username" }).fill("dqnid"); + await page.getByRole("textbox", { name: "password" }).fill("1234"); + + const button_element = page.getByRole("button", { name: /Log-in/ }) + button_element.click(); + + await expect(page.getByAltText("Main logo")).toBeVisible(); + }) });