diff --git a/alfa-client/apps/admin-e2e/src/e2e/main-tests/app/0-login-logout.cy.ts b/alfa-client/apps/admin-e2e/src/e2e/main-tests/app/0-login-logout.cy.ts index 530fd03a6149b145e333890bd931b3fda322b099..d4067cb06bb94921c136532a39f4c6433cb505c4 100644 --- a/alfa-client/apps/admin-e2e/src/e2e/main-tests/app/0-login-logout.cy.ts +++ b/alfa-client/apps/admin-e2e/src/e2e/main-tests/app/0-login-logout.cy.ts @@ -22,15 +22,22 @@ * unter der Lizenz sind dem Lizenztext zu entnehmen. */ import { HeaderE2EComponent } from '../../../page-objects/header.po'; +import { LoginPage } from '../../../page-objects/login.po'; import { MainPage } from '../../../page-objects/main.po'; import { reload } from '../../../support/cypress-helper'; import { exist } from '../../../support/cypress.util'; import { loginByUi } from '../../../support/user-util'; describe('Login and Logout', () => { + const loginPage: LoginPage = new LoginPage(); const mainPage: MainPage = new MainPage(); const header: HeaderE2EComponent = mainPage.getHeader(); + it('should display accessibility link', () => { + cy.visit(''); + exist(loginPage.getBarrierefreiheitLink()); + }); + it('login as Ariane', () => { Cypress.session.clearAllSavedSessions(); @@ -51,7 +58,7 @@ describe('Login and Logout', () => { it('should logout', () => { header.getCurrentUserProfile().logout(); - exist(cy.get('#kc-login')); + exist(loginPage.getLogin()); Cypress.session.clearAllSavedSessions(); }); diff --git a/alfa-client/apps/admin-e2e/src/page-objects/login.po.ts b/alfa-client/apps/admin-e2e/src/page-objects/login.po.ts new file mode 100644 index 0000000000000000000000000000000000000000..73005caaf69cb0be2990541fdabe003326a20153 --- /dev/null +++ b/alfa-client/apps/admin-e2e/src/page-objects/login.po.ts @@ -0,0 +1,12 @@ +export class LoginPage { + private readonly locatorLogin: string = '#kc-login'; + private readonly locatorBarrierefreiheitLink: string = '#kc-barrierefreiheit'; + + public getLogin(): Cypress.Chainable<JQuery<HTMLElement>> { + return cy.get(this.locatorLogin); + } + + public getBarrierefreiheitLink(): Cypress.Chainable<JQuery<HTMLElement>> { + return cy.get(this.locatorBarrierefreiheitLink); + } +} 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 cf78eeaa8b016603acbd8ebde5c4630fd18b3f2e..60db5d0f8610ec03e2cd6c0c34a71e45555612ca 100644 --- a/alfa-client/apps/admin-e2e/src/support/cypress.util.ts +++ b/alfa-client/apps/admin-e2e/src/support/cypress.util.ts @@ -33,11 +33,11 @@ export function notContainClass(element: Cypress.Chainable<Element>, cssClass: s element.should('not.have.class', cssClass); } -export function exist(element: Cypress.Chainable<Element>): void { +export function exist(element: Cypress.Chainable<Element> | Cypress.Chainable<JQuery<HTMLElement>>): void { element.should('exist'); } -export function notExist(element: Cypress.Chainable<Element>): void { +export function notExist(element: Cypress.Chainable<Element> | Cypress.Chainable<JQuery<HTMLElement>>): void { element.should('not.exist'); } diff --git a/alfa-client/apps/alfa-e2e/src/e2e/main-tests/app/login-logout.cy.ts b/alfa-client/apps/alfa-e2e/src/e2e/main-tests/app/login-logout.cy.ts index f429e0b8d01562ac2ee5964607b66bab04fa901a..4cb982be465e67ec951ab13c7688776da2c6dc32 100644 --- a/alfa-client/apps/alfa-e2e/src/e2e/main-tests/app/login-logout.cy.ts +++ b/alfa-client/apps/alfa-e2e/src/e2e/main-tests/app/login-logout.cy.ts @@ -26,6 +26,7 @@ import { getApp } from 'apps/alfa-e2e/src/support/app-util'; import { reload } from 'apps/alfa-e2e/src/support/cypress-helper'; import { UserE2E } from '../../../model/user'; import { HeaderE2EComponent } from '../../../page-objects/header.po'; +import { LoginPage } from '../../../page-objects/login.po'; import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main.po'; import { exist } from '../../../support/cypress.util'; import { getUserSabine } from '../../../support/user-util'; @@ -34,6 +35,7 @@ describe('Login and Logout', () => { const app: App = getApp(); const user: UserE2E = getUserSabine(); + const loginPage: LoginPage = new LoginPage(); const mainPage: MainPage = new MainPage(); const header: HeaderE2EComponent = mainPage.getHeader(); @@ -41,6 +43,10 @@ describe('Login and Logout', () => { cy.logout(); }); + it('should display accessibility link', () => { + exist(loginPage.getBarrierefreiheitLink()); + }); + it('login as test user', () => { cy.visit('') .get('#kc-login') @@ -69,6 +75,6 @@ describe('Login and Logout', () => { it('should logout', () => { header.getCurrentUserProfile().logout(); - exist(cy.get('#kc-login')); + exist(loginPage.getLogin()); }); }); diff --git a/alfa-client/apps/alfa-e2e/src/page-objects/login.po.ts b/alfa-client/apps/alfa-e2e/src/page-objects/login.po.ts new file mode 100644 index 0000000000000000000000000000000000000000..73005caaf69cb0be2990541fdabe003326a20153 --- /dev/null +++ b/alfa-client/apps/alfa-e2e/src/page-objects/login.po.ts @@ -0,0 +1,12 @@ +export class LoginPage { + private readonly locatorLogin: string = '#kc-login'; + private readonly locatorBarrierefreiheitLink: string = '#kc-barrierefreiheit'; + + public getLogin(): Cypress.Chainable<JQuery<HTMLElement>> { + return cy.get(this.locatorLogin); + } + + public getBarrierefreiheitLink(): Cypress.Chainable<JQuery<HTMLElement>> { + return cy.get(this.locatorBarrierefreiheitLink); + } +}