verua-e2e/tests/verua.spec.ts
2025-10-31 08:22:48 +01:00

69 lines
No EOL
4.5 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { test, expect } from '@playwright/test';
/**
* This spec is for testing VeruA application.
*
* Testing Instance: demo
* Testing User: demo
* Testing Host: VRG
* Testing URL: demo.verua.org
* Testing users:
* - 181
*
* Note: Authentication is processed through auth.setup.ts and is managed by Playwright automatically
*
*/
test('01 - login to verua application', async ({ page }) => {
await page.goto('https://demo.verua.org/start.php?first=1&id_owner=1');
await expect(page.getByRole('link', { name: 'ABMELDEN (demo)' })).toHaveText("ABMELDEN (demo)")
});
test('02 - create a new client', async ({ page }) => {
await page.goto('https://demo.verua.org/start.php?first=1&id_owner=1');
await page.getByRole('cell', { name: 'Suche nach Klient:    Klientenliste:   aktive Klienten   Neuen Klienten anlegen' }).getByRole('link').click();
await page.locator('iframe[name="edit_data"]').contentFrame().locator('input[name="nn"]').click();
await page.locator('iframe[name="edit_data"]').contentFrame().locator('input[name="nn"]').fill('TEST');
await page.locator('iframe[name="edit_data"]').contentFrame().getByRole('button', { name: 'Daten speichern' }).click();
await page.locator('iframe[name="edit_data"]').contentFrame().getByRole('link', { name: 'Weiter zum nächsten Schritt' }).click();
await expect(page.locator('iframe[name="edit_data"]').contentFrame().getByText('Schritt 3/3 : Versicherung fü')).toHaveText("Schritt 3/3 : Versicherung für Frau TEST zuordnen");
await page.locator('iframe[name="edit_data"]').contentFrame().getByRole('link', { name: 'Weiter zum nächsten Schritt' }).click();
await expect(page.locator('iframe[name="edit_data"]').contentFrame().getByText('Klientendossier wurde')).toHaveText("Klientendossier wurde erfolgreich erstellt!");
});
test('03 - create care report', async ({ page }) => {
await page.goto('https://demo.verua.org/start.php?id_k=181&sicht=2&aktiv=1');
await page.locator('iframe[name="edit_data"]').contentFrame().getByRole('link', { name: 'Neuer Eintrag' }).click();
await page.locator('iframe[name="edit_data"]').contentFrame().locator('input[name="ankunft"]').click();
await page.locator('iframe[name="edit_data"]').contentFrame().locator('input[name="ankunft"]').fill('06:30');
await page.locator('iframe[name="edit_data"]').contentFrame().locator('iframe[title="Rich-Text-Area"]').contentFrame().locator('html').click();
await page.locator('iframe[name="edit_data"]').contentFrame().locator('iframe[title="Rich-Text-Area"]').contentFrame().getByLabel('Rich-Text-Bereich. Drücken').fill('Lorem ipsum dolor sit amet');
await page.locator('iframe[name="edit_data"]').contentFrame().locator('#sendForm1').getByRole('button', { name: 'Bericht speichern und zur' }).click();
await expect(page.locator('iframe[name="edit_data"]').contentFrame().getByText('Lorem ipsum dolor sit amet')).toHaveText("Lorem ipsum dolor sit amet")
});
test('04 - create care report with services', async ({ page }) => {
await page.goto('https://demo.verua.org/start.php?id_k=181&sicht=2&aktiv=1');
await page.locator('iframe[name="edit_data"]').contentFrame().getByRole('link', { name: 'Neuer Eintrag' }).click();
await page.locator('iframe[name="edit_data"]').contentFrame().locator('input[name="ankunft"]').click();
await page.locator('iframe[name="edit_data"]').contentFrame().locator('input[name="ankunft"]').fill('06:30');
await page.locator('iframe[name="edit_data"]').contentFrame().locator('iframe[title="Rich-Text-Area"]').contentFrame().locator('html').click();
await page.locator('iframe[name="edit_data"]').contentFrame().locator('iframe[title="Rich-Text-Area"]').contentFrame().getByLabel('Rich-Text-Bereich. Drücken').fill('Lorem ipsum sit amet');
await page.locator('iframe[name="edit_data"]').contentFrame().locator('#sendForm1').getByRole('button', { name: 'Bericht speichern und zur' }).click();
await page.locator('iframe[name="edit_data"]').contentFrame().getByRole('cell', { name: 'a', exact: true }).getByRole('radio').check();
await page.locator('iframe[name="edit_data"]').contentFrame().getByRole('textbox').click();
await page.locator('iframe[name="edit_data"]').contentFrame().getByRole('textbox').fill('60');
await page.locator('iframe[name="edit_data"]').contentFrame().getByRole('cell', { name: 'a', exact: true }).getByRole('radio').check();
await expect(page.locator('iframe[name="edit_data"]').contentFrame().locator('iframe[name="liste"]').contentFrame().getByRole('cell', { name: 'a', exact: true })).toHaveText("a");
});