Skip to content
Snippets Groups Projects
Commit 37641001 authored by Martin's avatar Martin
Browse files

OZG-6810 tiny e2e refactoring

parent 54e42ad4
No related branches found
No related tags found
1 merge request!14Ozg 6810 fm dateiinhalt ersetzen
...@@ -61,15 +61,17 @@ describe('Vorgang Anhänge', () => { ...@@ -61,15 +61,17 @@ describe('Vorgang Anhänge', () => {
const vorgangHeader: VorgangDetailHeaderE2EComponent = vorgangPage.getVorgangDetailHeader(); const vorgangHeader: VorgangDetailHeaderE2EComponent = vorgangPage.getVorgangDetailHeader();
const subnavigation: VorgangSubnavigationE2EComponent = vorgangPage.getSubnavigation(); const subnavigation: VorgangSubnavigationE2EComponent = vorgangPage.getSubnavigation();
const attachmentContainer: AttachmentContainerE2EComponent = vorgangPage.getAttachmentContainer(); const attachmentContainer: AttachmentContainerE2EComponent = vorgangPage.getAttachmentContainer();
const attachmentList: AttachmentListE2EComponent = new AttachmentListE2EComponent(); const attachmentList: AttachmentListE2EComponent = new AttachmentListE2EComponent();
const formularDatenContainer: VorgangFormularDatenE2EComponent = vorgangPage.getFormularDatenContainer(); const formularDatenContainer: VorgangFormularDatenE2EComponent = vorgangPage.getFormularDatenContainer();
const vorgangDatenFormular: VorgangFormularDatenE2EComponent = vorgangPage.getFormularDatenContainer();
const xmlRepresentation: FileDataE2E = createXmlRepresentation(); const xmlRepresentation: FileDataE2E = createXmlRepresentation();
const jpgAttachment: FileDataE2E = createJpgAttachment();
const pdfAttachment: FileDataE2E = createPdfAttachment();
const sonstigeAttachment = { const sonstigeAttachment = {
name: 'datei_sonstiges', name: 'datei_sonstiges',
files: [createJpgAttachment(), createPdfAttachment()], files: [jpgAttachment, pdfAttachment],
}; };
const vorgangKeinAnhang: VorgangE2E = createVorgang(); const vorgangKeinAnhang: VorgangE2E = createVorgang();
...@@ -97,6 +99,7 @@ describe('Vorgang Anhänge', () => { ...@@ -97,6 +99,7 @@ describe('Vorgang Anhänge', () => {
after(() => { after(() => {
dropCollections(); dropCollections();
deleteDownloadFolder();
}); });
describe('Download Attachment', () => { describe('Download Attachment', () => {
...@@ -115,32 +118,32 @@ describe('Vorgang Anhänge', () => { ...@@ -115,32 +118,32 @@ describe('Vorgang Anhänge', () => {
}); });
it('should download jpg', () => { it('should download jpg', () => {
const jpgAttachmentName: string = getJpgAttachment().name; attachmentContainer.getList().getItem(jpgAttachment.name).getRoot().click();
attachmentContainer.getList().getItem(jpgAttachmentName).getRoot().click();
waitForSpinnerToDisappear(); waitForSpinnerToDisappear();
exist(readFileFromDownloads(buildDownloadFileName(jpgAttachmentName))); exist(readFileFromDownloads(buildDownloadFileName(jpgAttachment.name)));
}); });
it('should download pdf', () => { it('should download pdf', () => {
const pdfAttachmentName: string = getPdfAttachment().name; attachmentContainer.getList().getItem(convertToDataTestId(pdfAttachment.name)).getRoot().click();
attachmentContainer.getList().getItem(convertToDataTestId(pdfAttachmentName)).getRoot().click();
waitForSpinnerToDisappear(); waitForSpinnerToDisappear();
exist(readFileFromDownloads(buildDownloadFileName(pdfAttachmentName))); exist(readFileFromDownloads(buildDownloadFileName(pdfAttachment.name)));
}); });
it('should download attachment zip file', () => { it('should download attachment zip file', () => {
deleteDownloadFolder().then(() => {
attachmentList.downloadAttachments(); attachmentList.downloadAttachments();
});
waitForSpinnerToDisappear();
exist(readFileFromDownloads(`${vorgangAnhangVorhanden.nummer}_Anhaenge.zip`));
}); });
it('should unzip attachment file', () => { it('should unzip attachment file', () => {
getDownloadFiles().then((files) => { getDownloadFiles().then((files) => {
unzipDownloadFile(files[0]).then(() => { unzipDownloadFile(files[0]).then(() => {
countDownloadFiles().then((count) => { countDownloadFiles().then((count) => {
expect(count).to.eq(3); expect(count).to.eq(5);
}); });
}); });
}); });
...@@ -152,14 +155,6 @@ describe('Vorgang Anhänge', () => { ...@@ -152,14 +155,6 @@ describe('Vorgang Anhänge', () => {
exist(vorgangList.getRoot()); exist(vorgangList.getRoot());
}); });
function getJpgAttachment(): FileDataE2E {
return sonstigeAttachment.files[1];
}
function getPdfAttachment(): FileDataE2E {
return sonstigeAttachment.files[0];
}
}); });
describe('Download Representation', () => { describe('Download Representation', () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment