diff --git a/.travis.yml b/.travis.yml index 1c6044dd04..3fbc55738e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,12 @@ install: env: global: + #E2E VARIABLES - SAVE_SCREENSHOT=true + - REDIRECT_URI=/ + - REDIRECT_URI_LOGOUT=/logout/ + - BROWSER_RUN=true + - MAXINSTANCES=2 branches: only: @@ -57,7 +62,7 @@ jobs: - ./scripts/lint.sh - ./scripts/travis/release/release-npm.sh - ./scripts/travis/release/release-docker.sh - + after_success: - ./scripts/travis/release/release-docker.sh - ./scripts/ci/utils/artifact-to-s3.sh -a ./dist/demo-shell -o "$S3_DBP_FOLDER/alfresco-demoshell.tar.bz2" diff --git a/demo-shell/src/app.config.json b/demo-shell/src/app.config.json index 809659a228..0f3ecbdc8f 100644 --- a/demo-shell/src/app.config.json +++ b/demo-shell/src/app.config.json @@ -24,7 +24,8 @@ "redirectUriLogout": "/logout", "publicUrls": [ "**/preview/s/*", - "**/settings" + "**/settings", + "**/logout" ] }, "application": { diff --git a/demo-shell/src/app/components/permissions/demo-permissions.component.ts b/demo-shell/src/app/components/permissions/demo-permissions.component.ts index 0353c8ff12..c13ea55e32 100644 --- a/demo-shell/src/app/components/permissions/demo-permissions.component.ts +++ b/demo-shell/src/app/components/permissions/demo-permissions.component.ts @@ -51,12 +51,12 @@ export class DemoPermissionComponent implements OnInit { this.nodeService .getNode(this.nodeId, {include: ['permissions'] }) .subscribe( (currentNode: MinimalNodeEntryEntity) => { - this.toggleStatus = currentNode.permissions.isInheritanceEnabled; + this.toggleStatus = currentNode.permissions?.isInheritanceEnabled ?? false; }); } onUpdatedPermissions(node: MinimalNodeEntryEntity) { - this.toggleStatus = node.permissions.isInheritanceEnabled; + this.toggleStatus = node.permissions?.isInheritanceEnabled ?? false; this.displayPermissionComponent.reload(); } diff --git a/e2e/content-services/comments/comment-component.e2e.ts b/e2e/content-services/comments/comment-component.e2e.ts index 6bd15945e2..e69890c8a9 100644 --- a/e2e/content-services/comments/comment-component.e2e.ts +++ b/e2e/content-services/comments/comment-component.e2e.ts @@ -96,7 +96,7 @@ describe('Comment Component', () => { await apiService.getInstance().core.commentsApi.addComment(nodeId, { content: comments.test }); await viewerPage.viewFile(pngFileModel.name); - await viewerPage.checkImgViewerIsDisplayed(); + await viewerPage.clickInfoButton(); await viewerPage.checkInfoSideBarIsDisplayed(); @@ -111,7 +111,7 @@ describe('Comment Component', () => { it('[C276948] Should be able to add a comment on a file', async () => { await viewerPage.viewFile(pngFileModel.name); - await viewerPage.checkImgViewerIsDisplayed(); + await viewerPage.clickInfoButton(); await viewerPage.checkInfoSideBarIsDisplayed(); await viewerPage.clickOnCommentsTab(); @@ -127,7 +127,7 @@ describe('Comment Component', () => { it('[C280021] Should be able to add a multiline comment on a file', async () => { await viewerPage.viewFile(pngFileModel.name); - await viewerPage.checkImgViewerIsDisplayed(); + await viewerPage.clickInfoButton(); await viewerPage.checkInfoSideBarIsDisplayed(); await viewerPage.clickOnCommentsTab(); @@ -151,7 +151,6 @@ describe('Comment Component', () => { it('[C280022] Should not be able to add an HTML or other code input into the comment input filed', async () => { await viewerPage.viewFile(pngFileModel.name); - await viewerPage.checkImgViewerIsDisplayed(); await viewerPage.clickInfoButton(); await viewerPage.checkInfoSideBarIsDisplayed(); await viewerPage.clickOnCommentsTab(); @@ -198,7 +197,6 @@ describe('Comment Component', () => { await contentServicesPage.checkAcsContainer(); await viewerPage.viewFile(pngUploadedFile.entry.name); - await viewerPage.checkImgViewerIsDisplayed(); await viewerPage.checkInfoButtonIsDisplayed(); await viewerPage.clickInfoButton(); await viewerPage.checkInfoSideBarIsDisplayed(); diff --git a/e2e/content-services/directives/create-folder-directive.e2e.ts b/e2e/content-services/directives/create-folder-directive.e2e.ts index 0d48cb68e4..894903a282 100644 --- a/e2e/content-services/directives/create-folder-directive.e2e.ts +++ b/e2e/content-services/directives/create-folder-directive.e2e.ts @@ -101,7 +101,7 @@ describe('Create folder directive', () => { await contentServicesPage.createNewFolder(folderName); await contentServicesPage.checkContentIsDisplayed(folderName); - await contentServicesPage.doubleClickRow(folderName); + await contentServicesPage.openFolder(folderName); await contentServicesPage.createNewFolder(folderName); await contentServicesPage.checkContentIsDisplayed(folderName); diff --git a/e2e/content-services/directives/create-library-directive.e2e.ts b/e2e/content-services/directives/create-library-directive.e2e.ts index 09e74bb331..7bda9f78aa 100644 --- a/e2e/content-services/directives/create-library-directive.e2e.ts +++ b/e2e/content-services/directives/create-library-directive.e2e.ts @@ -46,13 +46,12 @@ describe('Create library directive', () => { await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); acsUser = await usersActions.createUser(); - - await loginPage.login(acsUser.email, acsUser.password); - createSite = await apiService.getInstance().core.sitesApi.createSite({ title: StringUtil.generateRandomString(20).toLowerCase(), visibility: 'PUBLIC' }); + + await loginPage.login(acsUser.email, acsUser.password); }); afterAll(async () => { @@ -86,15 +85,14 @@ describe('Create library directive', () => { const libraryName = 'cancelLibrary'; await createLibraryDialog.typeLibraryName(libraryName); - await createLibraryDialog.clickCancel(); - await createLibraryDialog.waitForDialogToClose(); }); it('[C290160] Should create a public library', async () => { const libraryName = StringUtil.generateRandomString(); const libraryDescription = StringUtil.generateRandomString(); + await createLibraryDialog.typeLibraryName(libraryName); await createLibraryDialog.typeLibraryDescription(libraryDescription); await createLibraryDialog.selectPublic(); @@ -104,8 +102,6 @@ describe('Create library directive', () => { await createLibraryDialog.clickCreate(); await createLibraryDialog.waitForDialogToClose(); - await expect(await createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed'); - await customSourcesPage.navigateToCustomSources(); await customSourcesPage.selectMySitesSourceType(); await customSourcesPage.checkRowIsDisplayed(libraryName); @@ -116,6 +112,7 @@ describe('Create library directive', () => { it('[C290173] Should create a private library', async () => { const libraryName = StringUtil.generateRandomString(); const libraryDescription = StringUtil.generateRandomString(); + await createLibraryDialog.typeLibraryName(libraryName); await createLibraryDialog.typeLibraryDescription(libraryDescription); await createLibraryDialog.selectPrivate(); @@ -125,8 +122,6 @@ describe('Create library directive', () => { await createLibraryDialog.clickCreate(); await createLibraryDialog.waitForDialogToClose(); - await expect(await createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed'); - await customSourcesPage.navigateToCustomSources(); await customSourcesPage.selectMySitesSourceType(); await customSourcesPage.checkRowIsDisplayed(libraryName); @@ -148,8 +143,6 @@ describe('Create library directive', () => { await createLibraryDialog.clickCreate(); await createLibraryDialog.waitForDialogToClose(); - await expect(await createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed'); - await customSourcesPage.navigateToCustomSources(); await customSourcesPage.selectMySitesSourceType(); await customSourcesPage.checkRowIsDisplayed(libraryName); @@ -247,8 +240,6 @@ describe('Create library directive', () => { await createLibraryDialog.clickCreate(); await createLibraryDialog.waitForDialogToClose(); - - await expect(await createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create library dialog remained open'); }); it('[C290179] Should not accept more than the expected characters for input fields', async () => { diff --git a/e2e/content-services/directives/delete-directive.e2e.ts b/e2e/content-services/directives/delete-directive.e2e.ts index 3a068f5c8c..4b203ee968 100644 --- a/e2e/content-services/directives/delete-directive.e2e.ts +++ b/e2e/content-services/directives/delete-directive.e2e.ts @@ -109,6 +109,7 @@ describe('Delete Directive', () => { }); describe('Handling multiselection', () => { + beforeEach(async () => { await uploadActions.uploadFile(txtFileModel.location, txtFileModel.name, baseFolderUploaded.entry.id); await uploadActions.uploadFile(file0BytesModel.location, file0BytesModel.name, baseFolderUploaded.entry.id); diff --git a/e2e/content-services/directives/favorite-directive.e2e.ts b/e2e/content-services/directives/favorite-directive.e2e.ts index e8fd554539..7f808082ea 100644 --- a/e2e/content-services/directives/favorite-directive.e2e.ts +++ b/e2e/content-services/directives/favorite-directive.e2e.ts @@ -173,7 +173,7 @@ describe('Favorite directive', () => { await contentNodeSelector.clickContentNodeSelectorResult(testFolder1.entry.name); await contentNodeSelector.clickMoveCopyButton(); await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name); - await contentServicesPage.doubleClickRow(testFolder1.entry.name); + await contentServicesPage.openFolder(testFolder1.entry.name); await contentServicesPage.checkContentIsDisplayed(testFile.entry.name); await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name); diff --git a/e2e/content-services/directives/restore-content-directive.e2e.ts b/e2e/content-services/directives/restore-content-directive.e2e.ts index b5d3d73095..a9fb03009e 100644 --- a/e2e/content-services/directives/restore-content-directive.e2e.ts +++ b/e2e/content-services/directives/restore-content-directive.e2e.ts @@ -175,7 +175,7 @@ describe('Restore content directive', () => { it('[C260240] Should validate restore when the original location no longer exists', async () => { await contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name); - await contentServicesPage.doubleClickRow(folderWithFolder.entry.name); + await contentServicesPage.openFolder(folderWithFolder.entry.name); await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name); await contentServicesPage.deleteContent(subFolder.entry.name); await contentServicesPage.checkContentIsNotDisplayed(subFolder.entry.name); @@ -204,7 +204,7 @@ describe('Restore content directive', () => { await navigationBarPage.clickContentServicesButton(); await contentServicesPage.waitForTableBody(); await contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name); - await contentServicesPage.doubleClickRow(folderWithFolder.entry.name); + await contentServicesPage.openFolder(folderWithFolder.entry.name); await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name); }); @@ -266,7 +266,7 @@ describe('Restore content directive', () => { await contentServicesPage.selectSite(publicSite.entry.title); await contentServicesPage.waitForTableBody(); await contentServicesPage.checkContentIsDisplayed(siteFolder.entry.name); - await contentServicesPage.doubleClickRow(siteFolder.entry.name); + await contentServicesPage.openFolder(siteFolder.entry.name); await contentServicesPage.checkContentIsDisplayed(siteFile.entry.name); await notificationHistoryPage.checkNotifyContains(publicSite.entry.id + ' item restored'); }); @@ -287,7 +287,6 @@ describe('Restore content directive', () => { await loginPage.login(anotherAcsUser.email, anotherAcsUser.password); await contentServicesPage.goToDocumentList(); - await contentServicesPage.waitForTableBody(); }); afterAll(async () => { @@ -318,9 +317,9 @@ describe('Restore content directive', () => { await contentServicesPage.checkContentIsDisplayed(parentFolder.entry.name); await contentServicesPage.checkContentIsDisplayed(mainFolder.entry.name); await contentServicesPage.checkContentIsDisplayed(mainFile.entry.name); - await contentServicesPage.doubleClickRow(parentFolder.entry.name); + await contentServicesPage.openFolder(parentFolder.entry.name); await contentServicesPage.checkContentIsDisplayed(folderWithin.entry.name); - await contentServicesPage.doubleClickRow(folderWithin.entry.name); + await contentServicesPage.openFolder(folderWithin.entry.name); await contentServicesPage.checkContentIsDisplayed(pdfFile.entry.name); await contentServicesPage.checkContentIsDisplayed(pngFile.entry.name); }); diff --git a/e2e/content-services/document-list/document-list-actions.e2e.ts b/e2e/content-services/document-list/document-list-actions.e2e.ts index 04936ebb77..6a863a0a07 100644 --- a/e2e/content-services/document-list/document-list-actions.e2e.ts +++ b/e2e/content-services/document-list/document-list-actions.e2e.ts @@ -15,24 +15,19 @@ * limitations under the License. */ -import { browser, by, element } from 'protractor'; +import { browser } from 'protractor'; import { ApiService, - BreadcrumbPage, - BreadcrumbDropdownPage, ContentNodeSelectorDialogPage, LoginPage, - PaginationPage, StringUtil, UploadActions, - UserModel, UsersActions, ViewerPage } from '@alfresco/adf-testing'; import { ContentServicesPage } from '../../core/pages/content-services.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { FileModel } from '../../models/ACS/file.model'; -import { InfinitePaginationPage } from '../../core/pages/infinite-pagination.page'; import { FolderModel } from '../../models/ACS/folder.model'; describe('Document List Component - Actions', () => { @@ -40,17 +35,12 @@ describe('Document List Component - Actions', () => { const loginPage = new LoginPage(); const contentServicesPage = new ContentServicesPage(); const navigationBarPage = new NavigationBarPage(); - const contentListPage = contentServicesPage.getDocumentList(); const contentNodeSelector = new ContentNodeSelectorDialogPage(); - const paginationPage = new PaginationPage(); - const breadCrumbDropdownPage = new BreadcrumbDropdownPage(); - const breadCrumbPage = new BreadcrumbPage(); const viewerPage = new ViewerPage(); const apiService = new ApiService(); const usersActions = new UsersActions(apiService); const uploadActions = new UploadActions(apiService); - const infinitePaginationPage = new InfinitePaginationPage(element(by.css('adf-content-node-selector'))); describe('Document List Component - Check Actions', () => { let uploadedFolder, secondUploadedFolder; @@ -89,7 +79,7 @@ describe('Document List Component - Actions', () => { await loginPage.login(acsUser.email, acsUser.password); - await browser.sleep(10000); + await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded }); afterAll(async () => { @@ -98,6 +88,7 @@ describe('Document List Component - Actions', () => { beforeEach(async () => { await navigationBarPage.clickContentServicesButton(); + await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); }); describe('File Actions', () => { @@ -110,7 +101,7 @@ describe('Document List Component - Actions', () => { await contentNodeSelector.clickContentNodeSelectorResult(folderName); await contentNodeSelector.clickMoveCopyButton(); await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); - await contentServicesPage.doubleClickRow(uploadedFolder.entry.name); + await contentServicesPage.openFolder(uploadedFolder.entry.name); await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); }); @@ -135,7 +126,7 @@ describe('Document List Component - Actions', () => { await contentNodeSelector.clickContentNodeSelectorResult(folderName); await contentNodeSelector.clickMoveCopyButton(); await contentServicesPage.checkContentIsNotDisplayed(testFileModel.name); - await contentServicesPage.doubleClickRow(uploadedFolder.entry.name); + await contentServicesPage.openFolder(uploadedFolder.entry.name); await contentServicesPage.checkContentIsDisplayed(testFileModel.name); }); @@ -151,7 +142,7 @@ describe('Document List Component - Actions', () => { }); it('[C280561] Should be able to delete a file via dropdown menu', async () => { - await contentServicesPage.doubleClickRow(uploadedFolder.entry.name); + await contentServicesPage.openFolder(uploadedFolder.entry.name); await contentServicesPage.checkContentIsDisplayed(fileNames[0]); await contentServicesPage.deleteContent(fileNames[0]); @@ -159,7 +150,7 @@ describe('Document List Component - Actions', () => { }); it('[C280562] Only one file is deleted when multiple files are selected using dropdown menu', async () => { - await contentServicesPage.doubleClickRow(uploadedFolder.entry.name); + await contentServicesPage.openFolder(uploadedFolder.entry.name); await contentServicesPage.getDocumentList().selectRow(fileNames[1]); await contentServicesPage.getDocumentList().selectRow(fileNames[2]); @@ -169,7 +160,7 @@ describe('Document List Component - Actions', () => { }); it('[C280565] Should be able to delete a file using context menu', async () => { - await contentServicesPage.doubleClickRow(uploadedFolder.entry.name); + await contentServicesPage.openFolder(uploadedFolder.entry.name); await contentServicesPage.checkContentIsDisplayed(fileNames[2]); await contentServicesPage.getDocumentList().rightClickOnRow(fileNames[2]); await contentServicesPage.pressContextMenuActionNamed('Delete'); @@ -177,7 +168,7 @@ describe('Document List Component - Actions', () => { }); it('[C280567] Only one file is deleted when multiple files are selected using context menu', async () => { - await contentServicesPage.doubleClickRow(uploadedFolder.entry.name); + await contentServicesPage.openFolder(uploadedFolder.entry.name); await contentServicesPage.getDocumentList().selectRow(fileNames[3]); await contentServicesPage.getDocumentList().selectRow(fileNames[4]); @@ -216,7 +207,7 @@ describe('Document List Component - Actions', () => { await contentNodeSelector.clickContentNodeSelectorResult(secondUploadedFolder.entry.name); await contentNodeSelector.clickMoveCopyButton(); await contentServicesPage.checkContentIsDisplayed(folderName); - await contentServicesPage.doubleClickRow(secondUploadedFolder.entry.name); + await contentServicesPage.openFolder(secondUploadedFolder.entry.name); await contentServicesPage.checkContentIsDisplayed(folderName); }); @@ -256,140 +247,4 @@ describe('Document List Component - Actions', () => { }); }); - describe('Folder Actions - Copy and Move', () => { - const folderModel1 = new FolderModel({ name: StringUtil.generateRandomString() }); - const folderModel2 = new FolderModel({ name: StringUtil.generateRandomString() }); - const folderModel3 = new FolderModel({ name: StringUtil.generateRandomString() }); - const folderModel4 = new FolderModel({ name: StringUtil.generateRandomString() }); - const folderModel5 = new FolderModel({ name: StringUtil.generateRandomString() }); - const folderModel6 = new FolderModel({ name: StringUtil.generateRandomString() }); - - let folder1, folder2, folder3, folder4, folder5, folder6; - - let folders; - const contentServicesUser = new UserModel(); - - beforeAll(async () => { - await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); - await usersActions.createUser(contentServicesUser); - await apiService.getInstance().login(contentServicesUser.email, contentServicesUser.password); - folder1 = await uploadActions.createFolder('A' + folderModel1.name, '-my-'); - folder2 = await uploadActions.createFolder('B' + folderModel2.name, '-my-'); - folder3 = await uploadActions.createFolder('C' + folderModel3.name, '-my-'); - folder4 = await uploadActions.createFolder('D' + folderModel4.name, '-my-'); - folder5 = await uploadActions.createFolder('E' + folderModel5.name, '-my-'); - folder6 = await uploadActions.createFolder('F' + folderModel6.name, '-my-'); - folders = [folder1, folder2, folder3, folder4, folder5, folder6]; - }); - - beforeEach(async () => { - await loginPage.login(contentServicesUser.email, contentServicesUser.password); - await contentServicesPage.goToDocumentList(); - await contentServicesPage.waitForTableBody(); - await paginationPage.selectItemsPerPage('5'); - await contentServicesPage.checkAcsContainer(); - await contentListPage.waitForTableBody(); - }); - - afterAll(async () => { - await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); - for (const folder of folders) { - await uploadActions.deleteFileOrFolder(folder.entry.id); - } - }); - - it('[C260132] Move action on folder with - Load more', async () => { - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5'); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6); - - await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name); - await contentServicesPage.checkContextActionIsVisible('Move'); - await contentServicesPage.pressContextMenuActionNamed('Move'); - await contentNodeSelector.checkDialogIsDisplayed(); - - await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Move \'' + 'A' + folderModel1.name + '\' to...'); - await contentNodeSelector.checkSearchInputIsDisplayed(); - await expect(await contentNodeSelector.getSearchLabel()).toBe('Search'); - await contentNodeSelector.checkSelectedSiteIsDisplayed('My files'); - await contentNodeSelector.checkCancelButtonIsDisplayed(); - await contentNodeSelector.checkMoveCopyButtonIsDisplayed(); - - await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('MOVE'); - await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5); - await infinitePaginationPage.clickLoadMoreButton(); - - await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6); - await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed(); - await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name); - await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name); - await contentNodeSelector.clickCancelButton(); - await contentNodeSelector.checkDialogIsNotDisplayed(); - await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); - - await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name); - await contentServicesPage.checkContextActionIsVisible('Move'); - await contentServicesPage.pressContextMenuActionNamed('Move'); - await contentNodeSelector.checkDialogIsDisplayed(); - await infinitePaginationPage.clickLoadMoreButton(); - await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name); - await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name); - await contentNodeSelector.clickMoveCopyButton(); - await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name); - await contentServicesPage.doubleClickRow('F' + folderModel6.name); - await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); - - await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name); - await contentServicesPage.checkContextActionIsVisible('Move'); - await contentServicesPage.pressContextMenuActionNamed('Move'); - await contentNodeSelector.checkDialogIsDisplayed(); - await breadCrumbDropdownPage.clickParentFolder(); - await breadCrumbDropdownPage.checkBreadCrumbDropdownIsDisplayed(); - await breadCrumbDropdownPage.choosePath(contentServicesUser.email); - await contentNodeSelector.clickMoveCopyButton(); - await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name); - - await breadCrumbPage.chooseBreadCrumb(contentServicesUser.email); - await contentServicesPage.waitForTableBody(); - await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); - }); - - it('[C305051] Copy action on folder with - Load more', async () => { - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5'); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6); - await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name); - await contentServicesPage.checkContextActionIsVisible('Copy'); - await contentServicesPage.pressContextMenuActionNamed('Copy'); - await contentNodeSelector.checkDialogIsDisplayed(); - await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Copy \'' + 'A' + folderModel1.name + '\' to...'); - await contentNodeSelector.checkSearchInputIsDisplayed(); - await expect(await contentNodeSelector.getSearchLabel()).toBe('Search'); - await contentNodeSelector.checkSelectedSiteIsDisplayed('My files'); - await contentNodeSelector.checkCancelButtonIsDisplayed(); - await contentNodeSelector.checkMoveCopyButtonIsDisplayed(); - await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('COPY'); - await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5); - await infinitePaginationPage.clickLoadMoreButton(); - await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6); - await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed(); - await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name); - await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name); - await contentNodeSelector.clickCancelButton(); - await contentNodeSelector.checkDialogIsNotDisplayed(); - await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); - - await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name); - await contentServicesPage.checkContextActionIsVisible('Copy'); - await contentServicesPage.pressContextMenuActionNamed('Copy'); - await contentNodeSelector.checkDialogIsDisplayed(); - await infinitePaginationPage.clickLoadMoreButton(); - await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name); - await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name); - await contentNodeSelector.clickMoveCopyButton(); - await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); - await paginationPage.clickOnNextPage(); - await contentServicesPage.getDocumentList().waitForTableBody(); - await contentServicesPage.doubleClickRow('F' + folderModel6.name); - await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); - }); - }); }); diff --git a/e2e/content-services/document-list/document-list-component.e2e.ts b/e2e/content-services/document-list/document-list-component.e2e.ts index af37051391..f0076f95f0 100644 --- a/e2e/content-services/document-list/document-list-component.e2e.ts +++ b/e2e/content-services/document-list/document-list-component.e2e.ts @@ -222,7 +222,7 @@ describe('Document List Component', () => { await loginPage.login(acsUser.email, acsUser.password); await contentServicesPage.goToDocumentList(); await contentServicesPage.createNewFolder(folderName); - await contentServicesPage.doubleClickRow(folderName); + await contentServicesPage.openFolder(folderName); await contentServicesPage.checkEmptyFolderTextToBe('This folder is empty'); await contentServicesPage.checkEmptyFolderImageUrlToContain('/assets/images/empty_doc_lib.svg'); }); @@ -241,7 +241,7 @@ describe('Document List Component', () => { await loginPage.login(acsUser.email, acsUser.password); await contentServicesPage.goToDocumentList(); await contentServicesPage.checkContentIsDisplayed(uploadedFolder.entry.name); - await contentServicesPage.doubleClickRow(uploadedFolder.entry.name); + await contentServicesPage.openFolder(uploadedFolder.entry.name); await contentServicesPage.uploadFile(testFile.location); await contentServicesPage.checkContentIsDisplayed(testFile.name); }); @@ -345,7 +345,6 @@ describe('Document List Component', () => { await loginPage.login(acsUser.email, acsUser.password); await contentServicesPage.goToDocumentList(); - await contentServicesPage.waitForTableBody(); }); it('[C291843] Should be able to navigate using nodes hyperlink when activated', async () => { diff --git a/e2e/content-services/document-list/document-list-copy-move-actions.e2e.ts b/e2e/content-services/document-list/document-list-copy-move-actions.e2e.ts index 809ea71949..c4b2fca4a5 100644 --- a/e2e/content-services/document-list/document-list-copy-move-actions.e2e.ts +++ b/e2e/content-services/document-list/document-list-copy-move-actions.e2e.ts @@ -97,7 +97,7 @@ describe('Document List Component', () => { } }); - await browser.driver.sleep(12000); + await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded }); afterAll(async () => { @@ -119,6 +119,7 @@ describe('Document List Component', () => { beforeEach(async () => { await BrowserActions.closeMenuAndDialogs(); await navigationBarPage.clickContentServicesButton(); + await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); }); it('[C260128] Move - Same name file', async () => { @@ -142,11 +143,11 @@ describe('Document List Component', () => { await contentNodeSelector.clickContentNodeSelectorResult(destinationFolder.entry.name); await contentNodeSelector.clickMoveCopyButton(); await contentServicesPage.checkContentIsNotDisplayed(sourceFolder.entry.name); - await contentServicesPage.doubleClickRow(destinationFolder.entry.name); + await contentServicesPage.openFolder(destinationFolder.entry.name); await contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name); - await contentServicesPage.doubleClickRow(sourceFolder.entry.name); + await contentServicesPage.openFolder(sourceFolder.entry.name); await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name); - await contentServicesPage.doubleClickRow(subFolder.entry.name); + await contentServicesPage.openFolder(subFolder.entry.name); await contentServicesPage.checkContentIsDisplayed(subFile.entry.name); }); diff --git a/e2e/content-services/document-list/document-list-folder-actions.e2e.ts b/e2e/content-services/document-list/document-list-folder-actions.e2e.ts new file mode 100644 index 0000000000..fbe4f42a57 --- /dev/null +++ b/e2e/content-services/document-list/document-list-folder-actions.e2e.ts @@ -0,0 +1,185 @@ +/*! + * @license + * Copyright 2019 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { browser, by, element } from 'protractor'; +import { + ApiService, + BreadcrumbPage, + BreadcrumbDropdownPage, + ContentNodeSelectorDialogPage, + LoginPage, + PaginationPage, + StringUtil, + UploadActions, + UserModel, + UsersActions +} from '@alfresco/adf-testing'; +import { ContentServicesPage } from '../../core/pages/content-services.page'; +import { InfinitePaginationPage } from '../../core/pages/infinite-pagination.page'; +import { FolderModel } from '../../models/ACS/folder.model'; + +describe('Document List Component - Actions', () => { + + const loginPage = new LoginPage(); + const contentServicesPage = new ContentServicesPage(); + const contentListPage = contentServicesPage.getDocumentList(); + const contentNodeSelector = new ContentNodeSelectorDialogPage(); + const paginationPage = new PaginationPage(); + const breadCrumbDropdownPage = new BreadcrumbDropdownPage(); + const breadCrumbPage = new BreadcrumbPage(); + const apiService = new ApiService(); + const usersActions = new UsersActions(apiService); + + const uploadActions = new UploadActions(apiService); + const infinitePaginationPage = new InfinitePaginationPage(element(by.css('adf-content-node-selector'))); + + describe('Folder Actions - Copy and Move', () => { + const folderModel1 = new FolderModel({ name: StringUtil.generateRandomString() }); + const folderModel2 = new FolderModel({ name: StringUtil.generateRandomString() }); + const folderModel3 = new FolderModel({ name: StringUtil.generateRandomString() }); + const folderModel4 = new FolderModel({ name: StringUtil.generateRandomString() }); + const folderModel5 = new FolderModel({ name: StringUtil.generateRandomString() }); + const folderModel6 = new FolderModel({ name: StringUtil.generateRandomString() }); + + let folder1, folder2, folder3, folder4, folder5, folder6; + + let folders; + const contentServicesUser = new UserModel(); + + beforeAll(async () => { + await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); + await usersActions.createUser(contentServicesUser); + await apiService.getInstance().login(contentServicesUser.email, contentServicesUser.password); + folder1 = await uploadActions.createFolder('A' + folderModel1.name, '-my-'); + folder2 = await uploadActions.createFolder('B' + folderModel2.name, '-my-'); + folder3 = await uploadActions.createFolder('C' + folderModel3.name, '-my-'); + folder4 = await uploadActions.createFolder('D' + folderModel4.name, '-my-'); + folder5 = await uploadActions.createFolder('E' + folderModel5.name, '-my-'); + folder6 = await uploadActions.createFolder('F' + folderModel6.name, '-my-'); + folders = [folder1, folder2, folder3, folder4, folder5, folder6]; + }); + + beforeEach(async () => { + await loginPage.login(contentServicesUser.email, contentServicesUser.password); + await contentServicesPage.goToDocumentList(); + await paginationPage.selectItemsPerPage('5'); + await contentServicesPage.checkAcsContainer(); + await contentListPage.waitForTableBody(); + }); + + afterAll(async () => { + await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); + for (const folder of folders) { + await uploadActions.deleteFileOrFolder(folder.entry.id); + } + }); + + it('[C260132] Move action on folder with - Load more', async () => { + await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5'); + await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6); + + await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name); + await contentServicesPage.checkContextActionIsVisible('Move'); + await contentServicesPage.pressContextMenuActionNamed('Move'); + await contentNodeSelector.checkDialogIsDisplayed(); + + await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Move \'' + 'A' + folderModel1.name + '\' to...'); + await contentNodeSelector.checkSearchInputIsDisplayed(); + await expect(await contentNodeSelector.getSearchLabel()).toBe('Search'); + await contentNodeSelector.checkSelectedSiteIsDisplayed('My files'); + await contentNodeSelector.checkCancelButtonIsDisplayed(); + await contentNodeSelector.checkMoveCopyButtonIsDisplayed(); + + await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('MOVE'); + await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5); + await infinitePaginationPage.clickLoadMoreButton(); + + await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6); + await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed(); + await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name); + await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name); + await contentNodeSelector.clickCancelButton(); + await contentNodeSelector.checkDialogIsNotDisplayed(); + await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); + + await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name); + await contentServicesPage.checkContextActionIsVisible('Move'); + await contentServicesPage.pressContextMenuActionNamed('Move'); + await contentNodeSelector.checkDialogIsDisplayed(); + await infinitePaginationPage.clickLoadMoreButton(); + await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name); + await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name); + await contentNodeSelector.clickMoveCopyButton(); + await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name); + await contentServicesPage.openFolder('F' + folderModel6.name); + await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); + + await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name); + await contentServicesPage.checkContextActionIsVisible('Move'); + await contentServicesPage.pressContextMenuActionNamed('Move'); + await contentNodeSelector.checkDialogIsDisplayed(); + await breadCrumbDropdownPage.clickParentFolder(); + await breadCrumbDropdownPage.checkBreadCrumbDropdownIsDisplayed(); + await breadCrumbDropdownPage.choosePath(contentServicesUser.email); + await contentNodeSelector.clickMoveCopyButton(); + await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name); + + await breadCrumbPage.chooseBreadCrumb(contentServicesUser.email); + await contentServicesPage.waitForTableBody(); + await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); + }); + + it('[C305051] Copy action on folder with - Load more', async () => { + await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5'); + await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6); + await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name); + await contentServicesPage.checkContextActionIsVisible('Copy'); + await contentServicesPage.pressContextMenuActionNamed('Copy'); + await contentNodeSelector.checkDialogIsDisplayed(); + await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Copy \'' + 'A' + folderModel1.name + '\' to...'); + await contentNodeSelector.checkSearchInputIsDisplayed(); + await expect(await contentNodeSelector.getSearchLabel()).toBe('Search'); + await contentNodeSelector.checkSelectedSiteIsDisplayed('My files'); + await contentNodeSelector.checkCancelButtonIsDisplayed(); + await contentNodeSelector.checkMoveCopyButtonIsDisplayed(); + await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('COPY'); + await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5); + await infinitePaginationPage.clickLoadMoreButton(); + await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6); + await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed(); + await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name); + await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name); + await contentNodeSelector.clickCancelButton(); + await contentNodeSelector.checkDialogIsNotDisplayed(); + await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); + + await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name); + await contentServicesPage.checkContextActionIsVisible('Copy'); + await contentServicesPage.pressContextMenuActionNamed('Copy'); + await contentNodeSelector.checkDialogIsDisplayed(); + await infinitePaginationPage.clickLoadMoreButton(); + await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name); + await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name); + await contentNodeSelector.clickMoveCopyButton(); + await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); + await paginationPage.clickOnNextPage(); + await contentServicesPage.getDocumentList().waitForTableBody(); + await contentServicesPage.openFolder('F' + folderModel6.name); + await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); + }); + }); +}); diff --git a/e2e/content-services/document-list/document-list-gallery.e2e.ts b/e2e/content-services/document-list/document-list-gallery.e2e.ts index 2b0e748525..3bb3c57b92 100644 --- a/e2e/content-services/document-list/document-list-gallery.e2e.ts +++ b/e2e/content-services/document-list/document-list-gallery.e2e.ts @@ -157,7 +157,7 @@ describe('Document List Component', () => { it('[C280130] Should be able to go back to List View', async () => { await contentServicesPage.clickGridViewButton(); await contentServicesPage.checkAcsContainer(); - await contentServicesPage.doubleClickRow(folderName); + await contentServicesPage.openFolder(folderName); await contentServicesPage.checkRowIsDisplayed(pdfFile.name); }); diff --git a/e2e/content-services/document-list/document-list-pagination.e2e.ts b/e2e/content-services/document-list/document-list-pagination.e2e.ts index ee52b80641..8368a704fa 100644 --- a/e2e/content-services/document-list/document-list-pagination.e2e.ts +++ b/e2e/content-services/document-list/document-list-pagination.e2e.ts @@ -105,7 +105,6 @@ describe('Document List - Pagination', () => { beforeEach(async () => { await contentServicesPage.goToDocumentList(); - await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); }); it('[C260062] Should use default pagination settings', async () => { @@ -136,7 +135,6 @@ describe('Document List - Pagination', () => { await loginPage.login(acsUser.email, acsUser.password); await contentServicesPage.goToDocumentList(); - await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty); await navigationBarPage.clickLogoutButton(); @@ -153,25 +151,31 @@ describe('Document List - Pagination', () => { await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue); let list = await contentServicesPage.getAllRowsNameColumn(); await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true); + await paginationPage.clickOnNextPage(); 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); list = await contentServicesPage.getAllRowsNameColumn(); await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(5, 10))).toEqual(true); + await paginationPage.clickOnNextPage(); 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); list = await contentServicesPage.getAllRowsNameColumn(); await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(10, 15))).toEqual(true); + await paginationPage.clickOnNextPage(); 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); @@ -336,7 +340,7 @@ describe('Document List - Pagination', () => { await contentServicesPage.goToDocumentList(); await browser.refresh(); - await contentServicesPage.doubleClickRow(newFolderModel.name); + await contentServicesPage.openFolder(newFolderModel.name); await contentServicesPage.uploadFile(docxFileModel.location); await contentServicesPage.checkContentIsDisplayed(docxFileModel.name); await uploadDialog.clickOnCloseButton(); diff --git a/e2e/content-services/document-list/document-list-properties.e2e.ts b/e2e/content-services/document-list/document-list-properties.e2e.ts index 832250343d..4d8985923d 100644 --- a/e2e/content-services/document-list/document-list-properties.e2e.ts +++ b/e2e/content-services/document-list/document-list-properties.e2e.ts @@ -61,7 +61,7 @@ describe('Document List Component - Properties', () => { it('[C299154] Should disallow upload content on a folder row if allowDropFiles is false', async () => { await navigationBar.clickContentServicesButton(); - await contentServicesPage.doubleClickRow(parentFolder.entry.name); + await contentServicesPage.openFolder(parentFolder.entry.name); await contentServicesPage.disableDropFilesInAFolder(); @@ -69,13 +69,13 @@ describe('Document List Component - Properties', () => { await DropActions.dropFile(dragAndDropArea, pngFile.location); await contentServicesPage.checkContentIsDisplayed(pngFile.name); - await contentServicesPage.doubleClickRow(subFolder.entry.name); + await contentServicesPage.openFolder(subFolder.entry.name); await contentServicesPage.checkEmptyFolderTextToBe('This folder is empty'); }); it('[C91319] Should allow upload content on a folder row if allowDropFiles is true', async () => { await navigationBar.clickContentServicesButton(); - await contentServicesPage.doubleClickRow(parentFolder.entry.name); + await contentServicesPage.openFolder(parentFolder.entry.name); await contentServicesPage.enableDropFilesInAFolder(); @@ -84,7 +84,7 @@ describe('Document List Component - Properties', () => { await DropActions.dropFile(dragAndDropArea, pngFile.location); await contentServicesPage.checkContentIsNotDisplayed(pngFile.name); - await contentServicesPage.doubleClickRow(subFolder.entry.name); + await contentServicesPage.openFolder(subFolder.entry.name); await contentServicesPage.checkContentIsDisplayed(pngFile.name); }); }); diff --git a/e2e/content-services/document-list/document-list-selection.e2e.ts b/e2e/content-services/document-list/document-list-selection.e2e.ts index bcaba89dc7..85291f75d6 100644 --- a/e2e/content-services/document-list/document-list-selection.e2e.ts +++ b/e2e/content-services/document-list/document-list-selection.e2e.ts @@ -48,7 +48,6 @@ describe('Document List - Selection', () => { await loginPage.login(acsUser.email, acsUser.password); await contentServicesPage.goToDocumentList(); - await contentServicesPage.checkDocumentListElementsAreDisplayed(); await contentServicesPage.createNewFolder(folderModel.name); await contentServicesPage.uploadFile(docxFileModel.location); await contentServicesPage.checkContentIsDisplayed(docxFileModel.name); diff --git a/e2e/content-services/permissions/permissions-component.e2e.ts b/e2e/content-services/permissions/permissions-component.e2e.ts index 6f4ca64947..4a647ebc5f 100644 --- a/e2e/content-services/permissions/permissions-component.e2e.ts +++ b/e2e/content-services/permissions/permissions-component.e2e.ts @@ -163,11 +163,11 @@ describe('Permissions Component', () => { await uploadActions.uploadFile(fileModel.location, 'RoleCoordinator' + fileModel.name, roleCoordinatorFolder.entry.id); await uploadActions.uploadFile(fileModel.location, 'RoleCollaborator' + fileModel.name, roleCollaboratorFolder.entry.id); await uploadActions.uploadFile(fileModel.location, 'RoleEditor' + fileModel.name, roleEditorFolder.entry.id); - }); + + await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded + }); afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); for (const folder of folders) { await uploadActions.deleteFileOrFolder(folder.entry.id); @@ -175,13 +175,17 @@ describe('Permissions Component', () => { }); describe('Inherit and assigning permissions', () => { + beforeEach(async () => { await apiService.getInstance().login(fileOwnerUser.email, fileOwnerUser.password); file = await uploadActions.uploadFile(fileModel.location, fileModel.name, '-my-'); + await loginPage.login(fileOwnerUser.email, fileOwnerUser.password); + await contentServicesPage.goToDocumentList(); + await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); await contentServicesPage.checkContentIsDisplayed(fileModel.name); - await contentServicesPage.checkSelectedSiteIsDisplayed('My files'); + await contentList.rightClickOnRow(fileModel.name); await contentServicesPage.pressContextMenuActionNamed('Permission'); await permissionsPage.addPermissionsDialog.checkPermissionContainerIsDisplayed(); @@ -193,17 +197,19 @@ describe('Permissions Component', () => { await uploadActions.deleteFileOrFolder(file.entry.id); } catch (error) { } - }); + await navigationBarPage.clickLogoutButton(); + }); it('[C268974] Inherit Permission', async () => { await permissionsPage.addPermissionsDialog.checkPermissionInheritedButtonIsDisplayed(); - await expect(await permissionsPage.addPermissionsDialog.getPermissionInheritedButtonText()).toBe('Permission Inherited'); + await permissionsPage.addPermissionsDialog.getPermissionInheritedButtonText('Permission Inherited'); await permissionsPage.addPermissionsDialog.checkPermissionsDatatableIsDisplayed(); await permissionsPage.addPermissionsDialog.clickPermissionInheritedButton(); - await expect(await permissionsPage.addPermissionsDialog.getPermissionInheritedButtonText()).toBe('Inherit Permission'); + + await permissionsPage.addPermissionsDialog.getPermissionInheritedButtonText('Inherit Permission'); await permissionsPage.addPermissionsDialog.checkNoPermissionsIsDisplayed(); await permissionsPage.addPermissionsDialog.clickPermissionInheritedButton(); - await expect(await permissionsPage.addPermissionsDialog.getPermissionInheritedButtonText()).toBe('Permission Inherited'); + await permissionsPage.addPermissionsDialog.getPermissionInheritedButtonText('Permission Inherited'); await permissionsPage.addPermissionsDialog.checkPermissionsDatatableIsDisplayed(); }); @@ -238,9 +244,10 @@ describe('Permissions Component', () => { await permissionsPage.addPermissionsDialog.checkResultListIsDisplayed(); await permissionsPage.addPermissionsDialog.checkUserOrGroupIsDisplayed('EVERYONE'); }); - }); + }); describe('Changing and duplicate Permissions', () => { + beforeEach(async () => { await apiService.getInstance().login(fileOwnerUser.email, fileOwnerUser.password); file = await uploadActions.uploadFile(fileModel.location, fileModel.name, '-my-'); @@ -261,6 +268,7 @@ describe('Permissions Component', () => { afterEach(async () => { await uploadActions.deleteFileOrFolder(file.entry.id); + await navigationBarPage.clickLogoutButton(); }); it('[C274691] Should be able to add a new User with permission to the file and also change locally set permissions', async () => { @@ -268,19 +276,24 @@ describe('Permissions Component', () => { await permissionsPage.addPermissionsDialog.clickRoleDropdownByUserOrGroupName(filePermissionUser.email); const roleDropdownOptions = permissionsPage.addPermissionsDialog.getRoleDropdownOptions(); await expect(await roleDropdownOptions.count()).toBe(5); + await expect(await BrowserActions.getText(roleDropdownOptions.get(0))).toBe('Contributor'); await expect(await BrowserActions.getText(roleDropdownOptions.get(1))).toBe('Collaborator'); await expect(await BrowserActions.getText(roleDropdownOptions.get(2))).toBe('Coordinator'); await expect(await BrowserActions.getText(roleDropdownOptions.get(3))).toBe('Editor'); await expect(await BrowserActions.getText(roleDropdownOptions.get(4))).toBe('Consumer'); + await permissionsPage.addPermissionsDialog.selectOption('Collaborator'); await expect(await permissionsPage.addPermissionsDialog.getRoleCellValue(filePermissionUser.email)).toEqual('Collaborator'); + await permissionsPage.addPermissionsDialog.clickRoleDropdownByUserOrGroupName(filePermissionUser.email); await permissionsPage.addPermissionsDialog.selectOption('Coordinator'); await expect(await permissionsPage.addPermissionsDialog.getRoleCellValue(filePermissionUser.email)).toEqual('Coordinator'); + await permissionsPage.addPermissionsDialog.clickRoleDropdownByUserOrGroupName(filePermissionUser.email); await permissionsPage.addPermissionsDialog.selectOption('Editor'); await expect(await permissionsPage.addPermissionsDialog.getRoleCellValue(filePermissionUser.email)).toEqual('Editor'); + await permissionsPage.addPermissionsDialog.clickRoleDropdownByUserOrGroupName(filePermissionUser.email); await permissionsPage.addPermissionsDialog.selectOption('Consumer'); await expect(await permissionsPage.addPermissionsDialog.getRoleCellValue(filePermissionUser.email)).toEqual('Consumer'); @@ -302,9 +315,14 @@ describe('Permissions Component', () => { await permissionsPage.addPermissionsDialog.clickDeletePermissionButton(); await permissionsPage.addPermissionsDialog.checkUserOrGroupIsDeleted(filePermissionUser.email); }); - }); + }); describe('Role: Consumer, Contributor, Coordinator, Collaborator, Editor, No Permissions', () => { + + afterEach(async () => { + await navigationBarPage.clickLogoutButton(); + }); + it('[C276993] Role Consumer', async () => { await loginPage.login(filePermissionUser.email, filePermissionUser.password); await navigationBarPage.openContentServicesFolder(roleConsumerFolder.entry.id); @@ -428,5 +446,5 @@ describe('Permissions Component', () => { await permissionsPage.addPermissionsDialog.clickAddPermissionButton(); await notificationHistoryPage.checkNotifyContains('You are not allowed to change permissions'); }); - }); + }); }); diff --git a/e2e/content-services/permissions/site-permissions.e2e.ts b/e2e/content-services/permissions/site-permissions.e2e.ts index 5743783152..3648089835 100644 --- a/e2e/content-services/permissions/site-permissions.e2e.ts +++ b/e2e/content-services/permissions/site-permissions.e2e.ts @@ -165,6 +165,8 @@ describe('Permissions Component', () => { await loginPage.login(folderOwnerUser.email, folderOwnerUser.password); await BrowserActions.getUrl(browser.baseUrl + '/files/' + publicSite.entry.guid); + await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); + }); it('[C277002] Should display the Role Site dropdown', async () => { diff --git a/e2e/content-services/share-file/share-file.e2e.ts b/e2e/content-services/share-file/share-file.e2e.ts index 44abd9ed73..80710b7627 100644 --- a/e2e/content-services/share-file/share-file.e2e.ts +++ b/e2e/content-services/share-file/share-file.e2e.ts @@ -62,7 +62,7 @@ describe('Share file', () => { return sharedLinkEntry.entry.nodeId === nodeIdSharedFile; }); - return sharedLink !== null; + return !!sharedLink; }; const apiCall = async () => { @@ -162,6 +162,7 @@ describe('Share file', () => { }); describe('Shared link preview', () => { + beforeEach(async () => { await loginPage.login(acsUser.email, acsUser.password); await navigationBarPage.clickContentServicesButton(); @@ -204,6 +205,7 @@ describe('Share file', () => { const sharedLink = await shareDialog.getShareLink(); await shareDialog.clickCloseButton(); await navigationBarPage.clickLogoutButton(); + await BrowserActions.getUrl(sharedLink); await viewerPage.checkFileNameIsDisplayed(pngFileModel.name); }); diff --git a/e2e/content-services/share-file/unshare-file.e2e.ts b/e2e/content-services/share-file/unshare-file.e2e.ts index b95df05bd8..d063478a63 100644 --- a/e2e/content-services/share-file/unshare-file.e2e.ts +++ b/e2e/content-services/share-file/unshare-file.e2e.ts @@ -120,6 +120,7 @@ describe('Unshare file', () => { describe('with permission', () => { afterAll(async () => { + await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); await uploadActions.deleteFileOrFolder(nodeId); }); @@ -160,7 +161,7 @@ describe('Unshare file', () => { await shareDialog.confirmationDialogIsDisplayed(); await shareDialog.clickConfirmationDialogRemoveButton(); await shareDialog.dialogIsClosed(); - await BrowserActions.getUrl(sharedLink.replace(browser.params.testConfig.appConfig.ecmHost, browser.baseUrl )); + await BrowserActions.getUrl(sharedLink.replace(browser.params.testConfig.appConfig.ecmHost, browser.baseUrl)); await errorPage.checkErrorCode(); }); }); @@ -173,7 +174,7 @@ describe('Unshare file', () => { it('[C286555] Should NOT be able to unshare file without permission', async () => { await navBar.goToSite(testSite); - await contentListPage.doubleClickRow('documentLibrary'); + await contentServicesPage.openFolder('documentLibrary'); await contentListPage.selectRow(nodeBody.name); await contentServicesPage.clickShareButton(); await shareDialog.checkDialogIsDisplayed(); diff --git a/e2e/content-services/social/social.component.e2e.ts b/e2e/content-services/social/social.component.e2e.ts index 34edc90034..7f6a8fe4ef 100644 --- a/e2e/content-services/social/social.component.e2e.ts +++ b/e2e/content-services/social/social.component.e2e.ts @@ -60,9 +60,7 @@ describe('Social component', () => { await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); await usersActions.createUser(componentOwner); - await usersActions.createUser(componentVisitor); - await usersActions.createUser(secondComponentVisitor); await apiService.getInstance().login(componentOwner.email, componentOwner.password); @@ -88,6 +86,7 @@ describe('Social component', () => { afterAll(async () => { await navigationBarPage.clickLogoutButton(); + await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); await uploadActions.deleteFileOrFolder(emptyFile.entry.email); }); diff --git a/e2e/content-services/sso/sso-download-directive-component.e2e.ts b/e2e/content-services/sso/sso-download-directive-component.e2e.ts index 89bcc09d67..9c357477c4 100644 --- a/e2e/content-services/sso/sso-download-directive-component.e2e.ts +++ b/e2e/content-services/sso/sso-download-directive-component.e2e.ts @@ -79,7 +79,7 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList await navigationBarPage.clickContentServicesButton(); await contentServicesPage.checkAcsContainer(); - await contentListPage.doubleClickRow(folderName); + await contentServicesPage.openFolder(folderName); await contentListPage.waitForTableBody(); }); diff --git a/e2e/content-services/tag-component.e2e.ts b/e2e/content-services/tag-component.e2e.ts index 88cc0d4e22..7c6a63f5f2 100644 --- a/e2e/content-services/tag-component.e2e.ts +++ b/e2e/content-services/tag-component.e2e.ts @@ -69,19 +69,16 @@ describe('Tag component', () => { await apiService.getInstance().core.tagsApi.addTag(nodeId, tags); await loginPage.login(acsUser.email, acsUser.password); + await navigationBarPage.clickTagButton(); }); afterAll(async () => { await navigationBarPage.clickLogoutButton(); await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); await uploadActions.deleteFileOrFolder(pdfUploadedFile.entry.id); - - await loginPage.login(acsUser.email, acsUser.password); }); it('[C260374] Should NOT be possible to add a new tag without Node ID', async () => { - await navigationBarPage.clickTagButton(); - await expect(await tagPage.getNodeId()).toEqual(''); await expect(await tagPage.getNewTagPlaceholder()).toEqual('New Tag'); await expect(await tagPage.addTagButtonIsEnabled()).toEqual(false); @@ -164,14 +161,4 @@ describe('Tag component', () => { await tagPage.checkShowLessButtonIsNotDisplayed(); }); - it('[C260378] Should be possible to add multiple tags', async () => { - await tagPage.insertNodeId(pdfFileModel.id); - await tagPage.addTag(tagList[2]); - - await browser.sleep(5000); // wait CS return tags - - await tagPage.checkTagListIsOrderedAscending(); - await tagPage.checkTagListByNodeIdIsOrderedAscending(); - await tagPage.checkTagListContentServicesIsOrderedAscending(); - }); }); diff --git a/e2e/content-services/trashcan-pagination.e2e.ts b/e2e/content-services/trashcan-pagination.e2e.ts index 18e47a7cfb..cdf4840e31 100644 --- a/e2e/content-services/trashcan-pagination.e2e.ts +++ b/e2e/content-services/trashcan-pagination.e2e.ts @@ -63,17 +63,20 @@ describe('Trashcan - Pagination', () => { const fileNames = StringUtil.generateFilesNames(10, noOfFiles + 9, pagination.base, pagination.extension); 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); const folderUploadedModel = await uploadActions.createFolder(newFolderModel.name, '-my-'); const emptyFiles: any = await uploadActions.createEmptyFiles(fileNames, folderUploadedModel.entry.id); + for (const entry of emptyFiles.list.entries) { await apiService.getInstance().node.deleteNode(entry.entry.id).then(() => {}, async () => { await apiService.getInstance().node.deleteNode(entry.entry.id); }); } + await loginPage.login(acsUser.email, acsUser.password); await navigationBarPage.clickTrashcanButton(); - await trashcanPage.waitForTableBody(); + await trashcanPage.getDocumentList().dataTablePage().waitTillContentLoaded(); }); afterAll(async () => { @@ -82,7 +85,7 @@ describe('Trashcan - Pagination', () => { afterEach(async () => { await browser.refresh(); - await trashcanPage.waitForTableBody(); + await trashcanPage.getDocumentList().dataTablePage().waitTillContentLoaded(); }); it('[C272811] Should be able to set Items per page to 20', async () => { diff --git a/e2e/content-services/upload/excluded-file.e2e.ts b/e2e/content-services/upload/excluded-file.e2e.ts index 2636a24fd8..0e4aec6692 100644 --- a/e2e/content-services/upload/excluded-file.e2e.ts +++ b/e2e/content-services/upload/excluded-file.e2e.ts @@ -134,6 +134,9 @@ describe('Upload component - Excluded Files', () => { await uploadToggles.enableFolderUpload(); await contentServicesPage.uploadFolder(folderUpload.location); + + await contentServicesPage.checkContentIsDisplayed(folderUpload.name); + await uploadDialog.clickOnCloseButton(); await uploadDialog.dialogIsNotDisplayed(); diff --git a/e2e/content-services/upload/upload-dialog.e2e.ts b/e2e/content-services/upload/upload-dialog.e2e.ts index 31d57f23f5..cf6ad4e24b 100644 --- a/e2e/content-services/upload/upload-dialog.e2e.ts +++ b/e2e/content-services/upload/upload-dialog.e2e.ts @@ -17,7 +17,7 @@ import { ApiService, - BrowserActions, BrowserVisibility, + BrowserActions, LoginPage, UploadActions, UserModel, @@ -29,7 +29,6 @@ import { UploadTogglesPage } from '../../core/pages/dialog/upload-toggles.page'; import { FileModel } from '../../models/ACS/file.model'; import { browser } from 'protractor'; import { VersionManagePage } from '../../core/pages/version-manager.page'; -import { FolderModel } from '../../models/ACS/folder.model'; describe('Upload component', () => { @@ -68,30 +67,6 @@ describe('Upload component', () => { const filesLocation = [pdfFileModel.location, docxFileModel.location, pngFileModel.location, firstPdfFileModel.location]; const filesName = [pdfFileModel.name, docxFileModel.name, pngFileModel.name, firstPdfFileModel.name]; - const parentFolder = new FolderModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.FOLDER_ONE.folder_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.FOLDER_ONE.folder_location - }); - - const fileInsideParentFolder = new FolderModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.FILE_INSIDE_FOLDER_ONE.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.FILE_INSIDE_FOLDER_ONE.file_location - }); - const subFolder = new FolderModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.FOLDER_TWO.folder_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.FOLDER_TWO.folder_location - }); - - const fileInsideSubFolder = new FolderModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.FILE_INSIDE_FOLDER_TWO.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.FILE_INSIDE_FOLDER_TWO.file_location - }); - - const adfBigFolder = new FolderModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.ADF_FOLDER.folder_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.ADF_FOLDER.folder_location - }); - beforeAll(async () => { await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); acsUser = await usersActions.createUser(); @@ -209,46 +184,4 @@ describe('Upload component', () => { await uploadDialog.dialogIsNotDisplayed(); }); - it('[C291893] Should enable folder upload in selected node', async () => { - await contentServicesPage.checkUploadButton(); - await expect(await uploadToggles.checkFolderUploadToggleIsNotEnabled()).toBe(true); - - await uploadToggles.enableFolderUpload(); - await expect(await uploadToggles.checkFolderUploadToggleIsEnabled()).toBe(true); - await contentServicesPage.uploadFolder(parentFolder.location); - await uploadDialog.fileIsUploaded(fileInsideParentFolder.name); - await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1'); - await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1'); - await uploadDialog.clickOnCloseButton(); - await uploadDialog.dialogIsNotDisplayed(); - - await contentServicesPage.openFolder(parentFolder.name); - await expect(await uploadToggles.checkFolderUploadToggleIsNotEnabled()).toBe(true); - await uploadToggles.enableFolderUpload(); - await expect(await uploadToggles.checkFolderUploadToggleIsEnabled()).toBe(true); - await contentServicesPage.uploadFolder(subFolder.location); - await uploadDialog.fileIsUploaded(fileInsideSubFolder.name); - await uploadDialog.clickOnCloseButton(); - await uploadDialog.dialogIsNotDisplayed(); - - await uploadToggles.enableFolderUpload(); - - await browser.executeScript(` setInterval(() => { - if(document.querySelector('[data-automation-id="adf"]')){ - document.querySelector("#adf-upload-dialog-cancel-all").click(); - document.querySelector("#adf-upload-dialog-cancel").click(); - } - }, 2000)`); - await contentServicesPage.uploadFolder(adfBigFolder.location); - - await uploadDialog.fileIsUploaded('a_png_noBackground_file.PNG'); - await uploadDialog.fileIsCancelled('a_png_noBackground_file.PNG'); - - await BrowserVisibility.waitUntilElementHasText(uploadDialog.title, 'Upload canceled'); - await uploadDialog.clickOnCloseButton(); - await uploadDialog.dialogIsNotDisplayed(); - await contentServicesPage.openFolder(adfBigFolder.name); - await browser.sleep(2000); // We need to wai when we upload too many files we have to wait the revert - await expect(contentServicesPage.numberOfResultsDisplayed()).toBe(0); - }); }); diff --git a/e2e/content-services/upload/uploader-component.e2e.ts b/e2e/content-services/upload/uploader-component.e2e.ts index 00390df1ff..b1ed15edce 100644 --- a/e2e/content-services/upload/uploader-component.e2e.ts +++ b/e2e/content-services/upload/uploader-component.e2e.ts @@ -181,10 +181,11 @@ describe('Upload component', () => { it('[C260174] Should be possible to set a max size', async () => { await contentServicesPage.goToDocumentList(); - await contentServicesPage.checkAcsContainer(); + await uploadToggles.enableMaxSize(); await uploadToggles.checkMaxSizeToggleIsEnabled(); await uploadToggles.addMaxSize('400'); + await contentServicesPage.uploadFile(fileWithSpecificSize.location); await uploadDialog.fileIsUploaded(fileWithSpecificSize.name); await uploadDialog.clickOnCloseButton(); @@ -194,8 +195,6 @@ describe('Upload component', () => { await uploadToggles.addMaxSize('399'); await contentServicesPage.uploadFile(fileWithSpecificSize.location); - // await expect(await contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size'); - await contentServicesPage.checkContentIsNotDisplayed(fileWithSpecificSize.name); await uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name); await contentServicesPage.uploadFile(emptyFile.location); diff --git a/e2e/core/error-component.e2e.ts b/e2e/core/error-component.e2e.ts index ca8bbe7291..fa9c4dd51b 100644 --- a/e2e/core/error-component.e2e.ts +++ b/e2e/core/error-component.e2e.ts @@ -18,6 +18,7 @@ import { ApiService, BrowserActions, ErrorPage, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing'; import { browser } from 'protractor'; import { NavigationBarPage } from '../core/pages/navigation-bar.page'; +import { ContentServicesPage } from './pages/content-services.page'; describe('Error Component', () => { @@ -28,12 +29,14 @@ describe('Error Component', () => { const apiService = new ApiService(); const usersActions = new UsersActions(apiService); + const contentServicesPage = new ContentServicesPage(); beforeAll(async () => { await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); await usersActions.createUser(acsUser); await loginPage.login(acsUser.email, acsUser.password); - }); + await contentServicesPage.goToDocumentList(); + }); afterAll(async () => { await navigationBarPage.clickLogoutButton(); diff --git a/e2e/core/infinite-scrolling.e2e.ts b/e2e/core/infinite-scrolling.e2e.ts index 5917bf6a15..4252a8fd99 100644 --- a/e2e/core/infinite-scrolling.e2e.ts +++ b/e2e/core/infinite-scrolling.e2e.ts @@ -74,7 +74,6 @@ describe('Enable infinite scrolling', () => { emptyFolderModel = await uploadActions.createFolder('emptyFolder', '-my-'); await uploadActions.createEmptyFiles(fileNames, folderUploadedModel.entry.id); - deleteUploaded = await uploadActions.createFolder('deleteFolder', '-my-'); await uploadActions.createEmptyFiles(deleteFileNames, deleteUploaded.entry.id); @@ -86,11 +85,11 @@ describe('Enable infinite scrolling', () => { beforeEach(async () => { await navigationBarPage.clickContentServicesButton(); - await contentServicesPage.checkAcsContainer(); + await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); }); it('[C260484] Should be possible to enable infinite scrolling', async () => { - await contentServicesPage.doubleClickRow(folderModel.name); + await contentServicesPage.openFolder(folderModel.name); await contentServicesPage.enableInfiniteScrolling(); await infinitePaginationPage.clickLoadMoreButton(); await contentServicesPage.contentList.dataTablePage().waitTillContentLoadedInfinitePagination(); @@ -120,9 +119,7 @@ describe('Enable infinite scrolling', () => { }); it('[C299201] Should use default pagination settings for infinite pagination', async () => { - await navigationBarPage.clickContentServicesButton(); - await contentServicesPage.checkAcsContainer(); - await contentServicesPage.doubleClickRow(folderModel.name); + await contentServicesPage.openFolder(folderModel.name); await contentServicesPage.enableInfiniteScrolling(); await contentServicesPage.contentList.dataTablePage().waitTillContentLoadedInfinitePagination(); @@ -138,10 +135,7 @@ describe('Enable infinite scrolling', () => { it('[C299202] Should not display load more button when all the files are already displayed', async () => { await LocalStorageUtil.setUserPreference('paginationSize', '30'); - await navigationBarPage.clickContentServicesButton(); - await contentServicesPage.checkAcsContainer(); - - await contentServicesPage.doubleClickRow(folderModel.name); + await contentServicesPage.openFolder(folderModel.name); await contentServicesPage.enableInfiniteScrolling(); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles); @@ -150,10 +144,7 @@ describe('Enable infinite scrolling', () => { }); it('[C299203] Should not display load more button when a folder is empty', async () => { - await navigationBarPage.clickContentServicesButton(); - await contentServicesPage.checkAcsContainer(); - - await contentServicesPage.doubleClickRow(emptyFolderModel.entry.name); + await contentServicesPage.openFolder(emptyFolderModel.entry.name); await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed(); }); diff --git a/e2e/core/login/login-sso/login-sso.e2e.ts b/e2e/core/login/login-sso/login-sso.e2e.ts index 93f26725fa..cc6120092b 100644 --- a/e2e/core/login/login-sso/login-sso.e2e.ts +++ b/e2e/core/login/login-sso/login-sso.e2e.ts @@ -38,7 +38,12 @@ describe('Login component - SSO', () => { it('[C261050] Should be possible login with SSO', async () => { await settingsPage.setProviderEcmSso(browser.params.testConfig.appConfig.ecmHost, browser.params.testConfig.appConfig.oauth2.host, - browser.params.testConfig.appConfig.identityHost, false, true, browser.params.testConfig.appConfig.oauth2.clientId); + browser.params.testConfig.appConfig.identityHost, + false, + true, + browser.params.testConfig.appConfig.oauth2.clientId, + browser.params.testConfig.appConfig.oauth2.redirectUriLogout); + await loginSSOPage.loginSSOIdentityService(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); }); @@ -49,18 +54,22 @@ describe('Login component - SSO', () => { browser.params.testConfig.appConfig.identityHost, true, true, - browser.params.testConfig.appConfig.oauth2.clientId - ); + browser.params.testConfig.appConfig.oauth2.clientId, + browser.params.testConfig.appConfig.oauth2.redirectUriLogout); await loginSSOPage.loginSSOIdentityService(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); }); - }); + }); describe('Login component - SSO Grant type password (implicit flow false)', () => { it('[C299158] Should be possible to login with SSO, with grant type password (Implicit Flow false)', async () => { await settingsPage.setProviderEcmSso(browser.params.testConfig.appConfig.ecmHost, browser.params.testConfig.appConfig.oauth2.host, - browser.params.testConfig.appConfig.identityHost, false, false, browser.params.testConfig.appConfig.oauth2.clientId); + browser.params.testConfig.appConfig.identityHost, + false, + false, + browser.params.testConfig.appConfig.oauth2.clientId, + browser.params.testConfig.appConfig.oauth2.redirectUriLogout); await loginPage.waitForElements(); diff --git a/e2e/core/login/login-sso/logout-sso.e2e.ts b/e2e/core/login/login-sso/logout-sso.e2e.ts index bc08b0519c..7b2ddfe060 100644 --- a/e2e/core/login/login-sso/logout-sso.e2e.ts +++ b/e2e/core/login/login-sso/logout-sso.e2e.ts @@ -15,22 +15,20 @@ * limitations under the License. */ -import { LoginPage, SettingsPage } from '@alfresco/adf-testing'; +import { BrowserActions, LoginPage, SettingsPage } from '@alfresco/adf-testing'; import { browser } from 'protractor'; -import { NavigationBarPage } from '../../../core/pages/navigation-bar.page'; describe('Logout component - SSO', () => { const settingsPage = new SettingsPage(); const loginSSOPage = new LoginPage(); - const navigationBarPage = new NavigationBarPage(); it('[C280665] Should be possible change the logout redirect URL', async () => { await settingsPage.setProviderEcmSso(browser.params.testConfig.appConfig.ecmHost, browser.params.testConfig.appConfig.oauth2.host, browser.params.testConfig.appConfig.identityHost, false, true, browser.params.testConfig.appConfig.oauth2.clientId, '/login'); await loginSSOPage.loginSSOIdentityService(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); - await navigationBarPage.clickLogoutButton(); + await BrowserActions.clickExecuteScript('.app-sidenav-link[adf-logout]'); await browser.sleep(2000); diff --git a/e2e/core/pages/content-services.page.ts b/e2e/core/pages/content-services.page.ts index 7a0fc0bd24..5bfeb50e27 100644 --- a/e2e/core/pages/content-services.page.ts +++ b/e2e/core/pages/content-services.page.ts @@ -275,22 +275,26 @@ export class ContentServicesPage { return BrowserActions.getText(this.recentFileIcon); } + // @deprecated prefer waitTillContentLoaded async checkDocumentListElementsAreDisplayed(): Promise { await this.checkAcsContainer(); await this.waitForTableBody(); } + // @deprecated prefer waitTillContentLoaded async checkAcsContainer(): Promise { await BrowserVisibility.waitUntilElementIsVisible(this.uploadBorder); } + // @deprecated prefer waitTillContentLoaded async waitForTableBody(): Promise { - await this.contentList.waitForTableBody(); + await this.contentList.dataTablePage().waitTillContentLoaded(); } async goToDocumentList(): Promise { const navigationBarPage = new NavigationBarPage(); await navigationBarPage.clickContentServicesButton(); + await this.contentList.dataTablePage().waitTillContentLoaded(); } async clickOnContentServices(): Promise { @@ -352,10 +356,9 @@ export class ContentServicesPage { return this.checkListIsSortedByCreatedColumn(sortOrder); } - async doubleClickRow(nodeName): Promise { - Logger.log(`Open Folder ${nodeName}`); + async doubleClickRow(nodeName: string): Promise { + Logger.log(`Open Folder/File ${nodeName}`); await this.contentList.doubleClickRow(nodeName); - await this.contentList.dataTablePage().waitTillContentLoaded(); } async selectRow(nodeName): Promise { @@ -405,6 +408,7 @@ export class ContentServicesPage { async openFolder(folderName: string): Promise { await this.doubleClickRow(folderName); + await this.contentList.dataTablePage().waitTillContentLoaded(); } async checkContentIsDisplayed(content): Promise { @@ -695,7 +699,7 @@ export class ContentServicesPage { async selectItemWithCheckbox(itemName: string): Promise { const item = element(by.css(`adf-datatable-row[aria-label="${itemName}"] mat-checkbox .mat-checkbox-input`)); await BrowserVisibility.waitUntilElementIsVisible(item); - await BrowserActions.clickScript(item); + await BrowserActions.click(item); } async unSelectItemWithCheckbox(itemName: string): Promise { diff --git a/e2e/core/pages/dialog/create-library-dialog.page.ts b/e2e/core/pages/dialog/create-library-dialog.page.ts index 342863755a..3b2ce7813b 100644 --- a/e2e/core/pages/dialog/create-library-dialog.page.ts +++ b/e2e/core/pages/dialog/create-library-dialog.page.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { by, element, browser, protractor } from 'protractor'; +import { by, element, protractor } from 'protractor'; import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; export class CreateLibraryDialogPage { @@ -47,7 +47,7 @@ export class CreateLibraryDialogPage { } async isDialogOpen(): Promise { - return browser.isElementPresent(this.libraryDialog); + return BrowserVisibility.waitUntilElementIsVisible(this.libraryDialog); } async getTitle(): Promise { diff --git a/e2e/core/pages/icons.page.ts b/e2e/core/pages/icons.page.ts index 6f2d5a535e..1c444f2482 100644 --- a/e2e/core/pages/icons.page.ts +++ b/e2e/core/pages/icons.page.ts @@ -15,7 +15,8 @@ * limitations under the License. */ -import { browser, by, element, ElementFinder } from 'protractor'; +import { by, element, ElementFinder } from 'protractor'; +import { BrowserVisibility } from '@alfresco/adf-testing'; export class IconsPage { @@ -28,7 +29,7 @@ export class IconsPage { } async isCustomIconDisplayed(name: string) { - const present = await browser.isElementPresent(this.locateCustomIcon(name)); + const present = await BrowserVisibility.waitUntilElementIsVisible(this.locateCustomIcon(name)); if (present) { return this.locateCustomIcon(name).isDisplayed(); } else { @@ -37,7 +38,7 @@ export class IconsPage { } async isLigatureIconDisplayed(name: string) { - const present = await browser.isElementPresent(this.locateLigatureIcon(name)); + const present = await BrowserVisibility.waitUntilElementIsVisible(this.locateLigatureIcon(name)); if (present) { return this.locateLigatureIcon(name).isDisplayed(); } else { diff --git a/e2e/core/pages/navigation-bar.page.ts b/e2e/core/pages/navigation-bar.page.ts index 16ebbd4e34..d4f7abf14c 100644 --- a/e2e/core/pages/navigation-bar.page.ts +++ b/e2e/core/pages/navigation-bar.page.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { AppListCloudPage, BrowserActions, BrowserVisibility } from '@alfresco/adf-testing'; +import { AppListCloudPage, BrowserActions, BrowserVisibility, Logger } from '@alfresco/adf-testing'; import { browser, by, element, ElementFinder } from 'protractor'; import { ProcessServicesPage } from '../../process-services/pages/process-services.page'; @@ -35,8 +35,11 @@ export class NavigationBarPage { menuButton = element(by.css('button[data-automation-id="adf-menu-icon"]')); formButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Form"]')); peopleGroupCloudButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="People/Group Cloud"]')); + logoutSection: ElementFinder = element(by.css('div[data-automation-id="adf-logout-section"]')); async clickNavigationBarItem(title: string): Promise { + Logger.log(`clickNavigationBarItem ${title}`); + const menu = element(by.css(`.app-sidenav-link[data-automation-id="${title}"]`)); await BrowserActions.closeMenuAndDialogs(); await BrowserActions.click(menu); @@ -63,8 +66,8 @@ export class NavigationBarPage { } async clickProcessCloudButton() { - await this.clickNavigationBarItem('Process Cloud'); - await BrowserVisibility.waitUntilElementIsVisible(this.linkMenuChildrenContainer); + await BrowserActions.closeMenuAndDialogs(); + await BrowserActions.clickUntilIsNotVisible(this.getMenuItem('Process Cloud'), this.linkMenuChildrenContainer); } async navigateToProcessServicesCloudPage(): Promise { @@ -87,8 +90,12 @@ export class NavigationBarPage { } async clickProcessServicesButton() { - await this.clickNavigationBarItem('Process Services'); - await BrowserVisibility.waitUntilElementIsVisible(this.linkMenuChildrenContainer); + await BrowserActions.closeMenuAndDialogs(); + await BrowserActions.clickUntilIsNotVisible(this.getMenuItem('Process Services'), this.linkMenuChildrenContainer); + } + + private getMenuItem(title: string) { + return element(by.css(`.app-sidenav-link[data-automation-id="${title}"]`)); } async navigateToProcessServicesPage(): Promise { @@ -172,8 +179,14 @@ export class NavigationBarPage { } async clickLogoutButton(): Promise { + Logger.log('Logout'); await BrowserActions.closeMenuAndDialogs(); await BrowserActions.clickExecuteScript('.app-sidenav-link[adf-logout]'); + + try { + await BrowserVisibility.waitUntilElementIsVisible(this.logoutSection); + } catch (error) { + } } async clickThemeButton(): Promise { diff --git a/e2e/core/pagination-empty-current-page.e2e.ts b/e2e/core/pagination-empty-current-page.e2e.ts index 6bff3dc76c..018a23f976 100644 --- a/e2e/core/pagination-empty-current-page.e2e.ts +++ b/e2e/core/pagination-empty-current-page.e2e.ts @@ -143,7 +143,7 @@ describe('Pagination - returns to previous page when current is empty', () => { await paginationPage.clickOnNextPage(); await contentServicesPage.checkDocumentListElementsAreDisplayed(); - await contentServicesPage.doubleClickRow(lastFolderResponse.entry.name); + await contentServicesPage.openFolder(lastFolderResponse.entry.name); await contentServicesPage.checkContentIsDisplayed(pngFileInfo.name); await viewerPage.viewFile(pngFileUploaded.entry.name); diff --git a/e2e/core/viewer/file-extensions/viewer-component.e2e.ts b/e2e/core/viewer/file-extensions/viewer-component.e2e.ts index a41d344778..c20b08ab70 100644 --- a/e2e/core/viewer/file-extensions/viewer-component.e2e.ts +++ b/e2e/core/viewer/file-extensions/viewer-component.e2e.ts @@ -88,7 +88,7 @@ describe('Viewer', () => { await loginPage.login(acsUser.email, acsUser.password); await navigationBarPage.goToSite(site); - await contentServicesPage.checkAcsContainer(); + await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); await viewerPage.viewFile(pngFileUploaded.entry.name); diff --git a/e2e/core/viewer/viewer-content-services-component.e2e.ts b/e2e/core/viewer/viewer-content-services-component.e2e.ts index 9839f70896..74e9f7db69 100644 --- a/e2e/core/viewer/viewer-content-services-component.e2e.ts +++ b/e2e/core/viewer/viewer-content-services-component.e2e.ts @@ -15,8 +15,16 @@ * limitations under the License. */ -import { browser } from 'protractor'; -import { ApiService, LoginPage, UploadActions, UserModel, UsersActions, ViewerPage } from '@alfresco/adf-testing'; +import { browser, by, element, protractor } from 'protractor'; +import { + ApiService, + BrowserActions, + LoginPage, + UploadActions, + UserModel, + UsersActions, + ViewerPage +} from '@alfresco/adf-testing'; import { ContentServicesPage } from '../../core/pages/content-services.page'; import { FileModel } from '../../models/ACS/file.model'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; @@ -102,7 +110,7 @@ describe('Content Services Viewer', () => { await loginPage.login(acsUser.email, acsUser.password); await contentServicesPage.goToDocumentList(); - }); + }); afterAll(async () => { await uploadActions.deleteFileOrFolder(pdfFile.getId()); @@ -113,11 +121,9 @@ describe('Content Services Viewer', () => { await uploadActions.deleteFileOrFolder(pptFile.getId()); await uploadActions.deleteFileOrFolder(unsupportedFile.getId()); await navigationBarPage.clickLogoutButton(); - }); + }); it('[C260038] Should display first page, toolbar and pagination when opening a .pdf file', async () => { - await contentServicesPage.checkAcsContainer(); - await viewerPage.viewFile(pdfFile.name); await viewerPage.checkZoomInButtonIsDisplayed(); @@ -369,7 +375,9 @@ describe('Content Services Viewer', () => { }); it('[C269109] Should not be able to open thumbnail panel before the pdf is loaded', async () => { - await viewerPage.viewFile(pdfFile.name); + const fileView = element.all(by.css(`#document-list-container div[data-automation-id="${pdfFile.name}"]`)).first(); + await BrowserActions.click(fileView); + await browser.actions().sendKeys(protractor.Key.ENTER).perform(); await viewerPage.checkThumbnailsBtnIsDisabled(); diff --git a/e2e/core/viewer/viewer-properties.e2e.ts b/e2e/core/viewer/viewer-properties.e2e.ts index 1e6354f8cb..096aa9d4ac 100644 --- a/e2e/core/viewer/viewer-properties.e2e.ts +++ b/e2e/core/viewer/viewer-properties.e2e.ts @@ -68,8 +68,6 @@ describe('Viewer - properties', () => { await contentServicesPage.goToDocumentList(); - await contentServicesPage.checkAcsContainer(); - await viewerPage.viewFile(pngFile.name); await viewerPage.clickLeftSidebarButton(); diff --git a/e2e/process-services-cloud/edit-task-filters-component.e2e.ts b/e2e/process-services-cloud/edit-task-filters-component.e2e.ts index 94e8460ff3..ec674b802b 100644 --- a/e2e/process-services-cloud/edit-task-filters-component.e2e.ts +++ b/e2e/process-services-cloud/edit-task-filters-component.e2e.ts @@ -75,23 +75,30 @@ describe('Edit task filters cloud', () => { afterEach(async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); }); it('[C291785] All the filters property should be set up accordingly with the Query Param', async () => { await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getStatusFilterDropDownValue()).toEqual('ASSIGNED'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('CreatedDate'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getOrderFilterDropDownValue()).toEqual('DESC'); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(assignedTaskName); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(completedTaskName); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('Completed Tasks'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getStatusFilterDropDownValue()).toEqual('COMPLETED'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('CreatedDate'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getOrderFilterDropDownValue()).toEqual('DESC'); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(assignedTaskName); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTaskName); await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); @@ -99,8 +106,12 @@ describe('Edit task filters cloud', () => { it('[C306896] Delete Save and Save as actions should be displayed and disabled when clicking on default filter header', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent(); @@ -118,8 +129,12 @@ describe('Edit task filters cloud', () => { await createNewCustomFilter('New'); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('custom-new'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('custom-new'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('New'); const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent(); await editTaskFilterCloudComponent.setSortFilterDropDown('Priority'); @@ -142,20 +157,26 @@ describe('Edit task filters cloud', () => { await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().checkSaveAsButtonIsEnabled()).toEqual(false); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().checkDeleteButtonIsEnabled()).toEqual(true); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('CreatedDate'); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('custom-new'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('Id'); await tasksCloudDemoPage.editTaskFilterCloudComponent().clickDeleteButton(); }); it('[C291796] Two filters with same name can be created when clicking the Save As button', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent(); await editTaskFilterCloudComponent.openFilter(); await editTaskFilterCloudComponent.setSortFilterDropDown('Id'); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); await tasksCloudDemoPage.editTaskFilterCloudComponent().clickSaveAsButton(); @@ -177,6 +198,7 @@ describe('Edit task filters cloud', () => { await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('Priority'); await tasksCloudDemoPage.editTaskFilterCloudComponent().clickDeleteButton(); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('custom-new'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('Id'); @@ -185,12 +207,15 @@ describe('Edit task filters cloud', () => { it('[C291797] A filter is overrided when clicking on save button', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent(); await editTaskFilterCloudComponent.openFilter(); await editTaskFilterCloudComponent.setSortFilterDropDown('Id'); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.editTaskFilterCloudComponent().clickSaveAsButton(); const editTaskFilterDialog = await tasksCloudDemoPage.editTaskFilterCloudComponent().editTaskFilterDialog(); @@ -211,12 +236,15 @@ describe('Edit task filters cloud', () => { it('[C291798] A filter is deleted when clicking on delete button', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent(); await editTaskFilterCloudComponent.openFilter(); await editTaskFilterCloudComponent.setSortFilterDropDown('Id'); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.editTaskFilterCloudComponent().clickSaveAsButton(); const editTaskFilterDialog = await tasksCloudDemoPage.editTaskFilterCloudComponent().editTaskFilterDialog(); @@ -234,29 +262,42 @@ describe('Edit task filters cloud', () => { it('[C291800] Task filter should not be created when task filter dialog is closed', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent(); await editTaskFilterCloudComponent.openFilter(); await editTaskFilterCloudComponent.setSortFilterDropDown('Priority'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('Priority'); + await tasksCloudDemoPage.editTaskFilterCloudComponent().clickSaveAsButton(); + await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().editTaskFilterDialog().getFilterName()).toEqual('My Tasks'); + await tasksCloudDemoPage.editTaskFilterCloudComponent().editTaskFilterDialog().setFilterName('Cancel'); + await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().editTaskFilterDialog().getFilterName()).toEqual('Cancel'); + await tasksCloudDemoPage.editTaskFilterCloudComponent().editTaskFilterDialog().clickOnCancelButton(); await tasksCloudDemoPage.taskFilterCloudComponent.checkTaskFilterNotDisplayed('Cancel'); + await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toEqual('My Tasks'); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); + await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('CreatedDate'); + await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); }); it('[C291801] Save button of task filter dialog should be disabled when task name is empty', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent(); await editTaskFilterCloudComponent.openFilter(); @@ -279,6 +320,8 @@ describe('Edit task filters cloud', () => { it('[C291799] Task filter dialog is displayed when clicking on Save As button', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + const tasksCloud = tasksCloudDemoPage.editTaskFilterCloudComponent(); await tasksCloud.openFilter(); await tasksCloud.setSortFilterDropDown('Id'); @@ -293,12 +336,14 @@ describe('Edit task filters cloud', () => { async function createNewCustomFilter(name: string): Promise { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent(); await editTaskFilterCloudComponent.openFilter(); await editTaskFilterCloudComponent.setSortFilterDropDown('Id'); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); await tasksCloudDemoPage.editTaskFilterCloudComponent().clickSaveAsButton(); diff --git a/e2e/process-services-cloud/form-field/dropdown-widget.e2e.ts b/e2e/process-services-cloud/form-field/dropdown-widget.e2e.ts index cd70ed06d4..0369b1cd15 100644 --- a/e2e/process-services-cloud/form-field/dropdown-widget.e2e.ts +++ b/e2e/process-services-cloud/form-field/dropdown-widget.e2e.ts @@ -85,28 +85,43 @@ describe('Form Field Component - Dropdown Widget', () => { it('[C290069] Should be able to read rest service dropdown options, save and complete the task form', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(task.entry.name); await tasksCloudDemoPage.taskListCloudComponent().selectRow(task.entry.name); + await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed(); + await taskFormCloudComponent.formFields().checkFormIsDisplayed(); await taskFormCloudComponent.formFields().checkWidgetIsVisible('Dropdown097maj'); await dropdown.selectOption('Clementine Bauch', 'dropdown-cloud-widget mat-select'); + await expect(await dropdown.getSelectedOptionText('Dropdown097maj')).toBe('Clementine Bauch'); + await taskFormCloudComponent.checkSaveButtonIsDisplayed(); await taskFormCloudComponent.clickSaveButton(); + await expect(await dropdown.getSelectedOptionText('Dropdown097maj')).toBe('Clementine Bauch'); + await taskFormCloudComponent.checkCompleteButtonIsDisplayed(); await taskFormCloudComponent.clickCompleteButton(); + await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(task.entry.name); await notificationHistoryPage.checkNotifyContains('Task has been saved successfully'); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(task.entry.name); await tasksCloudDemoPage.taskListCloudComponent().selectRow(task.entry.name); + await taskFormCloudComponent.formFields().checkFormIsDisplayed(); await taskFormCloudComponent.formFields().checkWidgetIsVisible('Dropdown097maj'); + await expect(await dropdown.getSelectedOptionText('Dropdown097maj')).toBe('Clementine Bauch'); + await taskFormCloudComponent.checkCompleteButtonIsNotDisplayed(); }); }); diff --git a/e2e/process-services-cloud/pages/tasks-cloud-demo.page.ts b/e2e/process-services-cloud/pages/tasks-cloud-demo.page.ts index 766799d9ec..8cd4c8b125 100644 --- a/e2e/process-services-cloud/pages/tasks-cloud-demo.page.ts +++ b/e2e/process-services-cloud/pages/tasks-cloud-demo.page.ts @@ -22,7 +22,7 @@ import { EditTaskFilterCloudComponentPage, BrowserVisibility, TaskListCloudComponentPage, - BrowserActions, DropdownPage + BrowserActions, DropdownPage, Logger } from '@alfresco/adf-testing'; export class TasksCloudDemoPage { @@ -166,4 +166,29 @@ export class TasksCloudDemoPage { await BrowserActions.click(this.newTaskButton); } + async waitTillContentLoaded(): Promise { + if (this.isSpinnerPresent()) { + Logger.log('wait loading spinner disappear'); + await BrowserVisibility.waitUntilElementIsNotPresent(element(by.tagName('mat-spinner'))); + } else { + try { + Logger.log('wait loading spinner is present'); + await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-spinner'))); + } catch (error) { + } + } + } + + private async isSpinnerPresent(): Promise { + let isSpinnerPresent; + + try { + isSpinnerPresent = await element(by.tagName('mat-spinner')).isDisplayed(); + } catch (error) { + isSpinnerPresent = false; + } + + return isSpinnerPresent; + } + } diff --git a/e2e/process-services-cloud/people-group-cloud-filter-component.e2e.ts b/e2e/process-services-cloud/people-group-cloud-filter-component.e2e.ts index c3a202aee2..23582c0394 100644 --- a/e2e/process-services-cloud/people-group-cloud-filter-component.e2e.ts +++ b/e2e/process-services-cloud/people-group-cloud-filter-component.e2e.ts @@ -83,9 +83,11 @@ describe('People Groups Cloud Component', () => { await peopleGroupCloudComponentPage.checkPeopleCloudSingleSelectionIsSelected(); await peopleGroupCloudComponentPage.clickPeopleFilerByApp(); await peopleGroupCloudComponentPage.enterPeopleAppName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name); + await peopleCloudComponent.searchAssignee(testUser.firstName); await peopleCloudComponent.checkUserIsDisplayed(`${testUser.firstName} ${testUser.lastName}`); await peopleCloudComponent.selectAssigneeFromList(`${testUser.firstName} ${testUser.lastName}`); + await browser.sleep(100); await expect(await peopleCloudComponent.checkSelectedPeople(`${testUser.firstName} ${testUser.lastName}`)); }); diff --git a/e2e/process-services-cloud/process-task-attach-content-file-cloud.e2e.ts b/e2e/process-services-cloud/process-task-attach-content-file-cloud.e2e.ts index 54ad488fdb..6626298497 100644 --- a/e2e/process-services-cloud/process-task-attach-content-file-cloud.e2e.ts +++ b/e2e/process-services-cloud/process-task-attach-content-file-cloud.e2e.ts @@ -145,6 +145,7 @@ describe('Process Task - Attach content file', () => { await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(taskName); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(taskName); await processCloudDemoPage.processFilterCloudComponent.clickOnProcessFilters(); diff --git a/e2e/process-services-cloud/start-task-form-cloud.e2e.ts b/e2e/process-services-cloud/start-task-form-cloud.e2e.ts index 86bec6c7ec..9b5077f37e 100644 --- a/e2e/process-services-cloud/start-task-form-cloud.e2e.ts +++ b/e2e/process-services-cloud/start-task-form-cloud.e2e.ts @@ -274,6 +274,8 @@ describe('Start Task Form', () => { await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedById(taskId); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedById(taskId); await processCloudDemoPage.processFilterCloudComponent.clickOnProcessFilters(); @@ -454,6 +456,8 @@ describe('Start Task Form', () => { await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedById(taskId); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedById(taskId); await tasksCloudDemoPage.taskListCloudComponent().selectRowByTaskId(taskId); await contentFileWidget.checkFileIsAttached(testFileModel.name); @@ -489,6 +493,8 @@ describe('Start Task Form', () => { await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedById(taskId); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedById(taskId); await tasksCloudDemoPage.taskListCloudComponent().selectRowByTaskId(taskId); await contentFileWidget.checkFileIsAttached(testFileModel.name); diff --git a/e2e/process-services-cloud/start-task/start-task-custom-app-cloud.e2e.ts b/e2e/process-services-cloud/start-task/start-task-custom-app-cloud.e2e.ts index ccdfb5656a..f39dea7978 100644 --- a/e2e/process-services-cloud/start-task/start-task-custom-app-cloud.e2e.ts +++ b/e2e/process-services-cloud/start-task/start-task-custom-app-cloud.e2e.ts @@ -191,6 +191,7 @@ describe('Start Task', () => { await browser.driver.sleep(1000); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); }); diff --git a/e2e/process-services-cloud/start-task/start-task-group-cloud.e2e.ts b/e2e/process-services-cloud/start-task/start-task-group-cloud.e2e.ts index 069226795a..c27b11f8f4 100644 --- a/e2e/process-services-cloud/start-task/start-task-group-cloud.e2e.ts +++ b/e2e/process-services-cloud/start-task/start-task-group-cloud.e2e.ts @@ -46,6 +46,7 @@ describe('Start Task - Group Cloud Component', () => { const apiService = new ApiService(); const identityService = new IdentityService(apiService); const groupIdentityService = new GroupIdentityService(apiService); + const rolesService = new RolesService(apiService); const bothGroupsTaskName = StringUtil.generateRandomString(5); const oneGroupTaskName = StringUtil.generateRandomString(5); @@ -58,9 +59,8 @@ describe('Start Task - Group Cloud Component', () => { apsUser = await identityService.createIdentityUser(); hrGroup = await groupIdentityService.getGroupInfoByGroupName('hr'); - testGroup = await groupIdentityService.getGroupInfoByGroupName('testgroup'); + testGroup = await groupIdentityService.createIdentityGroup(); - const rolesService = new RolesService(apiService); const apsAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.ROLES.ACTIVITI_USER); await groupIdentityService.assignRole(testGroup.id, apsAdminRoleId, identityService.ROLES.ACTIVITI_USER); diff --git a/e2e/process-services-cloud/task-filters-cloud.e2e.ts b/e2e/process-services-cloud/task-filters-cloud.e2e.ts index c5773ea437..cfdcc4f6e7 100644 --- a/e2e/process-services-cloud/task-filters-cloud.e2e.ts +++ b/e2e/process-services-cloud/task-filters-cloud.e2e.ts @@ -53,19 +53,19 @@ describe('Task filters cloud', () => { beforeAll(async () => { await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password); - testUser = await identityService.createIdentityUserWithRole( [identityService.ROLES.ACTIVITI_USER]); + testUser = await identityService.createIdentityUserWithRole([identityService.ROLES.ACTIVITI_USER]); groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr'); await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id); await apiService.login(testUser.email, testUser.password); await loginSSOPage.login(testUser.email, testUser.password); - }); + }); afterAll(async () => { await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password); await identityService.deleteIdentityUser(testUser.idIdentityService); - }); + }); beforeEach(async () => { await navigationBarPage.navigateToProcessServicesCloudPage(); @@ -78,10 +78,14 @@ describe('Task filters cloud', () => { await tasksService.claimTask(task.entry.id, simpleApp); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('Completed Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(newTask); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(newTask); @@ -94,10 +98,14 @@ describe('Task filters cloud', () => { await queryService.getTaskByStatus(toBeCompletedTask.entry.name, simpleApp, 'COMPLETED'); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(completedTask); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('Completed Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTask); diff --git a/e2e/process-services-cloud/task-form-cloud-component-tab.e2e.ts b/e2e/process-services-cloud/task-form-cloud-component-tab.e2e.ts index 005ce00ed8..f0971a6687 100644 --- a/e2e/process-services-cloud/task-form-cloud-component-tab.e2e.ts +++ b/e2e/process-services-cloud/task-form-cloud-component-tab.e2e.ts @@ -327,6 +327,7 @@ describe('Task form cloud component', () => { async function chooseFilterAndSelectTaskByName(filterName: string, taskName: string): Promise { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter(filterName); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(taskName); await tasksCloudDemoPage.taskListCloudComponent().selectRow(taskName); } @@ -339,6 +340,7 @@ describe('Task form cloud component', () => { async function chooseFilter(filterName: string, filterTitle: string): Promise { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter(filterName); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe(filterTitle); } }); diff --git a/e2e/process-services-cloud/task-form-cloud-component.e2e.ts b/e2e/process-services-cloud/task-form-cloud-component.e2e.ts index b635635a40..4919b255fe 100644 --- a/e2e/process-services-cloud/task-form-cloud-component.e2e.ts +++ b/e2e/process-services-cloud/task-form-cloud-component.e2e.ts @@ -143,6 +143,8 @@ describe('Task form cloud component', () => { it('[C310366] Should refresh buttons and form after an action is complete', async () => { await appListCloudComponent.goToApp(simpleApp); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter(myTasksFilter); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await expect(tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); await tasksCloudDemoPage.editTaskFilterCloudComponent().clearAssignee(); @@ -229,6 +231,8 @@ describe('Task form cloud component', () => { it('[C310142] Empty content is displayed when having a task without form', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter(myTasksFilter); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(assigneeTask.entry.name); await tasksCloudDemoPage.taskListCloudComponent().selectRow(assigneeTask.entry.name); await taskFormCloudComponent.checkFormIsNotDisplayed(); @@ -240,6 +244,8 @@ describe('Task form cloud component', () => { it('[C310199] Should not be able to complete a task when required field is empty or invalid data is added to a field', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter(myTasksFilter); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await selectTaskByName(formValidationsTask.entry.name); await taskFormCloudComponent.formFields().checkFormIsDisplayed(); await taskFormCloudComponent.formFields().checkWidgetIsVisible('Text0tma8h'); @@ -274,6 +280,8 @@ describe('Task form cloud component', () => { it('[C307093] Complete button is not displayed when the task is already completed', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter(completedTasksFilter); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('Completed Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTaskName); await tasksCloudDemoPage.taskListCloudComponent().selectRow(completedTaskName); @@ -283,6 +291,8 @@ describe('Task form cloud component', () => { it('[C307095] Task can not be completed by owner user', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter(myTasksFilter); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); @@ -297,6 +307,8 @@ describe('Task form cloud component', () => { it('[C307110] Task list is displayed after clicking on Cancel button', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter(myTasksFilter); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await selectTaskByName(assigneeTask.entry.name); @@ -308,6 +320,8 @@ describe('Task form cloud component', () => { it('[C307094] Standalone Task can be completed by a user that is owner and assignee', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter(myTasksFilter); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await selectTaskByName(toBeCompletedTask.entry.name); @@ -315,12 +329,16 @@ describe('Task form cloud component', () => { await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(toBeCompletedTask.entry.name); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter(completedTasksFilter); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(toBeCompletedTask.entry.name); await taskFormCloudComponent.checkCompleteButtonIsNotDisplayed(); }); it('[C307111] Task of a process can be completed by a user that is owner and assignee', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter(myTasksFilter); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await selectTaskByName(completedTask.entry.name); @@ -328,6 +346,8 @@ describe('Task form cloud component', () => { await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(completedTask.entry.name); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter(completedTasksFilter); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTask.entry.name); await taskFormCloudComponent.checkCompleteButtonIsNotDisplayed(); }); @@ -335,6 +355,8 @@ describe('Task form cloud component', () => { async function openTaskByIdFromFilters(filterName: string, taskId: string): Promise { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter(filterName); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedById(taskId); await tasksCloudDemoPage.taskListCloudComponent().selectRowByTaskId(taskId); } @@ -360,6 +382,8 @@ describe('Task form cloud component', () => { async function goToAppOpenDropdownTaskByNameFromFilters(filterName: string, taskName: string): Promise { await appListCloudComponent.goToApp(simpleApp); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter(filterName); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(taskName); await tasksCloudDemoPage.taskListCloudComponent().selectRow(taskName); await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed(); diff --git a/e2e/process-services-cloud/task-header-cloud.e2e.ts b/e2e/process-services-cloud/task-header-cloud.e2e.ts index 9c0073aa8c..4ea784677b 100644 --- a/e2e/process-services-cloud/task-header-cloud.e2e.ts +++ b/e2e/process-services-cloud/task-header-cloud.e2e.ts @@ -137,8 +137,12 @@ describe('Task Header cloud component', () => { it('[C291943] Should display task details for assigned task', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(basicCreatedTaskName); await tasksCloudDemoPage.taskListCloudComponent().selectRow(basicCreatedTaskName); + await tasksCloudDemoPage.waitTillContentLoaded(); + await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed(); await expect(await taskHeaderCloudPage.getId()).toEqual(basicCreatedTask.entry.id); await expect(await taskHeaderCloudPage.getDescription()) @@ -157,8 +161,12 @@ describe('Task Header cloud component', () => { it('[C291944] Should display task details for completed task', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTaskName); await tasksCloudDemoPage.taskListCloudComponent().selectRow(completedTaskName); + await tasksCloudDemoPage.waitTillContentLoaded(); + await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed(); await expect(await taskHeaderCloudPage.getId()).toEqual(completedTask.entry.id); await expect(await taskHeaderCloudPage.getDescription()) @@ -177,8 +185,12 @@ describe('Task Header cloud component', () => { it('[C291945] Should Parent Name and Parent Id not be empty in task details for sub task', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(subTask.entry.name); await tasksCloudDemoPage.taskListCloudComponent().selectRow(subTask.entry.name); + await tasksCloudDemoPage.waitTillContentLoaded(); + await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed(); await expect(await taskHeaderCloudPage.getId()).toEqual(subTask.entry.id); await expect(await taskHeaderCloudPage.getDescription()) @@ -203,8 +215,12 @@ describe('Task Header cloud component', () => { await startTaskCloudPage.typePriorityOf('50'); await startTaskCloudPage.clickStartButton(); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(myTaskName); await tasksCloudDemoPage.taskListCloudComponent().selectRow(myTaskName); + await tasksCloudDemoPage.waitTillContentLoaded(); + await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed(); await taskHeaderCloudPage.priorityCardTextItem.enterTextField('$$%£W21'); @@ -223,6 +239,8 @@ describe('Task Header cloud component', () => { await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(unclaimedTask.entry.name); await tasksCloudDemoPage.taskListCloudComponent().selectRow(unclaimedTask.entry.name); + await tasksCloudDemoPage.waitTillContentLoaded(); + await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed(); const currentAssignee = await taskHeaderCloudPage.assigneeCardTextItem.getFieldValue(); @@ -242,10 +260,6 @@ describe('Task Header cloud component', () => { await peopleCloudComponentPage.selectAssigneeFromList('HR User'); await peopleCloudComponentPage.checkSelectedPeople('HR User'); - await peopleCloudComponentPage.searchAssignee('processAdmin'); - await peopleCloudComponentPage.selectAssigneeFromList('Process Admin User'); - await peopleCloudComponentPage.checkSelectedPeople('Process Admin User'); - await peopleCloudComponentPage.searchAssignee('modeler'); await peopleCloudComponentPage.checkNoResultsFoundError(); }); @@ -264,8 +278,12 @@ describe('Task Header cloud component', () => { it('[C311280] Should pick up the default date format from the app configuration', async () => { await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTaskName); await tasksCloudDemoPage.taskListCloudComponent().selectRow(completedTaskName); + await tasksCloudDemoPage.waitTillContentLoaded(); + await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed(); await expect(await taskHeaderCloudPage.getCreated()).toEqual(defaultDate); }); diff --git a/e2e/process-services-cloud/task-list-selection.e2e.ts b/e2e/process-services-cloud/task-list-selection.e2e.ts index 95f2a44fcb..c5ed11cffa 100644 --- a/e2e/process-services-cloud/task-list-selection.e2e.ts +++ b/e2e/process-services-cloud/task-list-selection.e2e.ts @@ -86,7 +86,7 @@ describe('Task list cloud - selection', () => { await tasksCloudDemoPage.selectSelectionMode('None'); await tasksCloudDemoPage.disableDisplayTaskDetails(); await tasksCloudDemoPage.clickAppButton(); - await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitForTableBody(); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(tasks[0]); await tasksCloudDemoPage.taskListCloudComponent().selectRow(tasks[0]); @@ -98,7 +98,7 @@ describe('Task list cloud - selection', () => { await tasksCloudDemoPage.selectSelectionMode('Single'); await tasksCloudDemoPage.disableDisplayTaskDetails(); await tasksCloudDemoPage.clickAppButton(); - await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitForTableBody(); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(tasks[0]); await tasksCloudDemoPage.taskListCloudComponent().selectRow(tasks[0]); @@ -116,7 +116,7 @@ describe('Task list cloud - selection', () => { await tasksCloudDemoPage.enableMultiSelection(); await tasksCloudDemoPage.disableDisplayTaskDetails(); await tasksCloudDemoPage.clickAppButton(); - await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitForTableBody(); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(tasks[0]); await tasksCloudDemoPage.taskListCloudComponent().selectRow(tasks[0]); @@ -133,7 +133,7 @@ describe('Task list cloud - selection', () => { await tasksCloudDemoPage.clickSettingsButton(); await tasksCloudDemoPage.disableDisplayTaskDetails(); await tasksCloudDemoPage.clickAppButton(); - await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitForTableBody(); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(tasks[0]); await tasksCloudDemoPage.taskListCloudComponent().clickCheckbox(tasks[0]); @@ -154,7 +154,7 @@ describe('Task list cloud - selection', () => { await tasksCloudDemoPage.clickSettingsButton(); await tasksCloudDemoPage.disableDisplayTaskDetails(); await tasksCloudDemoPage.clickAppButton(); - await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitForTableBody(); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); await tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkAllRowsButtonIsDisplayed(); await tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkAllRows(); @@ -167,7 +167,7 @@ describe('Task list cloud - selection', () => { await tasksCloudDemoPage.clickSettingsButton(); await tasksCloudDemoPage.enableTestingMode(); await tasksCloudDemoPage.clickAppButton(); - await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitForTableBody(); + await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(tasks[0]); await tasksCloudDemoPage.taskListCloudComponent().clickCheckbox(tasks[0]); diff --git a/e2e/process-services/apps-section.e2e.ts b/e2e/process-services/apps-section.e2e.ts index a25da177bb..11523f54a8 100644 --- a/e2e/process-services/apps-section.e2e.ts +++ b/e2e/process-services/apps-section.e2e.ts @@ -51,23 +51,20 @@ describe('Modify applications', () => { appVersionToBeDeleted = await applicationService.importPublishDeployApp(appToBeDeleted.file_path); await loginPage.login(user.email, user.password); - }); + }); + + beforeEach(async () => { + await navigationBarPage.navigateToProcessServicesPage(); + await processServicesPage.checkApsContainer(); + }); it('[C260198] Should the app be displayed on dashboard when is deployed on APS', async () => { - await navigationBarPage.navigateToProcessServicesPage(); - - await processServicesPage.checkApsContainer(); - await expect(await processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.UNIT); await expect(await processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.BLUE); await expect(await processServicesPage.getDescription(app.title)).toEqual(app.description); }); it('[C260213] Should a new version of the app be displayed on dashboard when is replaced by importing another app in APS', async () => { - await navigationBarPage.navigateToProcessServicesPage(); - - await processServicesPage.checkApsContainer(); - await expect(await processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.UNIT); await expect(await processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.BLUE); await expect(await processServicesPage.getDescription(app.title)).toEqual(app.description); @@ -85,10 +82,6 @@ describe('Modify applications', () => { }); it('[C260220] Should the app not be displayed on dashboard after it was deleted in APS', async () => { - await navigationBarPage.navigateToProcessServicesPage(); - - await processServicesPage.checkApsContainer(); - await processServicesPage.checkAppIsDisplayed(app.title); await modelActions.deleteEntireModel(firstApp.id); @@ -100,10 +93,6 @@ describe('Modify applications', () => { }); it('[C260215] Should the penultimate version of an app be displayed on dashboard when the last version is deleted in APS', async () => { - await navigationBarPage.navigateToProcessServicesPage(); - - await processServicesPage.checkApsContainer(); - await processServicesPage.checkAppIsDisplayed(appToBeDeleted.title); await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE); @@ -131,9 +120,6 @@ describe('Modify applications', () => { it('[C260207] Should the app be updated when is edited in APS', async () => { const newDescription = 'new description'; - await navigationBarPage.navigateToProcessServicesPage(); - await processServicesPage.checkApsContainer(); - await expect(await processServicesPage.getAppIconType(appToBeDeleted.title)).toEqual(CONSTANTS.APP_ICON.USER); await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE); await expect(await processServicesPage.getDescription(appToBeDeleted.title)).toEqual(appToBeDeleted.description); diff --git a/e2e/process-services/attach-file-content-service.e2e.ts b/e2e/process-services/attach-file-content-service.e2e.ts index 71750499be..45c4c5ca0e 100644 --- a/e2e/process-services/attach-file-content-service.e2e.ts +++ b/e2e/process-services/attach-file-content-service.e2e.ts @@ -96,6 +96,8 @@ describe('Attach File - Content service', () => { await apiService.getInstance().login(user.email, user.password); await uploadActions.uploadFile(pdfFileTwo.location, pdfFileTwo.name, '-my-'); await applicationService.importPublishDeployApp(app.file_path); + + await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded }); afterAll(async () => { @@ -124,14 +126,14 @@ describe('Attach File - Content service', () => { await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id); await widget.attachFileWidget().selectUploadSource(csIntegrations[0]); - await contentNodeSelector.contentList.dataTablePage().waitTillContentLoaded(); - + await contentNodeSelector.checkDialogIsDisplayed(); await contentNodeSelector.searchAndSelectResult(pdfFileTwo.name, pdfFileTwo.name); + await contentNodeSelector.clickMoveCopyButton(); await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name); }); - it('[C246522] Attach file - Local file', async () => { + it('[C246522] Attach file - Local file', async () => { const name = 'Attach local file'; await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton(); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); @@ -154,9 +156,11 @@ describe('Attach File - Content service', () => { await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id); await widget.attachFileWidget().selectUploadSource(csIntegrations[1]); + await externalNodeSelector.waitForLogInDialog(); await expect(await externalNodeSelector.getTitle()).toEqual(`Sign into '${browser.params.testConfig.adf_external_acs.host}'`); await externalNodeSelector.login(user.email, user.password); + await externalNodeSelector.checkDialogIsDisplayed(); await externalNodeSelector.searchAndSelectResult(externalFile, externalFile); await externalNodeSelector.clickMoveCopyButton(); await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, externalFile); @@ -171,6 +175,7 @@ describe('Attach File - Content service', () => { await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id); await widget.attachFileWidget().selectUploadSource(csIntegrations[0]); + await contentNodeSelector.checkDialogIsDisplayed(); await contentNodeSelector.searchAndSelectResult(pdfFileTwo.name, pdfFileTwo.name); await contentNodeSelector.clickMoveCopyButton(); @@ -184,6 +189,9 @@ describe('Attach File - Content service', () => { await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id); await widget.attachFileWidget().selectUploadSource(csIntegrations[1]); + await externalNodeSelector.waitForLogInDialog(); + await externalNodeSelector.login(user.email, user.password); + await externalNodeSelector.searchAndSelectResult(externalFile, externalFile); await externalNodeSelector.clickMoveCopyButton(); await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, externalFile); diff --git a/e2e/process-services/info-drawer.e2e.ts b/e2e/process-services/info-drawer.e2e.ts index 0c7b79ca9c..a6de028d55 100644 --- a/e2e/process-services/info-drawer.e2e.ts +++ b/e2e/process-services/info-drawer.e2e.ts @@ -359,6 +359,6 @@ describe('Info Drawer', () => { await expect(await taskPage.taskDetails().getCategory()).toEqual(category); await expect(await taskPage.taskDetails().getParentName()).toEqual(parentName); await expect(await taskPage.taskDetails().getCreated()).toEqual(moment(Date.now()).format(dateFormat)); - await expect(await taskPage.taskDetails().getFormName()).toEqual(formName); + await taskPage.taskDetails().waitFormNameEqual(formName); } }); diff --git a/e2e/process-services/pages/attachment-list.page.ts b/e2e/process-services/pages/attachment-list.page.ts index ce682f9e94..4268d14f8f 100644 --- a/e2e/process-services/pages/attachment-list.page.ts +++ b/e2e/process-services/pages/attachment-list.page.ts @@ -33,6 +33,7 @@ export class AttachmentListPage { } async clickAttachFileButton(fileLocation: string): Promise { + await browser.sleep(500); await BrowserVisibility.waitUntilElementIsPresent(this.attachFileButton); await this.attachFileButton.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, fileLocation))); } diff --git a/e2e/process-services/pages/filters.page.ts b/e2e/process-services/pages/filters.page.ts index 11df766eb2..4c60c99a5f 100644 --- a/e2e/process-services/pages/filters.page.ts +++ b/e2e/process-services/pages/filters.page.ts @@ -31,6 +31,7 @@ export class FiltersPage { await BrowserActions.closeMenuAndDialogs(); const filter = element(by.css(`button[data-automation-id="${filterName}_filter"]`)); await BrowserActions.click(filter); + await this.dataTable.waitTillContentLoaded(); } async sortByName(sortOrder: string): Promise { diff --git a/e2e/process-services/pages/process-filters.page.ts b/e2e/process-services/pages/process-filters.page.ts index 30a71f3561..f54e33dbe6 100644 --- a/e2e/process-services/pages/process-filters.page.ts +++ b/e2e/process-services/pages/process-filters.page.ts @@ -93,7 +93,7 @@ export class ProcessFiltersPage { } async waitForTableBody(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.tableBody); + await this.dataTable.waitForTableBody(); } /** diff --git a/e2e/process-services/pages/task-details.page.ts b/e2e/process-services/pages/task-details.page.ts index 846771f2df..5c72b45f8d 100644 --- a/e2e/process-services/pages/task-details.page.ts +++ b/e2e/process-services/pages/task-details.page.ts @@ -143,6 +143,10 @@ export class TaskDetailsPage { return BrowserActions.getInputValue(this.formNameField); } + async waitFormNameEqual(formName: string): Promise { + await BrowserVisibility.waitUntilElementHasValue(this.formNameField, formName); + } + async clickForm(): Promise { await BrowserActions.closeMenuAndDialogs(); await BrowserActions.click(this.formNameButton); diff --git a/e2e/process-services/pagination-processlist-adding-processes.e2e.ts b/e2e/process-services/pagination-processlist-adding-processes.e2e.ts index 12b76e5a8c..d58be11867 100644 --- a/e2e/process-services/pagination-processlist-adding-processes.e2e.ts +++ b/e2e/process-services/pagination-processlist-adding-processes.e2e.ts @@ -75,8 +75,8 @@ describe('Process List - Pagination when adding processes', () => { let page = 1; await paginationPage.selectItemsPerPage(itemsPerPage.fifteen); + await processFiltersPage.dataTable.waitTillContentLoaded(); await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); diff --git a/e2e/process-services/pagination-tasklist-adding-tasks.e2e.ts b/e2e/process-services/pagination-tasklist-adding-tasks.e2e.ts index 0fa1d516f2..4ecf65b72d 100644 --- a/e2e/process-services/pagination-tasklist-adding-tasks.e2e.ts +++ b/e2e/process-services/pagination-tasklist-adding-tasks.e2e.ts @@ -74,6 +74,8 @@ describe('Items per page set to 15 and adding of tasks', () => { await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS); await paginationPage.selectItemsPerPage(itemsPerPage.fifteen); + await taskPage.tasksListPage().getDataTable().waitTillContentLoaded(); + await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen); await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage); await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); @@ -87,6 +89,8 @@ describe('Items per page set to 15 and adding of tasks', () => { currentPage++; await paginationPage.clickOnNextPage(); + await taskPage.tasksListPage().getDataTable().waitTillContentLoaded(); + await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen); await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage); await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); diff --git a/e2e/process-services/process-attachment-list-action-menu.e2e.ts b/e2e/process-services/process-attachment-list-action-menu.e2e.ts index 78f8fbc837..fd499ef2ac 100644 --- a/e2e/process-services/process-attachment-list-action-menu.e2e.ts +++ b/e2e/process-services/process-attachment-list-action-menu.e2e.ts @@ -94,10 +94,11 @@ describe('Attachment list action menu for processes', () => { await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(app.title)).clickProcessButton(); await processFiltersPage.selectFromProcessList(processName.active); - await processDetailsPage.checkProcessTitleIsDisplayed(); await attachmentListPage.clickAttachFileButton(pngFile.location); + await attachmentListPage.checkFileIsAttached(pngFile.name); + await attachmentListPage.viewFile(pngFile.name); await viewerPage.checkFileNameIsDisplayed(pngFile.name); @@ -105,6 +106,7 @@ describe('Attachment list action menu for processes', () => { await processFiltersPage.clickRunningFilterButton(); await processFiltersPage.selectFromProcessList(processName.active); + await processDetailsPage.checkProcessTitleIsDisplayed(); await attachmentListPage.doubleClickFile(pngFile.name); @@ -113,6 +115,7 @@ describe('Attachment list action menu for processes', () => { await processFiltersPage.clickRunningFilterButton(); await processFiltersPage.selectFromProcessList(processName.active); + await processDetailsPage.checkProcessTitleIsDisplayed(); await attachmentListPage.downloadFile(pngFile.name); @@ -127,12 +130,11 @@ describe('Attachment list action menu for processes', () => { it('[C279886] Should be able to access options of a file attached to a completed process', async () => { await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(app.title)).clickProcessButton(); - await processFiltersPage.clickRunningFilterButton(); await processFiltersPage.selectFromProcessList(processName.completed); - await processDetailsPage.checkProcessTitleIsDisplayed(); await attachmentListPage.clickAttachFileButton(pngFile.location); + await attachmentListPage.checkFileIsAttached(pngFile.name); await processDetailsPage.clickCancelProcessButton(); await processFiltersPage.clickCompletedFilterButton(); @@ -140,6 +142,7 @@ describe('Attachment list action menu for processes', () => { await processDetailsPage.checkProcessTitleIsDisplayed(); await attachmentListPage.checkAttachFileButtonIsNotDisplayed(); + await attachmentListPage.checkFileIsAttached(pngFile.name); await attachmentListPage.viewFile(pngFile.name); await viewerPage.checkFileNameIsDisplayed(pngFile.name); @@ -162,7 +165,6 @@ describe('Attachment list action menu for processes', () => { await processFiltersPage.clickRunningFilterButton(); await processFiltersPage.selectFromProcessList(processName.taskApp); - await processDetailsPage.checkProcessTitleIsDisplayed(); await attachmentListPage.clickAttachFileButton(pngFile.location); @@ -174,6 +176,7 @@ describe('Attachment list action menu for processes', () => { await processFiltersPage.clickRunningFilterButton(); await processFiltersPage.selectFromProcessList(processName.emptyList); + await processDetailsPage.checkProcessTitleIsDisplayed(); await attachmentListPage.checkEmptyAttachmentList(); await attachmentListPage.clickAttachFileButton(pngFile.location); diff --git a/e2e/process-services/standalone-task.e2e.ts b/e2e/process-services/standalone-task.e2e.ts index 25a65285f5..218fba5f16 100644 --- a/e2e/process-services/standalone-task.e2e.ts +++ b/e2e/process-services/standalone-task.e2e.ts @@ -73,7 +73,7 @@ describe('Start Task - Task App', () => { await taskDetails.checkCompleteTaskButtonIsEnabled(); await taskPage.taskDetails().checkAttachFormButtonIsDisplayed(); await taskPage.taskDetails().checkAttachFormButtonIsEnabled(); - await expect(await taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM); + await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM); await expect(await taskDetails.getNoFormMessage()).toEqual(noFormMessage); }); @@ -90,7 +90,7 @@ describe('Start Task - Task App', () => { await expect(await taskPage.formFields().getCompletedTaskNoFormMessage()).toEqual('Task ' + tasks[1] + ' completed'); await taskPage.formFields().noFormIsDisplayed(); - await expect(await taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM); + await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM); }); it('[C268911] Should allow adding a form to a standalone task when clicking on Add form button', async () => { @@ -108,7 +108,7 @@ describe('Start Task - Task App', () => { await taskPage.formFields().checkFormIsDisplayed(); await taskPage.taskDetails().checkCompleteFormButtonIsDisplayed(); - await expect(await taskPage.taskDetails().getFormName()).toEqual(app.formName); + await taskPage.taskDetails().waitFormNameEqual(app.formName); }); it('[C268912] Should a standalone task be displayed when removing the form from APS', async () => { @@ -119,7 +119,7 @@ describe('Start Task - Task App', () => { await task.clickStartButton(); await taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]); - await expect(await taskPage.taskDetails().getFormName()).toEqual(app.formName); + await taskPage.taskDetails().waitFormNameEqual(app.formName); const listOfTasks = await apiService.getInstance().activiti.taskApi.listTasks(new Task({ sort: 'created-desc' })); await apiService.getInstance().activiti.taskApi.removeForm(listOfTasks.data[0].id); @@ -129,7 +129,7 @@ describe('Start Task - Task App', () => { await taskPage.checkTaskTitle(tasks[3]); await taskPage.formFields().noFormIsDisplayed(); - await expect(await taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM); + await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM); await expect(await taskDetails.getNoFormMessage()).toEqual(noFormMessage); }); }); diff --git a/e2e/process-services/start-process-component.e2e.ts b/e2e/process-services/start-process-component.e2e.ts index 71634069d9..50b8142ea5 100644 --- a/e2e/process-services/start-process-component.e2e.ts +++ b/e2e/process-services/start-process-component.e2e.ts @@ -508,7 +508,6 @@ describe('Start Process Component', () => { await loginPage.login(processUserModel.email, processUserModel.password); await contentServicesPage.goToDocumentList(); - await contentServicesPage.checkDocumentListElementsAreDisplayed(); await contentServicesPage.uploadFile(imageUploaded.location); await contentServicesPage.checkContentIsDisplayed(imageUploaded.name); await uploadDialog.clickOnCloseButton(); diff --git a/e2e/process-services/start-task-custom-app.e2e.ts b/e2e/process-services/start-task-custom-app.e2e.ts index 5456666f4f..ab82217f6f 100644 --- a/e2e/process-services/start-task-custom-app.e2e.ts +++ b/e2e/process-services/start-task-custom-app.e2e.ts @@ -118,7 +118,7 @@ describe('Start Task - Custom App', () => { await taskPage.formFields().noFormIsDisplayed(); - await expect(await taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM); + await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM); }); it('[C263948] Should be possible to cancel a task', async () => { diff --git a/e2e/process-services/task-details-form.e2e.ts b/e2e/process-services/task-details-form.e2e.ts index 87d57f5e78..4d5be1d4e5 100644 --- a/e2e/process-services/task-details-form.e2e.ts +++ b/e2e/process-services/task-details-form.e2e.ts @@ -140,7 +140,7 @@ describe('Task Details - Form', () => { await taskDetailsPage.checkFormIsAttached('No form'); - await expect(await taskDetailsPage.getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM); + await taskDetailsPage.waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM); }); it('[C280557] Should display task details when selecting another task while the Attach Form dialog is displayed', async () => { diff --git a/e2e/process-services/task-details-no-form.e2e.ts b/e2e/process-services/task-details-no-form.e2e.ts index e9e238b731..63b14a628a 100644 --- a/e2e/process-services/task-details-no-form.e2e.ts +++ b/e2e/process-services/task-details-no-form.e2e.ts @@ -62,7 +62,7 @@ describe('Task Details - No form', () => { await taskPage.taskDetails().checkCompleteTaskButtonIsDisplayed(); await taskPage.taskDetails().checkCompleteTaskButtonIsEnabled(); await taskPage.taskDetails().checkAttachFormButtonIsNotDisplayed(); - await expect(await taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM); + await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM); await expect(await taskPage.formFields().getNoFormMessage()).toEqual(noFormMessage); }); }); diff --git a/e2e/process-services/task-details.e2e.ts b/e2e/process-services/task-details.e2e.ts index 72b0c5be4a..c2342779ce 100644 --- a/e2e/process-services/task-details.e2e.ts +++ b/e2e/process-services/task-details.e2e.ts @@ -104,7 +104,7 @@ describe('Task Details component', () => { const taskForm = await apiService.getInstance().activiti.taskFormsApi.getTaskForm(allTasks.data[0].id); formModel = new FormModel(taskForm); - await expect(await taskPage.taskDetails().getFormName()).toEqual(formModel.getName()); + await taskPage.taskDetails().waitFormNameEqual(formModel.getName()); }); it('[C263946] Should display task details for standalone task - Custom App', async () => { @@ -136,7 +136,7 @@ describe('Task Details component', () => { formModel = new FormModel(taskForm); - await expect(await taskPage.taskDetails().getFormName()).toEqual(formModel.getName()); + await taskPage.taskDetails().waitFormNameEqual(formModel.getName()); }); it('[C286706] Should display task details for task - Task App', async () => { @@ -169,8 +169,7 @@ describe('Task Details component', () => { formModel = new FormModel(taskForm); - await expect(await taskPage.taskDetails().getFormName()) - .toEqual(formModel.getName() === null ? CONSTANTS.TASK_DETAILS.NO_FORM : formModel.getName()); + await taskPage.taskDetails().waitFormNameEqual(formModel.getName()); }); it('[C286705] Should display task details for task - Custom App', async () => { @@ -201,8 +200,7 @@ describe('Task Details component', () => { formModel = new FormModel(taskForm); - await expect(await taskPage.taskDetails().getFormName()) - .toEqual(formModel.getName() === null ? CONSTANTS.TASK_DETAILS.NO_FORM : formModel.getName()); + await taskPage.taskDetails().waitFormNameEqual(formModel.getName()); }); it('[C286708] Should display task details for subtask - Task App', async () => { diff --git a/e2e/protractor.conf.js b/e2e/protractor.conf.js index d5c40c2922..15fce803d5 100644 --- a/e2e/protractor.conf.js +++ b/e2e/protractor.conf.js @@ -97,7 +97,8 @@ let specExists = function (listSpecs) { specs(); exports.config = { - allScriptsTimeout: TIMEOUT, + + allScriptsTimeout: 30000, specs: arraySpecs, @@ -136,7 +137,7 @@ exports.config = { '--no-sandbox', '--disable-web-security', '--disable-browser-side-navigation', - '-allow-running-insecure-content', + '--allow-running-insecure-content', ...(BROWSER_RUN === true ? [] : ['--headless'])] } }, @@ -154,13 +155,14 @@ exports.config = { resources: RESOURCES }, - framework: 'jasmine2', + framework: 'jasmine', getPageTimeout: 90000, jasmineNodeOpts: { showColors: true, - defaultTimeoutInterval: 120000, + defaultTimeoutInterval: 180000, + includeStackTrace: true, print: () => { }, ...smartRunner.withOptionalExclusions( @@ -184,7 +186,8 @@ exports.config = { writeReportFreq: 'end', imageToAscii: 'none', htmlOnExpect: 'none', - htmlOnSpec: 'none' + htmlOnSpec: 'none', + clearFoldersBeforeTest: false }], onCleanUp(results) { diff --git a/e2e/protractor.excludes.json b/e2e/protractor.excludes.json index 8c3419458e..7763a42b56 100644 --- a/e2e/protractor.excludes.json +++ b/e2e/protractor.excludes.json @@ -1,10 +1,6 @@ { "C362240": "Include once ADF starts using ACS 7 , https://issues.alfresco.com/jira/browse/ADF-5182", "C362241": "Include once ADF starts using ACS 7, https://issues.alfresco.com/jira/browse/ADF-5182", - "C291980": "https://issues.alfresco.com/jira/browse/ADF-5235", - "C291981": "https://issues.alfresco.com/jira/browse/ADF-5235", - "C299200": "https://issues.alfresco.com/jira/browse/ADF-5235", - "C297509": "https://issues.alfresco.com/jira/browse/ADF-5235", "C277751": "setting problem APS not basic", "C277752": "setting problem APS not basic", "C277753": "setting problem APS not basic", @@ -14,6 +10,12 @@ "C279931": "login problem APS not basic", "C279930": "login problem APS not basic", "C246534": "https://issues.alfresco.com/jira/browse/ADF-5236", - "C291893": "flaky test" + "C305041": "Open ticket", + "C291954": "Open ticket", + "C291955": "Open ticket", + "C291993": "Open ticket", + "C291995": "Open ticket", + "C297478": "Open ticket", + "C297485": "Open ticket" } diff --git a/e2e/search/components/search-check-list.e2e.ts b/e2e/search/components/search-check-list.e2e.ts index 9053a6b7a7..f3afe87563 100644 --- a/e2e/search/components/search-check-list.e2e.ts +++ b/e2e/search/components/search-check-list.e2e.ts @@ -76,7 +76,7 @@ describe('Search Checklist Component', () => { nodeType: 'cm:content' }); - await browser.sleep(15000); + await browser.sleep(browser.params.testConfig.timeouts.index_search); await loginPage.login(acsUser.email, acsUser.password); }); @@ -107,12 +107,14 @@ describe('Search Checklist Component', () => { await searchFiltersPage.checkListFiltersPage().checkCheckListOptionIsNotSelected(filterType.document); await searchFiltersPage.checkListFiltersPage().clickCheckListOption(filterType.folder); await searchFiltersPage.checkListFiltersPage().checkCheckListOptionIsSelected(filterType.folder); + await searchResults.dataTable.waitTillContentLoaded(); await searchResults.checkContentIsDisplayed(nodeNames.folder); await searchResults.checkContentIsNotDisplayed(nodeNames.document); await searchFiltersPage.checkListFiltersPage().clickClearAllButton(); await searchFiltersPage.checkListFiltersPage().checkCheckListOptionIsNotSelected(filterType.folder); + await searchResults.dataTable.waitTillContentLoaded(); await searchResults.checkContentIsDisplayed(nodeNames.folder); await searchResults.checkContentIsDisplayed(nodeNames.document); @@ -121,6 +123,7 @@ describe('Search Checklist Component', () => { await searchFiltersPage.checkListFiltersPage().clickCheckListOption(filterType.document); await searchFiltersPage.checkListFiltersPage().checkCheckListOptionIsSelected(filterType.folder); await searchFiltersPage.checkListFiltersPage().checkCheckListOptionIsSelected(filterType.document); + await searchResults.dataTable.waitTillContentLoaded(); await searchResults.checkContentIsDisplayed(nodeNames.folder); await searchResults.checkContentIsDisplayed(nodeNames.document); @@ -128,6 +131,7 @@ describe('Search Checklist Component', () => { await searchFiltersPage.checkListFiltersPage().clickCheckListOption(filterType.folder); await searchFiltersPage.checkListFiltersPage().checkCheckListOptionIsSelected(filterType.document); await searchFiltersPage.checkListFiltersPage().checkCheckListOptionIsNotSelected(filterType.folder); + await searchResults.dataTable.waitTillContentLoaded(); await searchResults.checkContentIsDisplayed(nodeNames.document); await searchResults.checkContentIsNotDisplayed(nodeNames.folder); @@ -154,6 +158,8 @@ describe('Search Checklist Component', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(randomName); + await searchResults.dataTable.waitTillContentLoaded(); + await searchFiltersPage.clickCheckListFilter(); await expect(await searchFiltersPage.checkListFiltersPage().getCheckListOptionsNumberOnPage()).toBe(5); @@ -193,6 +199,8 @@ describe('Search Checklist Component', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(randomName); + await searchResults.dataTable.waitTillContentLoaded(); + await searchFiltersPage.clickCheckListFilter(); await expect(await searchFiltersPage.checkListFiltersPage().getCheckListOptionsNumberOnPage()).toBe(10); @@ -207,6 +215,8 @@ describe('Search Checklist Component', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(randomName); + await searchResults.dataTable.waitTillContentLoaded(); + await searchFiltersPage.clickCheckListFilter(); await expect(await searchFiltersPage.checkListFiltersPage().getCheckListOptionsNumberOnPage()).toBe(10); @@ -246,6 +256,10 @@ describe('Search Checklist Component', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(randomName); + await searchResults.dataTable.waitTillContentLoaded(); + + await searchResults.dataTable.waitTillContentLoaded(); + await searchFiltersPage.clickCheckListFilter(); await expect(await searchFiltersPage.checkListFiltersPage().getCheckListOptionsNumberOnPage()).toBe(5); @@ -269,6 +283,8 @@ describe('Search Checklist Component', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(randomName); + await searchResults.dataTable.waitTillContentLoaded(); + await searchFiltersPage.clickCheckListFilter(); await expect(await searchFiltersPage.checkListFiltersPage().getCheckListOptionsNumberOnPage()).toBe(5); @@ -288,17 +304,12 @@ describe('Search Checklist Component', () => { describe('Properties', () => { let jsonFile; - beforeEach(() => { + beforeEach(async () => { jsonFile = SearchConfiguration.getConfiguration(); - }); - - beforeAll(async () => { - await loginPage.login(acsUser.email, acsUser.password); + await navigationBarPage.clickContentServicesButton(); }); it('[C277018] Should be able to change the operator', async () => { - await navigationBarPage.clickContentServicesButton(); - jsonFile.categories[1].component.settings.operator = 'AND'; await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); @@ -306,10 +317,13 @@ describe('Search Checklist Component', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(randomName); + await searchResults.dataTable.waitTillContentLoaded(); + await searchFiltersPage.clickCheckListFilter(); await searchFiltersPage.checkListFiltersPage().clickCheckListOption(filterType.folder); await searchFiltersPage.checkListFiltersPage().checkCheckListOptionIsSelected(filterType.folder); + await searchResults.dataTable.waitTillContentLoaded(); await searchResults.checkContentIsDisplayed(nodeNames.folder); await searchResults.checkContentIsNotDisplayed(nodeNames.document); @@ -321,8 +335,6 @@ describe('Search Checklist Component', () => { }); it('[C277019] Should be able to add new properties with different types', async () => { - await navigationBarPage.clickContentServicesButton(); - jsonFile.categories[1].component.settings.options.push({ 'name': filterType.custom, 'value': "TYPE:'cm:auditable'" @@ -333,6 +345,8 @@ describe('Search Checklist Component', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(randomName); + await searchResults.dataTable.waitTillContentLoaded(); + await searchFiltersPage.clickCheckListFilter(); await searchFiltersPage.checkListFiltersPage().checkCheckListOptionIsDisplayed(filterType.folder); @@ -346,6 +360,7 @@ describe('Search Checklist Component', () => { await searchFiltersPage.checkListFiltersPage().clickCheckListOption(filterType.document); await searchFiltersPage.checkListFiltersPage().clickCheckListOption(filterType.folder); + await searchResults.dataTable.waitTillContentLoaded(); await searchResults.checkContentIsDisplayed(nodeNames.folder); await searchResults.checkContentIsDisplayed(nodeNames.document); diff --git a/e2e/search/components/search-date-range.e2e.ts b/e2e/search/components/search-date-range.e2e.ts index cdebfd8b4b..1138e907fd 100644 --- a/e2e/search/components/search-date-range.e2e.ts +++ b/e2e/search/components/search-date-range.e2e.ts @@ -40,7 +40,8 @@ describe('Search Date Range Filter', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter('*'); - }); + await searchResults.dataTable.waitTillContentLoaded(); + }); beforeEach(async () => { await searchFilters.checkCreatedRangeFilterIsDisplayed(); @@ -183,6 +184,8 @@ describe('Search Date Range Filter', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter('*'); + await searchResults.dataTable.waitTillContentLoaded(); + await searchFilters.checkCreatedRangeFilterIsDisplayed(); await searchFilters.clickCreatedRangeFilterHeader(); await searchFilters.checkCreatedRangeFilterIsExpanded(); diff --git a/e2e/search/components/search-number-range.e2e.ts b/e2e/search/components/search-number-range.e2e.ts index ba3e9823e6..15006101d3 100644 --- a/e2e/search/components/search-number-range.e2e.ts +++ b/e2e/search/components/search-number-range.e2e.ts @@ -70,14 +70,15 @@ describe('Search Number Range Filter', () => { file2Bytes = await uploadActions.uploadFile(file2BytesModel.location, file2BytesModel.name, '-my-'); file0Bytes = await uploadActions.uploadFile(file0BytesModel.location, file0BytesModel.name, '-my-'); - await browser.sleep(15000); + await browser.sleep(browser.params.testConfig.timeouts.index_search); await loginPage.login(acsUser.email, acsUser.password); await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter('*'); - }); + await searchResults.dataTable.waitTillContentLoaded(); + }); afterAll(async () => { await apiService.getInstance().login(acsUser.email, acsUser.password); @@ -170,7 +171,7 @@ describe('Search Number Range Filter', () => { await expect(await sizeRangeFilter.checkApplyButtonIsEnabled()).toBe(true); await sizeRangeFilter.clickApplyButton(); - await searchResults.tableIsLoaded(); + await searchResults.dataTable.waitTillContentLoaded(); await searchResults.sortBySize('DESC'); const results = await dataTable.geCellElementDetail('Size') as ElementFinder[]; @@ -190,6 +191,7 @@ describe('Search Number Range Filter', () => { await searchFilters.checkNameFilterIsDisplayed(); await searchFilters.checkNameFilterIsExpanded(); await nameFilter.searchByName('*'); + await searchResults.dataTable.waitTillContentLoaded(); await sizeRangeFilter.checkFromFieldIsDisplayed(); await sizeRangeFilter.putFromNumber(fromSize); @@ -198,6 +200,8 @@ describe('Search Number Range Filter', () => { await expect(await sizeRangeFilter.checkApplyButtonIsEnabled()).toBe(true); await sizeRangeFilter.clickApplyButton(); + await searchResults.dataTable.waitTillContentLoaded(); + await searchResults.sortBySize('DESC'); const results = await dataTable.geCellElementDetail('Size') as ElementFinder[]; @@ -211,6 +215,7 @@ describe('Search Number Range Filter', () => { await searchFilters.checkNameFilterIsDisplayed(); await searchFilters.checkNameFilterIsExpanded(); await nameFilter.searchByName('z*'); + await searchResults.dataTable.waitTillContentLoaded(); await searchResults.sortBySize('DESC'); const resultsSize = await dataTable.geCellElementDetail('Size') as ElementFinder[]; @@ -237,14 +242,14 @@ describe('Search Number Range Filter', () => { await expect(await sizeRangeFilter.checkApplyButtonIsEnabled()).toBe(true); await sizeRangeFilter.clickApplyButton(); - await searchResults.tableIsLoaded(); + await searchResults.dataTable.waitTillContentLoaded(); await searchFilters.checkCheckListFilterIsDisplayed(); await searchFilters.clickCheckListFilter(); await searchFilters.checkCheckListFilterIsExpanded(); await searchFilters.checkListFiltersPage().clickCheckListOption('Folder'); - await searchResults.tableIsLoaded(); + await searchResults.dataTable.waitTillContentLoaded(); await searchResults.checkNoResultMessageIsDisplayed(); }); @@ -255,7 +260,8 @@ describe('Search Number Range Filter', () => { await expect(await sizeRangeFilter.checkApplyButtonIsEnabled()).toBe(true); await sizeRangeFilter.clickApplyButton(); - await searchResults.tableIsLoaded(); + await searchResults.dataTable.waitTillContentLoaded(); + await searchResults.sortBySize('DESC'); const results = await dataTable.geCellElementDetail('Size') as ElementFinder[]; @@ -327,7 +333,8 @@ describe('Search Number Range Filter', () => { await sizeRangeFilter.clickApplyButton(); - await searchResults.tableIsLoaded(); + await searchResults.dataTable.waitTillContentLoaded(); + await searchResults.checkContentIsDisplayed(file2BytesModel.name); await sizeRangeFilter.checkToFieldIsDisplayed(); @@ -337,7 +344,8 @@ describe('Search Number Range Filter', () => { await sizeRangeFilter.clickApplyButton(); - await searchResults.tableIsLoaded(); + await searchResults.dataTable.waitTillContentLoaded(); + await searchResults.checkContentIsNotDisplayed(file2BytesModel.name); await sizeRangeFilter.checkToFieldIsDisplayed(); @@ -347,7 +355,8 @@ describe('Search Number Range Filter', () => { await sizeRangeFilter.clickApplyButton(); - await searchResults.tableIsLoaded(); + await searchResults.dataTable.waitTillContentLoaded(); + await searchResults.checkContentIsDisplayed(file2BytesModel.name); await sizeRangeFilter.checkToFieldIsDisplayed(); @@ -357,7 +366,8 @@ describe('Search Number Range Filter', () => { await sizeRangeFilter.clickApplyButton(); - await searchResults.tableIsLoaded(); + await searchResults.dataTable.waitTillContentLoaded(); + await searchResults.checkContentIsNotDisplayed(file2BytesModel.name); }); @@ -378,6 +388,7 @@ describe('Search Number Range Filter', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter('*'); + await searchResults.dataTable.waitTillContentLoaded(); await searchFilters.checkSizeRangeFilterIsDisplayed(); await searchFilters.clickSizeRangeFilterHeader(); @@ -392,7 +403,8 @@ describe('Search Number Range Filter', () => { await expect(await sizeRangeFilter.checkApplyButtonIsEnabled()).toBe(true); await sizeRangeFilter.clickApplyButton(); - await searchResults.tableIsLoaded(); + await searchResults.dataTable.waitTillContentLoaded(); + await searchResults.sortByCreated('DESC'); const results = await dataTable.geCellElementDetail('Created') as ElementFinder[]; @@ -415,6 +427,7 @@ describe('Search Number Range Filter', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter('*'); + await searchResults.dataTable.waitTillContentLoaded(); await searchFilters.checkSizeRangeFilterIsDisplayed(); await searchFilters.clickSizeRangeFilterHeader(); @@ -427,7 +440,8 @@ describe('Search Number Range Filter', () => { await sizeRangeFilter.clickApplyButton(); - await searchResults.tableIsLoaded(); + await searchResults.dataTable.waitTillContentLoaded(); + await searchResults.checkContentIsNotDisplayed(file2BytesModel.name); await sizeRangeFilter.checkToFieldIsDisplayed(); @@ -437,7 +451,8 @@ describe('Search Number Range Filter', () => { await sizeRangeFilter.clickApplyButton(); - await searchResults.tableIsLoaded(); + await searchResults.dataTable.waitTillContentLoaded(); + await searchResults.checkContentIsDisplayed(file2BytesModel.name); }); @@ -451,6 +466,7 @@ describe('Search Number Range Filter', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter('*'); + await searchResults.dataTable.waitTillContentLoaded(); await searchFilters.checkSizeRangeFilterIsDisplayed(); await searchFilters.clickSizeRangeFilterHeader(); @@ -463,7 +479,8 @@ describe('Search Number Range Filter', () => { await sizeRangeFilter.clickApplyButton(); - await searchResults.tableIsLoaded(); + await searchResults.dataTable.waitTillContentLoaded(); + await searchResults.checkContentIsDisplayed(file2BytesModel.name); await sizeRangeFilter.checkToFieldIsDisplayed(); @@ -473,7 +490,8 @@ describe('Search Number Range Filter', () => { await sizeRangeFilter.clickApplyButton(); - await searchResults.tableIsLoaded(); + await searchResults.dataTable.waitTillContentLoaded(); + await searchResults.checkContentIsNotDisplayed(file2BytesModel.name); }); }); diff --git a/e2e/search/components/search-radio.e2e.ts b/e2e/search/components/search-radio.e2e.ts index 577296c32a..fa7481e59a 100644 --- a/e2e/search/components/search-radio.e2e.ts +++ b/e2e/search/components/search-radio.e2e.ts @@ -77,7 +77,7 @@ describe('Search Radio Component', () => { nodeType: 'cm:content' }); - await browser.sleep(15000); + await browser.sleep(browser.params.testConfig.timeouts.index_search); await loginPage.login(acsUser.email, acsUser.password); @@ -151,6 +151,8 @@ describe('Search Radio Component', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(randomName); + await searchResults.dataTable.waitTillContentLoaded(); + await searchFiltersPage.clickTypeFilterHeader(); await expect(await searchFiltersPage.typeFiltersPage().getRadioButtonsNumberOnPage()).toBe(10); @@ -164,6 +166,8 @@ describe('Search Radio Component', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(randomName); + await searchResults.dataTable.waitTillContentLoaded(); + await searchFiltersPage.clickTypeFilterHeader(); await expect(await searchFiltersPage.typeFiltersPage().getRadioButtonsNumberOnPage()).toBe(10); @@ -176,6 +180,8 @@ describe('Search Radio Component', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(randomName); + await searchResults.dataTable.waitTillContentLoaded(); + await searchFiltersPage.clickTypeFilterHeader(); await expect(await searchFiltersPage.typeFiltersPage().getRadioButtonsNumberOnPage()).toBe(9); @@ -203,6 +209,8 @@ describe('Search Radio Component', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(randomName); + await searchResults.dataTable.waitTillContentLoaded(); + await searchFiltersPage.clickTypeFilterHeader(); await expect(await searchFiltersPage.typeFiltersPage().getRadioButtonsNumberOnPage()).toBe(5); @@ -232,6 +240,8 @@ describe('Search Radio Component', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(randomName); + await searchResults.dataTable.waitTillContentLoaded(); + await searchFiltersPage.clickTypeFilterHeader(); await expect(await searchFiltersPage.typeFiltersPage().getRadioButtonsNumberOnPage()).toBe(5); @@ -263,6 +273,7 @@ describe('Search Radio Component', () => { }); beforeAll(async () => { + await navigationBarPage.clickLogoutButton(); await loginPage.login(acsUser.email, acsUser.password); }); @@ -279,6 +290,8 @@ describe('Search Radio Component', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(randomName); + await searchResults.dataTable.waitTillContentLoaded(); + await searchFiltersPage.clickTypeFilterHeader(); await searchFiltersPage.typeFiltersPage().checkFilterRadioButtonIsDisplayed(filterType.none); diff --git a/e2e/search/components/search-slider.e2e.ts b/e2e/search/components/search-slider.e2e.ts index c5503f6d0b..c800ef4a76 100644 --- a/e2e/search/components/search-slider.e2e.ts +++ b/e2e/search/components/search-slider.e2e.ts @@ -63,14 +63,16 @@ describe('Search Slider Filter', () => { await apiService.getInstance().login(acsUser.email, acsUser.password); file2Bytes = await uploadActions.uploadFile(file2BytesModel.location, file2BytesModel.name, '-my-'); - await browser.sleep(15000); + await browser.sleep(browser.params.testConfig.timeouts.index_search); await loginPage.login(acsUser.email, acsUser.password); await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter('*'); - }); + await searchResults.dataTable.waitTillContentLoaded(); + + }); afterAll(async () => { try { @@ -122,7 +124,6 @@ describe('Search Slider Filter', () => { await sizeSliderFilter.checkSliderIsDisplayed(); await sizeSliderFilter.setValue(size); await searchResults.sortBySize('DESC'); - await searchResults.tableIsLoaded(); const results = await dataTable.geCellElementDetail('Size') as ElementFinder[]; for (const currentResult of results) { @@ -137,7 +138,6 @@ describe('Search Slider Filter', () => { await sizeSliderFilter.clickClearButton(); await searchResults.sortBySize('DESC'); - await searchResults.tableIsLoaded(); const resultsSize = await dataTable.geCellElementDetail('Size') as ElementFinder[]; for (const currentResult of resultsSize) { @@ -165,6 +165,7 @@ describe('Search Slider Filter', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter('*'); + await searchResults.dataTable.waitTillContentLoaded(); await searchFilters.checkSizeSliderFilterIsDisplayed(); await searchFilters.clickSizeSliderFilterHeader(); @@ -182,6 +183,7 @@ describe('Search Slider Filter', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter('*'); + await searchResults.dataTable.waitTillContentLoaded(); await searchFilters.checkSizeSliderFilterIsDisplayed(); await searchFilters.clickSizeSliderFilterHeader(); @@ -201,6 +203,7 @@ describe('Search Slider Filter', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter('*'); + await searchResults.dataTable.waitTillContentLoaded(); await searchFilters.checkSizeSliderFilterIsDisplayed(); await searchFilters.clickSizeSliderFilterHeader(); @@ -220,6 +223,7 @@ describe('Search Slider Filter', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter('*'); + await searchResults.dataTable.waitTillContentLoaded(); await searchFilters.checkSizeSliderFilterIsDisplayed(); await searchFilters.clickSizeSliderFilterHeader(); diff --git a/e2e/search/components/search-sorting-picker.e2e.ts b/e2e/search/components/search-sorting-picker.e2e.ts index ae140a2f58..ae0c798df6 100644 --- a/e2e/search/components/search-sorting-picker.e2e.ts +++ b/e2e/search/components/search-sorting-picker.e2e.ts @@ -85,6 +85,7 @@ describe('Search Sorting Picker', () => { beforeEach(async () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(search); + await searchResults.dataTable.waitTillContentLoaded(); }); afterEach(async () => { @@ -114,6 +115,7 @@ describe('Search Sorting Picker', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(search); + await searchResults.dataTable.waitTillContentLoaded(); await searchSortingPicker.checkSortingDropdownIsDisplayed(); await searchSortingPicker.clickSortingDropdown(); @@ -130,6 +132,7 @@ describe('Search Sorting Picker', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(search); + await searchResults.dataTable.waitTillContentLoaded(); await searchSortingPicker.checkSortingDropdownIsDisplayed(); await searchSortingPicker.clickSortingDropdown(); @@ -155,6 +158,7 @@ describe('Search Sorting Picker', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(search); + await searchResults.dataTable.waitTillContentLoaded(); await searchSortingPicker.checkSortingDropdownIsDisplayed(); await searchSortingPicker.clickSortingDropdown(); @@ -206,6 +210,7 @@ describe('Search Sorting Picker', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(search); + await searchResults.dataTable.waitTillContentLoaded(); await searchSortingPicker.checkSortingDropdownIsDisplayed(); await searchSortingPicker.sortBy('ASC', 'Modified Date'); diff --git a/e2e/search/components/search-text.e2e.ts b/e2e/search/components/search-text.e2e.ts index 6a83639648..08461724a6 100644 --- a/e2e/search/components/search-text.e2e.ts +++ b/e2e/search/components/search-text.e2e.ts @@ -65,7 +65,7 @@ describe('Search component - Text widget', () => { } }, {}); - await browser.sleep(15000); + await browser.sleep(browser.params.testConfig.timeouts.index_search); await loginPage.login(acsUser.email, acsUser.password); }); @@ -91,6 +91,8 @@ describe('Search component - Text widget', () => { await searchFiltersPage.checkNameFilterIsDisplayed(); await searchFiltersPage.textFiltersPage().searchByName(newFolderModel.name); + await searchResultPage.dataTable.waitTillContentLoaded(); + await searchResultPage.checkContentIsDisplayed(newFolderModel.name); await searchFiltersPage.textFiltersPage().searchByName(newFolderModel.description); @@ -103,7 +105,7 @@ describe('Search component - Text widget', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter('*'); - await searchResultPage.tableIsLoaded(); + await searchResultPage.dataTable.waitTillContentLoaded(); await searchFiltersPage.checkCheckListFilterIsDisplayed(); await searchFiltersPage.clickCheckListFilter(); @@ -114,6 +116,8 @@ describe('Search component - Text widget', () => { await searchResultPage.checkContentIsNotDisplayed(newFolderModel.name); await searchFiltersPage.textFiltersPage().searchByName(newFolderModel.description); + await searchResultPage.dataTable.waitTillContentLoaded(); + await searchResultPage.checkContentIsDisplayed(newFolderModel.name); }); }); diff --git a/e2e/search/pages/search-bar.page.ts b/e2e/search/pages/search-bar.page.ts index a4590f27a3..52f1232874 100644 --- a/e2e/search/pages/search-bar.page.ts +++ b/e2e/search/pages/search-bar.page.ts @@ -30,7 +30,8 @@ export class SearchBarPage { searchBarPage = element(by.css(`mat-list[id='autocomplete-search-result-list']`)); async pressDownArrowAndEnter(): Promise { - await element(by.css(`adf-search-control div input`)).sendKeys(protractor.Key.ARROW_DOWN); + await BrowserVisibility.waitUntilElementIsVisible(this.searchBar); + await this.searchBar.sendKeys(protractor.Key.ARROW_DOWN); await browser.actions().sendKeys(protractor.Key.ENTER).perform(); } @@ -74,25 +75,25 @@ export class SearchBarPage { await BrowserVisibility.waitUntilElementIsVisible(this.getRowByRowName(name)); } - async clickOnSpecificRow(name: string): Promise { - await this.resultTableContainsRow(name); - await BrowserActions.click(this.getRowByRowName(name)); + async clickOnSpecificRow(fileName: string): Promise { + await this.resultTableContainsRow(fileName); + await BrowserActions.click(this.getRowByRowName(fileName)); } getRowByRowName(name: string): ElementFinder { return element(by.css(`mat-list-item[data-automation-id='autocomplete_for_${name}']`)); } - async getSpecificRowsHighlightName(name: string): Promise { - return BrowserActions.getText(this.getRowByRowName(name).element(this.highlightName)); + async getSpecificRowsHighlightName(fileName: string): Promise { + return BrowserActions.getText(this.getRowByRowName(fileName).element(this.highlightName)); } - async getSpecificRowsCompleteName(name: string): Promise { - return BrowserActions.getText(this.getRowByRowName(name).element(this.completeName)); + async getSpecificRowsCompleteName(fileName: string): Promise { + return BrowserActions.getText(this.getRowByRowName(fileName).element(this.completeName)); } - async getSpecificRowsAuthor(name: string): Promise { - return BrowserActions.getText(this.getRowByRowName(name).element(this.rowsAuthor)); + async getSpecificRowsAuthor(fileName: string): Promise { + return BrowserActions.getText(this.getRowByRowName(fileName).element(this.rowsAuthor)); } async clearText(): Promise { diff --git a/e2e/search/pages/search-results.page.ts b/e2e/search/pages/search-results.page.ts index d8e8220a09..cbecc3d7d2 100644 --- a/e2e/search/pages/search-results.page.ts +++ b/e2e/search/pages/search-results.page.ts @@ -55,7 +55,7 @@ export class SearchResultsPage { } async navigateToFolder(content: string): Promise { - await this.dataTable.doubleClickRow('Display name', content); + await this.contentServices.openFolder(content); } async deleteContent(content: string): Promise { @@ -64,18 +64,22 @@ export class SearchResultsPage { async sortByName(sortOrder: string): Promise { await this.searchSortingPicker.sortBy(sortOrder, 'Name'); + await this.dataTable.waitTillContentLoaded(); } async sortByAuthor(sortOrder: string): Promise { await this.searchSortingPicker.sortBy(sortOrder, 'Author'); + await this.dataTable.waitTillContentLoaded(); } async sortByCreated(sortOrder: string): Promise { await this.searchSortingPicker.sortBy(sortOrder, 'Created'); + await this.dataTable.waitTillContentLoaded(); } async sortBySize(sortOrder: string): Promise { await this.searchSortingPicker.sortBy(sortOrder, 'Size'); + await this.dataTable.waitTillContentLoaded(); } async checkListIsOrderedByNameAsc(): Promise { diff --git a/e2e/search/search-component.e2e.ts b/e2e/search/search-component.e2e.ts index 0a4905a748..25ff5efbfe 100644 --- a/e2e/search/search-component.e2e.ts +++ b/e2e/search/search-component.e2e.ts @@ -108,10 +108,10 @@ describe('Search component - Search Bar', () => { filesToDelete.push(await uploadActions.createFolder(secondFolder.name, '-my-')); filesToDelete.push(await uploadActions.createFolder(thirdFolder.name, '-my-')); - await browser.sleep(15000); // wait search index previous file/folder uploaded + await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded await loginPage.login(acsUser.email, acsUser.password); - }); + }); afterAll(async () => { for (const currentNode of filesToDelete) { @@ -123,7 +123,7 @@ describe('Search component - Search Bar', () => { afterEach(async () => { await BrowserActions.getUrl(browser.baseUrl); - }); + }); it('[C272798] Search bar should be visible', async () => { await searchBarPage.checkSearchBarIsNotVisible(); @@ -150,6 +150,8 @@ describe('Search component - Search Bar', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkNoResultMessageIsNotDisplayed(); await searchBarPage.enterText(search.inactive.name); + await searchResultPage.dataTable.waitTillContentLoaded(); + await searchBarPage.checkNoResultMessageIsDisplayed(); }); @@ -161,18 +163,18 @@ describe('Search component - Search Bar', () => { await searchBarPage.resultTableContainsRow(firstFolderModel.name); await expect(await searchBarPage.getSpecificRowsHighlightName(firstFolderModel.name)).toEqual(firstFolderModel.shortName); - await expect(await searchBarPage.getSpecificRowsAuthor(firstFolderModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName); + await expect(await searchBarPage.getSpecificRowsAuthor(firstFolderModel.name)).toContain(acsUser.firstName); + await expect(await searchBarPage.getSpecificRowsAuthor(firstFolderModel.name)).toContain(acsUser.lastName); await expect(await searchBarPage.getSpecificRowsCompleteName(firstFolderModel.name)).toEqual(firstFolderModel.name); await searchBarPage.clearText(); - await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterText(firstFileModel.shortName); await searchBarPage.resultTableContainsRow(firstFileModel.name); await expect(await searchBarPage.getSpecificRowsHighlightName(firstFileModel.name)).toEqual(firstFileModel.shortName); - await expect(await searchBarPage.getSpecificRowsAuthor(firstFileModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName); - + await expect(await searchBarPage.getSpecificRowsAuthor(firstFileModel.name)).toContain(acsUser.firstName); + await expect(await searchBarPage.getSpecificRowsAuthor(firstFileModel.name)).toContain(acsUser.lastName); await expect(await searchBarPage.getSpecificRowsCompleteName(firstFileModel.name)).toEqual(firstFileModel.name); }); @@ -184,7 +186,8 @@ describe('Search component - Search Bar', () => { await searchBarPage.resultTableContainsRow(firstFolderModel.name); await expect(await searchBarPage.getSpecificRowsHighlightName(firstFolderModel.name)).toEqual(firstFolderModel.name); - await expect(await searchBarPage.getSpecificRowsAuthor(firstFolderModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName); + await expect(await searchBarPage.getSpecificRowsAuthor(firstFolderModel.name)).toContain(acsUser.firstName); + await expect(await searchBarPage.getSpecificRowsAuthor(firstFolderModel.name)).toContain(acsUser.lastName); await expect(await searchBarPage.getSpecificRowsCompleteName(firstFolderModel.name)).toEqual(firstFolderModel.name); await searchBarPage.clearText(); @@ -194,7 +197,8 @@ describe('Search component - Search Bar', () => { await searchBarPage.resultTableContainsRow(firstFileModel.name); await expect(await searchBarPage.getSpecificRowsHighlightName(firstFileModel.name)).toEqual(firstFileModel.name); - await expect(await searchBarPage.getSpecificRowsAuthor(firstFileModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName); + await expect(await searchBarPage.getSpecificRowsAuthor(firstFileModel.name)).toContain(acsUser.firstName); + await expect(await searchBarPage.getSpecificRowsAuthor(firstFileModel.name)).toContain(acsUser.lastName); await expect(await searchBarPage.getSpecificRowsCompleteName(firstFileModel.name)).toEqual(firstFileModel.name); }); @@ -205,6 +209,7 @@ describe('Search component - Search Bar', () => { await searchBarPage.resultTableContainsRow(firstFolderModel.name); await searchBarPage.clickOnSpecificRow(firstFolderModel.name); + await searchResultPage.dataTable.waitTillContentLoaded(); await expect(await contentServicesPage.currentFolderName()).toEqual(firstFolderModel.name); @@ -215,6 +220,7 @@ describe('Search component - Search Bar', () => { await searchBarPage.resultTableContainsRow(firstFileModel.name); await searchBarPage.clickOnSpecificRow(firstFileModel.name); + await expect(await viewerPage.getDisplayedFileName()).toEqual(firstFileModel.name); await viewerPage.clickCloseButton(); @@ -225,6 +231,7 @@ describe('Search component - Search Bar', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(search.inactive.name); + await searchResultPage.dataTable.waitTillContentLoaded(); await searchResultPage.checkNoResultMessageIsDisplayed(); }); @@ -234,6 +241,7 @@ describe('Search component - Search Bar', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(firstFolderModel.name); + await searchResultPage.dataTable.waitTillContentLoaded(); await searchResultPage.checkContentIsDisplayed(firstFolderModel.name); }); @@ -243,6 +251,7 @@ describe('Search component - Search Bar', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(firstFileModel.name); + await searchResultPage.dataTable.waitTillContentLoaded(); await searchResultPage.checkContentIsDisplayed(firstFileModel.name); }); @@ -253,6 +262,7 @@ describe('Search component - Search Bar', () => { await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterText(secondFolder.shortName); await searchBarPage.pressDownArrowAndEnter(); + await searchResultPage.dataTable.waitTillContentLoaded(); await expect(await contentServicesPage.currentFolderName()).toEqual(secondFolder.name); }); @@ -260,7 +270,7 @@ describe('Search component - Search Bar', () => { it('[C290137] Should be able to search by \'%\'', async () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter('%'); - await searchResultPage.tableIsLoaded(); + await searchResultPage.dataTable.waitTillContentLoaded(); }); describe('Highlight', () => { @@ -275,6 +285,8 @@ describe('Search component - Search Bar', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.checkSearchBarIsVisible(); await searchBarPage.enterTextAndPressEnter(term); + await searchResultPage.dataTable.waitTillContentLoaded(); + }); it('[C299212] Should be able to configure the highlight option for search results', async () => { diff --git a/e2e/search/search-filters.e2e.ts b/e2e/search/search-filters.e2e.ts index 3b5fde1bf0..cda30fba4d 100644 --- a/e2e/search/search-filters.e2e.ts +++ b/e2e/search/search-filters.e2e.ts @@ -102,7 +102,7 @@ describe('Search Filters', () => { await loginPage.login(acsUser.email, acsUser.password); - await browser.sleep(15000); // wait search index previous file/folder uploaded + await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded jsonFile = SearchConfiguration.getConfiguration(); }); @@ -123,6 +123,7 @@ describe('Search Filters', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(fileUploaded.entry.name); + await searchResults.dataTable.waitTillContentLoaded(); await searchFiltersPage.checkSearchFiltersIsDisplayed(); @@ -175,51 +176,21 @@ describe('Search Filters', () => { }); }); - it('[C291802] Should be able to filter facet fields with "Contains"', async () => { - await navigationBarPage.clickContentServicesButton(); - - jsonFile['filterWithContains'] = true; - await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - - await searchBarPage.clickOnSearchIcon(); - await searchBarPage.enterTextAndPressEnter('*'); - - await searchResults.tableIsLoaded(); - - await searchFiltersPage.creatorCheckListFiltersPage().searchInFilter('dminis'); - await searchFiltersPage.creatorCheckListFiltersPage().checkCheckListOptionIsDisplayed('Administrator'); - }); - it('[C291980] Should group search facets under specified labels', async () => { - await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter('*'); + await searchResults.dataTable.waitTillContentLoaded(); await searchFiltersPage.checkDefaultFacetQueryGroupIsDisplayed(); await searchFiltersPage.checkTypeFacetQueryGroupIsDisplayed(); + await searchFiltersPage.checkSizeFacetQueryGroupIsDisplayed(); }); - it('[C291981] Should group search facets under the default label, by default', async () => { - await navigationBarPage.clickContentServicesButton(); - - await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - - await searchBarPage.clickOnSearchIcon(); - await searchBarPage.enterTextAndPressEnter('*'); - - await searchResults.tableIsLoaded(); - - await searchFiltersPage.checkDefaultFacetQueryGroupIsDisplayed(); - await expect(await searchFiltersPage.isTypeFacetQueryGroupPresent()).toBe(false); - await expect(await searchFiltersPage.isSizeFacetQueryGroupPresent()).toBe(false); - }); - it('[C297509] Should display search intervals under specified labels from config', async () => { - await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter('*'); + await searchResults.dataTable.waitTillContentLoaded(); await searchFiltersPage.checkFacetIntervalsByCreatedIsDisplayed(); await searchFiltersPage.checkFacetIntervalsByCreatedIsExpanded(); @@ -240,9 +211,9 @@ describe('Search Filters', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(fileTypeTxt1.entry.name); + await searchResults.dataTable.waitTillContentLoaded(); await searchFiltersPage.checkSearchFiltersIsDisplayed(); - await searchResults.tableIsLoaded(); await searchResults.checkContentIsDisplayed(fileTypeTxt1.entry.name); await searchFiltersPage.checkFileTypeFacetLabelIsDisplayed('Plain Text (1)'); await searchFiltersPage.checkFileTypeFacetLabelIsNotDisplayed('JPEG Image'); @@ -251,27 +222,59 @@ describe('Search Filters', () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(fileNamePrefix); + await searchResults.dataTable.waitTillContentLoaded(); + await searchFiltersPage.checkSearchFiltersIsDisplayed(); - await searchResults.tableIsLoaded(); await searchResults.checkContentIsDisplayed(fileTypeTxt1.entry.name); await searchResults.checkContentIsDisplayed(fileTypeTxt2.entry.name); await searchResults.checkContentIsDisplayed(fileTypeJpg.entry.name); await searchFiltersPage.checkFileTypeFacetLabelIsDisplayed('Plain Text (2)'); await searchFiltersPage.checkFileTypeFacetLabelIsDisplayed('JPEG Image (1)'); - }); + }); - it('[C299124] Should be able to parse escaped empty spaced labels inside facetFields', async () => { - await navigationBarPage.clickContentServicesButton(); + describe('Change config', () => { - jsonFile.facetFields.fields[0].label = 'My File Types'; - jsonFile.facetFields.fields[1].label = 'My File Sizes'; - await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); + it('[C291802] Should be able to filter facet fields with "Contains"', async () => { + await navigationBarPage.clickContentServicesButton(); - await searchBarPage.clickOnSearchIcon(); - await searchBarPage.enterTextAndPressEnter('*'); + jsonFile['filterWithContains'] = true; + await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchResults.tableIsLoaded(); - await searchFiltersPage.checkCustomFacetFieldLabelIsDisplayed('My File Types'); - await searchFiltersPage.checkCustomFacetFieldLabelIsDisplayed('My File Sizes'); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); + await searchResults.dataTable.waitTillContentLoaded(); + + await searchFiltersPage.creatorCheckListFiltersPage().searchInFilter('dminis'); + await searchFiltersPage.creatorCheckListFiltersPage().checkCheckListOptionIsDisplayed('Administrator'); + }); + + it('[C291981] Should group search facets under the default label, by default', async () => { + await navigationBarPage.clickContentServicesButton(); + + await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); + + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); + await searchResults.dataTable.waitTillContentLoaded(); + + await searchFiltersPage.checkDefaultFacetQueryGroupIsDisplayed(); + await expect(await searchFiltersPage.isTypeFacetQueryGroupPresent()).toBe(false); + await expect(await searchFiltersPage.isSizeFacetQueryGroupPresent()).toBe(false); + }); + + it('[C299124] Should be able to parse escaped empty spaced labels inside facetFields', async () => { + await navigationBarPage.clickContentServicesButton(); + + jsonFile.facetFields.fields[0].label = 'My File Types'; + jsonFile.facetFields.fields[1].label = 'My File Sizes'; + await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); + + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); + await searchResults.dataTable.waitTillContentLoaded(); + + await searchFiltersPage.checkCustomFacetFieldLabelIsDisplayed('My File Types'); + await searchFiltersPage.checkCustomFacetFieldLabelIsDisplayed('My File Sizes'); + }); }); }); diff --git a/e2e/search/search-multiselect.e2e.ts b/e2e/search/search-multiselect.e2e.ts index b8dde80762..111dc3b41b 100644 --- a/e2e/search/search-multiselect.e2e.ts +++ b/e2e/search/search-multiselect.e2e.ts @@ -71,13 +71,14 @@ describe('Search Component - Multi-Select Facet', () => { txtFileSite = await uploadActions.uploadFile(txtFileInfo.location, txtFileInfo.name, site.entry.guid); - await browser.sleep(15000); + await browser.sleep(browser.params.testConfig.timeouts.index_search); await loginPage.login(acsUser.email, acsUser.password); await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(`${randomName}`); + await searchResultsPage.dataTable.waitTillContentLoaded(); userOption = `${acsUser.firstName} ${acsUser.lastName}`; @@ -103,18 +104,21 @@ describe('Search Component - Multi-Select Facet', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(`${randomName}`); + await searchResultsPage.dataTable.waitTillContentLoaded(); userOption = `${acsUser.firstName} ${acsUser.lastName}`; await searchFiltersPage.checkSearchFiltersIsDisplayed(); await searchFiltersPage.creatorCheckListFiltersPage().filterBy(userOption); await searchFiltersPage.fileTypeCheckListFiltersPage().filterBy('Plain Text'); + await searchResultsPage.dataTable.waitTillContentLoaded(); await expect(searchResultsPage.numberOfResultsDisplayed()).toBe(2); await searchResultsPage.checkContentIsDisplayed(txtFile.entry.name); await searchResultsPage.checkContentIsDisplayed(txtFileSite.entry.name); await searchFiltersPage.fileTypeCheckListFiltersPage().filterBy('JPEG Image'); + await searchResultsPage.dataTable.waitTillContentLoaded(); await expect(await searchResultsPage.numberOfResultsDisplayed()).toBe(4); await searchResultsPage.checkContentIsDisplayed(txtFile.entry.name); @@ -163,23 +167,26 @@ describe('Search Component - Multi-Select Facet', () => { jpgFile = await uploadActions.uploadFile(jpgFileInfo.location, jpgFileInfo.name, site.entry.guid); - await browser.sleep(15000); + await browser.sleep(browser.params.testConfig.timeouts.index_search); await loginPage.login(userUploadingImg.email, userUploadingImg.password); await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(`*${randomName}*`); + await searchResultsPage.dataTable.waitTillContentLoaded(); await searchFiltersPage.checkSearchFiltersIsDisplayed(); await searchFiltersPage.creatorCheckListFiltersPage().filterBy(`${userUploadingTxt.firstName} ${userUploadingTxt.lastName}`); await searchFiltersPage.creatorCheckListFiltersPage().filterBy(`${userUploadingImg.firstName} ${userUploadingImg.lastName}`); + await searchResultsPage.dataTable.waitTillContentLoaded(); await searchResultsPage.checkContentIsDisplayed(txtFile.entry.name); await searchResultsPage.checkContentIsDisplayed(jpgFile.entry.name); await searchFiltersPage.fileTypeCheckListFiltersPage().filterBy('Plain Text'); await searchFiltersPage.fileTypeCheckListFiltersPage().filterBy('JPEG Image'); + await searchResultsPage.dataTable.waitTillContentLoaded(); await expect(await searchResultsPage.numberOfResultsDisplayed()).toBe(2); await searchResultsPage.checkContentIsDisplayed(txtFile.entry.name); @@ -210,13 +217,14 @@ describe('Search Component - Multi-Select Facet', () => { }); txtFile = await uploadActions.uploadFile(txtFileInfo.location, txtFileInfo.name, '-my-'); - await browser.sleep(15000); + await browser.sleep(browser.params.testConfig.timeouts.index_search); await loginPage.login(acsUser.email, acsUser.password); await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(`*${randomName}*`); + await searchResultsPage.dataTable.waitTillContentLoaded(); await searchFiltersPage.checkSearchFiltersIsDisplayed(); }); @@ -232,10 +240,12 @@ describe('Search Component - Multi-Select Facet', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(`*${randomName}*`); + await searchResultsPage.dataTable.waitTillContentLoaded(); await searchFiltersPage.checkSearchFiltersIsDisplayed(); await searchFiltersPage.fileTypeCheckListFiltersPage().filterBy('Plain Text'); await searchFiltersPage.creatorCheckListFiltersPage().filterBy(`${acsUser.firstName} ${acsUser.lastName}`); + await searchResultsPage.dataTable.waitTillContentLoaded(); await expect(await searchResultsPage.numberOfResultsDisplayed()).toBe(1); await searchResultsPage.checkContentIsDisplayed(txtFile.entry.name); diff --git a/e2e/search/search-page.e2e.ts b/e2e/search/search-page.e2e.ts index a019ee558a..693f9a2bdd 100644 --- a/e2e/search/search-page.e2e.ts +++ b/e2e/search/search-page.e2e.ts @@ -86,7 +86,7 @@ describe('Search component - Search Page', () => { await uploadActions.createEmptyFiles(adminFileNames, newFolderModelUploaded.entry.id); - await browser.sleep(15000); + await browser.sleep(browser.params.testConfig.timeouts.index_search); await loginPage.login(acsUser.email, acsUser.password); }); @@ -101,12 +101,15 @@ describe('Search component - Search Page', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(notExistentFileName); + await searchResultPage.dataTable.waitTillContentLoaded(); + await searchResultPage.checkNoResultMessageIsDisplayed(); }); it('[C272810] Should display only files corresponding to search', async () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(search.active.firstFile); + await searchResultPage.dataTable.waitTillContentLoaded(); await searchResultPage.checkContentIsDisplayed(search.active.firstFile); await expect(await searchResultPage.numberOfResultsDisplayed()).toBe(1); @@ -115,8 +118,11 @@ describe('Search component - Search Page', () => { it('[C260267] Should display content when opening a folder from search results', async () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(emptyFolderModel.name); + await searchResultPage.dataTable.waitTillContentLoaded(); await searchResultPage.checkNoResultMessageIsNotDisplayed(); + await searchResultPage.dataTable.waitTillContentLoaded(); + await searchResultPage.checkContentIsDisplayed(emptyFolderModel.name); await searchResultPage.navigateToFolder(emptyFolderModel.name); const result = await contentServicesPage.currentFolderName(); @@ -126,6 +132,7 @@ describe('Search component - Search Page', () => { it('[C260261] Should be able to delete a file from search results', async () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(search.active.firstFile); + await searchResultPage.dataTable.waitTillContentLoaded(); await searchResultPage.checkContentIsDisplayed(search.active.firstFile); @@ -138,15 +145,20 @@ describe('Search component - Search Page', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(search.active.firstFile); + await searchResultPage.dataTable.waitTillContentLoaded(); + await searchResultPage.checkNoResultMessageIsDisplayed(); }); it('[C272809] Should be able to delete a folder from search results', async () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(emptyFolderModel.name); + await searchResultPage.dataTable.waitTillContentLoaded(); await searchResultPage.checkContentIsDisplayed(emptyFolderModel.name); await searchResultPage.checkNoResultMessageIsNotDisplayed(); + await searchResultPage.dataTable.waitTillContentLoaded(); + await searchResultPage.checkContentIsDisplayed(emptyFolderModel.name); await searchResultPage.deleteContent(emptyFolderModel.name); await searchResultPage.checkNoResultMessageIsDisplayed(); @@ -155,12 +167,15 @@ describe('Search component - Search Page', () => { await searchBarPage.checkSearchIconIsVisible(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(emptyFolderModel.name); + await searchResultPage.dataTable.waitTillContentLoaded(); + await searchResultPage.checkNoResultMessageIsDisplayed(); }); it('[C286675] Should display results when searching for all elements', async () => { await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter('*'); + await searchResultPage.dataTable.waitTillContentLoaded(); await searchResultPage.checkNoResultMessageIsNotDisplayed(); }); diff --git a/e2e/test.config.js b/e2e/test.config.js index a8f4ed2a24..eead1a7822 100644 --- a/e2e/test.config.js +++ b/e2e/test.config.js @@ -51,6 +51,7 @@ const appConfig = { "redirectUriLogout": REDIRECT_URI_LOGOUT, "redirectSilentIframeUri": `${HOST}/assets/silent-refresh.html`, "publicUrls": [ + "**/logout", "**/preview/s/*", "**/settings" ] @@ -108,7 +109,8 @@ module.exports = { timeouts: { visible_timeout: 20000, - no_visible_timeout: 20000 + no_visible_timeout: 20000, + index_search: 25000 } }; diff --git a/lib/content-services/src/lib/mock/inherited-permission.component.mock.ts b/lib/content-services/src/lib/mock/inherited-permission.component.mock.ts index 14e42755e1..3f8ac7e5bb 100644 --- a/lib/content-services/src/lib/mock/inherited-permission.component.mock.ts +++ b/lib/content-services/src/lib/mock/inherited-permission.component.mock.ts @@ -35,7 +35,6 @@ export class SimpleInheritedPermissionTestComponent { } onUpdate(node: any) { - this.updatedNode = node.permissions.isInheritanceEnabled; + this.updatedNode = node.permissions?.isInheritanceEnabled ?? false; } - } diff --git a/lib/content-services/src/lib/permission-manager/components/inherited-button.directive.spec.ts b/lib/content-services/src/lib/permission-manager/components/inherited-button.directive.spec.ts index 6618004f4a..37ab567826 100644 --- a/lib/content-services/src/lib/permission-manager/components/inherited-button.directive.spec.ts +++ b/lib/content-services/src/lib/permission-manager/components/inherited-button.directive.spec.ts @@ -59,7 +59,7 @@ describe('InheritPermissionDirective', () => { it('should be able to add inherited permission', async(() => { spyOn(nodeService, 'getNode').and.returnValue(of(fakeNodeNoInherit)); spyOn(nodeService, 'updateNode').and.callFake((_, nodeBody) => { - if (nodeBody.permissions.isInheritanceEnabled) { + if (nodeBody.permissions?.isInheritanceEnabled) { return of(fakeNodeWithInherit); } else { return of(fakeNodeNoInherit); @@ -79,7 +79,7 @@ describe('InheritPermissionDirective', () => { it('should be able to remove inherited permission', async(() => { spyOn(nodeService, 'getNode').and.returnValue(of(fakeNodeWithInherit)); spyOn(nodeService, 'updateNode').and.callFake((_, nodeBody) => { - if (nodeBody.permissions.isInheritanceEnabled) { + if (nodeBody.permissions?.isInheritanceEnabled) { return of(fakeNodeWithInherit); } else { return of(fakeNodeNoInherit); diff --git a/lib/content-services/src/lib/permission-manager/components/inherited-button.directive.ts b/lib/content-services/src/lib/permission-manager/components/inherited-button.directive.ts index f05f407ae2..14dcaed5ea 100644 --- a/lib/content-services/src/lib/permission-manager/components/inherited-button.directive.ts +++ b/lib/content-services/src/lib/permission-manager/components/inherited-button.directive.ts @@ -48,7 +48,7 @@ export class InheritPermissionDirective { onInheritPermissionClicked() { this.nodeService.getNode(this.nodeId).subscribe((node: Node) => { if (this.contentService.hasAllowableOperations(node, AllowableOperationsEnum.UPDATEPERMISSIONS)) { - const nodeBody = { permissions: { isInheritanceEnabled: !node.permissions.isInheritanceEnabled } }; + const nodeBody = { permissions: { isInheritanceEnabled: !node?.permissions?.isInheritanceEnabled ?? false} }; this.nodeService.updateNode(this.nodeId, nodeBody, { include: ['permissions'] }).subscribe((nodeUpdated: Node) => { this.updated.emit(nodeUpdated); }, (error) => this.error.emit(error)); diff --git a/lib/content-services/src/lib/permission-manager/components/permission-list/permission-list.component.ts b/lib/content-services/src/lib/permission-manager/components/permission-list/permission-list.component.ts index 77490eb169..bfe05aafa0 100644 --- a/lib/content-services/src/lib/permission-manager/components/permission-list/permission-list.component.ts +++ b/lib/content-services/src/lib/permission-manager/components/permission-list/permission-list.component.ts @@ -71,13 +71,13 @@ export class PermissionListComponent implements OnInit { private getPermissionList(node: Node): PermissionDisplayModel[] { const allPermissions: PermissionDisplayModel[] = []; - if (node.permissions.locallySet) { + if (node?.permissions?.locallySet) { node.permissions.locallySet.map((permissionElement: PermissionElement) => { const permission = new PermissionDisplayModel(permissionElement); allPermissions.push(permission); }); } - if (node.permissions.inherited) { + if (node?.permissions?.inherited) { node.permissions.inherited.map((permissionElement: PermissionElement) => { const permissionInherited = new PermissionDisplayModel(permissionElement); permissionInherited.isInherited = true; diff --git a/lib/content-services/src/lib/search/components/search-filter/search-filter.component.ts b/lib/content-services/src/lib/search/components/search-filter/search-filter.component.ts index f62665e662..f39a4a649b 100644 --- a/lib/content-services/src/lib/search/components/search-filter/search-filter.component.ts +++ b/lib/content-services/src/lib/search/components/search-filter/search-filter.component.ts @@ -303,7 +303,7 @@ export class SearchFilterComponent implements OnInit, OnDestroy { private getResponseQueryBuckets(responseField: GenericFacetResponse, configGroup: any): FacetFieldBucket[] { return (configGroup || []).map((query) => { const respBucket = ((responseField && responseField.buckets) || []) - .find((bucket) => bucket.label === query.label); + .find((bucket) => bucket.label === query.label) || {}; respBucket['count'] = this.getCountValue(respBucket); return { @@ -316,8 +316,7 @@ export class SearchFilterComponent implements OnInit, OnDestroy { } private getCountValue(bucket: GenericBucket): number { - return (!!bucket && !!bucket.metrics && bucket.metrics[0] && bucket.metrics[0].value && bucket.metrics[0].value.count) - || 0; + return (!!bucket && !!bucket.metrics && bucket.metrics[0]?.value?.count) || 0; } getBucketCountDisplay(bucket: FacetFieldBucket): string { diff --git a/lib/testing/src/lib/content-services/dialog/add-permissions-dialog.page.ts b/lib/testing/src/lib/content-services/dialog/add-permissions-dialog.page.ts index abc0054db6..fa991fc387 100644 --- a/lib/testing/src/lib/content-services/dialog/add-permissions-dialog.page.ts +++ b/lib/testing/src/lib/content-services/dialog/add-permissions-dialog.page.ts @@ -57,6 +57,7 @@ export class AddPermissionsDialogPage { async searchUserOrGroup(name: string): Promise { await BrowserActions.clearSendKeys(this.searchUserInput, name); + await this.dataTableComponentPage.waitTillContentLoaded(); } async checkResultListIsDisplayed(): Promise { @@ -65,7 +66,7 @@ export class AddPermissionsDialogPage { async clickUserOrGroup(name: string): Promise { const userOrGroupName = element(by.cssContainingText('mat-list-option .mat-list-text', name)); - await BrowserActions.clickScript(userOrGroupName); + await BrowserActions.click(userOrGroupName); await BrowserActions.click(this.addButton); } @@ -95,8 +96,8 @@ export class AddPermissionsDialogPage { await BrowserVisibility.waitUntilElementIsVisible(this.noPermissions); } - async getPermissionInheritedButtonText(): Promise { - return BrowserActions.getText(this.permissionInheritedButton); + async getPermissionInheritedButtonText(text: string): Promise { + await BrowserVisibility.waitUntilElementHasText(this.permissionInheritedButton, text); } async checkPermissionsDatatableIsDisplayed(): Promise { diff --git a/lib/testing/src/lib/content-services/dialog/content-node-selector-dialog.page.ts b/lib/testing/src/lib/content-services/dialog/content-node-selector-dialog.page.ts index 0e386bf9c0..fac8e8966b 100644 --- a/lib/testing/src/lib/content-services/dialog/content-node-selector-dialog.page.ts +++ b/lib/testing/src/lib/content-services/dialog/content-node-selector-dialog.page.ts @@ -21,6 +21,7 @@ import { BrowserVisibility } from '../../core/utils/browser-visibility'; import { BrowserActions } from '../../core/utils/browser-actions'; import { DropdownPage } from '../../core/pages/material/dropdown.page'; import { BreadcrumbDropdownPage } from '../pages/breadcrumb/breadcrumb-dropdown.page'; +import { Logger } from '../../core/utils/logger'; export class ContentNodeSelectorDialogPage { dialog = element(by.css(`adf-content-node-selector`)); @@ -96,9 +97,12 @@ export class ContentNodeSelectorDialogPage { return this.dataTable.numberOfRows(); } - async typeIntoNodeSelectorSearchField(text): Promise { + async typeIntoNodeSelectorSearchField(text: string): Promise { + Logger.log(`Search Node content node selector ${text}`); + await BrowserVisibility.waitUntilElementIsVisible(this.searchInputElement); - await BrowserActions.clearSendKeys(this.searchInputElement, text); + await BrowserActions.clearSendKeys(this.searchInputElement, text, 100); + await this.dataTable.waitTillContentLoaded(); } async clickContentNodeSelectorResult(name: string): Promise { diff --git a/lib/testing/src/lib/content-services/pages/search/search-check-list.page.ts b/lib/testing/src/lib/content-services/pages/search/search-check-list.page.ts index 1430966b89..97b92cfaca 100644 --- a/lib/testing/src/lib/content-services/pages/search/search-check-list.page.ts +++ b/lib/testing/src/lib/content-services/pages/search/search-check-list.page.ts @@ -54,6 +54,7 @@ export class SearchCheckListPage { await this.checkSearchFilterInputIsDisplayed(); await this.searchInFilter(option); await this.clickCheckListOption(option); + return this; } diff --git a/lib/testing/src/lib/core/actions/identity/group-identity.service.ts b/lib/testing/src/lib/core/actions/identity/group-identity.service.ts index 992c028efb..edb9b08a1c 100644 --- a/lib/testing/src/lib/core/actions/identity/group-identity.service.ts +++ b/lib/testing/src/lib/core/actions/identity/group-identity.service.ts @@ -60,6 +60,8 @@ export class GroupIdentityService { } async getGroupInfoByGroupName(groupName: string): Promise { + Logger.log(`Get GroupInfoByGroupName ${groupName}`); + const predicate = (result: any) => { return !!result; }; @@ -71,6 +73,9 @@ export class GroupIdentityService { const queryParams = { search: groupName }, postBody = {}; const data = await this.api.performIdentityOperation(path, method, queryParams, postBody); + + Logger.log(`Data ${JSON.stringify(data)}`); + return data[0]; } catch (error) { Logger.error('Group not found'); @@ -81,6 +86,8 @@ export class GroupIdentityService { } async assignRole(groupId: string, roleId: string, roleName: string): Promise { + Logger.log(`Assign to group ${groupId} Role ${roleName}`); + const path = `/groups/${groupId}/role-mappings/realm`; const method = 'POST'; const queryParams = {}; diff --git a/lib/testing/src/lib/core/actions/identity/identity.service.ts b/lib/testing/src/lib/core/actions/identity/identity.service.ts index d742fa4bf0..1702d3b1ff 100644 --- a/lib/testing/src/lib/core/actions/identity/identity.service.ts +++ b/lib/testing/src/lib/core/actions/identity/identity.service.ts @@ -41,6 +41,7 @@ export class IdentityService { } async createIdentityUser(user: UserModel = new UserModel()): Promise { + Logger.log(`Create Identity User ${user.email}`); await this.createUser(user); const userIdentity = await this.getUserInfoByUsername(user.username); @@ -99,6 +100,8 @@ export class IdentityService { } async addUserToGroup(userId: string, groupId: string): Promise { + Logger.log(`Add user to group userId ${userId} ${groupId}`); + try { const path = `/users/${userId}/groups/${groupId}`; const method = 'PUT'; diff --git a/lib/testing/src/lib/core/pages/data-table-component.page.ts b/lib/testing/src/lib/core/pages/data-table-component.page.ts index 236c0a2d1e..aac5c65515 100644 --- a/lib/testing/src/lib/core/pages/data-table-component.page.ts +++ b/lib/testing/src/lib/core/pages/data-table-component.page.ts @@ -157,6 +157,8 @@ export class DataTableComponentPage { } async rightClickOnRow(columnName: string, columnValue: string): Promise { + Logger.log(`Right Click On Row ${columnName} ${columnValue}`); + const row = this.getRow(columnName, columnValue); await BrowserActions.rightClick(row); @@ -256,6 +258,7 @@ export class DataTableComponentPage { } async checkContentIsDisplayed(columnName: string, columnValue: string): Promise { + Logger.log(`Wait content is displayed ${columnName} ${columnValue}`); const row = this.getCellElementByValue(columnName, columnValue); await BrowserVisibility.waitUntilElementIsVisible(row); } @@ -289,48 +292,74 @@ export class DataTableComponentPage { async waitTillContentLoaded(): Promise { await browser.sleep(500); - if (element(by.tagName('mat-spinner')).isPresent()) { + if (this.isSpinnerPresent()) { Logger.log('wait datatable loading spinner disappear'); - await BrowserVisibility.waitUntilElementIsNotPresent(element(by.tagName('mat-spinner'))); + await BrowserVisibility.waitUntilElementIsNotVisible(element(by.tagName('mat-spinner'))); + + if (this.isEmpty()) { + Logger.log('empty page'); + } else { + await this.waitFirstElementPresent(); + } } else { try { Logger.log('wait datatable loading spinner is present'); - await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-spinner'))); + await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName('mat-spinner'))); } catch (error) { } + if (this.isEmpty()) { + Logger.log('empty page'); + } else { + await this.waitFirstElementPresent(); + } + } + } + + private async isSpinnerPresent(): Promise { + let isSpinnerPresent; + + try { + isSpinnerPresent = await element(by.tagName('mat-spinner')).isDisplayed(); + } catch (error) { + isSpinnerPresent = false; } + return isSpinnerPresent; + } + + private async waitFirstElementPresent(): Promise { try { Logger.log('wait first element is present'); await BrowserVisibility.waitUntilElementIsVisible(this.contents.first()); } catch (error) { Logger.log('Possible empty page'); } - } async waitTillContentLoadedInfinitePagination(): Promise { await browser.sleep(500); - if (element(by.tagName('mat-progress-bar')).isPresent()) { + if (this.isSpinnerPresent()) { Logger.log('wait datatable loading spinner disappear'); - await BrowserVisibility.waitUntilElementIsNotPresent(element(by.tagName('mat-progress-bar'))); + await BrowserVisibility.waitUntilElementIsNotVisible(element(by.tagName('mat-progress-bar'))); + + if (this.isEmpty()) { + Logger.log('empty page'); + } else { + await this.waitFirstElementPresent(); + } } else { try { Logger.log('wait datatable loading spinner is present'); - await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-progress-bar'))); + await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName('mat-progress-bar'))); } catch (error) { } - } - - try { - Logger.log('wait first element is present'); - await BrowserVisibility.waitUntilElementIsVisible(this.contents.first(), 1000); - } catch (error) { - Logger.log('Possible empty page'); - } - - } + if (this.isEmpty()) { + Logger.log('empty page'); + } else { + await this.waitFirstElementPresent(); + } + } } async checkColumnIsDisplayed(column: string): Promise { await BrowserVisibility.waitUntilElementIsVisible(element(by.css(`div[data-automation-id="auto_id_entry.${column}"]`))); @@ -449,11 +478,18 @@ export class DataTableComponentPage { } async isEmpty(): Promise { - return this.emptyList.isPresent(); + let isDisplayed; + + try { + isDisplayed = await this.emptyList.isDisplayed(); + } catch (error) { + isDisplayed = false; + } + return isDisplayed; } async waitForEmptyState(): Promise { - await BrowserVisibility.waitUntilElementIsPresent(this.emptyList); + await BrowserVisibility.waitUntilElementIsVisible(this.emptyList); } async getEmptyStateTitle(): Promise { diff --git a/lib/testing/src/lib/core/pages/login.page.ts b/lib/testing/src/lib/core/pages/login.page.ts index 67eeace954..36a0ac9b6e 100644 --- a/lib/testing/src/lib/core/pages/login.page.ts +++ b/lib/testing/src/lib/core/pages/login.page.ts @@ -63,6 +63,8 @@ export class LoginPage { } else { await this.loginBasicAuth(username, password); } + + await browser.waitForAngular(); } async loginSSOIdentityService(username: string, password: string) { @@ -84,8 +86,6 @@ export class LoginPage { await this.clickLoginButton(); await browser.actions().sendKeys(protractor.Key.ENTER).perform(); await BrowserVisibility.waitUntilElementIsVisible(this.header); - - await browser.waitForAngular(); } async loginBasicAuth(username: string, password: string): Promise { diff --git a/lib/testing/src/lib/core/pages/material/tabs.page.ts b/lib/testing/src/lib/core/pages/material/tabs.page.ts index d3e8c75e5a..04df5e2898 100644 --- a/lib/testing/src/lib/core/pages/material/tabs.page.ts +++ b/lib/testing/src/lib/core/pages/material/tabs.page.ts @@ -35,12 +35,12 @@ export class TabsPage { } async getNoOfTabs(): Promise { - BrowserVisibility.waitUntilElementIsVisible(this.tabs.first()); + await BrowserVisibility.waitUntilElementIsVisible(this.tabs.first()); return this.tabs.count(); } async getTabsLabels(): Promise { - BrowserVisibility.waitUntilElementIsVisible(this.tabs.first()); + await BrowserVisibility.waitUntilElementIsVisible(this.tabs.first()); return this.tabs.getText(); } } diff --git a/lib/testing/src/lib/core/pages/viewer.page.ts b/lib/testing/src/lib/core/pages/viewer.page.ts index d20dcfdeb9..5b5c1a5557 100644 --- a/lib/testing/src/lib/core/pages/viewer.page.ts +++ b/lib/testing/src/lib/core/pages/viewer.page.ts @@ -20,6 +20,7 @@ import { TabsPage } from './material/tabs.page'; import { TogglePage } from './material/toggle.page'; import { BrowserVisibility } from '../utils/browser-visibility'; import { element, by, browser, protractor } from 'protractor'; +import { Logger } from '../utils/logger'; export class ViewerPage { @@ -110,6 +111,34 @@ export class ViewerPage { const fileView = element.all(by.css(`#document-list-container div[data-automation-id="${fileName}"]`)).first(); await BrowserActions.click(fileView); await browser.actions().sendKeys(protractor.Key.ENTER).perform(); + await this.waitTillContentLoaded(); + } + + async waitTillContentLoaded(): Promise { + await browser.sleep(500); + + if (this.isSpinnerPresent()) { + Logger.log('wait spinner disappear'); + await BrowserVisibility.waitUntilElementIsNotPresent(element(by.tagName('mat-spinner'))); + } else { + try { + Logger.log('wait spinner is present'); + await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-spinner'))); + } catch (error) { + } + } + } + + private async isSpinnerPresent(): Promise { + let isSpinnerPresent; + + try { + isSpinnerPresent = await element(by.tagName('mat-spinner')).isDisplayed(); + } catch (error) { + isSpinnerPresent = false; + } + + return isSpinnerPresent; } async clearPageNumber(): Promise { @@ -338,7 +367,7 @@ export class ViewerPage { } async clickInfoButton(): Promise { - await BrowserActions.clickExecuteScript('button[data-automation-id="adf-toolbar-sidebar"]'); + await BrowserActions.click(element(by.css('button[data-automation-id="adf-toolbar-sidebar"]'))); } async clickOnTab(tabName: string): Promise { diff --git a/lib/testing/src/lib/core/utils/browser-actions.ts b/lib/testing/src/lib/core/utils/browser-actions.ts index 68a48bf58d..94686f6c53 100644 --- a/lib/testing/src/lib/core/utils/browser-actions.ts +++ b/lib/testing/src/lib/core/utils/browser-actions.ts @@ -21,32 +21,54 @@ import { Logger } from './logger'; import * as path from 'path'; import * as fs from 'fs'; +import { ApiUtil } from '../actions/api.util'; export class BrowserActions { - static async click(elementFinder: ElementFinder): Promise { + static async clickUntilIsNotVisible(elementToClick: ElementFinder, elementToFind: ElementFinder): Promise { + Logger.info(`Click until element is not present: ${elementToClick.locator().toString()}`); + + const predicate = (isVisible: boolean) => { + return isVisible; + }; + + const apiCall = async () => { + await this.click(elementToClick); + + try { + return BrowserVisibility.waitUntilElementIsVisible(elementToFind); + return true; + } catch (error) { + return false; + } + }; + + return ApiUtil.waitForApi(apiCall, predicate, 5, 2000); + } + + static async click(elementToClick: ElementFinder): Promise { try { - Logger.info(`Click element: ${elementFinder.locator().toString()}`); - await BrowserVisibility.waitUntilElementIsPresent(elementFinder); - await BrowserVisibility.waitUntilElementIsClickable(elementFinder); - await elementFinder.click(); + Logger.info(`Click element: ${elementToClick.locator().toString()}`); + await BrowserVisibility.waitUntilElementIsVisible(elementToClick); + await BrowserVisibility.waitUntilElementIsClickable(elementToClick); + await elementToClick.click(); } catch (clickErr) { - Logger.warn(`click error element ${elementFinder.locator().toString()} consider to use directly clickScript`); - await this.clickScript(elementFinder); + Logger.warn(`click error element ${elementToClick.locator().toString()} consider to use directly clickScript`); + await this.clickScript(elementToClick); } } - static async clickScript(elementFinder: ElementFinder): Promise { - Logger.info(`Click script ${elementFinder.locator().toString()}`); + static async clickScript(elementToClick: ElementFinder): Promise { + Logger.info(`Click script ${elementToClick.locator().toString()}`); - await browser.executeScript(`arguments[0].scrollIntoView();`, elementFinder); - await browser.executeScript(`arguments[0].click();`, elementFinder); + await browser.executeScript(`arguments[0].scrollIntoView();`, elementToClick); + await browser.executeScript(`arguments[0].click();`, elementToClick); } static async clickExecuteScript(elementCssSelector: string): Promise { Logger.info(`Click execute script ${elementCssSelector}`); - await BrowserVisibility.waitUntilElementIsPresent(element(by.css(elementCssSelector))); + await BrowserVisibility.waitUntilElementIsVisible(element(by.css(elementCssSelector))); await browser.executeScript(`document.querySelector('${elementCssSelector}').click();`); } @@ -72,12 +94,14 @@ export class BrowserActions { static async getText(elementFinder: ElementFinder): Promise { Logger.info(`Get Text ${elementFinder.locator().toString()}`); - const present = await BrowserVisibility.waitUntilElementIsPresent(elementFinder); + const present = await BrowserVisibility.waitUntilElementIsVisible(elementFinder); if (present) { let text = await elementFinder.getText(); if (text === '') { // DO NOT REMOVE BUG sometime wrongly return empty text for cdk elements + Logger.info(`Use backup get text script`); + text = await this.getTextScript(elementFinder); return text?.trim(); } @@ -89,14 +113,15 @@ export class BrowserActions { } } - static async getTextScript(elementFinder: ElementFinder): Promise { + // Don't make it pub,ic use getText + private static async getTextScript(elementFinder: ElementFinder): Promise { return browser.executeScript(`return arguments[0].textContent`, elementFinder); } static async getInputValue(elementFinder: ElementFinder): Promise { Logger.info(`Get Input value ${elementFinder.locator().toString()}`); - const present = await BrowserVisibility.waitUntilElementIsPresent(elementFinder); + const present = await BrowserVisibility.waitUntilElementIsVisible(elementFinder); if (present) { return elementFinder.getAttribute('value'); } else { @@ -187,7 +212,7 @@ export class BrowserActions { const fileWithPath = path.join(screenshotFilePath, filenameWithExt); const stream = fs.createWriteStream(fileWithPath); - stream.write(new Buffer(pngData, 'base64')); + stream.write(Buffer.from(pngData, 'base64')); stream.end(); } diff --git a/lib/testing/src/lib/core/utils/browser-visibility.ts b/lib/testing/src/lib/core/utils/browser-visibility.ts index 6c3fd66437..6f2aff56d8 100644 --- a/lib/testing/src/lib/core/utils/browser-visibility.ts +++ b/lib/testing/src/lib/core/utils/browser-visibility.ts @@ -101,7 +101,9 @@ export class BrowserVisibility { return browser.wait(protractor.ExpectedConditions.stalenessOf(elementToCheck), waitTimeout, 'Element is present ' + elementToCheck.locator()); } - static async waitUntilDialogIsClose(): Promise { + static async waitUntilDialogIsClose(): Promise { + Logger.info(`Wait Until dialog close`); + const dialog = element(by.css('mat-dialog-container')); await this.waitUntilElementIsNotPresent(dialog); } diff --git a/lib/testing/src/lib/process-services-cloud/pages/edit-task-filter-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/edit-task-filter-cloud-component.page.ts index 6668fc957e..a567faa08f 100644 --- a/lib/testing/src/lib/process-services-cloud/pages/edit-task-filter-cloud-component.page.ts +++ b/lib/testing/src/lib/process-services-cloud/pages/edit-task-filter-cloud-component.page.ts @@ -20,6 +20,7 @@ import { EditTaskFilterDialogPage } from './dialog/edit-task-filter-dialog.page' import { BrowserVisibility } from '../../core/utils/browser-visibility'; import { BrowserActions } from '../../core/utils/browser-actions'; import { DropdownPage } from '../../core/pages/material/dropdown.page'; +import { DataTableComponentPage } from '../../core/pages/data-table-component.page'; export class EditTaskFilterCloudComponentPage { @@ -51,6 +52,8 @@ export class EditTaskFilterCloudComponentPage { editTaskFilterDialogPage = new EditTaskFilterDialogPage(); + dataTable = new DataTableComponentPage( element(by.css('adf-cloud-task-list'))); + editTaskFilterDialog(): EditTaskFilterDialogPage { return this.editTaskFilterDialogPage; } @@ -66,6 +69,7 @@ export class EditTaskFilterCloudComponentPage { async setStatusFilterDropDown(option: string): Promise { await this.statusDropdown.selectDropdownOption(option); + await this.dataTable.waitTillContentLoaded(); } async getStatusFilterDropDownValue(): Promise { @@ -74,6 +78,7 @@ export class EditTaskFilterCloudComponentPage { async setSortFilterDropDown(option: string): Promise { await this.sortDropdown.selectDropdownOption(option); + await this.dataTable.waitTillContentLoaded(); } async getSortFilterDropDownValue(): Promise { @@ -82,7 +87,7 @@ export class EditTaskFilterCloudComponentPage { async setOrderFilterDropDown(option: string): Promise { await this.orderDropdown.selectDropdownOption(option); - await browser.sleep(1500); + await this.dataTable.waitTillContentLoaded(); } async getOrderFilterDropDownValue(): Promise { @@ -124,6 +129,7 @@ export class EditTaskFilterCloudComponentPage { async setLastModifiedFrom(lastModifiedFromDate: string) { await this.clearField(this.lastModifiedFrom); await BrowserActions.clearSendKeys(this.lastModifiedFrom, lastModifiedFromDate); + await this.dataTable.waitTillContentLoaded(); } async getLastModifiedFrom(): Promise { @@ -133,6 +139,7 @@ export class EditTaskFilterCloudComponentPage { async setLastModifiedTo(lastModifiedToDate: string): Promise { await this.clearField(this.lastModifiedTo); await BrowserActions.clearSendKeys(this.lastModifiedTo, lastModifiedToDate); + await this.dataTable.waitTillContentLoaded(); } async getLastModifiedTo(): Promise { @@ -194,6 +201,7 @@ export class EditTaskFilterCloudComponentPage { async setAppNameDropDown(option: string): Promise { await this.appNameDropdown.selectDropdownOption(option); + await this.dataTable.waitTillContentLoaded(); } async getAppNameDropDownValue(): Promise { @@ -234,6 +242,7 @@ export class EditTaskFilterCloudComponentPage { await locator.clear(); await locator.sendKeys(option); await locator.sendKeys(protractor.Key.ENTER); + await this.dataTable.waitTillContentLoaded(); } async getProcessInstanceId(): Promise { diff --git a/lib/testing/src/lib/process-services-cloud/pages/task-filters-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/task-filters-cloud-component.page.ts index 8109e5c07d..b47baee85a 100644 --- a/lib/testing/src/lib/process-services-cloud/pages/task-filters-cloud-component.page.ts +++ b/lib/testing/src/lib/process-services-cloud/pages/task-filters-cloud-component.page.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { browser, by, element, ElementFinder } from 'protractor'; +import { by, element, ElementFinder } from 'protractor'; import { BrowserVisibility } from '../../core/utils/browser-visibility'; import { BrowserActions } from '../../core/utils/browser-actions'; @@ -34,7 +34,6 @@ export class TaskFiltersCloudComponentPage { this.filter = this.getTaskFilterLocatorByFilterName(filterName); await BrowserVisibility.waitUntilElementIsClickable(this.filter); await BrowserActions.click(this.filter); - await browser.sleep(1500); } async checkTaskFilterNotDisplayed(filterName: string): Promise { diff --git a/lib/testing/tslint.json b/lib/testing/tslint.json index 1d1214df70..efd3c2f25e 100644 --- a/lib/testing/tslint.json +++ b/lib/testing/tslint.json @@ -1,6 +1,7 @@ { "extends": "../tslint.json", "rules": { + "no-floating-promises": true, "directive-selector": [ true, "attribute", diff --git a/scripts/lint.sh b/scripts/lint.sh index a09dc3750e..4ad7ba12c5 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -1,12 +1,5 @@ #!/usr/bin/env bash - -show_help() { - echo "Usage: ./scripts/lint.sh -ban word_to_ban" - echo "" - echo "-ban (optional)" -} - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "$DIR/../" diff --git a/scripts/test-e2e-lib.sh b/scripts/test-e2e-lib.sh index 1544c12c74..ba5935bb18 100755 --- a/scripts/test-e2e-lib.sh +++ b/scripts/test-e2e-lib.sh @@ -167,7 +167,7 @@ while [[ $1 == -* ]]; do done rm -rf ./e2e/downloads/ -rm -rf ./e2e-output/screenshots/ +rm -rf ./e2e-output/ export TIMEOUT=$TIMEOUT diff --git a/scripts/travis/e2e/content-services-e2e.sh b/scripts/travis/e2e/content-services-e2e.sh index bddd9cfc7e..bddc129132 100755 --- a/scripts/travis/e2e/content-services-e2e.sh +++ b/scripts/travis/e2e/content-services-e2e.sh @@ -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 #-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 -b -m 4 || 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 echo "Run all e2e $CONTEXT_ENV" $RUN_CHECK diff --git a/scripts/travis/e2e/core-e2e.sh b/scripts/travis/e2e/core-e2e.sh index d4e339421e..361e684441 100755 --- a/scripts/travis/e2e/core-e2e.sh +++ b/scripts/travis/e2e/core-e2e.sh @@ -22,7 +22,7 @@ fi; #./node_modules/@alfresco/adf-cli/bin/adf-cli check-ps-env --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 TODO chanvge login check SSO ./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 -m 2 || 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 echo "Run all e2e $CONTEXT_ENV" diff --git a/scripts/travis/e2e/process-services-cloud-e2e.sh b/scripts/travis/e2e/process-services-cloud-e2e.sh index 8e33b2bdaa..f0e1354e25 100755 --- a/scripts/travis/e2e/process-services-cloud-e2e.sh +++ b/scripts/travis/e2e/process-services-cloud-e2e.sh @@ -19,7 +19,7 @@ if [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then echo "Affected e2e ${AFFECTED_E2E}" fi; -RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -host_sso "$HOST_SSO" -identity_admin_email "$E2E_ADMIN_EMAIL_IDENTITY" -identity_admin_password "$E2E_ADMIN_PASSWORD_IDENTITY" -prefix $TRAVIS_BUILD_NUMBER --use-dist -m 2 -save -b ) +RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -host_sso "$HOST_SSO" -identity_admin_email "$E2E_ADMIN_EMAIL_IDENTITY" -identity_admin_password "$E2E_ADMIN_PASSWORD_IDENTITY" -prefix $TRAVIS_BUILD_NUMBER --use-dist ) check_env(){ ./node_modules/@alfresco/adf-cli/bin/adf-cli init-aae-env --host "$E2E_HOST" --oauth "$HOST_SSO" --modelerUsername "$E2E_MODELER_USERNAME" --modelerPassword "$E2E_MODELER_PASSWORD" --devopsUsername "$E2E_DEVOPS_USERNAME" --devopsPassword "$E2E_DEVOPS_PASSWORD" --clientId 'activiti' || exit 1 diff --git a/scripts/travis/e2e/process-services-e2e.sh b/scripts/travis/e2e/process-services-e2e.sh index 3e155f75e4..09b4681e92 100755 --- a/scripts/travis/e2e/process-services-e2e.sh +++ b/scripts/travis/e2e/process-services-e2e.sh @@ -21,7 +21,7 @@ fi; #./node_modules/@alfresco/adf-cli/bin/adf-cli check-ps-env --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 TODO chanvge login check SSO -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 -m 2 -b || exit 1) +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 echo "Run all e2e $CONTEXT_ENV" diff --git a/scripts/travis/e2e/search-e2e.sh b/scripts/travis/e2e/search-e2e.sh index 2fac7ca55e..ac09cd8596 100755 --- a/scripts/travis/e2e/search-e2e.sh +++ b/scripts/travis/e2e/search-e2e.sh @@ -20,7 +20,7 @@ if [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ];then 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 -m 2 || 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" ]]; then