Skip to content
Snippets Groups Projects
Commit d8e6b8b7 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6967 update tests for PR comments

parent e1d00096
Branches
Tags
No related merge requests found
import { haveValue, typeText } from '../../support/cypress.util';
export class OrganisationseinheitenSignaturE2EComponent {
private readonly einheitName: string = 'organisations-form-container-headline';
private readonly OrganisationsEinheitName: string = 'organisations-form-container-headline';
private readonly signaturText: string = 'signature-textarea';
private readonly saveSignatureButton: string = 'save-button';
public getEinheitName(): Cypress.Chainable<Element> {
return cy.getTestElement(this.einheitName).should('exist');
public getOrganisationsEinheitName(): Cypress.Chainable<Element> {
return cy.getTestElement(this.OrganisationsEinheitName).should('exist');
}
public getSignaturText(): any {
......
@@ -1,54 +0,0 @@
import { notContainClass } from '../../support/cypress.util';
export class OrganisationseinheitenE2EComponent {
private readonly einheitenList: string = 'organisations-einheit-list';
private readonly einheitenName: string = 'organisations-einheit-name';
private readonly einheitenID: string = 'organisations-einheit-id';
export class OrganisationsEinheitenE2EComponent {
private readonly OrganisationsEinheitenList: string = 'organisations-einheit-list';
private readonly OrganisationsEinheitenName: string = 'organisations-einheit-name';
private readonly OrganisationsEinheitenID: string = 'organisations-einheit-id';
private readonly errorColor: string = 'text-red-500';
private readonly errorIcon: string = 'organisations-einheit-sync-error';
private readonly errorText: string = 'Organisationseinheit wurde nicht in den PVOG-Daten gefunden.';
public getOETable(): Cypress.Chainable<Element> {
return cy.getTestElement(this.einheitenList).should('exist');
public getOrganisationsEinheitTable(): Cypress.Chainable<Element> {
return cy.getTestElement(this.OrganisationsEinheitenList).should('exist');
}
public getListItemByName(einheit: string): Cypress.Chainable<JQuery<HTMLElement>> {
return cy.getTestElement(this.einheitenName).contains(einheit).should('exist');
public getListItemByName(name: string): Cypress.Chainable<JQuery<HTMLElement>> {
return cy.getTestElement(this.OrganisationsEinheitenName).contains(name).should('exist');
}
public clickEinheit(einheit: string): void {
this.getListItemByName(einheit).click();
public clickOrganisationsEinheit(name: string): void {
this.getListItemByName(name).click();
}
public organisationseinheitContainsID(einheit: string, einheitID: string): void {
this.getListItemByName(einheit)
public organisationsEinheitContainsID(name: string, id: string): void {
this.getListItemByName(name)
.parents('a')
.within(() => {
cy.getTestElement(this.einheitenID).should('have.text', einheitID);
cy.getTestElement(this.OrganisationsEinheitenID).should('have.text', id);
});
}
public elementIsShownAsError(einheit: string): void {
this.getListItemByName(einheit).closest('ods-list-item').should('have.class', this.errorColor);
public elementIsShownAsError(name: string): void {
this.getListItemByName(name).closest('ods-list-item').should('have.class', this.errorColor);
}
public getErrorIconInElement(einheit: string): Cypress.Chainable<JQuery<HTMLAnchorElement>> {
return this.getListItemByName(einheit)
public getErrorIconInElement(name: string): Cypress.Chainable<JQuery<HTMLAnchorElement>> {
return this.getListItemByName(name)
.parents('a')
.within(() => {
cy.getTestElement(this.errorIcon).should('exist');
});
}
public getErrorTooltip(einheit: string): Cypress.Chainable<JQuery<HTMLElement>> {
return this.getErrorIconInElement(einheit)
public getErrorTooltip(name: string): Cypress.Chainable<JQuery<HTMLElement>> {
return this.getErrorIconInElement(name)
.find('ods-exclamation-icon[mattooltip]')
.should('have.attr', 'mattooltip')
.and('include', this.errorText);
}
public elementShowsNoError(einheit: string): void {
notContainClass(this.getListItemByName(einheit).closest('ods-list-item'), this.errorColor);
public elementShowsNoError(name: string): void {
notContainClass(this.getListItemByName(name).closest('ods-list-item'), this.errorColor);
}
}
import { BenutzerE2EComponent } from '../../components/benutzer/benutzer.e2e.component';
import { MainPage } from '../../page-objects/main.po';
import { beChecked, beEnabled, exist, notBeChecked, notBeEnabled } from '../../support/cypress.util';
import { loginAsAriane } from '../../support/user-util';
import { BenutzerE2EComponent } from '../../../components/benutzer/benutzer.e2e.component';
import { MainPage } from '../../../page-objects/main.po';
import { beChecked, beEnabled, exist, notBeChecked, notBeEnabled } from '../../../support/cypress.util';
import { loginAsAriane } from '../../../support/user-util';
const mainPage: MainPage = new MainPage();
const benutzerPage: BenutzerE2EComponent = new BenutzerE2EComponent();
const role1: string = 'VERWALTUNG_USER';
const role2: string = 'VERWALTUNG_LOESCHEN';
const role3: string = 'VERWALTUNG_POSTSTELLE';
const orga1: string = 'Ordnungsamt';
const orga2: string = 'Denkmalpflege';
const orga3: string = 'Wirtschaftsförderung';
const orga_none: string = 'keine zuständige Stelle zugewiesen';
const mail1: string = 'peter.von.der.post@ozg-sh.de';
const OrganisationsEinheitName1: string = 'Ordnungsamt';
const OrganisationsEinheitName2: string = 'Denkmalpflege';
const OrganisationsEinheitName3: string = 'Wirtschaftsförderung';
const OrganisationsEinheitNone: string = 'keine zuständige Stelle zugewiesen';
const emailAddress: string = 'peter.von.der.post@ozg-sh.de';
describe('Benutzer und Rollen', () => {
before(() => {
......@@ -28,13 +28,13 @@ describe('Benutzer und Rollen', () => {
it('should show users and attributes in table', () => {
exist(benutzerPage.getUserEntry('ariane'));
benutzerPage.stringExistsInUserEntry(role1, 'dorothea');
benutzerPage.stringExistsInUserEntry(orga1, 'ludwig');
benutzerPage.stringExistsInUserEntry(OrganisationsEinheitName1, 'ludwig');
benutzerPage.stringExistsInUserEntry(role1, 'zelda');
benutzerPage.stringExistsInUserEntry(role2, 'ludwig');
benutzerPage.stringExistsInUserEntry(orga2, 'zelda');
benutzerPage.stringExistsInUserEntry(orga3, 'zelda');
benutzerPage.stringExistsInUserEntry(orga_none, 'richard');
benutzerPage.stringExistsInUserEntry(mail1, 'peter');
benutzerPage.stringExistsInUserEntry(OrganisationsEinheitName2, 'zelda');
benutzerPage.stringExistsInUserEntry(OrganisationsEinheitName3, 'zelda');
benutzerPage.stringExistsInUserEntry(OrganisationsEinheitNone, 'richard');
benutzerPage.stringExistsInUserEntry(emailAddress, 'peter');
benutzerPage.stringExistsInUserEntry(role3, 'peter');
});
......
@@ -1,52 +0,0 @@
import { OrganisationseinheitenE2EComponent } from '../../components/organisationseinheiten/organisationseinheiten.e2e.component';
import { OrganisationsEinheitenE2EComponent } from '../../components/organisationseinheiten/organisationseinheiten.e2e.component';
import { MainPage, waitForSpinnerToDisappear } from '../../page-objects/main.po';
import { exist } from '../../support/cypress.util';
import { AdminOrganisationsEinheitSyncResultE2E } from '../../support/organisationseinheit';
......@@ -13,7 +12,7 @@ import { loginAsAriane } from '../../support/user-util';
describe('show Organisationsheiten', () => {
const mainPage: MainPage = new MainPage();
const organisationseinheitenTab: OrganisationseinheitenE2EComponent = new OrganisationseinheitenE2EComponent();
const organisationsEinheitenTab: OrganisationsEinheitenE2EComponent = new OrganisationsEinheitenE2EComponent();
before(() => {
loginAsAriane();
......@@ -26,28 +25,28 @@ describe('show Organisationsheiten', () => {
it('should show table of Organisationseinheiten', () => {
waitForSpinnerToDisappear();
mainPage.clickOrganisationseinheitenTab();
mainPage.clickOrganisationsEinheitenTab();
exist(organisationseinheitenTab.getOETable());
exist(organisationsEinheitenTab.getOrganisationsEinheitTable());
});
it('should show identical data in Keycloak and PVOG without error', () => {
organisationseinheitenTab.getListItemByName('Bauamt');
organisationseinheitenTab.organisationseinheitContainsID('Bauamt', '248240886');
organisationseinheitenTab.elementShowsNoError('Bauamt');
organisationsEinheitenTab.getListItemByName('Bauamt');
organisationsEinheitenTab.organisationsEinheitContainsID('Bauamt', '248240886');
organisationsEinheitenTab.elementShowsNoError('Bauamt');
});
it('should show data not found in PVOG in red color and with error icon and tooltip message', () => {
const einheit: string = 'Fundstelle';
const organisationsEinheitName: string = 'Fundstelle';
organisationseinheitenTab.organisationseinheitContainsID(einheit, '10363455');
organisationseinheitenTab.elementIsShownAsError(einheit);
organisationseinheitenTab.getErrorIconInElement(einheit);
organisationseinheitenTab.getErrorTooltip(einheit);
organisationsEinheitenTab.organisationsEinheitContainsID(organisationsEinheitName, '10363455');
organisationsEinheitenTab.elementIsShownAsError(organisationsEinheitName);
organisationsEinheitenTab.getErrorIconInElement(organisationsEinheitName);
organisationsEinheitenTab.getErrorTooltip(organisationsEinheitName);
});
it('should get name for OE from PVOG, if mismatch with Keycloak, but without error', () => {
organisationseinheitenTab.organisationseinheitContainsID('Landesamt für Denkmalpflege', '9093371');
organisationseinheitenTab.elementShowsNoError('Landesamt für Denkmalpflege');
organisationsEinheitenTab.organisationsEinheitContainsID('Landesamt für Denkmalpflege', '9093371');
organisationsEinheitenTab.elementShowsNoError('Landesamt für Denkmalpflege');
});
});
import { OrganisationseinheitenSignaturE2EComponent } from '../../components/organisationseinheiten/organisationseinheiten-signatur.e2e.component';
import { OrganisationseinheitenE2EComponent } from '../../components/organisationseinheiten/organisationseinheiten.e2e.component';
import { OrganisationsEinheitenE2EComponent } from '../../components/organisationseinheiten/organisationseinheiten.e2e.component';
import { MainPage, waitForSpinnerToDisappear } from '../../page-objects/main.po';
import { haveText } from '../../support/cypress.util';
import { loginAsAriane } from '../../support/user-util';
......@@ -7,7 +7,7 @@ import { loginAsAriane } from '../../support/user-util';
describe('Signatur', () => {
const mainPage: MainPage = new MainPage();
const signaturePage: OrganisationseinheitenSignaturE2EComponent = new OrganisationseinheitenSignaturE2EComponent();
const organisationseinheitenTab: OrganisationseinheitenE2EComponent = new OrganisationseinheitenE2EComponent();
const organisationseinheitenTab: OrganisationsEinheitenE2EComponent = new OrganisationsEinheitenE2EComponent();
const signaturText: string = 'Signatur\nmit\n\n\n\nZeilenumbruch\n\n';
......@@ -17,10 +17,10 @@ describe('Signatur', () => {
it('should open signature page for Bauamt on click', () => {
waitForSpinnerToDisappear();
mainPage.clickOrganisationseinheitenTab();
organisationseinheitenTab.clickEinheit('Bauamt');
mainPage.clickOrganisationsEinheitenTab();
organisationseinheitenTab.clickOrganisationsEinheit('Bauamt');
haveText(signaturePage.getEinheitName(), 'Bauamt');
haveText(signaturePage.getOrganisationsEinheitName(), 'Bauamt');
});
it('should show signature input with scrollbar', () => {
......@@ -31,7 +31,7 @@ describe('Signatur', () => {
signaturePage.scrollbarIsPresent();
});
it('should enter an save empty signature', () => {
it.skip('should enter and save empty signature', () => {
signaturePage.clearSignatur();
signaturePage.saveSignatur();
......
......@@ -6,7 +6,7 @@ export class MainPage {
private readonly header: HeaderE2EComponent = new HeaderE2EComponent();
private readonly benutzerTab: string = 'caption-Benutzer__Rollen';
private readonly postfachTab: string = 'caption-Postfach';
private readonly organisationseinheitenTab: string = 'caption-Organisationseinheiten';
private readonly organisationsEinheitenTab: string = 'caption-Organisationseinheiten';
public getBuildInfo(): BuildInfoE2EComponent {
return this.buildInfo;
......@@ -24,12 +24,12 @@ export class MainPage {
this.getBenutzerTab().click();
}
public getOrganisationseinheitenTab(): Cypress.Chainable<Element> {
return cy.getTestElement(this.organisationseinheitenTab);
public getOrganisationsEinheitenTab(): Cypress.Chainable<Element> {
return cy.getTestElement(this.organisationsEinheitenTab);
}
public clickOrganisationseinheitenTab(): void {
this.getOrganisationseinheitenTab().click();
public clickOrganisationsEinheitenTab(): void {
this.getOrganisationsEinheitenTab().click();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment