diff --git a/tests/login.spec.ts b/tests/login.spec.ts index cc6e4ce..06a5865 100644 --- a/tests/login.spec.ts +++ b/tests/login.spec.ts @@ -31,12 +31,16 @@ test('LoginPageButtonShouldRedirectToKeycloak', async ({ page }) => { expect(page.url()).toContain("keycloak.szut.dev"); }); -// test('get started link', async ({ page }) => { -// await page.goto('https://playwright.dev/'); +test('AfterLoginUserShouldBeRedirectedToEmployees', async ({ page }) => { + await page.goto('http://localhost:4200'); -// // Click the get started link. -// await page.getByRole('link', { name: 'Get started' }).click(); + await page.getByRole('button').click(); + await page.waitForFunction(() => window.location.href.includes('keycloak')); + await page.getByLabel('Username or email').fill('user'); + await page.getByLabel('Password').fill('test'); + await page.click('#kc-login'); + + expect(page.url()).toContain('localhost'); + expect(page.url()).toContain('mitarbeiter'); +}); -// // Expects page to have a heading with the name of Installation. -// await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); -// });