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 cebd7aa2c967d2cae2897936b00f563d37ae6738..695156b2fc18b7cea63df6c52791f04ade9da0bd 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 a20594d9fa0c7ad650e1726381837ad17e1b48b8..7e535d5b824d7ce4f6c406d7eca9a0ea0aa6390d 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 980f009afc865e47e4b395e06baefe6e137362ff..9323a2db3aed63fe537d57e4430030b273febff0 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 866d75ce0a307701e1e2dee0be1dad17f6b593e0..93efa8d8ba0639d999fbcdaf9f2387426ed61291 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 866d75ce0a307701e1e2dee0be1dad17f6b593e0..0000000000000000000000000000000000000000 --- 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 6c57cb56d4d26b53db3658f2b23e79de4ecf1d0d..024419213edd7e67280c2fc9893d6864fd2469df 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 652c0aa730e5487396ba298f8bca7e6ae30c7f47..31bc691609532f43d99d1a066a28b3778d184636 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 f204fd70d224b0b92bef485c05b3f0ca04406dca..90dde9a2818eb8e3d0ea43e55aa80c768262adbb 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 d3bc28d43dc56ab8ee5a94af29f702a3bce66104..3d4769f1095fa7cf54b1fe0992618b7458f9b173 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 4b45f922abb7e64be5329d03112af9769196c9fa..8eb3e6c0db0ea806a58eb30239dae08e51f382f4 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 30dcac11b68286faf90f1bfb4258e65685c15264..2a2850ca1ec05e4c53c0014df5fa689d98f6d1c1 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 20e88a42597b6912bdbededf9c5adb6b1e7162bc..0000000000000000000000000000000000000000 --- 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