Skip to content
Snippets Groups Projects
Commit 9298d2ff authored by Alexander Reifschneider's avatar Alexander Reifschneider
Browse files

OZG-7615 Add e2e test for documentation

parent 9c704308
Branches
Tags
1 merge request!73OZG-7615 Admin Leifaden
......@@ -79,7 +79,7 @@ services:
depends_on:
- user-manager
extra_hosts:
- "host.docker.internal:host-gateway"
- 'host.docker.internal:host-gateway'
alfa-cors-proxy:
image: alfa-cors-proxy
......@@ -91,7 +91,6 @@ services:
alfa:
condition: service_started
user-manager:
image: docker.ozg-sh.de/user-manager:${USER_MANAGER_DOCKER_IMAGE:-snapshot-latest}
platform: linux/amd64
......@@ -132,6 +131,7 @@ services:
- SPRING_DATA_MONGODB_URI=mongodb://mongodb:27017/config-db
- OZGCLOUD_OAUTH2_REALM=${KEYCLOAK_REALM:-by-e2e-tests-local-dev}
- ozgcloud_organisationeinheit_zufisearchuri=http://localhost:8082/api/organisationseinheits
- OZGCLOUD_USER-ASSISTANCE_DOCUMENTATION_URL=http://dummy-leitfaden.url
- BPL_DEBUG_ENABLED=true
- BPL_DEBUG_PORT=5100
ports:
......@@ -145,4 +145,4 @@ services:
user-manager:
condition: service_started
extra_hosts:
- "host.docker.internal:host-gateway"
- 'host.docker.internal:host-gateway'
......@@ -26,6 +26,7 @@ import { UserProfileE2EComponent } from './user-profile.component.e2e';
export class CurrentUserProfileE2EComponent {
private readonly locatorUserIconButton: string = 'popup-button-content';
private readonly locatorLogoutButton: string = 'popup-logout-button';
private readonly locatorDocumentation: string = 'admin-documentation';
private readonly locatorRoot: string = 'current-user';
......@@ -46,7 +47,11 @@ export class CurrentUserProfileE2EComponent {
return cy.getTestElement(this.locatorUserIconButton);
}
private getLogoutButton() {
public getLogoutButton() {
return cy.getTestElement(this.locatorLogoutButton);
}
public getDocumentation() {
return cy.getTestElement(this.locatorDocumentation);
}
}
/*
* Copyright (C) 2025 Das Land Schleswig-Holstein vertreten durch den
* Ministerpräsidenten des Landes Schleswig-Holstein
* Staatskanzlei
* Abteilung Digitalisierung und zentrales IT-Management der Landesregierung
*
* Lizenziert unter der EUPL, Version 1.2 oder - sobald
* diese von der Europäischen Kommission genehmigt wurden -
* Folgeversionen der EUPL ("Lizenz");
* Sie dürfen dieses Werk ausschließlich gemäß
* dieser Lizenz nutzen.
* Eine Kopie der Lizenz finden Sie hier:
*
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
*
* Sofern nicht durch anwendbare Rechtsvorschriften
* gefordert oder in schriftlicher Form vereinbart, wird
* die unter der Lizenz verbreitete Software "so wie sie
* ist", OHNE JEGLICHE GEWÄHRLEISTUNG ODER BEDINGUNGEN -
* ausdrücklich oder stillschweigend - verbreitet.
* Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen.
*/
import { HeaderE2EComponent } from '../../../page-objects/header.po';
import { MainPage } from '../../../page-objects/main.po';
import { exist, shouldHaveAttribute } from '../../../support/cypress.util';
import { loginAsAriane } from '../../../support/user-util';
describe('User Profile Menu', () => {
const mainPage: MainPage = new MainPage();
const header: HeaderE2EComponent = mainPage.getHeader();
const documentationLink: string = 'http://dummy-leitfaden.url';
before(() => {
loginAsAriane();
});
describe('open user profile menu', () => {
before(() => {
header.getCurrentUserProfile().getUserIconButton().click();
});
it('should show logout button', () => {
exist(header.getCurrentUserProfile().getLogoutButton());
});
it('should show documentation', () => {
exist(header.getCurrentUserProfile().getDocumentation());
});
it('should find documentation link', () => {
shouldHaveAttribute(header.getCurrentUserProfile().getDocumentation().find('a'), 'href', documentationLink);
});
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment