Skip to content
Snippets Groups Projects
Commit 0e9e753e authored by Cord Westhoff's avatar Cord Westhoff
Browse files

OZG-8086 OZG-8172 update tests

parent 354dc2c6
Branches
No related tags found
2 merge requests!144OZG-8086 Refactor tab handling; use existing components; inverse dependencies,!142Ozg 8086 statistik datenanfrage erstellen
export class DatenanfragenFormE2EComponent { export class DatenanfragenFormE2EComponent {
private readonly root: string = 'auswertung-form'; private readonly root: string = 'datenanfragen-form';
private readonly nameInput: string = 'auswertung-name-text-input'; private readonly nameInput: string = 'auswertung-name-text-input';
private readonly formEngineInput: string = 'form-engine-name-text-input'; private readonly formEngineInput: string = 'form-engine-name-text-input';
......
...@@ -3,19 +3,23 @@ import { convertToDataTestId } from '../../support/tech-util'; ...@@ -3,19 +3,23 @@ import { convertToDataTestId } from '../../support/tech-util';
export class DatenanfragenE2EComponent { export class DatenanfragenE2EComponent {
private readonly headerText: string = 'auswertung-header-text'; private readonly headerText: string = 'auswertung-header-text';
private readonly weitereFelderAuswertenButton = 'weitere-felder-auswerten-button'; private readonly auswertungErstellenButton = 'auswertung-erstellen-button';
public getHeaderText(): Cypress.Chainable<Element> { public getHeaderText(): Cypress.Chainable<Element> {
return cy.getTestElement(this.headerText); return cy.getTestElement(this.headerText);
} }
public getWeitereFelderAuswertenButton(): Cypress.Chainable<Element> { public getAuswertungErstellenButton(): Cypress.Chainable<Element> {
return cy.getTestElement(this.weitereFelderAuswertenButton); return cy.getTestElement(this.auswertungErstellenButton);
} }
public getListItem(name: string): DatenanfragenListItemE2EComponent { public getListItem(name: string): DatenanfragenListItemE2EComponent {
return new DatenanfragenListItemE2EComponent(name); return new DatenanfragenListItemE2EComponent(name);
} }
public neueAuswertungErstellen(): void {
this.getAuswertungErstellenButton().click();
}
} }
export class DatenanfragenListItemE2EComponent { export class DatenanfragenListItemE2EComponent {
......
...@@ -41,14 +41,22 @@ describe('Datenanfrage erstellen', () => { ...@@ -41,14 +41,22 @@ describe('Datenanfrage erstellen', () => {
dropCollections(); dropCollections();
}); });
it('should show "Auswertung erstellen" button', () => {}); it('should show "Auswertung erstellen" button', () => {
helper.openDatenanfragen();
it('should show first tab after button click', () => {}); exist(page.getAuswertungErstellenButton());
});
it('should show first tab after button click', () => {
page.neueAuswertungErstellen();
exist(form.getRoot());
});
it('should fill input fields', () => {}); it('should fill input fields', () => {});
it('should add data field in form', () => { it('should add data field in form', () => {
page.getWeitereFelderAuswertenButton().click(); page.getAuswertungErstellenButton().click();
form.getAddFieldButton().click(); form.getAddFieldButton().click();
exist(form.getDataFieldInput(1)); exist(form.getDataFieldInput(1));
......
...@@ -8,11 +8,11 @@ export class E2EDatenanfragenNavigator { ...@@ -8,11 +8,11 @@ export class E2EDatenanfragenNavigator {
private readonly mainPage: MainPage = new MainPage(); private readonly mainPage: MainPage = new MainPage();
private readonly AuswertungPage: DatenanfragenE2EComponent = new DatenanfragenE2EComponent(); private readonly DatenanfragenPage: DatenanfragenE2EComponent = new DatenanfragenE2EComponent();
public openDatenanfragen(): void { public openDatenanfragen(): void {
this.appHelper.navigateToDomain(); this.appHelper.navigateToDomain();
this.mainPage.getDatenAnfragenNavigationItem().getRoot().click(); this.mainPage.getDatenAnfragenNavigationItem().getRoot().click();
exist(this.AuswertungPage.getHeaderText()); exist(this.DatenanfragenPage.getHeaderText());
} }
} }
...@@ -4,5 +4,5 @@ ...@@ -4,5 +4,5 @@
class="my-4 w-fit" class="my-4 w-fit"
[linkPath]="ROUTES.DATENANFRAGEN_NEU" [linkPath]="ROUTES.DATENANFRAGEN_NEU"
text="Auswertung erstellen" text="Auswertung erstellen"
dataTestId="auswerung-erstellen-button" dataTestId="auswertung-erstellen-button"
/> />
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment