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

OZG-6810 tiny e2e refactoring

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