diff --git a/alfa-client/apps/admin-e2e/src/components/postfach/postfach.e2e.component.ts b/alfa-client/apps/admin-e2e/src/components/postfach/postfach.e2e.component.ts index 62527711781b022092af5336db78779b0df2c914..f177cf791efec0113ceaebf9d6098e2008bc21f9 100644 --- a/alfa-client/apps/admin-e2e/src/components/postfach/postfach.e2e.component.ts +++ b/alfa-client/apps/admin-e2e/src/components/postfach/postfach.e2e.component.ts @@ -21,19 +21,24 @@ * Die sprachspezifischen Genehmigungen und Beschränkungen * unter der Lizenz sind dem Lizenztext zu entnehmen. */ -import { haveValue, typeText } from '../../support/cypress.util'; +import { haveValue } from '../../support/cypress.util'; export class PostfachE2EComponent { + private readonly headline: string = 'headline'; private readonly signaturText: string = 'signature-textarea'; private readonly saveSignaturButton: string = 'save-button'; + public getHeadline(): any { + return cy.getTestElement(this.headline); + } + public getSignaturText(): any { return cy.getTestElement(this.signaturText); } public setSignatur(signatur: string): void { this.clearSignatur(); - typeText(this.getSignaturText(), signatur); + this.getSignaturText().type(signatur); } public clearSignatur(): void { diff --git a/alfa-client/apps/admin-e2e/src/components/zustaendige-stelle/zustaendige-stelle-dialog.e2e.component.ts b/alfa-client/apps/admin-e2e/src/components/zustaendige-stelle/zustaendige-stelle-dialog.e2e.component.ts index 337cad0fe51c3ba1e7bf0b1123e8f324c57dbc73..6bd293d6fc2c39febbea6bfef0fb4e66de7e22b6 100644 --- a/alfa-client/apps/admin-e2e/src/components/zustaendige-stelle/zustaendige-stelle-dialog.e2e.component.ts +++ b/alfa-client/apps/admin-e2e/src/components/zustaendige-stelle/zustaendige-stelle-dialog.e2e.component.ts @@ -1,5 +1,3 @@ -import { typeText } from '../../support/cypress.util'; - export class ZustaendigeStelleDialogE2EComponent { private readonly locatorZustaendigeStelleForm: string = 'search-organisations-einheit'; private readonly locatorSearchInput: string = 'instant_search-text-input'; @@ -15,7 +13,7 @@ export class ZustaendigeStelleDialogE2EComponent { } public enterSearchTerm(searchTerm: string): void { - typeText(this.getSearchInput(), searchTerm); + this.getSearchInput().type(searchTerm); } public countSearchEntries(): Cypress.Chainable<number> { 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 15f015c750247dfe536e92c91ac924299c042c1d..f39ed75f138024cdb3f0273716714e75134aade1 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 @@ -47,7 +47,7 @@ describe('Benutzer und Rollen', () => { it('should show users and attributes in list', () => { helper.openBenutzerListPage(); - const ariane: BenutzerListItemE2EComponent = benutzerListPage.getItem(AlfaUsers.ARAINE); + const ariane: BenutzerListItemE2EComponent = benutzerListPage.getItem(AlfaUsers.ARIANE); exist(ariane.getRoot()); contains(ariane.getRoles(), AlfaRollen.USER); @@ -76,14 +76,9 @@ describe('Benutzer und Rollen', () => { exist(richard.getNoOrganisationsEinheitText()); }); - it('should show single user screen on click', () => { + it('should show checkbox for each role', () => { helper.openNewBenutzerPage(); - exist(benutzerPage.getVornameInput()); - exist(benutzerPage.getNachnameInput()); - exist(benutzerPage.getBenutzernameInput()); - exist(benutzerPage.getMailInput()); - notBeChecked(benutzerPage.getAdminCheckbox()); notBeChecked(benutzerPage.getDatenbeauftragungCheckbox()); notBeChecked(benutzerPage.getLoeschenCheckbox()); @@ -91,7 +86,7 @@ describe('Benutzer und Rollen', () => { notBeChecked(benutzerPage.getPostCheckbox()); }); - it('should activate loeschen checkbox and deactivate the other two checkboxes', () => { + it('should deactivate other alfa roles if "loeschen" role is selected', () => { benutzerPage.getLoeschenCheckbox().click(); beChecked(benutzerPage.getLoeschenCheckbox()); notBeEnabled(benutzerPage.getUserCheckbox()); @@ -103,22 +98,7 @@ describe('Benutzer und Rollen', () => { beEnabled(benutzerPage.getPostCheckbox()); }); - it('should additionally activate and deactivate admin checkbox', () => { - benutzerPage.getLoeschenCheckbox().click(); - benutzerPage.getAdminCheckbox().click(); - benutzerPage.getDatenbeauftragungCheckbox().click(); - beChecked(benutzerPage.getLoeschenCheckbox()); - beChecked(benutzerPage.getAdminCheckbox()); - beChecked(benutzerPage.getDatenbeauftragungCheckbox()); - - benutzerPage.getAdminCheckbox().click(); - notBeChecked(benutzerPage.getLoeschenCheckbox()); - notBeChecked(benutzerPage.getAdminCheckbox()); - notBeChecked(benutzerPage.getDatenbeauftragungCheckbox()); - }); - - it('should activate user checkbox and deactivate the other two checkboxes', () => { - benutzerPage.getLoeschenCheckbox().click(); + it('should deactivate other alfa roles if "user" role is selected', () => { benutzerPage.getUserCheckbox().click(); beChecked(benutzerPage.getUserCheckbox()); notBeEnabled(benutzerPage.getLoeschenCheckbox()); @@ -130,7 +110,7 @@ describe('Benutzer und Rollen', () => { beEnabled(benutzerPage.getPostCheckbox()); }); - it('should activate post checkbox and deactivate the other two checkboxes', () => { + it('should deactivate other alfa roles if "poststelle" role is selected', () => { benutzerPage.getPostCheckbox().click(); beChecked(benutzerPage.getPostCheckbox()); notBeEnabled(benutzerPage.getLoeschenCheckbox()); @@ -141,4 +121,16 @@ describe('Benutzer und Rollen', () => { beEnabled(benutzerPage.getLoeschenCheckbox()); beEnabled(benutzerPage.getUserCheckbox()); }); + + it('should activate and deactivate admin roles', () => { + benutzerPage.getAdminCheckbox().click(); + benutzerPage.getDatenbeauftragungCheckbox().click(); + beChecked(benutzerPage.getAdminCheckbox()); + beChecked(benutzerPage.getDatenbeauftragungCheckbox()); + + benutzerPage.getAdminCheckbox().click(); + benutzerPage.getDatenbeauftragungCheckbox().click(); + notBeChecked(benutzerPage.getAdminCheckbox()); + notBeChecked(benutzerPage.getDatenbeauftragungCheckbox()); + }); }); diff --git a/alfa-client/apps/admin-e2e/src/e2e/main-tests/navigation/ariane.cy.ts b/alfa-client/apps/admin-e2e/src/e2e/main-tests/navigation/ariane.cy.ts index fda055fd0d361a20edf8a96829b6859e07cc24b1..64218bf8c50d791ca4f221c518a454cc54df37fe 100644 --- a/alfa-client/apps/admin-e2e/src/e2e/main-tests/navigation/ariane.cy.ts +++ b/alfa-client/apps/admin-e2e/src/e2e/main-tests/navigation/ariane.cy.ts @@ -1,32 +1,34 @@ -import { MainPage, waitForSpinnerToDisappear } from 'apps/admin-e2e/src/page-objects/main.po'; -import { visitUrl } from 'apps/admin-e2e/src/support/cypress-helper'; -import { exist, notExist } from 'apps/admin-e2e/src/support/cypress.util'; +import { MainPage } from 'apps/admin-e2e/src/page-objects/main.po'; +import { containClass, exist, notExist } from 'apps/admin-e2e/src/support/cypress.util'; import { loginAsAriane } from 'apps/admin-e2e/src/support/user-util'; -describe('Navigation', () => { +describe('Ariane Navigation', () => { const mainPage: MainPage = new MainPage(); describe('with user ariane', () => { before(() => { loginAsAriane(); - - waitForSpinnerToDisappear(); }); it('should show benutzer navigation item', () => { exist(mainPage.getBenutzerNavigationItem()); }); - it('should show postfach navigation item', () => { - exist(mainPage.getPostfachNavigationItem()); - }); - it('should show organisationseinheiten navigation item', () => { exist(mainPage.getOrganisationEinheitNavigationItem()); }); + describe('postfach navigation item', () => { + it('should be visible', () => { + exist(mainPage.getPostfachNavigationItem()); + }); + + it('should be selected initial', () => { + containClass(mainPage.getPostfachNavigationItem(), 'border-selected'); + }); + }); + it('should hide statistik navigation item', () => { - visitUrl('/statistik'); notExist(mainPage.getStatistikNavigationItem()); }); }); diff --git a/alfa-client/apps/admin-e2e/src/e2e/main-tests/navigation/daria.cy.ts b/alfa-client/apps/admin-e2e/src/e2e/main-tests/navigation/daria.cy.ts index 33a06a73b83c3a839b0490f96aa17ddb42106994..4fda0a2dee6bfb74ad354a08e46f27ced5e15bc6 100644 --- a/alfa-client/apps/admin-e2e/src/e2e/main-tests/navigation/daria.cy.ts +++ b/alfa-client/apps/admin-e2e/src/e2e/main-tests/navigation/daria.cy.ts @@ -1,43 +1,34 @@ -import { MainPage, waitForSpinnerToDisappear } from 'apps/admin-e2e/src/page-objects/main.po'; -import { exist, notExist, visible } from 'apps/admin-e2e/src/support/cypress.util'; +import { MainPage } from 'apps/admin-e2e/src/page-objects/main.po'; +import { containClass, exist, notExist } from 'apps/admin-e2e/src/support/cypress.util'; import { loginAsDaria } from 'apps/admin-e2e/src/support/user-util'; -import { StatistikE2EComponent } from '../../../components/statistik/statistik.e2e.component'; -describe('Navigation', () => { +describe('Daria Navigation', () => { const mainPage: MainPage = new MainPage(); - const statistikPage: StatistikE2EComponent = new StatistikE2EComponent(); - describe('with user daria', () => { before(() => { loginAsDaria(); - - waitForSpinnerToDisappear(); }); - it('should hide other navigation item', () => { + it('should hide benutzer navigation item', () => { notExist(mainPage.getBenutzerNavigationItem()); }); - it('should hide postfach navigation item', () => { - notExist(mainPage.getPostfachNavigationItem()); - }); - it('should hide organisationseinheiten navigation item', () => { notExist(mainPage.getOrganisationEinheitNavigationItem()); }); - describe('statistik', () => { + it('should hide postfach navigation item', () => { + notExist(mainPage.getPostfachNavigationItem()); + }); + + describe('statistik navigation item', () => { it('should be visible', () => { exist(mainPage.getStatistikNavigationItem()); }); it('should be initial selected', () => { - mainPage.isStatistikNavigationItemSelected(); - }); - - it('should show header text', () => { - visible(statistikPage.getHeaderText()); + containClass(mainPage.getStatistikNavigationItem(), 'border-selected'); }); }); }); diff --git a/alfa-client/apps/admin-e2e/src/e2e/main-tests/navigation/safira.cy.ts b/alfa-client/apps/admin-e2e/src/e2e/main-tests/navigation/safira.cy.ts index 005da2e5a576948787fdeb1f26165bd250b22138..ae328f579e493b6c493a687da703269120bebbd5 100644 --- a/alfa-client/apps/admin-e2e/src/e2e/main-tests/navigation/safira.cy.ts +++ b/alfa-client/apps/admin-e2e/src/e2e/main-tests/navigation/safira.cy.ts @@ -1,50 +1,35 @@ -import { MainPage, waitForSpinnerToDisappear } from 'apps/admin-e2e/src/page-objects/main.po'; -import { exist, visible } from 'apps/admin-e2e/src/support/cypress.util'; +import { MainPage } from 'apps/admin-e2e/src/page-objects/main.po'; +import { containClass, exist } from 'apps/admin-e2e/src/support/cypress.util'; import { loginAsSafira } from 'apps/admin-e2e/src/support/user-util'; -import { StatistikE2EComponent } from '../../../components/statistik/statistik.e2e.component'; -describe('Navigation', () => { +describe('Safira Navigation', () => { const mainPage: MainPage = new MainPage(); - const statistikPage: StatistikE2EComponent = new StatistikE2EComponent(); - describe('with user safira', () => { before(() => { loginAsSafira(); - - waitForSpinnerToDisappear(); }); it('should show benutzer navigation item', () => { exist(mainPage.getBenutzerNavigationItem()); }); - it('should show postfach navigation item', () => { - exist(mainPage.getPostfachNavigationItem()); - }); - it('should show organisationseinheiten navigation item', () => { exist(mainPage.getOrganisationEinheitNavigationItem()); }); - describe('statistik', () => { + describe('postfach navigation item', () => { it('should be visible', () => { - exist(mainPage.getStatistikNavigationItem()); + exist(mainPage.getPostfachNavigationItem()); }); - describe('on selection', () => { - before(() => { - mainPage.clickStatistikNavigationItem(); - }); - - it('should show page on selection', () => { - visible(statistikPage.getHeaderText()); - }); - - it('should mark navigation item as selected', () => { - mainPage.isStatistikNavigationItemSelected(); - }); + it('should be selected initial', () => { + containClass(mainPage.getPostfachNavigationItem(), 'border-selected'); }); }); + + it('should show statistik navigation item', () => { + exist(mainPage.getStatistikNavigationItem()); + }); }); }); diff --git a/alfa-client/apps/admin-e2e/src/e2e/main-tests/organisationseinheiten/organisationseinheiten-hinzufuegen.cy.ts b/alfa-client/apps/admin-e2e/src/e2e/main-tests/organisationseinheiten/organisationseinheiten-hinzufuegen.cy.ts index c88d54bf3dac14f0f0a7b5f124a66e7d1e26d60f..ce01dec8af3d1dcb9404b260266af663b754b63e 100644 --- a/alfa-client/apps/admin-e2e/src/e2e/main-tests/organisationseinheiten/organisationseinheiten-hinzufuegen.cy.ts +++ b/alfa-client/apps/admin-e2e/src/e2e/main-tests/organisationseinheiten/organisationseinheiten-hinzufuegen.cy.ts @@ -18,7 +18,7 @@ describe('Organisationseinheiten', () => { it('should show table with Organisationseinheiten', () => { waitForSpinnerToDisappear(); - mainPage.clickOrganisationsEinheitenNavigationItem(); + mainPage.getOrganisationEinheitNavigationItem().click(); exist(organisationsEinheitenComponent.getOrganisationsEinheitHinzufuegenButton()); }); diff --git a/alfa-client/apps/admin-e2e/src/e2e/main-tests/organisationseinheiten/organisationseinheiten-laden.cy.ts b/alfa-client/apps/admin-e2e/src/e2e/main-tests/organisationseinheiten/organisationseinheiten-laden.cy.ts index 2b8eaeb70ab47d7845d24f973bac43f7645c25b2..e65e64480cdbff481e8939cd1e79187fc84efd37 100644 --- a/alfa-client/apps/admin-e2e/src/e2e/main-tests/organisationseinheiten/organisationseinheiten-laden.cy.ts +++ b/alfa-client/apps/admin-e2e/src/e2e/main-tests/organisationseinheiten/organisationseinheiten-laden.cy.ts @@ -36,7 +36,7 @@ describe('Organisationsheiten list', () => { it('should show Organisationseinheiten list', () => { waitForSpinnerToDisappear(); - mainPage.clickOrganisationsEinheitenNavigationItem(); + mainPage.getOrganisationEinheitNavigationItem().click(); waitForSpinnerToDisappear(); exist(organisationsEinheitenTab.getOrganisationsEinheitList()); 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 1a8b4a69f8b1f19d1c2daf27b65274f46fea62e0..779a88f3c46a4724f9d188768e7344e9b992cf1d 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 @@ -21,12 +21,12 @@ * Die sprachspezifischen Genehmigungen und Beschränkungen * unter der Lizenz sind dem Lizenztext zu entnehmen. */ +import { E2EPostfachHelper } from 'apps/admin-e2e/src/helper/postfach/postfach.helper'; 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', () => { +describe('(TODO: Ist noch wackelig in Bezug auf die Eingabe in das Feld) Postfach Signatur', () => { + const postfachHelper: E2EPostfachHelper = new E2EPostfachHelper(); const postfach: PostfachE2EComponent = new PostfachE2EComponent(); const signaturText: string = 'Signatur\nmit\n\n\n\nZeilenumbruch\n\n'; @@ -35,12 +35,9 @@ describe('Signatur', () => { loginAsAriane(); }); - it('should show Postfach page', () => { - waitForSpinnerToDisappear(); - exist(postfach.getSignaturText()); - }); - it('should show signature input with scrollbar', () => { + postfachHelper.openPostfachPage(); + postfach.setSignatur(signaturText); postfach.saveSignatur(); diff --git a/alfa-client/apps/admin-e2e/src/helper/postfach/postfach.helper.ts b/alfa-client/apps/admin-e2e/src/helper/postfach/postfach.helper.ts new file mode 100644 index 0000000000000000000000000000000000000000..90624b0151bdae26e5e1859734132d6b2e24cf62 --- /dev/null +++ b/alfa-client/apps/admin-e2e/src/helper/postfach/postfach.helper.ts @@ -0,0 +1,9 @@ +import { E2EPostfachNavigator } from './postfach.navigator'; + +export class E2EPostfachHelper { + private readonly navigator: E2EPostfachNavigator = new E2EPostfachNavigator(); + + public openPostfachPage(): void { + this.navigator.openPostfachPage(); + } +} diff --git a/alfa-client/apps/admin-e2e/src/helper/postfach/postfach.navigator.ts b/alfa-client/apps/admin-e2e/src/helper/postfach/postfach.navigator.ts new file mode 100644 index 0000000000000000000000000000000000000000..074438baaaf22cc22669f085412ddd5d2f22046d --- /dev/null +++ b/alfa-client/apps/admin-e2e/src/helper/postfach/postfach.navigator.ts @@ -0,0 +1,18 @@ +import { PostfachE2EComponent } from '../../components/postfach/postfach.e2e.component'; +import { MainPage } from '../../page-objects/main.po'; +import { exist } from '../../support/cypress.util'; + +export class E2EPostfachNavigator { + private mainPage: MainPage = new MainPage(); + private postfach: PostfachE2EComponent = new PostfachE2EComponent(); + + public openPostfachPage(): void { + this.navigateToDomain(); + this.mainPage.getPostfachNavigationItem().click(); + exist(this.postfach.getHeadline()); + } + + private navigateToDomain(): void { + this.mainPage.getHeader().getLogo().click(); + } +} 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 338c98286a6f1fc02e97d52381b99de0dbfc3db6..75ecbdaefa5d692ca637af325afb58ec05f80abe 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 @@ -22,17 +22,16 @@ * unter der Lizenz sind dem Lizenztext zu entnehmen. */ import { BuildInfoE2EComponent } from '../components/buildinfo/buildinfo.e2e.component'; -import { containClass, exist } from '../support/cypress.util'; import { HeaderE2EComponent } from './header.po'; export class MainPage { private readonly buildInfo: BuildInfoE2EComponent = new BuildInfoE2EComponent(); private readonly header: HeaderE2EComponent = new HeaderE2EComponent(); - private readonly benutzerNavigationItem: string = 'caption-Benutzer__Rollen'; - private readonly postfachNavigationItem: string = 'postfach-navigation'; - private readonly organisationEinheitNavigationItem: string = 'organisations-einheiten-navigation'; - private readonly statistikNavigationItem: string = 'statistik-navigation'; + private readonly benutzerNavigationItem: string = 'link-path-benutzer'; + private readonly organisationEinheitNavigationItem: string = 'link-path-organisationseinheiten'; + private readonly postfachNavigationItem: string = 'link-path-postfach'; + private readonly statistikNavigationItem: string = 'link-path-statistik'; public getBuildInfo(): BuildInfoE2EComponent { return this.buildInfo; @@ -46,41 +45,17 @@ export class MainPage { return cy.getTestElement(this.benutzerNavigationItem); } - public clickBenutzerNavigationItem(): void { - this.getBenutzerNavigationItem().click(); - } - - public benutzerNavigationItemIsVisible(): void { - exist(this.getBenutzerNavigationItem()); - } - public getPostfachNavigationItem(): Cypress.Chainable<Element> { return cy.getTestElement(this.postfachNavigationItem); } - public clickPostfachNavigationItem(): void { - this.getPostfachNavigationItem().click(); - } - public getOrganisationEinheitNavigationItem(): Cypress.Chainable<Element> { return cy.getTestElement(this.organisationEinheitNavigationItem); } - public clickOrganisationsEinheitenNavigationItem(): void { - this.getOrganisationEinheitNavigationItem().click(); - } - public getStatistikNavigationItem(): Cypress.Chainable<Element> { return cy.getTestElement(this.statistikNavigationItem); } - - public clickStatistikNavigationItem(): void { - this.getStatistikNavigationItem().click(); - } - - public isStatistikNavigationItemSelected(): void { - containClass(this.getStatistikNavigationItem().get('a'), 'border-selected'); - } } export function waitForSpinnerToDisappear(): boolean { 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 637963609081aa8cddbd24bbf5f56369b80cf0ef..498a30cf734696be13b3b2e999edc4df176fc74b 100644 --- a/alfa-client/apps/admin-e2e/src/support/cypress.util.ts +++ b/alfa-client/apps/admin-e2e/src/support/cypress.util.ts @@ -128,10 +128,6 @@ export function enterWith(element: Cypress.Chainable<Element>, value: string, de element.type(CypressKeyboardActions.ENTER); } -export function typeText(element: Cypress.Chainable<Element>, value: string): void { - element.type(value); -} - export function backspaceOn(element: Cypress.Chainable<Element>): void { element.type(CypressKeyboardActions.BACKSPACE); } diff --git a/alfa-client/libs/admin/postfach/src/lib/postfach-container/postfach-container.component.html b/alfa-client/libs/admin/postfach/src/lib/postfach-container/postfach-container.component.html index 3e8e4b49ae09ba083768eb4a1ffa4155ab1bb49c..4cc1c39f9ceae871719596a641734e16f8f966c4 100644 --- a/alfa-client/libs/admin/postfach/src/lib/postfach-container/postfach-container.component.html +++ b/alfa-client/libs/admin/postfach/src/lib/postfach-container/postfach-container.component.html @@ -1,2 +1,2 @@ -<h1 class="heading-1">Postfach</h1> +<h1 class="heading-1" data-test-id="headline">Postfach</h1> <admin-postfach-form [postfachStateResource]="postfachStateResource$ | async" />