mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
fix e2e (#5686)
* fix e2e * Update notifications-component.e2e.ts * fix e2e * fix e2e * try with interval * Update version-actions.e2e.ts
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
import { ContentServicesPage } from '../../pages/adf/content-services.page';
|
||||
import { AcsUserModel } from '../../models/ACS/acs-user.model';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { LoginPage, UploadActions, PaginationPage, StringUtil, PermissionActions } from '@alfresco/adf-testing';
|
||||
import { BrowserActions, LoginPage, UploadActions, PaginationPage, StringUtil, PermissionActions } from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { FolderModel } from '../../models/ACS/folder.model';
|
||||
@@ -114,7 +114,7 @@ describe('Delete Directive', () => {
|
||||
await uploadActions.createFolder(folderSecond.name, baseFolderUploaded.entry.id);
|
||||
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await browser.get(`${browser.baseUrl}/files/${baseFolderUploaded.entry.id}`);
|
||||
await BrowserActions.getUrl(`${browser.baseUrl}/files/${baseFolderUploaded.entry.id}`);
|
||||
await contentServicesPage.waitForTableBody();
|
||||
});
|
||||
|
||||
@@ -188,7 +188,7 @@ describe('Delete Directive', () => {
|
||||
await uploadActions.uploadFile(secondPngFileModel.location, secondPngFileModel.name, baseFolderUploaded.entry.id);
|
||||
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await browser.get(`${browser.baseUrl}/files/${baseFolderUploaded.entry.id}`);
|
||||
await BrowserActions.getUrl(`${browser.baseUrl}/files/${baseFolderUploaded.entry.id}`);
|
||||
await contentServicesPage.waitForTableBody();
|
||||
});
|
||||
|
||||
@@ -240,7 +240,7 @@ describe('Delete Directive', () => {
|
||||
await permissionActions.disableInheritedPermissionsForNode(filePdf.entry.id);
|
||||
|
||||
await loginPage.loginToContentServicesUsingUserModel(secondAcsUser);
|
||||
await browser.get(`${browser.baseUrl}/files/${createdSite.entry.guid}`);
|
||||
await BrowserActions.getUrl(`${browser.baseUrl}/files/${createdSite.entry.guid}`);
|
||||
await contentServicesPage.waitForTableBody();
|
||||
});
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ describe('Notifications Component', () => {
|
||||
await notificationPage.enterDurationField(1000);
|
||||
await notificationPage.clickNotificationButton();
|
||||
await notificationPage.checkNotificationSnackBarIsDisplayed();
|
||||
await browser.sleep(1500);
|
||||
await browser.sleep(2000);
|
||||
await notificationPage.checkNotificationSnackBarIsNotDisplayed();
|
||||
});
|
||||
|
||||
|
||||
@@ -73,7 +73,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();}, 2500)`);
|
||||
await browser.executeScript(`setInterval(() => {document.querySelector('div[data-automation-id="cancel-upload-progress"]').click();}, 500)`);
|
||||
|
||||
await contentServicesPage.uploadFile(mediumFile.location);
|
||||
|
||||
@@ -84,8 +84,8 @@ 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(' setTimeout(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
|
||||
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 2500)');
|
||||
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');
|
||||
@@ -97,8 +97,8 @@ describe('Upload component', async () => {
|
||||
it('[C272793] Should be able to cancel multiple files upload', async () => {
|
||||
await uploadToggles.enableMultipleFileUpload();
|
||||
|
||||
await browser.executeScript(' setTimeout(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
|
||||
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 2500)');
|
||||
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]);
|
||||
|
||||
@@ -113,7 +113,7 @@ describe('Upload component', async () => {
|
||||
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();}, 2500)`);
|
||||
await browser.executeScript(`setInterval(() => {document.querySelector('button[data-automation-id="cancel-upload-queue"]').click();}, 500)`);
|
||||
|
||||
await contentServicesPage.uploadMultipleFile([mediumFile.location, pngFile.location]);
|
||||
await uploadDialog.fileIsCancelled(pngFile.name);
|
||||
|
||||
@@ -149,10 +149,10 @@ describe('Version component actions', () => {
|
||||
it('[C307033] Should be possible to cancel the upload of a new version', async () => {
|
||||
await browser.refresh();
|
||||
await contentServicesPage.versionManagerContent(txtFileModel.name);
|
||||
await browser.executeScript(' setTimeout(() => {document.querySelector("div[data-automation-id=\'cancel-upload-progress\']").click();}, 1000)');
|
||||
|
||||
await BrowserActions.click(versionManagePage.showNewVersionButton);
|
||||
|
||||
await browser.executeScript(' setTimeout(() => {document.querySelector("div[data-automation-id=\'cancel-upload-progress\']").click();}, 1000)');
|
||||
await versionManagePage.uploadNewVersionFile(bigFileToCancel.location);
|
||||
await versionManagePage.closeVersionDialog();
|
||||
|
||||
|
||||
@@ -97,12 +97,12 @@ export class UploadDialogPage {
|
||||
}
|
||||
|
||||
async checkCancelProgressIsVisible(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.cancelUploadInProgressButton);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.cancelUploadInProgressButton);
|
||||
}
|
||||
|
||||
async fileIsCancelled(content): Promise<void> {
|
||||
const row = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.cancelledStatusIcon));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.cancelledStatusIcon), 10000);
|
||||
}
|
||||
|
||||
async removeUploadedFile(content): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user