Skip to content

Commit

Permalink
feat: updated login page test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Florez authored and Sergio Florez committed Jan 26, 2025
1 parent 40d51db commit 34dd332
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 8 additions & 4 deletions tests/login/login.spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import { expect, test } from '@playwright/test';
import { caritasRework } from '../config';
import { ensureLanguage } from '../utils';

test('Login as an advice seeker', async ({ page }) => {
const username = process.env.TEST_USERNAME;
const password = process.env.TEST_PASSWORD;
const loginButton = page.locator('button.button__item.button__primary');
await page.goto(`${caritasRework.dev}`);
ensureLanguage(page);
await page.fill('input[id="username"]', username!);
await page.fill('input[id="passwordInput"]', password!);
await page.click('button[id="login"]');
await loginButton.click();
await page.locator('.sessionsList__illustration__image').click();
await expect(page.locator('a[href="/profile"]')).toBeVisible();
await expect(page.locator('div[id="local-switch-wrapper"]')).toBeVisible();
await page.click('div[id="logout"]');
await page
.locator('svg[aria-label="Log out"]')
.nth(0)
.click({ force: true });
await expect(page.locator('h1.headline--1')).toBeVisible();
await expect(page.locator('h4.headline--4')).toBeVisible();
});
3 changes: 1 addition & 2 deletions tests/registration/registration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import { caritasRework } from '../config';
import { ensureLanguage, generateRandomAlphanumeric } from '../utils';

// checks if the page has the home titles
test('Check registration page elements', async ({ page }) => {
test('Check registration page title and subtitle', async ({ page }) => {
await page.goto(`${caritasRework.dev}registration`);
ensureLanguage(page);
await expect(page.locator('h1.headline--1')).toBeVisible();
await expect(page.locator('h4.headline--4')).toBeVisible();
});
Expand Down

0 comments on commit 34dd332

Please sign in to comment.