From 205a30249b552e37cd111aaff3d1ad2cac2d04bf Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Tue, 19 Nov 2024 12:49:09 +0100 Subject: [PATCH] OZG-6967 update for PR --- ...sationseinheiten-signatur.e2e.component.ts | 14 ++++---- .../organisationseinheiten.e2e.component.ts | 16 ++++----- .../benutzer_rollen/benutzer_rollen.cy.ts | 12 +++---- .../postfach/postfach-signatur.cy.ts | 18 +++++----- .../e2e/main-tests/postfach/signatur.cy.ts | 34 ------------------- .../organisationseinheiten-laden.cy.ts | 10 +++--- .../organisationseinheiten-signaturen.cy.ts | 10 +++--- .../admin-e2e/src/page-objects/main.po.ts | 6 ++-- .../admin-e2e/src/support/cypress-tasks.ts | 8 ++--- .../admin-e2e/src/support/cypress.util.ts | 4 +++ .../src/support/organisationseinheit.ts | 9 +++-- alfa-client/apps/alfa-e2e/.env | 1 - 12 files changed, 55 insertions(+), 87 deletions(-) delete mode 100644 alfa-client/apps/admin-e2e/src/e2e/main-tests/postfach/signatur.cy.ts delete mode 100644 alfa-client/apps/alfa-e2e/.env diff --git a/alfa-client/apps/admin-e2e/src/components/organisationseinheiten/organisationseinheiten-signatur.e2e.component.ts b/alfa-client/apps/admin-e2e/src/components/organisationseinheiten/organisationseinheiten-signatur.e2e.component.ts index cebd7aa2c9..695156b2fc 100644 --- a/alfa-client/apps/admin-e2e/src/components/organisationseinheiten/organisationseinheiten-signatur.e2e.component.ts +++ b/alfa-client/apps/admin-e2e/src/components/organisationseinheiten/organisationseinheiten-signatur.e2e.component.ts @@ -1,15 +1,15 @@ -import { haveValue, typeText } from '../../support/cypress.util'; +import { clearText, haveValue, typeText } from '../../support/cypress.util'; export class OrganisationseinheitenSignaturE2EComponent { - private readonly OrganisationsEinheitName: 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 getOrganisationsEinheitName(): Cypress.Chainable<Element> { - return cy.getTestElement(this.OrganisationsEinheitName).should('exist'); + return cy.getTestElement(this.organisationsEinheitName).should('exist'); } - public getSignaturText(): any { + public getSignaturText(): Cypress.Chainable<Element> { return cy.getTestElement(this.signaturText); } @@ -19,7 +19,7 @@ export class OrganisationseinheitenSignaturE2EComponent { } public clearSignatur(): void { - this.getSignaturText().type('{selectAll}{del}'); + clearText(this.getSignaturText); } public getSaveButton(): Cypress.Chainable<Element> { @@ -30,11 +30,11 @@ export class OrganisationseinheitenSignaturE2EComponent { this.getSaveButton().click(); } - public signatureIs(compare: string): void { + public hasSignature(compare: string): void { haveValue(this.getSignaturText(), compare); } - public scrollbarIsPresent(): void { + public hasScrollbar(): void { this.getSignaturText().then((textarea) => { const scrollHeight = textarea[0].scrollHeight; const clientHeight = textarea[0].clientHeight; diff --git a/alfa-client/apps/admin-e2e/src/components/organisationseinheiten/organisationseinheiten.e2e.component.ts b/alfa-client/apps/admin-e2e/src/components/organisationseinheiten/organisationseinheiten.e2e.component.ts index a20594d9fa..7e535d5b82 100644 --- a/alfa-client/apps/admin-e2e/src/components/organisationseinheiten/organisationseinheiten.e2e.component.ts +++ b/alfa-client/apps/admin-e2e/src/components/organisationseinheiten/organisationseinheiten.e2e.component.ts @@ -1,23 +1,23 @@ import { notContainClass } from '../../support/cypress.util'; 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 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 getOrganisationsEinheitTable(): Cypress.Chainable<Element> { - return cy.getTestElement(this.OrganisationsEinheitenList).should('exist'); + public getOrganisationsEinheitList(): Cypress.Chainable<Element> { + return cy.getTestElement(this.organisationsEinheitenList).should('exist'); } public getListItemByName(name: string): Cypress.Chainable<JQuery<HTMLElement>> { - return cy.getTestElement(this.OrganisationsEinheitenName).contains(name).should('exist'); + return cy.getTestElement(this.organisationsEinheitenName).contains(name).should('exist'); } - public clickOrganisationsEinheit(name: string): void { + public openOrganisationsEinheit(name: string): void { this.getListItemByName(name).click(); } @@ -25,7 +25,7 @@ export class OrganisationsEinheitenE2EComponent { this.getListItemByName(name) .parents('a') .within(() => { - cy.getTestElement(this.OrganisationsEinheitenID).should('have.text', id); + cy.getTestElement(this.organisationsEinheitenID).should('have.text', id); }); } diff --git a/alfa-client/apps/admin-e2e/src/e2e/main-tests/benutzer_rollen/benutzer_rollen.cy.ts b/alfa-client/apps/admin-e2e/src/e2e/main-tests/benutzer_rollen/benutzer_rollen.cy.ts index 980f009afc..9323a2db3a 100644 --- a/alfa-client/apps/admin-e2e/src/e2e/main-tests/benutzer_rollen/benutzer_rollen.cy.ts +++ b/alfa-client/apps/admin-e2e/src/e2e/main-tests/benutzer_rollen/benutzer_rollen.cy.ts @@ -8,9 +8,9 @@ const benutzerPage: BenutzerE2EComponent = new BenutzerE2EComponent(); const role1: string = 'VERWALTUNG_USER'; const role2: string = 'VERWALTUNG_LOESCHEN'; const role3: string = 'VERWALTUNG_POSTSTELLE'; -const organisationsEinheitName1: string = 'Ordnungsamt'; -const organisationsEinheitName2: string = 'Denkmalpflege'; -const organisationsEinheitName3: string = 'Wirtschaftsförderung'; +const organistationsEinheitOrdnungsamt: string = 'Ordnungsamt'; +const organisationsEinheitDenkmalpflege: string = 'Denkmalpflege'; +const organisationsEinheitWirtschaftsfoerderung: string = 'Wirtschaftsförderung'; const organisationsEinheitNone: string = 'keine zuständige Stelle zugewiesen'; const emailAddress: string = 'peter.von.der.post@ozg-sh.de'; @@ -28,11 +28,11 @@ describe('Benutzer und Rollen', () => { it('should show users and attributes in table', () => { exist(benutzerPage.getUserEntry('ariane')); benutzerPage.stringExistsInUserEntry(role1, 'dorothea'); - benutzerPage.stringExistsInUserEntry(organisationsEinheitName1, 'ludwig'); + benutzerPage.stringExistsInUserEntry(organistationsEinheitOrdnungsamt, 'ludwig'); benutzerPage.stringExistsInUserEntry(role1, 'zelda'); benutzerPage.stringExistsInUserEntry(role2, 'ludwig'); - benutzerPage.stringExistsInUserEntry(organisationsEinheitName2, 'zelda'); - benutzerPage.stringExistsInUserEntry(organisationsEinheitName3, 'zelda'); + benutzerPage.stringExistsInUserEntry(organisationsEinheitDenkmalpflege, 'zelda'); + benutzerPage.stringExistsInUserEntry(organisationsEinheitWirtschaftsfoerderung, 'zelda'); benutzerPage.stringExistsInUserEntry(organisationsEinheitNone, 'richard'); benutzerPage.stringExistsInUserEntry(emailAddress, 'peter'); benutzerPage.stringExistsInUserEntry(role3, 'peter'); diff --git a/alfa-client/apps/admin-e2e/src/e2e/main-tests/postfach/postfach-signatur.cy.ts b/alfa-client/apps/admin-e2e/src/e2e/main-tests/postfach/postfach-signatur.cy.ts index 866d75ce0a..93efa8d8ba 100644 --- a/alfa-client/apps/admin-e2e/src/e2e/main-tests/postfach/postfach-signatur.cy.ts +++ b/alfa-client/apps/admin-e2e/src/e2e/main-tests/postfach/postfach-signatur.cy.ts @@ -4,7 +4,7 @@ import { exist } from '../../../support/cypress.util'; import { loginAsAriane } from '../../../support/user-util'; describe('Signatur', () => { - const postfachTab: PostfachE2EComponent = new PostfachE2EComponent(); + const postfach: PostfachE2EComponent = new PostfachE2EComponent(); const signaturText: string = 'Signatur\nmit\n\n\n\nZeilenumbruch\n\n'; @@ -14,21 +14,21 @@ describe('Signatur', () => { it('should show Postfach page', () => { waitForSpinnerToDisappear(); - exist(postfachTab.getSignaturText()); + exist(postfach.getSignaturText()); }); it('should show signature input with scrollbar', () => { - postfachTab.setSignatur(signaturText); - postfachTab.saveSignatur(); + postfach.setSignatur(signaturText); + postfach.saveSignatur(); - postfachTab.signatureIs(signaturText); - postfachTab.scrollbarIsPresent(); + postfach.signatureIs(signaturText); + postfach.scrollbarIsPresent(); }); it('should enter an save empty signature', () => { - postfachTab.clearSignatur(); - postfachTab.saveSignatur(); + postfach.clearSignatur(); + postfach.saveSignatur(); - postfachTab.signatureIs(''); + postfach.signatureIs(''); }); }); diff --git a/alfa-client/apps/admin-e2e/src/e2e/main-tests/postfach/signatur.cy.ts b/alfa-client/apps/admin-e2e/src/e2e/main-tests/postfach/signatur.cy.ts deleted file mode 100644 index 866d75ce0a..0000000000 --- a/alfa-client/apps/admin-e2e/src/e2e/main-tests/postfach/signatur.cy.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { PostfachE2EComponent } from '../../../components/postfach/postfach.e2e.component'; -import { waitForSpinnerToDisappear } from '../../../page-objects/main.po'; -import { exist } from '../../../support/cypress.util'; -import { loginAsAriane } from '../../../support/user-util'; - -describe('Signatur', () => { - const postfachTab: PostfachE2EComponent = new PostfachE2EComponent(); - - const signaturText: string = 'Signatur\nmit\n\n\n\nZeilenumbruch\n\n'; - - before(() => { - loginAsAriane(); - }); - - it('should show Postfach page', () => { - waitForSpinnerToDisappear(); - exist(postfachTab.getSignaturText()); - }); - - it('should show signature input with scrollbar', () => { - postfachTab.setSignatur(signaturText); - postfachTab.saveSignatur(); - - postfachTab.signatureIs(signaturText); - postfachTab.scrollbarIsPresent(); - }); - - it('should enter an save empty signature', () => { - postfachTab.clearSignatur(); - postfachTab.saveSignatur(); - - postfachTab.signatureIs(''); - }); -}); diff --git a/alfa-client/apps/admin-e2e/src/e2e/organisationseinheiten/organisationseinheiten-laden.cy.ts b/alfa-client/apps/admin-e2e/src/e2e/organisationseinheiten/organisationseinheiten-laden.cy.ts index 6c57cb56d4..024419213e 100644 --- a/alfa-client/apps/admin-e2e/src/e2e/organisationseinheiten/organisationseinheiten-laden.cy.ts +++ b/alfa-client/apps/admin-e2e/src/e2e/organisationseinheiten/organisationseinheiten-laden.cy.ts @@ -1,7 +1,7 @@ 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'; +import { OrganisationsEinheitSyncResultE2E } from '../../support/organisationseinheit'; import { createBauamtOrganisationsEinheit, createDenkmalpflegeOrganisationsEinheit, @@ -18,16 +18,16 @@ describe('show Organisationsheiten', () => { loginAsAriane(); initOrganisationsEinheiten([ createBauamtOrganisationsEinheit(), - { ...createDenkmalpflegeOrganisationsEinheit(), syncResult: AdminOrganisationsEinheitSyncResultE2E.NAME_MISMATCH }, - { ...createFundstelleOrganisationsEinheit(), syncResult: AdminOrganisationsEinheitSyncResultE2E.NOT_FOUND_IN_PVOG }, + { ...createDenkmalpflegeOrganisationsEinheit(), syncResult: OrganisationsEinheitSyncResultE2E.NAME_MISMATCH }, + { ...createFundstelleOrganisationsEinheit(), syncResult: OrganisationsEinheitSyncResultE2E.NOT_FOUND_IN_PVOG }, ]); }); it('should show table of Organisationseinheiten', () => { waitForSpinnerToDisappear(); - mainPage.clickOrganisationsEinheitenTab(); + mainPage.openOrganisationsEinheiten(); - exist(organisationsEinheitenTab.getOrganisationsEinheitTable()); + exist(organisationsEinheitenTab.getOrganisationsEinheitList()); }); it('should show identical data in Keycloak and PVOG without error', () => { diff --git a/alfa-client/apps/admin-e2e/src/e2e/organisationseinheiten/organisationseinheiten-signaturen.cy.ts b/alfa-client/apps/admin-e2e/src/e2e/organisationseinheiten/organisationseinheiten-signaturen.cy.ts index 652c0aa730..31bc691609 100644 --- a/alfa-client/apps/admin-e2e/src/e2e/organisationseinheiten/organisationseinheiten-signaturen.cy.ts +++ b/alfa-client/apps/admin-e2e/src/e2e/organisationseinheiten/organisationseinheiten-signaturen.cy.ts @@ -17,8 +17,8 @@ describe('Signatur', () => { it('should open signature page for Bauamt on click', () => { waitForSpinnerToDisappear(); - mainPage.clickOrganisationsEinheitenTab(); - organisationsEinheitenTab.clickOrganisationsEinheit('Bauamt'); + mainPage.openOrganisationsEinheiten(); + organisationsEinheitenTab.openOrganisationsEinheit('Bauamt'); haveText(signaturePage.getOrganisationsEinheitName(), 'Bauamt'); }); @@ -27,14 +27,14 @@ describe('Signatur', () => { signaturePage.setSignatur(signaturText); signaturePage.saveSignatur(); - signaturePage.signatureIs(signaturText); - signaturePage.scrollbarIsPresent(); + signaturePage.hasSignature(signaturText); + signaturePage.hasScrollbar(); }); it.skip('should enter and save empty signature', () => { signaturePage.clearSignatur(); signaturePage.saveSignatur(); - signaturePage.signatureIs(''); + signaturePage.hasSignature(''); }); }); diff --git a/alfa-client/apps/admin-e2e/src/page-objects/main.po.ts b/alfa-client/apps/admin-e2e/src/page-objects/main.po.ts index f204fd70d2..90dde9a281 100644 --- a/alfa-client/apps/admin-e2e/src/page-objects/main.po.ts +++ b/alfa-client/apps/admin-e2e/src/page-objects/main.po.ts @@ -24,12 +24,12 @@ export class MainPage { this.getBenutzerTab().click(); } - public getOrganisationsEinheitenTab(): Cypress.Chainable<Element> { + public getOrganisationsEinheitenMenu(): Cypress.Chainable<Element> { return cy.getTestElement(this.organisationsEinheitenTab); } - public clickOrganisationsEinheitenTab(): void { - this.getOrganisationsEinheitenTab().click(); + public openOrganisationsEinheiten(): void { + this.getOrganisationsEinheitenMenu().click(); } } diff --git a/alfa-client/apps/admin-e2e/src/support/cypress-tasks.ts b/alfa-client/apps/admin-e2e/src/support/cypress-tasks.ts index d3bc28d43d..3d4769f109 100644 --- a/alfa-client/apps/admin-e2e/src/support/cypress-tasks.ts +++ b/alfa-client/apps/admin-e2e/src/support/cypress-tasks.ts @@ -137,14 +137,14 @@ function handleInsertMany(connection, error) { connection.close(); } -function createObjectId(field) { - return new ObjectId(field._id.$oid); -} - function parseOrganisationsEinheit(organisationsEinheit) { organisationsEinheit._id = createObjectId(organisationsEinheit); } +function createObjectId(field) { + return new ObjectId(field._id.$oid); +} + function parseOrganisationsEinheitData(data) { data.forEach((organisationsEinheit) => parseOrganisationsEinheit(organisationsEinheit)); return data; diff --git a/alfa-client/apps/admin-e2e/src/support/cypress.util.ts b/alfa-client/apps/admin-e2e/src/support/cypress.util.ts index 4b45f922ab..8eb3e6c0db 100644 --- a/alfa-client/apps/admin-e2e/src/support/cypress.util.ts +++ b/alfa-client/apps/admin-e2e/src/support/cypress.util.ts @@ -113,6 +113,10 @@ export function backspaceOn(element: Cypress.Chainable<Element>): void { element.type(CypressKeyboardActions.BACKSPACE); } +export function clearText(element: Cypress.Chainable<Element>): void { + element.type('{selectAll}{del}'); +} + enum CypressKeyboardActions { ENTER = '{enter}', BACKSPACE = '{backspace}', diff --git a/alfa-client/apps/admin-e2e/src/support/organisationseinheit.ts b/alfa-client/apps/admin-e2e/src/support/organisationseinheit.ts index 30dcac11b6..2a2850ca1e 100644 --- a/alfa-client/apps/admin-e2e/src/support/organisationseinheit.ts +++ b/alfa-client/apps/admin-e2e/src/support/organisationseinheit.ts @@ -4,12 +4,11 @@ export class OrganisationsEinheitE2E { _id: ObjectIdE2E; name: string; organisationsEinheitId: string; - syncResult: AdminOrganisationsEinheitSyncResultE2E; - settings: AdminOrganisationsEinheitSettingsE2E; - isChild: boolean; + syncResult: OrganisationsEinheitSyncResultE2E; + settings: OrganisationsEinheitSettingsE2E; } -export enum AdminOrganisationsEinheitSyncResultE2E { +export enum OrganisationsEinheitSyncResultE2E { OK = 'OK', NOT_FOUND_IN_PVOG = 'NOT_FOUND_IN_PVOG', NAME_MISMATCH = 'NAME_MISMATCH', @@ -17,6 +16,6 @@ export enum AdminOrganisationsEinheitSyncResultE2E { DELETED = 'DELETED', } -export class AdminOrganisationsEinheitSettingsE2E { +export class OrganisationsEinheitSettingsE2E { signatur: string; } diff --git a/alfa-client/apps/alfa-e2e/.env b/alfa-client/apps/alfa-e2e/.env deleted file mode 100644 index 20e88a4259..0000000000 --- a/alfa-client/apps/alfa-e2e/.env +++ /dev/null @@ -1 +0,0 @@ -USER_MANAGER_DOCKER_IMAGE:march-snapshot-latest \ No newline at end of file -- GitLab