[ADF-5263] Empty page displayed all the time when load content fix (#6209)

* Make test run on API update
Improve create librrary test

* Fix empty page displayed always first

* remvoe console

* fix

* fix

* lint

* fix

* fix

* fix

* fix

* fix
This commit is contained in:
Eugenio Romano 2020-10-05 00:26:56 +01:00 committed by GitHub
parent d128bc158c
commit 04f5fdffd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 174 additions and 179 deletions

View File

@ -172,7 +172,7 @@ describe('Create library directive', () => {
for (let i = 0; i < 3; i++) {
await createLibraryDialog.typeLibraryName(name[i]);
await expect(await createLibraryDialog.getLibraryIdText()).toMatch(libraryId[i]);
await createLibraryDialog.waitUntilLibraryIdTextHasValue(libraryId[i]);
await createLibraryDialog.clearLibraryName();
}
});
@ -185,7 +185,7 @@ describe('Create library directive', () => {
for (let i = 0; i < 3; i++) {
await createLibraryDialog.typeLibraryId(libraryId[i]);
await expect(await createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
await createLibraryDialog.waitErrorMessageIsDisplayed();
await expect(await createLibraryDialog.getErrorMessage()).toMatch('Use numbers and letters only');
}
});
@ -196,7 +196,7 @@ describe('Create library directive', () => {
await createLibraryDialog.typeLibraryName(name);
await createLibraryDialog.typeLibraryId(libraryId);
await expect(await createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
await createLibraryDialog.waitErrorMessageIsDisplayed();
await expect(await createLibraryDialog.getErrorMessage()).toMatch('Title must be at least 2 characters long');
});
@ -207,7 +207,7 @@ describe('Create library directive', () => {
await createLibraryDialog.typeLibraryName(name);
await createLibraryDialog.typeLibraryId(libraryId);
await expect(await createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
await createLibraryDialog.waitErrorMessageIsDisplayed();
await expect(await createLibraryDialog.getErrorMessage()).toMatch("Library name can't contain only spaces");
});
@ -224,7 +224,7 @@ describe('Create library directive', () => {
await createLibraryDialog.typeLibraryName(name);
await createLibraryDialog.typeLibraryId(libraryId);
await expect(await createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
await createLibraryDialog.waitErrorMessageIsDisplayed();
await expect(await createLibraryDialog.getErrorMessage()).toMatch("This Library ID isn't available. Try a different Library ID.");
});

View File

@ -144,10 +144,13 @@ describe('Favorite directive', () => {
await navigationBarPage.clickTrashcanButton();
await trashcanPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(1);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(testFile.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(testFile.entry.name);
await trashcanPage.clickRestore();
await trashcanPage.contentList.dataTablePage().waitTillContentLoaded();
await trashcanPage.checkTrashcanIsEmpty();
await navigationBarPage.clickContentServicesButton();

View File

@ -41,40 +41,29 @@ describe('Document List - Pagination', () => {
extension: '.txt'
};
const itemsPerPage = {
five: '5',
fiveValue: 5,
ten: '10',
tenValue: 10,
fifteen: '15',
fifteenValue: 15,
twenty: '20',
twentyValue: 20,
twentyOne: '21',
twentyOneValue: 21,
default: '25'
};
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const paginationPage = new PaginationPage();
const navigationBarPage = new NavigationBarPage();
const uploadDialog = new UploadDialogPage();
let acsUser: UserModel;
const newFolderModel = new FolderModel({ name: 'newFolder' });
let acsUser: UserModel;
let fileNames = [];
const nrOfFiles = 20;
const numberOfFilesAfterUpload = 21;
let currentPage = 1;
let secondSetOfFiles = [];
const nrOfFiles = 20;
const numberOfFilesAfterUpload = 21;
const secondSetNumber = 25;
const folderTwoModel = new FolderModel({ name: 'folderTwo' });
const folderThreeModel = new FolderModel({ name: 'folderThree' });
const numberOfSubFolders = 6;
const apiService = new ApiService();
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);
const docxFileModel = new FileModel({
@ -109,7 +98,7 @@ describe('Document List - Pagination', () => {
it('[C260062] Should use default pagination settings', async () => {
await contentServicesPage.openFolder(newFolderModel.name);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('20');
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${nrOfFiles} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
const list = await contentServicesPage.getAllRowsNameColumn();
@ -120,10 +109,10 @@ describe('Document List - Pagination', () => {
it('[C274713] Should be able to set Items per page to 20', async () => {
await contentServicesPage.openFolder(newFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await paginationPage.selectItemsPerPage('20');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('20');
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${nrOfFiles} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
const list = await contentServicesPage.getAllRowsNameColumn();
@ -135,7 +124,7 @@ describe('Document List - Pagination', () => {
await loginPage.login(acsUser.email, acsUser.password);
await contentServicesPage.goToDocumentList();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('20');
await navigationBarPage.clickLogoutButton();
await loginPage.login(acsUser.email, acsUser.password);
@ -143,12 +132,12 @@ describe('Document List - Pagination', () => {
it('[C260069] Should be able to set Items per page to 5', async () => {
await contentServicesPage.openFolder(newFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await paginationPage.selectItemsPerPage('5');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${5 * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(5);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
@ -156,9 +145,9 @@ describe('Document List - Pagination', () => {
currentPage++;
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 6-${itemsPerPage.fiveValue * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 6-${5 * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(5);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(5, 10))).toEqual(true);
@ -166,9 +155,9 @@ describe('Document List - Pagination', () => {
currentPage++;
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 11-${itemsPerPage.fiveValue * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 11-${5 * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(5);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(10, 15))).toEqual(true);
@ -176,15 +165,15 @@ describe('Document List - Pagination', () => {
currentPage++;
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${itemsPerPage.fiveValue * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${5 * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(5);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
await browser.refresh();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await navigationBarPage.clickLogoutButton();
await loginPage.login(acsUser.email, acsUser.password);
});
@ -192,26 +181,27 @@ describe('Document List - Pagination', () => {
it('[C260067] Should be able to set Items per page to 10', async () => {
currentPage = 1;
await contentServicesPage.openFolder(newFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await paginationPage.selectItemsPerPage('10');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.tenValue * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('10');
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${10 * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(10);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 10))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 11-${itemsPerPage.tenValue * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('10');
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 11-${10 * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(10);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(10, 20))).toEqual(true);
await browser.refresh();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('10');
await navigationBarPage.clickLogoutButton();
await loginPage.login(acsUser.email, acsUser.password);
currentPage = 1;
@ -221,34 +211,35 @@ describe('Document List - Pagination', () => {
currentPage = 1;
await contentServicesPage.openFolder(newFolderModel.name);
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await paginationPage.selectItemsPerPage('15');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fifteenValue * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('15');
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${15 * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(15);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 15))).toEqual(true);
currentPage++;
await paginationPage.clickOnNextPage();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('15');
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${nrOfFiles} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles - itemsPerPage.fifteenValue);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles - 15);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
await browser.refresh();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('15');
});
it('[C91320] Pagination should preserve sorting', async () => {
await contentServicesPage.openFolder(newFolderModel.name);
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await paginationPage.selectItemsPerPage('20');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('ASC', 'Display name'));
@ -256,7 +247,7 @@ describe('Document List - Pagination', () => {
await contentServicesPage.sortByName('DESC');
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await paginationPage.selectItemsPerPage('5');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
@ -266,21 +257,21 @@ describe('Document List - Pagination', () => {
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await paginationPage.selectItemsPerPage('10');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
});
it('[C260107] Should not display pagination bar when a folder is empty', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await paginationPage.selectItemsPerPage('5');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await contentServicesPage.openFolder(newFolderModel.name);
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await contentServicesPage.createAndOpenNewFolder(folderTwoModel.name);
@ -293,39 +284,39 @@ describe('Document List - Pagination', () => {
currentPage = 1;
await contentServicesPage.openFolder(folderThreeModel.name);
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(folderThreeModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await paginationPage.selectItemsPerPage('15');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fifteenValue * currentPage} of ${secondSetNumber}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('15');
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${15 * currentPage} of ${secondSetNumber}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(15);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(ArrayUtil.arrayContainsArray(list, secondSetOfFiles.slice(0, 15))).toEqual(true);
currentPage++;
await paginationPage.clickOnNextPage();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('15');
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${secondSetNumber} of ${secondSetNumber}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.fifteenValue);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - 15);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(ArrayUtil.arrayContainsArray(list, secondSetOfFiles.slice(15, 25))).toEqual(true);
currentPage = 1;
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await paginationPage.selectItemsPerPage('20');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.twentyValue * currentPage} of ${secondSetNumber}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyValue);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('20');
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${20 * currentPage} of ${secondSetNumber}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(20);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(ArrayUtil.arrayContainsArray(list, secondSetOfFiles.slice(0, 20))).toEqual(true);
currentPage++;
await paginationPage.clickOnNextPage();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('20');
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 21-${secondSetNumber} of ${secondSetNumber}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.twentyValue);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - 20);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(ArrayUtil.arrayContainsArray(list, secondSetOfFiles.slice(20, 25))).toEqual(true);
});
@ -339,6 +330,7 @@ describe('Document List - Pagination', () => {
await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 21]));
await contentServicesPage.goToDocumentList();
await browser.refresh();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await contentServicesPage.openFolder(newFolderModel.name);
await contentServicesPage.uploadFile(docxFileModel.location);
@ -354,16 +346,20 @@ describe('Document List - Pagination', () => {
await paginationPage.clickItemsPerPageDropdown();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await paginationPage.selectItemsPerPage(itemsPerPage.twentyOne);
await paginationPage.selectItemsPerPage('21');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twentyOne);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('21');
await browser.refresh();
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.twentyOneValue} of ${numberOfFilesAfterUpload}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyOneValue);
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-21 of ${numberOfFilesAfterUpload}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(21);
await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 20]));
await browser.refresh();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await paginationPage.clickItemsPerPageDropdown();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
@ -371,12 +367,12 @@ describe('Document List - Pagination', () => {
});
it('[C272767] Should propagate the option chosen regarding displaying items per page to files/folders inside a folder', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await paginationPage.selectItemsPerPage('5');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await contentServicesPage.openFolder(newFolderModel.name);
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await apiService.getInstance().login(acsUser.email, acsUser.password);
await contentServicesPage.createNewFolder(folderTwoModel.name);
@ -387,8 +383,9 @@ describe('Document List - Pagination', () => {
await uploadActions.createFolder('subfolder' + (i + 1), nodeIdSubFolderTwo);
}
await browser.refresh();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue} of ${numberOfSubFolders}`);
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-5 of ${numberOfSubFolders}`);
await paginationPage.clickOnNextPage();
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 6-${numberOfSubFolders} of ${numberOfSubFolders}`);
@ -398,8 +395,9 @@ describe('Document List - Pagination', () => {
await uploadActions.createFolder('subfolder' + (i + 1), nodeIdSubFolder6);
}
await browser.refresh();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue} of ${numberOfSubFolders}`);
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-5 of ${numberOfSubFolders}`);
await expect(await paginationPage.getCurrentPage()).toEqual('Page 1');
await expect(await paginationPage.getTotalPages()).toEqual('of 2');
@ -407,11 +405,11 @@ describe('Document List - Pagination', () => {
});
it('[C260064] Should download only the last selection when changing pages in Single mode', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await paginationPage.selectItemsPerPage('5');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await contentServicesPage.openFolder(newFolderModel.name);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await contentServicesPage.createNewFolder(folderTwoModel.name);
const nodeIdSubFolderTwo = await contentServicesPage.getAttributeValueForElement(folderTwoModel.name, 'Node id');
@ -423,7 +421,9 @@ describe('Document List - Pagination', () => {
}
await browser.refresh();
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue} of ${numberOfSubFolders}`);
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-5 of ${numberOfSubFolders}`);
await contentServicesPage.chooseSelectionMode('Single');

View File

@ -43,11 +43,9 @@ describe('Document List Component - Properties', () => {
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
acsUser = await usersActions.createUser();
await apiService.getInstance().login(acsUser.email, acsUser.password);
parentFolder = await uploadActions.createFolder('parentFolder', '-my-');
subFolder = await uploadActions.createFolder('subFolder', parentFolder.entry.id);
await loginPage.login(acsUser.email, acsUser.password);
@ -57,13 +55,16 @@ describe('Document List Component - Properties', () => {
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
await uploadActions.deleteFileOrFolder(subFolder.entry.id);
await uploadActions.deleteFileOrFolder(parentFolder.entry.id);
await navigationBar.clickLogoutButton();
});
it('[C299154] Should disallow upload content on a folder row if allowDropFiles is false', async () => {
await navigationBar.clickContentServicesButton();
await contentServicesPage.openFolder(parentFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.openFolder(parentFolder.entry.name);
await contentServicesPage.disableDropFilesInAFolder();
await browser.sleep(1000);
const dragAndDropArea = contentServicesPage.getRowByName(subFolder.entry.name);
@ -75,9 +76,11 @@ describe('Document List Component - Properties', () => {
it('[C91319] Should allow upload content on a folder row if allowDropFiles is true', async () => {
await navigationBar.clickContentServicesButton();
await contentServicesPage.openFolder(parentFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.openFolder(parentFolder.entry.name);
await contentServicesPage.enableDropFilesInAFolder();
await browser.sleep(1000);
const dragAndDropArea = contentServicesPage.getRowByName(subFolder.entry.name);

View File

@ -39,11 +39,11 @@ export class CreateLibraryDialogPage {
}
async waitForDialogToOpen(): Promise<void> {
await BrowserVisibility.waitUntilElementIsPresent(this.libraryDialog);
await BrowserVisibility.waitUntilElementIsVisible(this.libraryDialog);
}
async waitForDialogToClose(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotPresent(this.libraryDialog);
await BrowserVisibility.waitUntilElementIsNotPresent(this.libraryDialog, 60000);
}
async isDialogOpen(): Promise<any> {
@ -54,12 +54,12 @@ export class CreateLibraryDialogPage {
return BrowserActions.getText(this.libraryTitle);
}
async getLibraryIdText(): Promise<string> {
return this.libraryIdField.getAttribute('value');
async waitUntilLibraryIdTextHasValue(value: string): Promise<void> {
await BrowserVisibility.waitUntilElementHasValue(this.libraryIdField, value);
}
async isErrorMessageDisplayed(): Promise<boolean> {
return this.errorMessage.isDisplayed();
async waitErrorMessageIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.errorMessage, 60000);
}
async getErrorMessage(): Promise<string> {

View File

@ -184,7 +184,7 @@ export class NavigationBarPage {
await BrowserActions.closeMenuAndDialogs();
await BrowserActions.clickExecuteScript('.app-sidenav-link[adf-logout]');
await BrowserVisibility.waitUntilElementIsVisible(this.logoutSection);
await BrowserVisibility.waitUntilElementIsPresent(this.logoutSection);
} catch (error) {
Logger.log('Logout section NOT found');
}

View File

@ -169,11 +169,11 @@ export class TasksCloudDemoPage {
async waitTillContentLoaded(): Promise<void> {
if (this.isSpinnerPresent()) {
Logger.log('wait loading spinner disappear');
await BrowserVisibility.waitUntilElementIsNotPresent(element(by.tagName('mat-spinner')));
await BrowserVisibility.waitUntilElementIsNotPresent(element(by.tagName('mat-progress-spinner')));
} else {
try {
Logger.log('wait loading spinner is present');
await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-spinner')));
await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-progress-spinner')));
} catch (error) {
}
}
@ -183,7 +183,7 @@ export class TasksCloudDemoPage {
let isSpinnerPresent;
try {
isSpinnerPresent = await element(by.tagName('mat-spinner')).isDisplayed();
isSpinnerPresent = await element(by.tagName('mat-progress-spinner')).isDisplayed();
} catch (error) {
isSpinnerPresent = false;
}

View File

@ -102,8 +102,7 @@ describe('Info Drawer', () => {
it('[C260319] New Task - displayed details', async () => {
const name = StringUtil.generateRandomString(5);
await taskPage.createTask({ ...taskDetails, formName: app.formName, name });
await taskPage.tasksListPage().checkTaskListIsLoaded();
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await taskPage.tasksListPage().getDataTable().waitTillContentLoaded();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(name);
await taskPage.tasksListPage().selectRow(name);
@ -128,8 +127,7 @@ describe('Info Drawer', () => {
it('[C260323] Priority - Editing field', async () => {
const name = StringUtil.generateRandomString(5);
await taskPage.createTask({ ...taskDetails, formName: app.formName, name });
await taskPage.tasksListPage().checkTaskListIsLoaded();
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await taskPage.tasksListPage().getDataTable().waitTillContentLoaded();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(name);
await taskPage.tasksListPage().selectRow(name);
@ -138,11 +136,9 @@ describe('Info Drawer', () => {
await expect(await taskPage.taskDetails().getPriority()).toEqual(taskDetails.priority);
await taskPage.taskDetails().updatePriority('40');
await taskPage.taskDetails().checkTaskDetailsDisplayed();
await browser.sleep(2000);
await expect(await taskPage.taskDetails().getPriority()).toEqual('40');
await taskPage.taskDetails().updatePriority();
await taskPage.taskDetails().checkTaskDetailsDisplayed();
await browser.sleep(2000);
await expect(await taskPage.taskDetails().getPriority()).toEqual('0');
await taskPage.taskDetails().clickCompleteFormTask();
@ -151,8 +147,7 @@ describe('Info Drawer', () => {
it('[C260325] Due Date - Changing', async () => {
const name = StringUtil.generateRandomString(5);
await taskPage.createTask({ ...taskDetails, formName: app.formName, name });
await taskPage.tasksListPage().checkTaskListIsLoaded();
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await taskPage.tasksListPage().getDataTable().waitTillContentLoaded();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(name);
await taskPage.tasksListPage().selectRow(name);
@ -194,8 +189,7 @@ describe('Info Drawer', () => {
it('[C260329] Task with no form', async () => {
const name = StringUtil.generateRandomString(5);
await taskPage.createTask(<any> { ...taskDetails, formName: '', name });
await taskPage.tasksListPage().checkTaskListIsLoaded();
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await taskPage.tasksListPage().getDataTable().waitTillContentLoaded();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(name);
await taskPage.tasksListPage().selectRow(name);
@ -212,8 +206,7 @@ describe('Info Drawer', () => {
it('[C260320] Assign user to the task', async () => {
const name = StringUtil.generateRandomString(5);
await taskPage.createTask(<any> { ...taskDetails, formName: app.formName, name });
await taskPage.tasksListPage().checkTaskListIsLoaded();
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await taskPage.tasksListPage().getDataTable().waitTillContentLoaded();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(name);
await taskPage.tasksListPage().selectRow(name);
@ -253,9 +246,7 @@ describe('Info Drawer', () => {
});
await taskPage.taskDetails().updateAssignee(assigneeUserModelFullName);
await taskPage.tasksListPage().checkTaskListIsLoaded();
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await taskPage.tasksListPage().getDataTable().waitTillContentLoaded();
await taskPage.tasksListPage().checkContentIsNotDisplayed(app.taskName);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
@ -279,8 +270,7 @@ describe('Info Drawer', () => {
await startProcess.clickStartProcessButton();
await processServiceTabBarPage.clickTasksButton();
await taskPage.tasksListPage().checkTaskListIsLoaded();
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await taskPage.tasksListPage().getDataTable().waitTillContentLoaded();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(app.taskName);
@ -304,8 +294,7 @@ describe('Info Drawer', () => {
it('[C260328] Description - Editing field', async () => {
const name = StringUtil.generateRandomString(5);
await taskPage.createTask({ ...taskDetails, formName: app.formName, name });
await taskPage.tasksListPage().checkTaskListIsLoaded();
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await taskPage.tasksListPage().getDataTable().waitTillContentLoaded();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(name);
await taskPage.tasksListPage().selectRow(name);
@ -334,8 +323,7 @@ describe('Info Drawer', () => {
const name = StringUtil.generateRandomString(5);
await taskPage.createTask({ ...taskDetails, formName: app.formName, name });
await taskPage.tasksListPage().checkTaskListIsLoaded();
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await taskPage.tasksListPage().getDataTable().waitTillContentLoaded();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(name);
await taskPage.tasksListPage().selectRow(name);

View File

@ -220,7 +220,7 @@ export class TaskDetailsPage {
async updatePriority(priority?: string): Promise<void> {
await BrowserActions.click(this.priority);
await BrowserActions.clearWithBackSpace(this.priority);
await BrowserActions.clearSendKeys(element(by.css('input[data-automation-id="card-textitem-value-priority"]')), priority ? priority : ' ');
await BrowserActions.clearSendKeys(element(by.css('input[data-automation-id="card-textitem-value-priority"]')), priority ? priority : ' ', 500);
await this.priority.sendKeys(Key.TAB);
await browser.sleep(1000);
}

View File

@ -45,20 +45,20 @@ describe('Hyperlink widget', () => {
let deployedApp, process;
beforeAll(async () => {
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
processUserModel = await usersActions.createUser();
processUserModel = await usersActions.createUser();
await apiService.getInstance().login(processUserModel.email, processUserModel.password);
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
await apiService.getInstance().login(processUserModel.email, processUserModel.password);
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
deployedApp = appDefinitions.data.find((currentApp) => {
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
deployedApp = appDefinitions.data.find((currentApp) => {
return currentApp.modelId === appModel.id;
});
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.email, processUserModel.password);
});
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.email, processUserModel.password);
});
beforeEach(async () => {
const urlToNavigateTo = `${browser.baseUrl}/activiti/apps/${deployedApp.id}/tasks/`;
@ -71,7 +71,7 @@ describe('Hyperlink widget', () => {
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
});
});
it('[C276728] Should be able to set visibility properties for Hyperlink widget', async () => {
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.hyperlink_id);

View File

@ -1,4 +1,4 @@
const { LocalStorageUtil, Logger } = require('@alfresco/adf-testing');
const {LocalStorageUtil, Logger} = require('@alfresco/adf-testing');
const path = require('path');
const {SpecReporter} = require('jasmine-spec-reporter');
const retry = require('protractor-retry').retry;
@ -292,7 +292,7 @@ exports.config = {
} catch (error) {
console.error('Error saving screenshot', error);
}
}else{
} else {
console.log(`Save screenshot disabled`);
}

View File

@ -1588,12 +1588,12 @@ describe('DocumentList', () => {
expect(nodeSelectedSpy).not.toHaveBeenCalled();
});
});
});
});
@Component({
template: `
<adf-document-list currentFolderId="-my-" #customDocumentList>
<adf-document-list #customDocumentList>
<adf-custom-loading-content-template>
<span id="custom-loading-template">This is a custom loading template</span>
</adf-custom-loading-content-template>
@ -1685,4 +1685,5 @@ describe('DocumentListComponent rendering', () => {
const cell3 = fixture.nativeElement.querySelector('div[title="Id"][data-automation-id="Name 3"]');
expect(cell3.innerText).toBe('3');
});
});

View File

@ -481,18 +481,8 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
}
}
if (changes['currentFolderId']?.currentValue !== changes['currentFolderId']?.previousValue) {
if (this.data) {
this.data.loadPage(null, false, null, this.getPreselectNodesBasedOnSelectionMode());
this.onPreselectNodes();
this.resetNewFolderPagination();
}
if (changes['currentFolderId'].currentValue) {
this.loadFolder();
}
if (this.currentFolderId && changes['currentFolderId']?.currentValue !== changes['currentFolderId']?.previousValue) {
this.loadFolder();
}
if (this.data) {
@ -659,14 +649,19 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
}
private setLoadingState(value: boolean) {
if (value) {
clearTimeout(this.loadingTimeout);
this.loadingTimeout = setTimeout(() => {
this.loading = true;
}, 1000);
if (this.data?.getRows().length > 0) {
if (value) {
clearTimeout(this.loadingTimeout);
this.loadingTimeout = setTimeout(() => {
this.loading = true;
}, 1000);
} else {
clearTimeout(this.loadingTimeout);
this.loading = false;
}
} else {
clearTimeout(this.loadingTimeout);
this.loading = false;
this.loading = value;
}
}

View File

@ -127,7 +127,6 @@ export class DocumentListService implements DocumentListLoader {
* @returns Details of the folder
*/
getNode(nodeId: string, includeFields: string[] = []): Observable<NodeEntry> {
const includeFieldsRequest = ['path', 'properties', 'allowableOperations', 'permissions', 'definition', ...includeFields]
.filter((element, index, array) => index === array.indexOf(element));
@ -146,7 +145,6 @@ export class DocumentListService implements DocumentListLoader {
* @returns Details of the folder
*/
getFolderNode(nodeId: string, includeFields: string[] = []): Observable<NodeEntry> {
const includeFieldsRequest = ['path', 'properties', 'allowableOperations', 'permissions', 'aspectNames', ...includeFields]
.filter((element, index, array) => index === array.indexOf(element));
@ -184,7 +182,7 @@ export class DocumentListService implements DocumentListLoader {
}
private retrieveDocumentNode(nodeId: string, pagination: PaginationModel, includeFields: string[], where?: string, orderBy?: string[]): Observable<DocumentLoaderNode> {
return forkJoin(
return forkJoin([
this.getFolderNode(nodeId, includeFields),
this.getFolder(null, {
maxItems: pagination.maxItems,
@ -192,7 +190,7 @@ export class DocumentListService implements DocumentListLoader {
orderBy: orderBy,
rootFolderId: nodeId,
where: where
}, includeFields)).pipe(
}, includeFields)]).pipe(
map((results) => new DocumentLoaderNode(results[0], results[1]))
);
}

View File

@ -77,7 +77,7 @@ export class CardViewTextItemComponent extends BaseCardView<CardViewTextItemMode
this.textInput.valueChanges
.pipe(
filter(textInputValue => textInputValue !== this.editedValue),
debounceTime(500),
debounceTime(50),
takeUntil(this.onDestroy$)
)
.subscribe(textInputValue => {

View File

@ -398,7 +398,7 @@ describe('TaskFormCloudComponent', () => {
component.loading = true;
fixture.detectChanges();
const loadingTemplate = debugElement.query(By.css('mat-spinner'));
const loadingTemplate = debugElement.query(By.css('mat-progress-spinner'));
expect(loadingTemplate).toBeDefined();
});
@ -411,7 +411,7 @@ describe('TaskFormCloudComponent', () => {
component.loadTask();
fixture.detectChanges();
const loadingTemplate = debugElement.query(By.css('mat-spinner'));
const loadingTemplate = debugElement.query(By.css('mat-progress-spinner'));
expect(loadingTemplate).toBeNull();
});

View File

@ -82,7 +82,7 @@ describe('AppsListComponent', () => {
component.loading = true;
fixture.detectChanges();
fixture.whenStable().then(() => {
const loadingSpinner = fixture.nativeElement.querySelector('mat-spinner');
const loadingSpinner = fixture.nativeElement.querySelector('mat-progress-spinner');
expect(loadingSpinner).toBeDefined();
});
}));

View File

@ -50,7 +50,7 @@ export class CardTextItemPage {
async enterTextField(text: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.element(this.textField));
await BrowserActions.clearSendKeys(this.rootElement.element(this.textField), text);
await BrowserActions.clearSendKeys(this.rootElement.element(this.textField), text, 500);
await this.rootElement.element(this.textField).sendKeys(Key.TAB);
}

View File

@ -36,6 +36,8 @@ export class DataTableComponentPage {
emptyListTitle: ElementFinder;
emptyListSubtitle: ElementFinder;
MAX_LOADING_TIME = 120000;
constructor(rootElement = element.all(by.css('adf-datatable')).first()) {
this.rootElement = rootElement;
this.list = this.rootElement.all(by.css(`div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row']`));
@ -311,21 +313,24 @@ export class DataTableComponentPage {
}
async waitTillContentLoaded(): Promise<void> {
await browser.sleep(500);
if (await this.isSpinnerPresent()) {
Logger.log('wait datatable loading spinner disappear');
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.tagName('mat-spinner')));
await BrowserVisibility.waitUntilElementIsNotVisible(this.rootElement.element(by.tagName('mat-progress-spinner')), this.MAX_LOADING_TIME);
if (await this.isEmpty()) {
Logger.log('empty page');
} else {
await this.waitFirstElementPresent();
}
} else if (await this.isEmpty()) {
Logger.log('empty page');
} else {
try {
Logger.log('wait datatable loading spinner is present');
await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName('mat-spinner')), 2000);
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.element(by.tagName('mat-progress-spinner')), 2000);
await BrowserVisibility.waitUntilElementIsNotVisible(this.rootElement.element(by.tagName('mat-progress-spinner')), this.MAX_LOADING_TIME);
} catch (error) {
}
@ -341,7 +346,7 @@ export class DataTableComponentPage {
let isSpinnerPresent;
try {
isSpinnerPresent = await element(by.tagName('mat-spinner')).isDisplayed();
isSpinnerPresent = await this.rootElement.element(by.tagName('mat-progress-spinner')).isDisplayed();
} catch (error) {
isSpinnerPresent = false;
}
@ -353,7 +358,7 @@ export class DataTableComponentPage {
let isSpinnerPresent;
try {
isSpinnerPresent = await element(by.tagName('mat-progress-bar')).isDisplayed();
isSpinnerPresent = await this.rootElement.element(by.tagName('mat-progress-bar')).isDisplayed();
} catch (error) {
isSpinnerPresent = false;
}

View File

@ -119,11 +119,11 @@ export class ViewerPage {
if (this.isSpinnerPresent()) {
Logger.log('wait spinner disappear');
await BrowserVisibility.waitUntilElementIsNotPresent(element(by.tagName('mat-spinner')));
await BrowserVisibility.waitUntilElementIsNotPresent(element(by.tagName('mat-progress-spinner')));
} else {
try {
Logger.log('wait spinner is present');
await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-spinner')));
await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-progress-spinner')));
} catch (error) {
}
}
@ -133,7 +133,7 @@ export class ViewerPage {
let isSpinnerPresent;
try {
isSpinnerPresent = await element(by.tagName('mat-spinner')).isDisplayed();
isSpinnerPresent = await element(by.tagName('mat-progress-spinner')).isDisplayed();
} catch (error) {
isSpinnerPresent = false;
}

4
package-lock.json generated
View File

@ -2460,6 +2460,7 @@
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.9.6.tgz",
"integrity": "sha512-0gQJ9RTzO0heXOhzftog+a/WyOuqMrAIugVYxMYf83gh1CQaQDjMtsOpqOwXyDL/5JcWsrCm8l4ju8QC97O7EQ==",
"dev": true,
"optional": true,
"requires": {
"@babel/compat-data": "^7.9.6",
"@babel/helper-compilation-targets": "^7.9.6",
@ -2527,7 +2528,8 @@
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true
"dev": true,
"optional": true
}
}
},

View File

@ -23,7 +23,7 @@ fi;
#-b is needed to run the Folder upload test that are not workin in Headless chrome
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --use-dist || exit 1)
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$CONTEXT_ENV" || "${TRAVIS_EVENT_TYPE}" == "push" ]]; then
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$CONTEXT_ENV" || "${TRAVIS_EVENT_TYPE}" == "push" || "${TRAVIS_EVENT_TYPE}" == "api" ]]; then
echo "Run all e2e $CONTEXT_ENV"
$RUN_CHECK
$RUN_E2E --folder $CONTEXT_ENV

View File

@ -24,7 +24,7 @@ fi;
./node_modules/@alfresco/adf-cli/bin/adf-cli check-cs-env --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --use-dist || exit 1)
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$CONTEXT_ENV" || "${TRAVIS_EVENT_TYPE}" == "push" ]]; then
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$CONTEXT_ENV" || "${TRAVIS_EVENT_TYPE}" == "push" || "${TRAVIS_EVENT_TYPE}" == "api" ]]; then
echo "Run all e2e $CONTEXT_ENV"
$RUN_E2E --folder $CONTEXT_ENV || exit 1
else if [[ $AFFECTED_E2E == "e2e/$CONTEXT_ENV" ]]; then

View File

@ -17,7 +17,7 @@ if [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then
echo "Affected e2e ${AFFECTED_E2E}"
fi;
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "insight" || "${TRAVIS_EVENT_TYPE}" == "push" ]];
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "insight" || "${TRAVIS_EVENT_TYPE}" == "push" || "${TRAVIS_EVENT_TYPE}" == "api" ]];
then
./node_modules/@alfresco/adf-cli/bin/adf-cli check-ps-env --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1;
./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --folder insights --use-dist || exit 1;

View File

@ -27,7 +27,7 @@ check_env(){
./node_modules/@alfresco/adf-cli/bin/adf-cli check-cs-env --host "$E2E_HOST" -u "$E2E_ADMIN_EMAIL_IDENTITY" -p "$E2E_ADMIN_PASSWORD_IDENTITY" || exit 1
}
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$CONTEXT_ENV" || "${TRAVIS_EVENT_TYPE}" == "push" ]]; then
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$CONTEXT_ENV" || "${TRAVIS_EVENT_TYPE}" == "push" || "${TRAVIS_EVENT_TYPE}" == "api" ]]; then
echo "Run all e2e $CONTEXT_ENV"
check_env;
$RUN_E2E --folder $CONTEXT_ENV

View File

@ -23,7 +23,7 @@ fi;
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -host_sso "$HOST_SSO" -identity_admin_email "$E2E_ADMIN_EMAIL_IDENTITY" -identity_admin_password "$E2E_ADMIN_PASSWORD_IDENTITY" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --use-dist || exit 1)
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$CONTEXT_ENV" || "${TRAVIS_EVENT_TYPE}" == "push" ]]; then
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$CONTEXT_ENV" || "${TRAVIS_EVENT_TYPE}" == "push" || "${TRAVIS_EVENT_TYPE}" == "api" ]]; then
echo "Run all e2e $CONTEXT_ENV"
$RUN_E2E --folder $CONTEXT_ENV
else if [[ $AFFECTED_E2E == "e2e/$CONTEXT_ENV" ]]; then

View File

@ -22,7 +22,7 @@ fi;
./node_modules/@alfresco/adf-cli/bin/adf-cli check-cs-env --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --use-dist || exit 1)
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "content-services" || "${TRAVIS_EVENT_TYPE}" == "push" ]];
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "content-services" || "${TRAVIS_EVENT_TYPE}" == "push" || "${TRAVIS_EVENT_TYPE}" == "api" ]];
then
$RUN_E2E --folder $CONTEXT_ENV
else if [[ $AFFECTED_E2E == "e2e/$CONTEXT_ENV" ]];