Skip to content
Snippets Groups Projects
Verified Commit f41f561a authored by Sebastian Bergandy's avatar Sebastian Bergandy :keyboard:
Browse files

Merge branch 'main' into OZG-7619-E2EAndTextAdjustment

# Conflicts:
#	alfa-client/apps/admin-e2e/src/components/benutzer/benutzer.e2e.component.ts
#	alfa-client/libs/test-utils/src/lib/mocking.ts
parents 83dd535d ced64b94
No related branches found
No related tags found
1 merge request!84Ozg 7619 e2 e and text adjustment
Showing
with 444 additions and 77 deletions
......@@ -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
......@@ -145,4 +144,4 @@ services:
user-manager:
condition: service_started
extra_hosts:
- "host.docker.internal:host-gateway"
- 'host.docker.internal:host-gateway'
......@@ -24,14 +24,20 @@
import 'cypress-real-events';
import { convertToDataTestId } from '../../support/tech-util';
//TODO BenutzerListPage erstellen welche den Button und die Liste enthaelt.
export class BenutzerListE2EComponent {
private readonly headline: string = 'user-list-headline';
private readonly list: string = 'user-list';
private readonly benutzerHinzufuegenButton: string = 'add-user-button';
public getHeadline(): Cypress.Chainable<Element> {
return cy.getTestElement(this.headline);
}
public getList(): Cypress.Chainable<Element> {
return cy.getTestElement(this.list);
}
public getHinzufuegenButton(): Cypress.Chainable<Element> {
return cy.getTestElement(this.benutzerHinzufuegenButton);
}
......@@ -98,10 +104,16 @@ export class BenutzerE2EComponent {
private readonly loeschenCheckboxLabel: string = 'Löschen';
private readonly userCheckboxLabel: string = 'User';
private readonly postCheckboxLabel: string = 'Poststelle';
private readonly datenbeauftragungLabel: string = 'Datenbeauftragung';
private readonly organisationsEinheitCheckboxSuffix: string = '-checkbox-editor';
private readonly saveButton: string = 'save-button';
private readonly deleteButton: string = 'delete-button';
public getHeadline(): Cypress.Chainable<Element> {
return cy.getTestElement(this.headline);
}
public getVornameInput(): Cypress.Chainable<Element> {
return cy.getTestElement(this.userVorname);
......@@ -135,16 +147,33 @@ export class BenutzerE2EComponent {
return new BenutzerCheckboxE2EComponent(this.postCheckboxLabel);
}
public getSaveButton(): Cypress.Chainable<Element> {
return cy.getTestElement(this.saveButton);
public getDatenbeauftragungCheckbox(): Cypress.Chainable<Element> {
return cy.getTestElement(this.datenbeauftragungLabel);
}
public getOrganisationsEinheitCheckbox(einheit: string): Cypress.Chainable<Element> {
return cy.getTestElement(einheit + this.organisationsEinheitCheckboxSuffix);
}
public getHeadline(): Cypress.Chainable<Element> {
return cy.getTestElement(this.headline);
public getSaveButton(): Cypress.Chainable<Element> {
return cy.getTestElement(this.saveButton);
}
public getDeleteButton(): Cypress.Chainable<Element> {
return cy.getTestElement(this.deleteButton);
}
}
export class BenutzerDeleteDialogE2EComponent {
private readonly deleteButton: string = 'dialog-delete';
private readonly cancelButton: string = 'cancel-dialog';
public getCancelButton(): Cypress.Chainable<Element> {
return cy.getTestElement(this.cancelButton);
}
public getDeleteButton(): Cypress.Chainable<Element> {
return cy.getTestElement(this.deleteButton);
}
}
......
......@@ -21,21 +21,52 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen.
*/
export class OrganisationsEinheitListE2EComponent {
private readonly root: string = 'organisations-einheit-list';
public getRoot(): Cypress.Chainable<Element> {
return cy.getTestElement(this.root);
}
public getListItem(name: string): OrganisationsEinheitListItemE2EComponent {
return new OrganisationsEinheitListItemE2EComponent(name);
}
}
export class OrganisationsEinheitListItemE2EComponent {
private root: string;
export class OrganisationsEinheitenE2EComponent {
private readonly organisationsEinheitenList: string = 'organisations-einheit-list';
private readonly organisationsEinheitHinzufuegen: string = 'add-organisationseinheit-button';
private readonly organisationsEinheitItemSuffix: string = '-organisation-item';
private readonly deleteButton: string = 'delete-button';
constructor(name: string) {
this.root = name;
}
public getRoot(): Cypress.Chainable<Element> {
return cy.getTestElement(this.root + this.organisationsEinheitItemSuffix);
}
public getDeleteButton(): Cypress.Chainable<Element> {
return this.getRoot().findTestElementWithClass(this.deleteButton);
}
}
export class OrganisationsEinheitDeleteDialogE2EComponent {
private readonly root: string = 'organisations-einheit-delete-dialog';
private readonly deleteButton: string = 'dialog-delete-button';
private readonly cancelButton: string = 'dialog-cancel-button';
public getOrganisationsEinheitList(): Cypress.Chainable<Element> {
return cy.getTestElement(this.organisationsEinheitenList);
public getRoot(): Cypress.Chainable<Element> {
return cy.getTestElement(this.root);
}
public getOrganisationsEinheitHinzufuegenButton(): Cypress.Chainable<Element> {
return cy.getTestElement(this.organisationsEinheitHinzufuegen);
public getDeleteButton(): Cypress.Chainable<Element> {
return cy.getTestElement(this.deleteButton);
}
public getListItem(name: string) {
return cy.getTestElement(name + this.organisationsEinheitItemSuffix);
public getCancelButton(): Cypress.Chainable<Element> {
return cy.getTestElement(this.cancelButton);
}
}
......@@ -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) 2023 Das Land Schleswig-Holstein vertreten durch den
* 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
......@@ -21,27 +21,45 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen.
*/
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { getUrl } from '@ngxp/rest';
import { HttpMethodE2E } from '../../../model/util';
import { HeaderE2EComponent } from '../../../page-objects/header.po';
import { MainPage } from '../../../page-objects/main.po';
import { getBaseUrl, intercept, waitOfInterceptor } from '../../../support/cypress-helper';
import { exist, shouldHaveAttribute } from '../../../support/cypress.util';
import { ApiRootLinkRelE2E } from '../../../support/linkrels';
import { loginAsAriane } from '../../../support/user-util';
import { OpenDocumentationButtonComponent } from './open-documentation-button.component';
import { MockComponent } from 'ng-mocks';
import { OpenUrlButtonComponent } from '@alfa-client/ui';
describe('User Profile Menu', () => {
const mainPage: MainPage = new MainPage();
const header: HeaderE2EComponent = mainPage.getHeader();
describe('OpenDocumentationButtonComponent', () => {
let component: OpenDocumentationButtonComponent;
let fixture: ComponentFixture<OpenDocumentationButtonComponent>;
let documentationLink: string = '';
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [OpenDocumentationButtonComponent, MockComponent(OpenUrlButtonComponent)],
}).compileComponents();
fixture = TestBed.createComponent(OpenDocumentationButtonComponent);
component = fixture.componentInstance;
fixture.detectChanges();
before(() => {
const interceptor: string = 'getApiRoot';
intercept(HttpMethodE2E.GET, `${getBaseUrl()}/api`).as(interceptor);
loginAsAriane();
waitOfInterceptor(interceptor).then(
(interception) => (documentationLink = getUrl(interception?.response?.body, ApiRootLinkRelE2E.DOCUMENTATIONS)),
);
});
it('should create', () => {
expect(component).toBeTruthy();
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);
});
});
});
import { faker } from '@faker-js/faker';
import { E2EBenutzerHelper } from 'apps/admin-e2e/src/helper/benutzer/benutzer.helper';
import { E2EBenutzerVerifier } from 'apps/admin-e2e/src/helper/benutzer/benutzer.verifier';
import { AdminUserE2E } from 'apps/admin-e2e/src/model/util';
import { loginAsAriane } from 'apps/admin-e2e/src/support/user-util';
describe('Benutzer Löschen', () => {
const benutzerVerifier: E2EBenutzerVerifier = new E2EBenutzerVerifier();
const benutzerHelper: E2EBenutzerHelper = new E2EBenutzerHelper();
const userName: string = 'testtheo' + faker.string.uuid();
const user: AdminUserE2E = {
vorname: 'Theo',
nachname: 'Testuser',
username: userName,
email: 'theo' + faker.string.uuid() + '@ozg-sh.de',
isUser: true,
organisationseinheiten: [],
};
before(() => {
loginAsAriane();
});
it('should delete user', () => {
benutzerHelper.openNewBenutzerPage();
benutzerHelper.addBenutzerAndSave(user);
benutzerHelper.deleteBenutzer(userName);
benutzerVerifier.verifyUserNotInList(userName);
});
});
import { E2EOrganisationsEinheitHelper } from 'apps/admin-e2e/src/helper/organisations-einheit/organisations-einheit.helper';
import { E2EOrganisationsEinheitVerifier } from 'apps/admin-e2e/src/helper/organisations-einheit/organisations-einheit.verifier';
import { OrganisationsEinheitPage } from 'apps/admin-e2e/src/page-objects/organisations-einheit.po';
import { ZustaendigeStelleDialogE2EComponent } from '../../../components/zustaendige-stelle/zustaendige-stelle-dialog.e2e.component';
import { exist } from '../../../support/cypress.util';
import { loginAsAriane } from '../../../support/user-util';
describe('Organisationseinheit', () => {
const organisationsEinheitPage: OrganisationsEinheitPage = new OrganisationsEinheitPage();
const organisationsEinheitHelper: E2EOrganisationsEinheitHelper = new E2EOrganisationsEinheitHelper();
const organisationsEinheitVerifier: E2EOrganisationsEinheitVerifier = new E2EOrganisationsEinheitVerifier();
const zustaendigeStelleSearchComponent: ZustaendigeStelleDialogE2EComponent = new ZustaendigeStelleDialogE2EComponent();
const organisationsEinheit: string = 'Wasserwerk - Hamburg Wasser - Hamburger Stadtentwässerung';
before(() => {
loginAsAriane();
});
describe('hinzufügen', () => {
it('should show search dialog on add button click', () => {
organisationsEinheitHelper.openOrganisationsEinheitPage();
organisationsEinheitPage.getAddButton().click();
exist(zustaendigeStelleSearchComponent.getZustaendigeStelleForm());
});
it('should find at least one organisationseinheit on search', () => {
zustaendigeStelleSearchComponent.enterSearchTerm(organisationsEinheit);
zustaendigeStelleSearchComponent.expectNumberOfEntriesToBeGreaterThan(1);
});
it('should show organisationseinheit in list', () => {
organisationsEinheitHelper.addOrganisationsEinheit(organisationsEinheit);
organisationsEinheitVerifier.verifyOrganisationsEinheitInList(organisationsEinheit);
});
});
describe('löschen', () => {
it('should not show entry in list', () => {
organisationsEinheitHelper.openOrganisationsEinheitPage();
organisationsEinheitHelper.deleteOrganisationsEinheit(organisationsEinheit);
organisationsEinheitVerifier.verifyOrganisationsEinheitNotInList(organisationsEinheit);
});
});
});
......@@ -21,36 +21,41 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen.
*/
import { OrganisationsEinheitenE2EComponent } from '../../../components/organisationseinheiten/organisationseinheiten.e2e.component';
import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main.po';
import { OrganisationsEinheitListE2EComponent } from 'apps/admin-e2e/src/components/organisationseinheiten/organisationseinheiten.e2e.component';
import { E2EOrganisationsEinheitHelper } from 'apps/admin-e2e/src/helper/organisations-einheit/organisations-einheit.helper';
import { OrganisationsEinheitE2E } from 'apps/admin-e2e/src/model/organisations-einheit';
import { OrganisationsEinheitPage } from 'apps/admin-e2e/src/page-objects/organisations-einheit.po';
import { exist } from '../../../support/cypress.util';
import { loginAsAriane } from '../../../support/user-util';
describe('Organisationsheiten list', () => {
const mainPage: MainPage = new MainPage();
const organisationsEinheitenTab: OrganisationsEinheitenE2EComponent = new OrganisationsEinheitenE2EComponent();
describe('Organisationsheiten page', () => {
const organisationsEinheitPage: OrganisationsEinheitPage = new OrganisationsEinheitPage();
const organisationsEinheitHelper: E2EOrganisationsEinheitHelper = new E2EOrganisationsEinheitHelper();
const organisationsEinheitList: OrganisationsEinheitListE2EComponent = new OrganisationsEinheitListE2EComponent();
before(() => {
loginAsAriane();
});
it('should show Organisationseinheiten list', () => {
waitForSpinnerToDisappear();
mainPage.clickOrganisationsEinheitenNavigationItem();
waitForSpinnerToDisappear();
it('should show list', () => {
organisationsEinheitHelper.openOrganisationsEinheitPage();
exist(organisationsEinheitenTab.getOrganisationsEinheitList());
exist(organisationsEinheitPage.getList().getRoot());
});
it('should show entry for Bauamt', () => {
exist(organisationsEinheitenTab.getListItem('Bauamt'));
});
it('should show add button', () => {
organisationsEinheitHelper.openOrganisationsEinheitPage();
it('should show entry for Fundstelle', () => {
exist(organisationsEinheitenTab.getListItem('Fundstelle'));
exist(organisationsEinheitPage.getAddButton());
});
it('should show entry for Denkmalpflege', () => {
exist(organisationsEinheitenTab.getListItem('Denkmalpflege'));
it('should show default (Bauamt, Fundstelle, Denkmalpflege) entries', () => {
organisationsEinheitHelper.openOrganisationsEinheitPage();
exist(organisationsEinheitList.getListItem(OrganisationsEinheitE2E.BAUAMT).getRoot());
exist(organisationsEinheitList.getListItem(OrganisationsEinheitE2E.FUNDSTELLE).getRoot());
exist(organisationsEinheitList.getListItem(OrganisationsEinheitE2E.DENKMALPFLEGE).getRoot());
});
});
import { convertToDataTestId } from 'apps/admin-e2e/src/support/tech-util';
import { OrganisationsEinheitenE2EComponent } from '../../../components/organisationseinheiten/organisationseinheiten.e2e.component';
import { ZustaendigeStelleDialogE2EComponent } from '../../../components/zustaendige-stelle/zustaendige-stelle-dialog.e2e.component';
import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main.po';
import { exist } from '../../../support/cypress.util';
import { loginAsAriane } from '../../../support/user-util';
describe('Organisationseinheiten', () => {
const mainPage: MainPage = new MainPage();
const organisationsEinheitenComponent: OrganisationsEinheitenE2EComponent = new OrganisationsEinheitenE2EComponent();
const zustaendigeStelleSearchComponent: ZustaendigeStelleDialogE2EComponent = new ZustaendigeStelleDialogE2EComponent();
const searchTerm: string = 'Hamburg';
before(() => {
loginAsAriane();
});
it('should show table with Organisationseinheiten', () => {
waitForSpinnerToDisappear();
mainPage.clickOrganisationsEinheitenNavigationItem();
exist(organisationsEinheitenComponent.getOrganisationsEinheitHinzufuegenButton());
});
it('should show button to add Organisationseinheit', () => {
exist(organisationsEinheitenComponent.getOrganisationsEinheitHinzufuegenButton());
});
it('should show search Organisationseinheit dialog', () => {
organisationsEinheitenComponent.getOrganisationsEinheitHinzufuegenButton().click();
exist(zustaendigeStelleSearchComponent.getZustaendigeStelleForm());
});
it('should find at least one Organisationseinheit', () => {
zustaendigeStelleSearchComponent.enterSearchTerm(searchTerm);
zustaendigeStelleSearchComponent.expectNumberOfEntriesToBeGreaterThan(1);
});
it('should add first Organisationseinheit', () => {
zustaendigeStelleSearchComponent.getZustaendigeStelleTitle(0).then((name: string) => {
zustaendigeStelleSearchComponent.clickFoundItem(0);
exist(organisationsEinheitenComponent.getListItem(convertToDataTestId(name)));
});
});
});
import { BenutzerE2EComponent } from '../../components/benutzer/benutzer.e2e.component';
import {
BenutzerDeleteDialogE2EComponent,
BenutzerE2EComponent,
BenutzerListE2EComponent,
} from '../../components/benutzer/benutzer.e2e.component';
import { SnackBarE2EComponent } from '../../components/ui/snackbar.e2e.component';
import { OrganisationsEinheitE2E } from '../../model/organisations-einheit';
import { AdminUserE2E } from '../../model/util';
......@@ -7,6 +11,8 @@ import { exist, notExist } from '../../support/cypress.util';
export class E2EBenutzerExecutor {
private benutzerPage: BenutzerE2EComponent = new BenutzerE2EComponent();
private snackBar: SnackBarE2EComponent = new SnackBarE2EComponent();
private benutzerDeleteDialog: BenutzerDeleteDialogE2EComponent = new BenutzerDeleteDialogE2EComponent();
private benutzerListPage: BenutzerListE2EComponent = new BenutzerListE2EComponent();
public modifyBenutzer(user: AdminUserE2E): void {
this.benutzerPage.getVornameInput().type(user.vorname);
......@@ -39,9 +45,17 @@ export class E2EBenutzerExecutor {
exist(this.snackBar.getMessage());
this.snackBar.getCloseButton().click();
notExist(this.snackBar.getMessage());
exist(this.benutzerListPage.getList());
}
public saveBenutzer(): void {
this.benutzerPage.getSaveButton().click();
}
public deleteBenutzer(): void {
this.benutzerPage.getDeleteButton().click();
exist(this.benutzerDeleteDialog.getDeleteButton());
this.benutzerDeleteDialog.getDeleteButton().click();
exist(this.benutzerListPage.getList());
}
}
......@@ -17,32 +17,45 @@ export class E2EBenutzerHelper {
public addBenutzerAndSave(user: AdminUserE2E): void {
this.addBenutzer(user);
this.executer.saveAndCloseSnackbar();
this.saveAndCloseSnackbar();
}
public addBenutzer(user: AdminUserE2E): void {
this.executer.modifyBenutzer(user);
}
public openBenutzerPage(userName: string): void {
this.navigator.openBenutzerPage(userName);
this.modifyBenutzer(user);
}
public editBenutzerAndSave(user: AdminUserE2E): void {
this.editBenutzer(user);
this.executer.saveAndCloseSnackbar();
this.saveAndCloseSnackbar();
}
public editBenutzer(user: AdminUserE2E): void {
this.modifyBenutzer(user);
}
private modifyBenutzer(user: AdminUserE2E): void {
this.executer.modifyBenutzer(user);
}
public editOrganisationsEinheitenAndSave(organisationsEinheiten: OrganisationsEinheitE2E[]): void {
this.executer.modifyOrganisationsEinheiten(organisationsEinheiten);
this.saveAndCloseSnackbar();
}
private saveAndCloseSnackbar(): void {
this.executer.saveAndCloseSnackbar();
}
public saveBenutzer(): void {
this.executer.saveBenutzer();
}
public deleteBenutzer(userName: string): void {
this.openBenutzerPage(userName);
this.executer.deleteBenutzer();
}
public openBenutzerPage(userName: string): void {
this.navigator.openBenutzerPage(userName);
}
}
......@@ -4,7 +4,7 @@ import {
BenutzerListItemE2EComponent,
} from '../../components/benutzer/benutzer.e2e.component';
import { AdminUserE2E } from '../../model/util';
import { contains, exist } from '../../support/cypress.util';
import { contains, exist, notExist } from '../../support/cypress.util';
import { AlfaRollen } from '../../support/user-util';
export class E2EBenutzerVerifier {
......@@ -41,6 +41,10 @@ export class E2EBenutzerVerifier {
if (user.isAdmin) contains(benutzer.getRoles(), AlfaRollen.ADMIN);
}
public verifyUserNotInList(userName: string): void {
notExist(this.getBenutzerItem(userName).getRoot());
}
private getBenutzerItem(userName: string): BenutzerListItemE2EComponent {
return this.benutzerListPage.getItem(userName);
}
......
import {
OrganisationsEinheitDeleteDialogE2EComponent,
OrganisationsEinheitListE2EComponent,
} from '../../components/organisationseinheiten/organisationseinheiten.e2e.component';
import { ZustaendigeStelleDialogE2EComponent } from '../../components/zustaendige-stelle/zustaendige-stelle-dialog.e2e.component';
import { OrganisationsEinheitPage } from '../../page-objects/organisations-einheit.po';
import { exist } from '../../support/cypress.util';
import { convertToDataTestId } from '../../support/tech-util';
export class E2EOrganisationsEinheitExecutor {
private readonly organisationsEinheitPage: OrganisationsEinheitPage = new OrganisationsEinheitPage();
private readonly organisationsEinheitList: OrganisationsEinheitListE2EComponent = this.organisationsEinheitPage.getList();
private readonly deleteDialog: OrganisationsEinheitDeleteDialogE2EComponent =
new OrganisationsEinheitDeleteDialogE2EComponent();
private readonly zustaendigeStelleSearchComponent: ZustaendigeStelleDialogE2EComponent =
new ZustaendigeStelleDialogE2EComponent();
public addOrganisationsEinheit(name: string): void {
//TODO von index auf Name umstellen
this.zustaendigeStelleSearchComponent
.getZustaendigeStelleTitle(0)
.then((name: string) => this.zustaendigeStelleSearchComponent.clickFoundItem(0));
exist(this.organisationsEinheitList.getRoot());
}
public deleteOrganisationsEinheit(name: string): void {
this.organisationsEinheitList.getListItem(convertToDataTestId(name)).getDeleteButton().click();
exist(this.deleteDialog.getRoot());
this.deleteDialog.getDeleteButton().click();
exist(this.organisationsEinheitList.getRoot());
}
}
import { E2EOrganisationsEinheitExecutor } from './organisations-einheit.executor';
import { E2EOrganisationsEinheitNavigator } from './organisations-einheit.navigator';
export class E2EOrganisationsEinheitHelper {
private readonly navigator: E2EOrganisationsEinheitNavigator = new E2EOrganisationsEinheitNavigator();
private readonly executor: E2EOrganisationsEinheitExecutor = new E2EOrganisationsEinheitExecutor();
public openOrganisationsEinheitPage(): void {
this.navigator.openOrganisationsEinheitListPage();
}
public addOrganisationsEinheit(name: string): void {
this.executor.addOrganisationsEinheit(name);
}
public deleteOrganisationsEinheit(name: string): void {
this.executor.deleteOrganisationsEinheit(name);
}
}
import { OrganisationsEinheitListE2EComponent } from '../../components/organisationseinheiten/organisationseinheiten.e2e.component';
import { MainPage } from '../../page-objects/main.po';
import { OrganisationsEinheitPage } from '../../page-objects/organisations-einheit.po';
import { exist } from '../../support/cypress.util';
export class E2EOrganisationsEinheitNavigator {
private readonly mainPage: MainPage = new MainPage();
private readonly organisationsEinheitPage: OrganisationsEinheitPage = new OrganisationsEinheitPage();
private readonly organisationsEinheitList: OrganisationsEinheitListE2EComponent = this.organisationsEinheitPage.getList();
public openOrganisationsEinheitListPage(): void {
this.navigateToDomain();
this.mainPage.getOrganisationEinheitNavigationItem().click();
exist(this.organisationsEinheitList.getRoot());
}
private navigateToDomain(): void {
this.mainPage.getHeader().getLogo().click();
}
}
import { OrganisationsEinheitListE2EComponent } from '../../components/organisationseinheiten/organisationseinheiten.e2e.component';
import { OrganisationsEinheitPage } from '../../page-objects/organisations-einheit.po';
import { exist, notExist } from '../../support/cypress.util';
import { convertToDataTestId } from '../../support/tech-util';
export class E2EOrganisationsEinheitVerifier {
private readonly organisationsEinheitPage: OrganisationsEinheitPage = new OrganisationsEinheitPage();
private readonly organisationsEinheitList: OrganisationsEinheitListE2EComponent = this.organisationsEinheitPage.getList();
public verifyOrganisationsEinheitInList(name: string): void {
exist(this.organisationsEinheitList.getListItem(convertToDataTestId(name)).getRoot());
}
public verifyOrganisationsEinheitNotInList(name: string): void {
notExist(this.organisationsEinheitList.getListItem(convertToDataTestId(name)).getRoot());
}
}
export enum OrganisationsEinheitE2E {
ORDNUNGSAMT = 'Ordnungsamt',
BAUAMT = 'Bauamt',
DENKMALPFLEGE = 'Denkmalpflege',
FUNDSTELLE = 'Fundstelle',
ORDNUNGSAMT = 'Ordnungsamt',
WIRTSCHAFTSFOERDERUNG = 'Wirtschaftsförderung',
}
......@@ -24,13 +24,13 @@
import { CurrentUserProfileE2EComponent } from '../components/user-profile/current-user-profile.component.e2e';
import { UserSettingsE2EComponent } from '../components/user-settings/user-settings.component.e2e';
//TODO Zu den Componenten packen, nicht zu den page-objects
export class HeaderE2EComponent {
private readonly locatorLogo: string = 'logo-link';
private readonly locatorRoot: string = 'header';
private readonly userSettings: UserSettingsE2EComponent = new UserSettingsE2EComponent();
private readonly currentUserProfile: CurrentUserProfileE2EComponent =
new CurrentUserProfileE2EComponent();
private readonly currentUserProfile: CurrentUserProfileE2EComponent = new CurrentUserProfileE2EComponent();
public getRoot() {
return cy.getTestElement(this.locatorRoot);
......
//TODO Das sollte eher eine Component als eine Page sein
export class LoginPage {
private readonly locatorLogin: string = '#kc-login';
private readonly locatorBarrierefreiheitLink: string = '#kc-barrierefreiheit';
......
import { OrganisationsEinheitListE2EComponent } from '../components/organisationseinheiten/organisationseinheiten.e2e.component';
export class OrganisationsEinheitPage {
private readonly addButton: string = 'add-organisationseinheit-button';
private readonly list: OrganisationsEinheitListE2EComponent = new OrganisationsEinheitListE2EComponent();
public getAddButton(): Cypress.Chainable<Element> {
return cy.getTestElement(this.addButton);
}
public getList(): OrganisationsEinheitListE2EComponent {
return this.list;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment