chore: update Playwright tests and remove examples
Some checks failed
Playwright Tests / test (pull_request) Failing after 1m36s
Some checks failed
Playwright Tests / test (pull_request) Failing after 1m36s
This commit is contained in:
parent
b30a40fe07
commit
6c1ec524ec
6 changed files with 44 additions and 467 deletions
42
tests/login.spec.ts
Normal file
42
tests/login.spec.ts
Normal file
|
@ -0,0 +1,42 @@
|
|||
import { test, expect } from '@playwright/test';
|
||||
import { async } from 'rxjs';
|
||||
|
||||
test('LoginPageShouldRender', async ({ page }) => {
|
||||
await page.goto('http://localhost:4200');
|
||||
|
||||
// Expect a title "to contain" a substring.
|
||||
await expect(page).toHaveTitle(/EmployeeService/);
|
||||
});
|
||||
|
||||
test('LoginPageShouldHaveCorrectHeading', async ({ page }) => {
|
||||
await page.goto('http://localhost:4200');
|
||||
|
||||
const heading = page.getByRole('heading');
|
||||
await expect(heading).toHaveText('Hi-Tec GmbH');
|
||||
});
|
||||
|
||||
test('LoginPageShouldHaveLoginButton', async ({ page }) => {
|
||||
await page.goto('http://localhost:4200');
|
||||
|
||||
const button = page.getByRole('button');
|
||||
await expect(button).toHaveText('Login with Keycloak');
|
||||
});
|
||||
|
||||
test('LoginPageButtonShouldRedirectToKeycloak', async ({ page }) => {
|
||||
await page.goto('http://localhost:4200');
|
||||
|
||||
const button = page.getByText("Login with Keycloak");
|
||||
await button.click();
|
||||
await page.waitForFunction(() => window.location.href.includes('keycloak'));
|
||||
expect(page.url()).toContain("keycloak.szut.dev");
|
||||
});
|
||||
|
||||
// test('get started link', async ({ page }) => {
|
||||
// await page.goto('https://playwright.dev/');
|
||||
|
||||
// // Click the get started link.
|
||||
// await page.getByRole('link', { name: 'Get started' }).click();
|
||||
|
||||
// // Expects page to have a heading with the name of Installation.
|
||||
// await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
|
||||
// });
|
Loading…
Add table
Add a link
Reference in a new issue