[ADF-4838] Upload Dialog - canceling a pending file cancels the file in progress (#5063)

* add automation id

* call cancel upload api only if file is not pending

* tests

* e2e
This commit is contained in:
Cilibiu Bogdan
2019-09-09 13:23:07 +03:00
committed by Eugenio Romano
parent 4de00fd6ca
commit 5b9f37d01f
4 changed files with 70 additions and 7 deletions

View File

@@ -79,7 +79,7 @@ describe('Upload component', async () => {
});
it('[C272792] Should be possible to cancel upload of a big file using row cancel icon', async () => {
await browser.executeScript('setTimeout(() => {document.querySelector("div[data-automation-id=\'cancel-upload-progress\']").click();}, 3000)');
await browser.executeScript('setTimeout(() => {document.querySelector("div[data-automation-id=\'cancel-upload-progress\']").click();}, 1000)');
await contentServicesPage.uploadFile(largeFile.location);
@@ -90,7 +90,7 @@ describe('Upload component', async () => {
});
it('[C287790] Should be possible to cancel upload of a big file through the cancel uploads button', async () => {
await browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
await browser.executeScript(' setTimeout(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)');
await contentServicesPage.uploadFile(largeFile.location);
@@ -102,7 +102,7 @@ describe('Upload component', async () => {
});
it('[C272793] Should be able to cancel multiple files upload', async () => {
await browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
await browser.executeScript(' setTimeout(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)');
await uploadToggles.enableMultipleFileUpload();
@@ -115,4 +115,13 @@ describe('Upload component', async () => {
await uploadToggles.disableMultipleFileUpload();
});
it('[C315257] Should be able to cancel file in upload queue', async () => {
await uploadToggles.enableMultipleFileUpload();
await browser.executeScript('setTimeout(() => {document.querySelector("button[data-automation-id=\'cancel-upload-queue\']").click();}, 500)');
await contentServicesPage.uploadMultipleFile([largeFile.location, pngFileModel.location]);
await uploadDialog.fileIsCancelled(pngFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await uploadToggles.disableMultipleFileUpload();
});
});