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

OZG-5981 change test structure

parent edae12f4
No related branches found
No related tags found
No related merge requests found
...@@ -38,7 +38,7 @@ export class AttachmentContainerE2EComponent { ...@@ -38,7 +38,7 @@ export class AttachmentContainerE2EComponent {
export class AttachmentListE2EComponent { export class AttachmentListE2EComponent {
private readonly locatorRoot: string = 'file-list'; private readonly locatorRoot: string = 'file-list';
private readonly downloadAttachmentsButton: string = 'download-archive'; private readonly downloadAttachmentsButton: string = 'download-archive-file-button';
public getRoot() { public getRoot() {
return cy.getTestElement(this.locatorRoot); return cy.getTestElement(this.locatorRoot);
...@@ -48,12 +48,12 @@ export class AttachmentListE2EComponent { ...@@ -48,12 +48,12 @@ export class AttachmentListE2EComponent {
return new AttachmentE2EItem(fileName); return new AttachmentE2EItem(fileName);
} }
public getDownloadAttachmentsButton(): Cypress.Chainable<JQuery<HTMLElement>> { public getDownloadAttachmentsButton(parent: any): Cypress.Chainable<JQuery<HTMLElement>> {
return cy.getTestElementWithClass(this.downloadAttachmentsButton); return cy.get(parent).getTestElementWithClass(this.downloadAttachmentsButton);
} }
public downloadAttachments(): Cypress.Chainable<any> { public downloadAttachments(parent: any): Cypress.Chainable<any> {
return this.getDownloadAttachmentsButton().click(); return this.getDownloadAttachmentsButton(parent).click();
} }
} }
......
...@@ -69,6 +69,8 @@ describe('Vorgang Anhänge', () => { ...@@ -69,6 +69,8 @@ describe('Vorgang Anhänge', () => {
const attachmentList: AttachmentListE2EComponent = new AttachmentListE2EComponent(); const attachmentList: AttachmentListE2EComponent = new AttachmentListE2EComponent();
const formularDatenContainer: VorgangFormularDatenE2EComponent = const formularDatenContainer: VorgangFormularDatenE2EComponent =
vorgangPage.getFormularDatenContainer(); vorgangPage.getFormularDatenContainer();
const vorgangDatenFormular: VorgangFormularDatenE2EComponent =
vorgangPage.getFormularDatenContainer();
const xmlRepresentation: FileDataE2E = createXmlRepresentation(); const xmlRepresentation: FileDataE2E = createXmlRepresentation();
...@@ -141,7 +143,7 @@ describe('Vorgang Anhänge', () => { ...@@ -141,7 +143,7 @@ describe('Vorgang Anhänge', () => {
it('should download attachment zip file', () => { it('should download attachment zip file', () => {
deleteDownloadFolder().then(() => { deleteDownloadFolder().then(() => {
attachmentList.downloadAttachments(); attachmentList.downloadAttachments(vorgangDatenFormular.getRoot());
}); });
}); });
......
...@@ -127,7 +127,7 @@ describe('Dateien Tab', () => { ...@@ -127,7 +127,7 @@ describe('Dateien Tab', () => {
it('should show attachments and download button', () => { it('should show attachments and download button', () => {
exist(vorgangDatenFormular.getFileElementByName(jpgFileName)); exist(vorgangDatenFormular.getFileElementByName(jpgFileName));
exist(vorgangDatenFormular.getFileElementByName(pdfFileName)); exist(vorgangDatenFormular.getFileElementByName(pdfFileName));
exist(attachmentList.getDownloadAttachmentsButton()); exist(attachmentList.getDownloadAttachmentsButton(vorgangDatenFormular.getRoot()));
}); });
}); });
}); });
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment