diff --git a/e2e/core/infinite-scrolling.e2e.ts b/e2e/core/infinite-scrolling.e2e.ts index 6b615919fa..5917bf6a15 100644 --- a/e2e/core/infinite-scrolling.e2e.ts +++ b/e2e/core/infinite-scrolling.e2e.ts @@ -93,6 +93,8 @@ describe('Enable infinite scrolling', () => { await contentServicesPage.doubleClickRow(folderModel.name); await contentServicesPage.enableInfiniteScrolling(); await infinitePaginationPage.clickLoadMoreButton(); + await contentServicesPage.contentList.dataTablePage().waitTillContentLoadedInfinitePagination(); + for (let i = 0; i < nrOfFiles; i++) { await contentServicesPage.checkContentIsDisplayed(fileNames[i]); } @@ -102,6 +104,8 @@ describe('Enable infinite scrolling', () => { await contentServicesPage.openFolder(deleteUploaded.entry.name); await contentServicesPage.enableInfiniteScrolling(); await infinitePaginationPage.clickLoadMoreButton(); + await contentServicesPage.contentList.dataTablePage().waitTillContentLoadedInfinitePagination(); + for (let i = 0; i < nrOfDeletedFiles; i++) { await contentServicesPage.checkContentIsDisplayed(deleteFileNames[i]); } @@ -121,15 +125,14 @@ describe('Enable infinite scrolling', () => { await contentServicesPage.doubleClickRow(folderModel.name); await contentServicesPage.enableInfiniteScrolling(); - await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); + await contentServicesPage.contentList.dataTablePage().waitTillContentLoadedInfinitePagination(); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(pageSize); await infinitePaginationPage.clickLoadMoreButton(); - await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); - - await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles); + await contentServicesPage.contentList.dataTablePage().waitTillContentLoadedInfinitePagination(); await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed(); + await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles); }); it('[C299202] Should not display load more button when all the files are already displayed', async () => { diff --git a/e2e/core/pages/content-services.page.ts b/e2e/core/pages/content-services.page.ts index 329295ddf9..7a0fc0bd24 100644 --- a/e2e/core/pages/content-services.page.ts +++ b/e2e/core/pages/content-services.page.ts @@ -15,7 +15,16 @@ * limitations under the License. */ -import { DropActions, BrowserActions, BrowserVisibility, DateUtil, DocumentListPage, TogglePage, DropdownPage } from '@alfresco/adf-testing'; +import { + DropActions, + BrowserActions, + BrowserVisibility, + DateUtil, + DocumentListPage, + TogglePage, + DropdownPage, + Logger +} from '@alfresco/adf-testing'; import { Locator, $$, browser, by, element, ElementFinder, protractor } from 'protractor'; import { CreateLibraryDialogPage } from './dialog/create-library-dialog.page'; import { FolderDialogPage } from './dialog/folder-dialog.page'; @@ -344,6 +353,7 @@ export class ContentServicesPage { } async doubleClickRow(nodeName): Promise { + Logger.log(`Open Folder ${nodeName}`); await this.contentList.doubleClickRow(nodeName); await this.contentList.dataTablePage().waitTillContentLoaded(); } @@ -648,9 +658,11 @@ export class ContentServicesPage { await BrowserActions.closeMenuAndDialogs(); await BrowserActions.click(this.multiSelectToggle); } + async multiSelectToggleIsEnabled(): Promise { return this.multiSelectToggle.isEnabled(); } + async clickSelectAllCheckbox(): Promise { await BrowserActions.click(this.selectAllCheckbox); } diff --git a/e2e/core/pagination-empty-current-page.e2e.ts b/e2e/core/pagination-empty-current-page.e2e.ts index b158ba5059..6bff3dc76c 100644 --- a/e2e/core/pagination-empty-current-page.e2e.ts +++ b/e2e/core/pagination-empty-current-page.e2e.ts @@ -103,6 +103,7 @@ describe('Pagination - returns to previous page when current is empty', () => { await paginationPage.selectItemsPerPage(itemsPerPage.five); await contentServicesPage.checkDocumentListElementsAreDisplayed(); + await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue); @@ -111,7 +112,6 @@ describe('Pagination - returns to previous page when current is empty', () => { await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true); await paginationPage.clickOnNextPage(); - await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); @@ -135,6 +135,7 @@ describe('Pagination - returns to previous page when current is empty', () => { await paginationPage.selectItemsPerPage(itemsPerPage.five); await contentServicesPage.checkDocumentListElementsAreDisplayed(); + await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue); diff --git a/e2e/process-services/attach-file-content-service.e2e.ts b/e2e/process-services/attach-file-content-service.e2e.ts index 030defe102..71750499be 100644 --- a/e2e/process-services/attach-file-content-service.e2e.ts +++ b/e2e/process-services/attach-file-content-service.e2e.ts @@ -46,11 +46,12 @@ describe('Attach File - Content service', () => { const apiServiceExternal = new ApiService({ provider: 'ECM', - hostEcm: browser.params.testConfig.adf_external_acs.host + hostEcm: browser.params.testConfig.adf_external_acs.host, + authType: 'BASIC' }); const usersActionsExternal = new UsersActions(apiServiceExternal); - const apiService = new ApiService({ provider: 'ALL'}); + const apiService = new ApiService({ provider: 'ALL' }); const integrationService = new IntegrationService(apiService); const applicationService = new ApplicationsUtil(apiService); const uploadActions = new UploadActions(apiService); @@ -81,8 +82,16 @@ describe('Attach File - Content service', () => { await apiServiceExternal.login(email, password); await usersActionsExternal.createUser(user); - await integrationService.addCSIntegration({ tenantId: user.tenantId, name: csIntegrations[0], host: browser.params.testConfig.appConfig.ecmHost }); - await integrationService.addCSIntegration({ tenantId: user.tenantId, name: csIntegrations[1], host: browser.params.testConfig.adf_external_acs.host }); + await integrationService.addCSIntegration({ + tenantId: user.tenantId, + name: csIntegrations[0], + host: browser.params.testConfig.appConfig.ecmHost + }); + await integrationService.addCSIntegration({ + tenantId: user.tenantId, + name: csIntegrations[1], + host: browser.params.testConfig.adf_external_acs.host + }); await apiService.getInstance().login(user.email, user.password); await uploadActions.uploadFile(pdfFileTwo.location, pdfFileTwo.name, '-my-'); @@ -94,11 +103,11 @@ describe('Attach File - Content service', () => { await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId); }); - beforeEach( async () => { + beforeEach(async () => { await loginPage.login(user.email, user.password); }); - afterEach( async () => { + afterEach(async () => { await navigationBarPage.clickLogoutButton(); }); @@ -115,6 +124,8 @@ 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.searchAndSelectResult(pdfFileTwo.name, pdfFileTwo.name); await contentNodeSelector.clickMoveCopyButton(); await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name); diff --git a/e2e/protractor.conf.js b/e2e/protractor.conf.js index cf9cbfe374..d5c40c2922 100644 --- a/e2e/protractor.conf.js +++ b/e2e/protractor.conf.js @@ -136,6 +136,7 @@ exports.config = { '--no-sandbox', '--disable-web-security', '--disable-browser-side-navigation', + '-allow-running-insecure-content', ...(BROWSER_RUN === true ? [] : ['--headless'])] } }, diff --git a/e2e/protractor.excludes.json b/e2e/protractor.excludes.json index 6fe19f4abc..8c3419458e 100644 --- a/e2e/protractor.excludes.json +++ b/e2e/protractor.excludes.json @@ -1,10 +1,10 @@ { "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": "Facet not working", - "C291981": "Facet not working", - "C299200": "Facet not working", - "C297509": "Facet not working", + "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", @@ -13,12 +13,7 @@ "C279932": "login problem APS not basic", "C279931": "login problem APS not basic", "C279930": "login problem APS not basic", - "C315268": "Attach file issue", - "C246522": "Attach file issue", - "C299040": "Attach file issue", - "C286516": "Attach file issue", - "C246534": "Attach file issue", - "C279886": "Attach file issue", + "C246534": "https://issues.alfresco.com/jira/browse/ADF-5236", "C291893": "flaky test" } 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 dd538c74fb..0e386bf9c0 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 @@ -151,6 +151,7 @@ export class ContentNodeSelectorDialogPage { async searchAndSelectResult(searchText: string, name: string) { await this.typeIntoNodeSelectorSearchField(searchText); + await this.contentListPage().dataTablePage().waitTillContentLoaded(); try { await this.contentListPage().dataTablePage().checkRowContentIsDisplayed(name); } catch (e) { 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 9c49d0b927..236c0a2d1e 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 @@ -300,6 +300,29 @@ export class DataTableComponentPage { } } + 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()) { + Logger.log('wait datatable loading spinner disappear'); + await BrowserVisibility.waitUntilElementIsNotPresent(element(by.tagName('mat-progress-bar'))); + } else { + try { + Logger.log('wait datatable loading spinner is present'); + await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-progress-bar'))); + } catch (error) { + } + } + try { Logger.log('wait first element is present'); await BrowserVisibility.waitUntilElementIsVisible(this.contents.first(), 1000); diff --git a/lib/testing/src/lib/core/pages/pagination.page.ts b/lib/testing/src/lib/core/pages/pagination.page.ts index 5dbedcaf4e..0fa4f37597 100644 --- a/lib/testing/src/lib/core/pages/pagination.page.ts +++ b/lib/testing/src/lib/core/pages/pagination.page.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Locator, by, element } from 'protractor'; +import { Locator, by, element, browser } from 'protractor'; import { BrowserVisibility } from '../utils/browser-visibility'; import { BrowserActions } from '../utils/browser-actions'; import { Logger } from '../utils/logger'; @@ -47,6 +47,7 @@ export class PaginationPage { await BrowserActions.click(itemsPerPage); await BrowserVisibility.waitUntilElementIsNotVisible(this.pageSelectorDropDown); Logger.log('Select page size ', numberOfItem); + await browser.sleep(500); } async checkPageSelectorIsNotDisplayed(): Promise { @@ -82,8 +83,8 @@ export class PaginationPage { } async clickOnNextPage(): Promise { - return BrowserActions.click(this.nextPageButton); Logger.log('Next page'); + return BrowserActions.click(this.nextPageButton); } async clickOnPageDropdown(): Promise {