ESLint: cleanup await expect from protractor tests (#9630)

This commit is contained in:
Denys Vuika
2024-04-30 08:07:10 -04:00
committed by GitHub
parent 4109f272ea
commit f401b8c13e
114 changed files with 2096 additions and 1908 deletions

View File

@@ -23,7 +23,6 @@ import { UploadTogglesPage } from '../../core/pages/dialog/upload-toggles.page';
import { FileModel } from '../../models/ACS/file.model';
describe('Upload component', async () => {
const apiService = createApiService();
const contentServicesPage = new ContentServicesPage();
const uploadDialog = new UploadDialogPage();
@@ -58,14 +57,13 @@ describe('Upload component', async () => {
await contentServicesPage.goToDocumentList();
});
const deleteNodesInCurrentPage = async function() {
const deleteNodesInCurrentPage = async () => {
const nodeList = await contentServicesPage.getElementsDisplayedId();
for (const node of nodeList) {
try {
await uploadActions.deleteFileOrFolder(node);
} catch (error) {
}
} catch (error) {}
}
};
@@ -74,18 +72,20 @@ describe('Upload component', async () => {
await contentServicesPage.uploadFile(mediumFile.location);
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(mediumFile.name);
});
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();' +
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)');
await browser.executeScript(
' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)'
);
await contentServicesPage.uploadFile(largeFile.location);
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
@@ -94,12 +94,14 @@ describe('Upload component', async () => {
it('[C272793] Should be able to cancel multiple files upload', async () => {
await uploadToggles.enableMultipleFileUpload();
await browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)');
await browser.executeScript(
' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)'
);
await contentServicesPage.uploadMultipleFile([mediumFile.location, largeFile.location]);
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(mediumFile.name);