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

Merge pull request 'OZG-7021-7249-barrierefreiheit-e2e-test' (#868) from...

Merge pull request 'OZG-7021-7249-barrierefreiheit-e2e-test' (#868) from OZG-7021-7249-barrierefreiheit-e2e-test into master

Reviewed-on: https://git.ozg-sh.de/ozgcloud-app/alfa/pulls/868


Reviewed-by: default avatarOZGCloud <ozgcloud@mgm-tp.com>
parents 394cada3 5bd6318f
No related branches found
No related tags found
No related merge requests found
......@@ -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();
});
......
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);
}
}
......@@ -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');
}
......
......@@ -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());
});
});
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);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment