diff --git a/.gitignore b/.gitignore index cf9293e516..5b64e4a2e1 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ workspace.xml dist/ e2e/.env.cloud tmp -e2e-output/ +e2e-output*/ /e2e/downloads/ *.npmrc .history @@ -24,3 +24,5 @@ coverage/ /desktop.ini out-tsc !/.protractor-smartrunner/ +/reports/ +e2e-result-* diff --git a/.travis.yml b/.travis.yml index 331f90a98f..f5e3d5de25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,10 @@ before_install: . ./scripts/ci/job_hooks/before_install.sh install: echo "no install" +env: + global: + - SAVE_SCREENSHOT=true + branches: only: - master @@ -21,10 +25,6 @@ branches: stages: - name: Lint & Build Dist & Release - - name: Update Rancher - if: (type = push AND tag IS blank) OR type = api - - name: Deploy PR - if: type = pull_request && commit_message =~ /\[create preview\]/ - name: Check bundle if: type = push AND tag IS blank - name: Trigger ADF child build @@ -55,6 +55,7 @@ jobs: script: - ./scripts/travis/build/build.sh && ./scripts/lint.sh && ./scripts/travis/release/release-npm.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" - ./scripts/ci/utils/artifact-to-s3.sh -a ./lib/dist -o "$S3_DBP_FOLDER/alfresco-libs.tar.bz2" @@ -110,17 +111,6 @@ jobs: - ./scripts/ci/utils/artifact-from-s3.sh -a "$S3_DBP_FOLDER/alfresco-libs.tar.bz2" -o "./lib/dist" script: ./scripts/travis/e2e/process-services-cloud-e2e.sh - - - stage: Update Rancher - name: Update Rancher - before_script: ./scripts/ci/utils/artifact-from-s3.sh -a "$S3_DBP_FOLDER/alfresco-demoshell.tar.bz2" -o "./dist/demo-shell" - script: ./scripts/travis/deploy/deploy.sh - - - stage: Deploy PR - name: Deploy PR - script: ./scripts/travis/deploy/deploy-pr.sh - - - stage: Check bundle script: - ADF_VERSION=$(npm view @alfresco/adf-core@${TAG_NPM} version) diff --git a/e2e/content-services/directives/restore-content-directive.e2e.ts b/e2e/content-services/directives/restore-content-directive.e2e.ts index 8ad8fca88a..b5d3d73095 100644 --- a/e2e/content-services/directives/restore-content-directive.e2e.ts +++ b/e2e/content-services/directives/restore-content-directive.e2e.ts @@ -142,6 +142,8 @@ describe('Restore content directive', () => { await trashcanPage.clickRestore(); await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsNotDisplayed(testFile.entry.name); + await notificationHistoryPage.checkNotifyContains(testFile.entry.name + ' item restored'); + await navigationBarPage.clickContentServicesButton(); await contentServicesPage.waitForTableBody(); await contentServicesPage.checkContentIsDisplayed(testFile.entry.name); @@ -150,7 +152,6 @@ describe('Restore content directive', () => { await navigationBarPage.clickTrashcanButton(); await trashcanPage.waitForTableBody(); await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(testFile.entry.name); - await notificationHistoryPage.checkNotifyContains(testFile.entry.name + ' item restored'); }); it('[C260239] Should restore folder with content', async () => { 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 0a040691f7..04936ebb77 100644 --- a/e2e/content-services/document-list/document-list-actions.e2e.ts +++ b/e2e/content-services/document-list/document-list-actions.e2e.ts @@ -223,10 +223,17 @@ describe('Document List Component - Actions', () => { it('[C260060] Should be able to open a file/folder through double click action - folder', async () => { const folderTwoModel = new FolderModel({ name: 'folderTwo' }); const numberOfSubFolders = 3; - await contentServicesPage.createAndOpenNewFolder(folderTwoModel.name); + + await contentServicesPage.createNewFolder(folderTwoModel.name); + const nodeIdSubFolderTwo = await contentServicesPage.getAttributeValueForElement(folderTwoModel.name, 'Node id'); + await contentServicesPage.openFolder(folderTwoModel.name); + for (let i = 0; i < numberOfSubFolders; i++) { - await contentServicesPage.createNewFolder('subFolder' + (i + 1)); + await uploadActions.createFolder('subfolder' + (i + 1), nodeIdSubFolderTwo); } + + await browser.refresh(); + await contentServicesPage.checkContentsAreDisplayed(numberOfSubFolders); }); 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 0e3d8bc11f..aed3d8b45e 100644 --- a/e2e/content-services/document-list/document-list-pagination.e2e.ts +++ b/e2e/content-services/document-list/document-list-pagination.e2e.ts @@ -111,7 +111,7 @@ describe('Document List - Pagination', () => { it('[C260062] Should use default pagination settings', async () => { await contentServicesPage.openFolder(newFolderModel.name); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty); - await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 1-${nrOfFiles} of ${nrOfFiles}`); + await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${nrOfFiles} of ${nrOfFiles}`); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles); const list = await contentServicesPage.getAllRowsNameColumn(); await expect(ArrayUtil.arrayContainsArray(list, fileNames)).toEqual(true); @@ -125,7 +125,7 @@ describe('Document List - Pagination', () => { await contentServicesPage.checkDocumentListElementsAreDisplayed(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty); - await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 1-${nrOfFiles} of ${nrOfFiles}`); + await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${nrOfFiles} of ${nrOfFiles}`); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles); const list = await contentServicesPage.getAllRowsNameColumn(); await expect(ArrayUtil.arrayContainsArray(list, fileNames)).toEqual(true); @@ -155,7 +155,7 @@ describe('Document List - Pagination', () => { currentPage++; await contentServicesPage.checkDocumentListElementsAreDisplayed(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); - await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 6-${itemsPerPage.fiveValue * currentPage} of ${nrOfFiles}`); + 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); @@ -228,7 +228,7 @@ describe('Document List - Pagination', () => { await contentServicesPage.checkDocumentListElementsAreDisplayed(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen); - await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 16-${nrOfFiles} of ${nrOfFiles}`); + await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${nrOfFiles} of ${nrOfFiles}`); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles - itemsPerPage.fifteenValue); list = await contentServicesPage.getAllRowsNameColumn(); await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true); @@ -309,7 +309,7 @@ describe('Document List - Pagination', () => { await paginationPage.clickOnNextPage(); await contentServicesPage.checkDocumentListElementsAreDisplayed(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty); - await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 21-${secondSetNumber} of ${secondSetNumber}`); + await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 21-${secondSetNumber} of ${secondSetNumber}`); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.twentyValue); list = await contentServicesPage.getAllRowsNameColumn(); await expect(ArrayUtil.arrayContainsArray(list, secondSetOfFiles.slice(20, 25))).toEqual(true); @@ -319,7 +319,7 @@ describe('Document List - Pagination', () => { await paginationPage.clickItemsPerPageDropdown(); await expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual(['5', '10', '15', '20']); - await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 21])); + await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 21])); await contentServicesPage.goToDocumentList(); await browser.refresh(); @@ -328,19 +328,19 @@ describe('Document List - Pagination', () => { await contentServicesPage.checkContentIsDisplayed(docxFileModel.name); await uploadDialog.clickOnCloseButton(); await uploadDialog.dialogIsNotDisplayed(); - await paginationPage.clickItemsPerPageDropdown(); - await expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual([ '5', '10', '15', '21' ]); + await paginationPage.clickItemsPerPageDropdown(); + await expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual(['5', '10', '15', '21']); await paginationPage.clickItemsPerPageDropdown(); await paginationPage.selectItemsPerPage(itemsPerPage.twentyOne); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twentyOne); await browser.refresh(); - await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 1-${itemsPerPage.twentyOneValue} of ${numberOfFilesAfterUpload}`); + await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.twentyOneValue} of ${numberOfFilesAfterUpload}`); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyOneValue); - await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 20])); + await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 20])); await browser.refresh(); - await paginationPage.clickItemsPerPageDropdown(); + await paginationPage.clickItemsPerPageDropdown(); await expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual(['5', '10', '15', '20']); }); @@ -349,20 +349,28 @@ describe('Document List - Pagination', () => { await contentServicesPage.openFolder(newFolderModel.name); await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); - await contentServicesPage.createAndOpenNewFolder(folderTwoModel.name); + + await apiService.getInstance().login(acsUser.email, acsUser.password); + await contentServicesPage.createNewFolder(folderTwoModel.name); + const nodeIdSubFolderTwo = await contentServicesPage.getAttributeValueForElement(folderTwoModel.name, 'Node id'); + await contentServicesPage.openFolder(folderTwoModel.name); for (let i = 0; i < numberOfSubFolders; i++) { - await contentServicesPage.createNewFolder('subfolder' + (i + 1)); + await uploadActions.createFolder('subfolder' + (i + 1), nodeIdSubFolderTwo); } + await browser.refresh(); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue} of ${numberOfSubFolders}`); await paginationPage.clickOnNextPage(); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 6-${numberOfSubFolders} of ${numberOfSubFolders}`); - await contentServicesPage.openFolder('subfolder6'); + const nodeIdSubFolder6 = await contentServicesPage.getAttributeValueForElement('subfolder6', 'Node id'); + for (let i = 0; i < numberOfSubFolders; i++) { - await contentServicesPage.createNewFolder('subfolder' + (i + 1)); + await uploadActions.createFolder('subfolder' + (i + 1), nodeIdSubFolder6); } + await browser.refresh(); + await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue} of ${numberOfSubFolders}`); await expect(await paginationPage.getCurrentPage()).toEqual('Page 1'); await expect(await paginationPage.getTotalPages()).toEqual('of 2'); @@ -374,10 +382,17 @@ describe('Document List - Pagination', () => { await paginationPage.selectItemsPerPage(itemsPerPage.five); await contentServicesPage.openFolder(newFolderModel.name); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); - await contentServicesPage.createAndOpenNewFolder(folderTwoModel.name); + + await apiService.getInstance().login(acsUser.email, acsUser.password); + await contentServicesPage.createNewFolder(folderTwoModel.name); + const nodeIdSubFolderTwo = await contentServicesPage.getAttributeValueForElement(folderTwoModel.name, 'Node id'); + await contentServicesPage.openFolder(folderTwoModel.name); + for (let i = 0; i < numberOfSubFolders; i++) { - await contentServicesPage.createNewFolder('subfolder' + (i + 1)); + await uploadActions.createFolder('subfolder' + (i + 1), nodeIdSubFolderTwo); } + + await browser.refresh(); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue} of ${numberOfSubFolders}`); await contentServicesPage.chooseSelectionMode('Single'); diff --git a/e2e/content-services/pages/tag.page.ts b/e2e/content-services/pages/tag.page.ts index d8df191326..46ce55c4be 100644 --- a/e2e/content-services/pages/tag.page.ts +++ b/e2e/content-services/pages/tag.page.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { element, by, protractor, browser } from 'protractor'; +import { Locator, element, by, protractor, browser } from 'protractor'; import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; export class TagPage { @@ -26,9 +26,9 @@ export class TagPage { tagListRow = element(by.css('adf-tag-node-actions-list mat-list-item')); tagListByNodeIdRow = element(by.css('adf-tag-node-list mat-chip')); errorMessage = element(by.css('mat-hint[data-automation-id="errorMessage"]')); - tagListRowLocator = by.css('adf-tag-node-actions-list mat-list-item div'); - tagListByNodeIdRowLocator = by.css('adf-tag-node-list mat-chip span'); - tagListContentServicesRowLocator = by.css('div[class*="adf-list-tag"]'); + tagListRowLocator: Locator = by.css('adf-tag-node-actions-list mat-list-item div'); + tagListByNodeIdRowLocator: Locator = by.css('adf-tag-node-list mat-chip span'); + tagListContentServicesRowLocator: Locator = by.css('div[class*="adf-list-tag"]'); showDeleteButton = element(by.id('adf-remove-button-tag')); showMoreButton = element(by.css('button[data-automation-id="show-more-tags"]')); showLessButton = element(by.css('button[data-automation-id="show-fewer-tags"]')); @@ -76,7 +76,7 @@ export class TagPage { async getNewTagPlaceholder(): Promise { await BrowserVisibility.waitUntilElementIsVisible(this.newTagInput); - return this.newTagInput.getAttribute('placeholder'); + return this.newTagInput.getAttribute('data-placeholder'); } async addTagButtonIsEnabled(): Promise { diff --git a/e2e/content-services/pages/tree-view.page.ts b/e2e/content-services/pages/tree-view.page.ts index 506d3e62f3..ae7a19891d 100644 --- a/e2e/content-services/pages/tree-view.page.ts +++ b/e2e/content-services/pages/tree-view.page.ts @@ -21,7 +21,7 @@ import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; export class TreeViewPage { treeViewTitle = element(by.cssContainingText('app-tree-view div', 'TREE VIEW TEST')); - nodeIdInput = element(by.css('input[placeholder="Node Id"]')); + nodeIdInput = element(by.css('input[data-placeholder="Node Id"]')); noNodeMessage = element(by.id('adf-tree-view-missing-node')); nodesOnPage = element.all(by.css('mat-tree-node')); diff --git a/e2e/content-services/tag-component.e2e.ts b/e2e/content-services/tag-component.e2e.ts index a4009af4a6..88cc0d4e22 100644 --- a/e2e/content-services/tag-component.e2e.ts +++ b/e2e/content-services/tag-component.e2e.ts @@ -73,8 +73,10 @@ describe('Tag component', () => { 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 () => { diff --git a/e2e/content-services/upload/upload-dialog.e2e.ts b/e2e/content-services/upload/upload-dialog.e2e.ts index ca9af6a267..31d57f23f5 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, + BrowserActions, BrowserVisibility, LoginPage, UploadActions, UserModel, @@ -98,15 +98,15 @@ describe('Upload component', () => { await apiService.getInstance().login(acsUser.email, acsUser.password); await loginPage.login(acsUser.email, acsUser.password); await contentServicesPage.goToDocumentList(); - }); + }); beforeEach(async () => { await contentServicesPage.goToDocumentList(); }); afterEach(async () => { - const nbResults = await contentServicesPage.numberOfResultsDisplayed(); - if (nbResults > 1) { + const nbResults = await contentServicesPage.emptyFolder.isPresent(); + if (!nbResults) { const nodeIds = await contentServicesPage.getElementsDisplayedId(); for (const nodeId of nodeIds) { await uploadActions.deleteFileOrFolder(nodeId); @@ -173,7 +173,7 @@ describe('Upload component', () => { await uploadDialog.clickOnCloseButton(); await uploadDialog.dialogIsNotDisplayed(); await contentServicesPage.uploadFile(pdfFileModel.location); - await contentServicesPage .checkContentIsDisplayed(pdfFileModel.name); + await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); await uploadDialog.fileIsUploaded(pdfFileModel.name); await uploadDialog.fileIsNotDisplayedInDialog(pngFileModel.name); await uploadDialog.fileIsNotDisplayedInDialog(pngFileModelTwo.name); @@ -202,6 +202,7 @@ describe('Upload component', () => { await BrowserActions.click(versionManagePage.showNewVersionButton); await versionManagePage.uploadNewVersionFile(pngFileModel.location); await versionManagePage.closeVersionDialog(); + await uploadDialog.removeUploadedFile(pngFileModel.name); await contentServicesPage.checkContentIsDisplayed(pngFileModel.name); await uploadDialog.clickOnCloseButton(); @@ -231,18 +232,23 @@ describe('Upload component', () => { 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(); } - }, 500)`); + }, 2000)`); await contentServicesPage.uploadFolder(adfBigFolder.location); - await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled'); + 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/core/infinite-scrolling.e2e.ts b/e2e/core/infinite-scrolling.e2e.ts index 61ef0f43cf..6f37881a5d 100644 --- a/e2e/core/infinite-scrolling.e2e.ts +++ b/e2e/core/infinite-scrolling.e2e.ts @@ -121,6 +121,7 @@ describe('Enable infinite scrolling', () => { await contentServicesPage.doubleClickRow(folderModel.name); await contentServicesPage.enableInfiniteScrolling(); + await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(pageSize); await infinitePaginationPage.clickLoadMoreButton(); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles); diff --git a/e2e/core/login/login-component.e2e.ts b/e2e/core/login/login-component.e2e.ts index a65978e3b1..4f3951d3e1 100644 --- a/e2e/core/login/login-component.e2e.ts +++ b/e2e/core/login/login-component.e2e.ts @@ -53,6 +53,8 @@ describe('Login component', () => { const usersActions = new UsersActions(apiService); beforeAll(async () => { + await LocalStorageUtil.setStorageItem('authType', 'BASIC'); + await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); await usersActions.createUser(userA); diff --git a/e2e/core/login/redirection.e2e.ts b/e2e/core/login/redirection.e2e.ts deleted file mode 100644 index 419a8b5aff..0000000000 --- a/e2e/core/login/redirection.e2e.ts +++ /dev/null @@ -1,170 +0,0 @@ -/*! - * @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 } from 'protractor'; - -import { - ApiService, - LocalStorageUtil, - SettingsPage, - StringUtil, - UploadActions, - UsersActions -} from '@alfresco/adf-testing'; -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { ProcessServicesPage } from '../../process-services/pages/process-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { LogoutPage } from '../../core/pages/logout.page'; -import { LoginShellPage } from '../../core/pages/login-shell.page'; - -describe('Login component - Redirect', () => { - - const settingsPage = new SettingsPage(); - const processServicesPage = new ProcessServicesPage(); - const navigationBarPage = new NavigationBarPage(); - const contentServicesPage = new ContentServicesPage(); - const loginPage = new LoginShellPage(); - const logoutPage = new LogoutPage(); - - let user; - let uploadedFolder; - - const apiService = new ApiService(); - const uploadActions = new UploadActions(apiService); - const usersActions = new UsersActions(apiService); - - beforeAll(async () => { - await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); - - user = await usersActions.createUser(); - await apiService.getInstance().login(user.email, user.password); - - uploadedFolder = await uploadActions.createFolder('protecteFolder' + StringUtil.generateRandomString(), '-my-'); - }); - - it('[C213838] Should after login in CS be redirect to Login page when try to access to PS', async () => { - await LocalStorageUtil.setStorageItem('providers', 'ECM'); - - await loginPage.goToLoginPage(); - await loginPage.clickSettingsIcon(); - await settingsPage.setProviderEcm(); - await loginPage.login(user.email, user.password); - - await navigationBarPage.clickContentServicesButton(); - await contentServicesPage.checkAcsContainer(); - - await navigationBarPage.navigateToProcessServicesPage(); - - await loginPage.waitForElements(); - }); - - it('[C260085] Should after login in PS be redirect to Login page when try to access to CS', async () => { - await LocalStorageUtil.setStorageItem('providers', 'BPM'); - - await loginPage.goToLoginPage(); - await loginPage.clickSettingsIcon(); - await settingsPage.setProviderBpm(); - - await loginPage.enableSuccessRouteSwitch(); - await loginPage.enterSuccessRoute('activiti'); - - await loginPage.login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); - - await navigationBarPage.navigateToProcessServicesPage(); - await processServicesPage.checkApsContainer(); - - await navigationBarPage.clickContentServicesButton(); - - await loginPage.waitForElements(); - }); - - it('[C260081] Should after login in BOTH not be redirect to Login page when try to access to CS or PS', async () => { - await LocalStorageUtil.setStorageItem('providers', 'ALL'); - - await loginPage.goToLoginPage(); - await loginPage.clickSettingsIcon(); - - await settingsPage.setProviderEcmBpm(); - - await loginPage.login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); - - await navigationBarPage.navigateToProcessServicesPage(); - await processServicesPage.checkApsContainer(); - - await navigationBarPage.clickContentServicesButton(); - await contentServicesPage.checkAcsContainer(); - }); - - it('[C260088] Should be re-redirect to the request URL after login when try to access to a protect URL ', async () => { - await loginPage.goToLoginPage(); - await loginPage.clickSettingsIcon(); - await settingsPage.setProviderEcm(); - await loginPage.login(user.email, user.password); - - await navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id); - - let actualUrl = await browser.getCurrentUrl(); - await expect(actualUrl).toEqual(browser.baseUrl + '/files/' + uploadedFolder.entry.id); - - await contentServicesPage.waitForTableBody(); - - await navigationBarPage.clickLogoutButton(); - - await logoutPage.checkLogoutSectionIsDisplayed(); - - await navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id); - - await loginPage.waitForElements(); - - await loginPage.login(user.email, user.password); - - actualUrl = await browser.getCurrentUrl(); - await expect(actualUrl).toEqual(browser.baseUrl + '/files/' + uploadedFolder.entry.id); - }); - - it('[C299161] Should redirect user to requested URL after reloading login page', async () => { - await loginPage.goToLoginPage(); - await loginPage.clickSettingsIcon(); - await settingsPage.setProviderEcm(); - await loginPage.login(user.email, user.password); - - await navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id); - - const currentUrl = await browser.getCurrentUrl(); - await expect(currentUrl).toEqual(browser.baseUrl + '/files/' + uploadedFolder.entry.id); - - await contentServicesPage.waitForTableBody(); - - await navigationBarPage.clickLogoutButton(); - - await logoutPage.checkLogoutSectionIsDisplayed(); - - await navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id); - await loginPage.waitForElements(); - await browser.refresh(); - await loginPage.waitForElements(); - - await loginPage.enterUsername(user.email); - await loginPage.enterPassword(user.password); - await loginPage.clickSignInButton(); - - await navigationBarPage.checkMenuButtonIsDisplayed(); - - const actualUrl = await browser.getCurrentUrl(); - await expect(actualUrl).toEqual(browser.baseUrl + '/files/' + uploadedFolder.entry.id); - }); -}); diff --git a/e2e/core/login/remember-me.e2e.ts b/e2e/core/login/remember-me.e2e.ts index 5f9696295d..5c52502aa1 100644 --- a/e2e/core/login/remember-me.e2e.ts +++ b/e2e/core/login/remember-me.e2e.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { SettingsPage } from '@alfresco/adf-testing'; +import { SettingsPage, LocalStorageUtil } from '@alfresco/adf-testing'; import { LoginShellPage } from '../../core/pages/login-shell.page'; describe('Login component - Remember Me', () => { @@ -24,6 +24,8 @@ describe('Login component - Remember Me', () => { const loginPage = new LoginShellPage(); beforeAll(async () => { + await LocalStorageUtil.setStorageItem('authType', 'BASIC'); + await loginPage.goToLoginPage(); await loginPage.clickSettingsIcon(); await settingsPage.setProviderEcmBpm(); diff --git a/e2e/core/pages/content-services.page.ts b/e2e/core/pages/content-services.page.ts index ab6f3b735b..f1c99d0c13 100644 --- a/e2e/core/pages/content-services.page.ts +++ b/e2e/core/pages/content-services.page.ts @@ -16,7 +16,7 @@ */ import { DropActions, BrowserActions, BrowserVisibility, DateUtil, DocumentListPage, TogglePage, DropdownPage } from '@alfresco/adf-testing'; -import { $$, browser, by, element, ElementFinder, protractor } from 'protractor'; +import { Locator, $$, browser, by, element, ElementFinder, protractor } from 'protractor'; import { CreateLibraryDialogPage } from './dialog/create-library-dialog.page'; import { FolderDialogPage } from './dialog/folder-dialog.page'; import { NavigationBarPage } from './navigation-bar.page'; @@ -47,7 +47,7 @@ export class ContentServicesPage { deleteNodesButton = element(by.css('button[data-automation-id="delete-toolbar-button"]')); createLibraryButton = element(by.css('button[data-automation-id="create-new-library"]')); activeBreadcrumb = element(by.css('div[class*="active"]')); - tooltip = by.css('div[class*="--text adf-full-width"] span'); + tooltip: Locator = by.css('div[class*="--text adf-full-width"] span'); uploadFileButton = element(by.css('.adf-upload-button-file-container button')); uploadFileButtonInput = element(by.css('input[data-automation-id="upload-single-file"]')); uploadMultipleFileButton = element(by.css('input[data-automation-id="upload-multiple-files"]')); diff --git a/e2e/core/pages/dialog/upload-dialog.page.ts b/e2e/core/pages/dialog/upload-dialog.page.ts index 78962cf085..01b9e439df 100644 --- a/e2e/core/pages/dialog/upload-dialog.page.ts +++ b/e2e/core/pages/dialog/upload-dialog.page.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { element, by, browser, ElementFinder } from 'protractor'; +import { element, by, browser, ElementFinder, Locator } from 'protractor'; import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; export class UploadDialogPage { @@ -23,9 +23,9 @@ export class UploadDialogPage { closeButton = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]'))); dialog = element(by.css('div[id="upload-dialog"]')); minimizedDialog = element(by.css('div[class*="upload-dialog--minimized"]')); - uploadedStatusIcon = by.css('mat-icon[class*="status--done"]'); - cancelledStatusIcon = by.css('div[class*="status--cancelled"]'); - errorStatusIcon = by.css('div[class*="status--error"] mat-icon'); + uploadedStatusIcon: Locator = by.css('mat-icon[class*="status--done"]'); + cancelledStatusIcon: Locator = by.css('div[class*="status--cancelled"]'); + errorStatusIcon: Locator = by.css('div[class*="status--error"] mat-icon'); errorTooltip = element(by.css('div.mat-tooltip')); rowByRowName = by.xpath('ancestor::adf-file-uploading-list-row'); title = element(by.css('span[class*="upload-dialog__title"]')); @@ -63,14 +63,15 @@ export class UploadDialogPage { return element.all(by.css(`div[class*='uploading-row'] span[title="${content}"]`)).first(); } - getRowByRowName(content: string) { + async getRowByRowName(content: string): Promise { const rows = this.getRowsByName(content); + await BrowserVisibility.waitUntilElementIsVisible(rows); return rows.element(this.rowByRowName); } async fileIsUploaded(content: string): Promise { const row = await this.getRowByRowName(content); - await BrowserVisibility.waitUntilElementIsVisible(row.element(this.uploadedStatusIcon)); + await BrowserVisibility.waitUntilElementIsVisible(row.element(this.uploadedStatusIcon), 60000); } async fileIsError(content: string) { @@ -102,6 +103,7 @@ export class UploadDialogPage { async fileIsCancelled(content: string): Promise { const row = await this.getRowByRowName(content); + await BrowserVisibility.waitUntilElementIsVisible(row); await BrowserVisibility.waitUntilElementIsVisible(row.element(this.cancelledStatusIcon), 10000); } @@ -110,7 +112,6 @@ export class UploadDialogPage { await BrowserVisibility.waitUntilElementIsVisible(row.element(this.uploadedStatusIcon)); const elementRow = await this.getRowByRowName(content); await BrowserActions.click(elementRow.element(this.uploadedStatusIcon)); - } async getTitleText(): Promise { diff --git a/e2e/core/pages/header.page.ts b/e2e/core/pages/header.page.ts deleted file mode 100644 index 873c1d686c..0000000000 --- a/e2e/core/pages/header.page.ts +++ /dev/null @@ -1,129 +0,0 @@ -/*! - * @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 { element, by, protractor } from 'protractor'; -import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; - -export class HeaderPage { - - checkBox = element(by.cssContainingText('.mat-checkbox-label', 'Show menu button')); - headerColor = element(by.css('option[value="primary"]')); - titleInput = element(by.css('input[name="title"]')); - iconInput = element(by.css('input[placeholder="URL path"]')); - hexColorInput = element(by.css('input[placeholder="hex color code"]')); - logoHyperlinkInput = element(by.css('input[placeholder="Redirect URL"]')); - logoTooltipInput = element(by.css('input[placeholder="Tooltip text"]')); - positionStart = element.all(by.css('mat-radio-button[value="start"]')).first(); - positionEnd = element.all(by.css('mat-radio-button[value="end"]')).first(); - sideBarPositionRight = element(by.css('mat-sidenav.mat-drawer.mat-sidenav.mat-drawer-end')); - sideBarPositionLeft = element(by.css('mat-sidenav.mat-drawer.mat-sidenav')); - - async checkShowMenuCheckBoxIsDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.checkBox); - } - - async checkChooseHeaderColourIsDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.headerColor); - } - - async checkChangeTitleIsDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.titleInput); - } - - async checkChangeUrlPathIsDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.iconInput); - } - - async clickShowMenuButton(): Promise { - const checkBox = element(by.css('mat-checkbox')); - await BrowserActions.click(checkBox.get(0)); - } - - async changeHeaderColor(color: string): Promise { - const headerColor = element(by.css('option[value="' + color + '"]')); - await BrowserActions.click(headerColor); - } - - async checkAppTitle(name: string): Promise { - const title = element(by.cssContainingText('.adf-app-title', name)); - await BrowserVisibility.waitUntilElementIsVisible(title); - } - - async addTitle(title: string): Promise { - await BrowserActions.click(this.titleInput); - await BrowserActions.clearSendKeys(this.titleInput, title); - await this.titleInput.sendKeys(protractor.Key.ENTER); - } - - async checkIconIsDisplayed(url: string): Promise { - const icon = element(by.css('img[src="' + url + '"]')); - await BrowserVisibility.waitUntilElementIsVisible(icon); - } - - async addIcon(url: string): Promise { - await BrowserActions.click(this.iconInput); - await BrowserActions.clearSendKeys(this.iconInput, url); - await this.iconInput.sendKeys(protractor.Key.ENTER); - } - - async checkHexColorInputIsDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.hexColorInput); - } - - async checkLogoHyperlinkInputIsDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.logoHyperlinkInput); - } - - async checkLogoTooltipInputIsDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.logoTooltipInput); - } - - async addHexCodeColor(hexCode: string): Promise { - await BrowserActions.click(this.hexColorInput); - await this.hexColorInput.sendKeys(hexCode); - await this.hexColorInput.sendKeys(protractor.Key.ENTER); - } - - async addLogoHyperlink(hyperlink: string): Promise { - await BrowserActions.click(this.logoHyperlinkInput); - await this.logoHyperlinkInput.sendKeys(hyperlink); - await this.logoHyperlinkInput.sendKeys(protractor.Key.ENTER); - } - - async addLogoTooltip(tooltip: string): Promise { - await BrowserActions.click(this.logoTooltipInput); - await this.logoTooltipInput.sendKeys(tooltip); - await this.logoTooltipInput.sendKeys(protractor.Key.ENTER); - } - - async sideBarPositionStart(): Promise { - await BrowserActions.click(this.positionStart); - } - - async sideBarPositionEnd(): Promise { - await BrowserActions.click(this.positionEnd); - } - - async checkSidebarPositionStart(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.sideBarPositionLeft); - } - - async checkSidebarPositionEnd(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.sideBarPositionRight); - } - -} diff --git a/e2e/core/pages/infinite-pagination.page.ts b/e2e/core/pages/infinite-pagination.page.ts index c63589bf4d..702337e59d 100644 --- a/e2e/core/pages/infinite-pagination.page.ts +++ b/e2e/core/pages/infinite-pagination.page.ts @@ -22,6 +22,7 @@ export class InfinitePaginationPage { rootElement: ElementFinder; loadMoreButton; + loading = element(by.css('[data-automation-id="adf-infinite-pagination-spinner"]')); constructor(rootElement = element.all(by.css('adf-infinite-pagination')).first()) { this.rootElement = rootElement; @@ -30,6 +31,7 @@ export class InfinitePaginationPage { async clickLoadMoreButton(): Promise { await BrowserActions.click(this.loadMoreButton); + await BrowserVisibility.waitUntilElementIsNotVisible(this.loading); } async checkLoadMoreButtonIsNotDisplayed(): Promise { diff --git a/e2e/core/pages/metadata-view.page.ts b/e2e/core/pages/metadata-view.page.ts index 8cc5f54d2b..33c3674e3f 100644 --- a/e2e/core/pages/metadata-view.page.ts +++ b/e2e/core/pages/metadata-view.page.ts @@ -15,14 +15,14 @@ * limitations under the License. */ -import { by, element, Key, protractor } from 'protractor'; +import { Locator, by, element, Key, protractor } from 'protractor'; import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; export class MetadataViewPage { title = element(by.css(`div[info-drawer-title]`)); expandedAspect = element(by.css(`mat-expansion-panel-header[aria-expanded='true']`)); - aspectTitle = by.css(`mat-panel-title`); + aspectTitle: Locator = by.css(`mat-panel-title`); name = element(by.css(`[data-automation-id='card-textitem-value-name']`)); creator = element(by.css(`[data-automation-id='card-textitem-value-createdByUser.displayName']`)); createdDate = element(by.css(`span[data-automation-id='card-dateitem-createdAt'] span`)); @@ -43,7 +43,7 @@ export class MetadataViewPage { presetSwitch = element(by.id('adf-toggle-custom-preset')); defaultPropertiesSwitch = element(by.id('adf-metadata-default-properties')); closeButton = element(by.cssContainingText('button.mat-button span', 'Close')); - displayAspect = element(by.css(`input[placeholder='Display Aspect']`)); + displayAspect = element(by.css(`input[data-placeholder='Display Aspect']`)); applyAspect = element(by.cssContainingText(`button span.mat-button-wrapper`, 'Apply Aspect')); saveMetadataButton = element(by.css(`[data-automation-id='save-metadata']`)); resetMetadataButton = element(by.css(`[data-automation-id='reset-metadata']`)); diff --git a/e2e/core/pages/trashcan.page.ts b/e2e/core/pages/trashcan.page.ts index dcc7b3dc7d..39bc1337d5 100644 --- a/e2e/core/pages/trashcan.page.ts +++ b/e2e/core/pages/trashcan.page.ts @@ -16,12 +16,12 @@ */ import { BrowserActions, BrowserVisibility, DocumentListPage } from '@alfresco/adf-testing'; -import { element, by } from 'protractor'; +import { Locator, element, by } from 'protractor'; export class TrashcanPage { contentList = new DocumentListPage(element(by.css('adf-document-list'))); - rows = by.css('adf-document-list div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"]'); + rows: Locator = by.css('adf-document-list div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"]'); tableBody = element.all(by.css('adf-document-list .adf-datatable-body')).first(); pagination = element(by.css('adf-pagination')); emptyTrashcan = element(by.css('adf-empty-content')); diff --git a/e2e/core/settings-component.e2e.ts b/e2e/core/settings-component.e2e.ts index 74d1dcaa8a..c642c2ddcf 100644 --- a/e2e/core/settings-component.e2e.ts +++ b/e2e/core/settings-component.e2e.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { BrowserActions, SettingsPage } from '@alfresco/adf-testing'; +import { BrowserActions, LocalStorageUtil, SettingsPage } from '@alfresco/adf-testing'; import { browser, protractor } from 'protractor'; import { ContentServicesPage } from '../core/pages/content-services.page'; import { NavigationBarPage } from '../core/pages/navigation-bar.page'; @@ -33,6 +33,11 @@ describe('Settings component', () => { 'Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.'; describe('Should be able to change Urls in the Settings', () => { + beforeAll(async () => { + await LocalStorageUtil.setStorageItem('authType', 'BASIC'); + await browser.refresh(); + }); + beforeEach(async () => { await settingsPage.goToSettingsPage(); }); @@ -94,10 +99,14 @@ describe('Settings component', () => { describe('Settings Component - Basic Authentication', () => { beforeAll(async () => { + await LocalStorageUtil.setStorageItem('authType', 'OAUTH'); + await browser.refresh(); await settingsPage.goToSettingsPage(); await settingsPage.setProvider('ALL'); await settingsPage.setContentServicesURL(browser.params.testConfig.appConfig.ecmHost); await settingsPage.setProcessServicesURL(browser.params.testConfig.appConfig.bpmHost); + await settingsPage.setImplicitFlow(false); + await settingsPage.setSilentLogin(false); await settingsPage.clickApply(); }); diff --git a/e2e/core/user-info-component.e2e.ts b/e2e/core/user-info-component.e2e.ts deleted file mode 100644 index 90fd7996eb..0000000000 --- a/e2e/core/user-info-component.e2e.ts +++ /dev/null @@ -1,173 +0,0 @@ -/*! - * @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 { PeopleApi } from '@alfresco/js-api'; -import { ApiService, LocalStorageUtil, LoginPage, UserInfoPage, UsersActions } from '@alfresco/adf-testing'; -import { browser } from 'protractor'; -import { FileModel } from '../models/ACS/file.model'; -import { NavigationBarPage } from '../core/pages/navigation-bar.page'; -import * as path from 'path'; -import * as fs from 'fs'; - -describe('User Info component', () => { - - const loginPage = new LoginPage(); - const userInfoPage = new UserInfoPage(); - const navigationBarPage = new NavigationBarPage(); - - const apiService = new ApiService(); - const usersActions = new UsersActions(apiService); - const peopleApi: PeopleApi = new PeopleApi(apiService.getInstance()); - - let user; - - const acsAvatarFileModel = new FileModel({ - 'name': browser.params.resources.Files.PROFILE_IMAGES.ECM.file_name, - 'location': browser.params.resources.Files.PROFILE_IMAGES.ECM.file_location - }); - const apsAvatarFileModel = new FileModel({ - 'name': browser.params.resources.Files.PROFILE_IMAGES.BPM.file_name, - 'location': browser.params.resources.Files.PROFILE_IMAGES.BPM.file_location - }); - - beforeAll(async () => { - await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); - - user = await usersActions.createUser(); - }); - - afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - it('[C260111] Should display UserInfo when Process Services and Content Services are enabled', async () => { - await loginPage.login(user.email, user.password); - - await userInfoPage.clickUserProfile(); - await userInfoPage.dialogIsDisplayed(); - await userInfoPage.checkContentServicesTabIsSelected(); - - await expect(await userInfoPage.getContentHeaderTitle()).toEqual(user.firstName + ' ' + user.lastName); - await expect(await userInfoPage.getContentTitle()).toEqual(user.firstName + ' ' + user.lastName); - await expect(await userInfoPage.getContentEmail()).toEqual(user.email); - await expect(await userInfoPage.getContentJobTitle()).toEqual('N/A'); - - await userInfoPage.checkInitialImage(); - await userInfoPage.APSProfileImageNotDisplayed(); - await userInfoPage.ACSProfileImageNotDisplayed(); - - await userInfoPage.clickOnProcessServicesTab(); - await userInfoPage.checkProcessServicesTabIsSelected(); - - await browser.sleep(1000); - - await expect(await userInfoPage.getProcessHeaderTitle()).toEqual(user.firstName + ' ' + user.lastName); - await expect(await userInfoPage.getProcessTitle()).toEqual(user.firstName + ' ' + user.lastName); - await expect(await userInfoPage.getProcessEmail()).toEqual(user.email); - - await userInfoPage.closeUserProfile(); - }); - - it('[C260113] Should display UserInfo when Content Services is enabled and Process Services is disabled', async () => { - await loginPage.login(user.email, user.password); - - await userInfoPage.clickUserProfile(); - await userInfoPage.dialogIsDisplayed(); - - await expect(await userInfoPage.getContentHeaderTitle()).toEqual(user.firstName + ' ' + user.lastName); - await expect(await userInfoPage.getContentTitle()).toEqual(user.firstName + ' ' + user.lastName); - await expect(await userInfoPage.getContentEmail()).toEqual(user.email); - await expect(await userInfoPage.getContentJobTitle()).toEqual('N/A'); - - await userInfoPage.checkInitialImage(); - await userInfoPage.APSProfileImageNotDisplayed(); - await userInfoPage.ACSProfileImageNotDisplayed(); - await userInfoPage.closeUserProfile(); - await userInfoPage.dialogIsNotDisplayed(); - }); - - it('[C260115] Should display UserInfo when Process Services is enabled and Content Services is disabled', async () => { - await LocalStorageUtil.setStorageItem('providers', 'BPM'); - - await loginPage.login(user.email, user.password); - - await userInfoPage.clickUserProfile(); - - await userInfoPage.dialogIsDisplayed(); - - await expect(await userInfoPage.getProcessHeaderTitle()).toEqual(user.firstName + ' ' + user.lastName); - await expect(await userInfoPage.getProcessTitle()).toEqual(user.firstName + ' ' + user.lastName); - await expect(await userInfoPage.getProcessEmail()).toEqual(user.email); - - await userInfoPage.checkInitialImage(); - await userInfoPage.APSProfileImageNotDisplayed(); - await userInfoPage.ACSProfileImageNotDisplayed(); - await userInfoPage.closeUserProfile(); - }); - - it('[C260117] Should display UserInfo with profile image uploaded in ACS', async () => { - await LocalStorageUtil.setStorageItem('providers', 'ECM'); - - await updateAvatarACS(); - - await loginPage.login(user.email, user.password); - - await userInfoPage.clickUserProfile(); - - await userInfoPage.checkACSProfileImage(); - await userInfoPage.APSProfileImageNotDisplayed(); - await userInfoPage.closeUserProfile(); - }); - - it('[C260118] Should display UserInfo with profile image uploaded in APS', async () => { - await LocalStorageUtil.setStorageItem('providers', 'BPM'); - - const users = new UsersActions(apiService); - await apiService.getInstance().login(user.email, user.password); - await users.changeProfilePictureAps(apsAvatarFileModel.getLocation()); - - await loginPage.login(user.email, user.password); - - await userInfoPage.clickUserProfile(); - - await userInfoPage.checkAPSProfileImage(); - await userInfoPage.ACSProfileImageNotDisplayed(); - await userInfoPage.initialImageNotDisplayed(); - await userInfoPage.closeUserProfile(); - }); - - it('[C260120] Should not display profile image in UserInfo when deleted in ACS', async () => { - await LocalStorageUtil.setStorageItem('providers', 'ECM'); - - await peopleApi.deleteAvatarImage(user.email); - - await loginPage.login(user.email, user.password); - - await userInfoPage.clickUserProfile(); - - await userInfoPage.checkInitialImage(); - await userInfoPage.ACSProfileImageNotDisplayed(); - await userInfoPage.closeUserProfile(); - }); - - const updateAvatarACS = async function () { - await apiService.getInstance().login(user.email, user.password); - const absolutePath = path.resolve(path.join(browser.params.testConfig.main.rootPath, acsAvatarFileModel.getLocation())); - const file: any = fs.readFileSync(absolutePath); - await peopleApi.updateAvatarImage('-me-', file); - }; -}); diff --git a/e2e/core/viewer/file-extensions/viewer-component.e2e.ts b/e2e/core/viewer/file-extensions/viewer-component.e2e.ts index 302b798315..a41d344778 100644 --- a/e2e/core/viewer/file-extensions/viewer-component.e2e.ts +++ b/e2e/core/viewer/file-extensions/viewer-component.e2e.ts @@ -17,7 +17,7 @@ import { browser } from 'protractor'; import { - ApiService, + ApiService, LocalStorageUtil, LoginPage, StringUtil, UploadActions, @@ -38,7 +38,7 @@ describe('Viewer', () => { const contentServicesPage = new ContentServicesPage(); const navigationBarPage = new NavigationBarPage(); - const apiService = new ApiService(); + const apiService = new ApiService({ authType: 'ECM', provider: 'ECM' }); const uploadActions = new UploadActions(apiService); const usersActions = new UsersActions(apiService); @@ -57,6 +57,9 @@ describe('Viewer', () => { }); beforeAll(async () => { + await LocalStorageUtil.setStorageItem('providers', 'ECM'); + await LocalStorageUtil.setStorageItem('authType', 'BASIC'); + await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); await usersActions.createUser(acsUser); diff --git a/e2e/core/viewer/info-drawer.component.e2e.ts b/e2e/core/viewer/info-drawer.component.e2e.ts deleted file mode 100644 index 7a4289a8af..0000000000 --- a/e2e/core/viewer/info-drawer.component.e2e.ts +++ /dev/null @@ -1,103 +0,0 @@ -/*! - * @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 } from 'protractor'; -import { - ApiService, - LoginPage, - StringUtil, - UploadActions, - UserModel, - UsersActions, - ViewerPage -} from '@alfresco/adf-testing'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { FileModel } from '../../models/ACS/file.model'; -import CONSTANTS = require('../../util/constants'); - -describe('Info Drawer', () => { - - const viewerPage = new ViewerPage(); - const navigationBarPage = new NavigationBarPage(); - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - - const apiService = new ApiService(); - const usersActions = new UsersActions(apiService); - const uploadActions = new UploadActions(apiService); - let site; - const acsUser = new UserModel(); - let pngFileUploaded; - - const pngFileInfo = new FileModel({ - 'name': browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name, - 'location': browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path - }); - - beforeAll(async () => { - await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); - await usersActions.createUser(acsUser); - - site = await apiService.getInstance().core.sitesApi.createSite({ - title: StringUtil.generateRandomString(8), - visibility: 'PUBLIC' - }); - - await apiService.getInstance().core.sitesApi.addSiteMember(site.entry.id, { - id: acsUser.email, - role: CONSTANTS.CS_USER_ROLES.MANAGER - }); - - await apiService.getInstance().login(acsUser.email, acsUser.password); - - pngFileUploaded = await uploadActions.uploadFile(pngFileInfo.location, pngFileInfo.name, site.entry.guid); - }); - - afterAll(async () => { - await apiService.getInstance().login(acsUser.email, acsUser.password); - await uploadActions.deleteFileOrFolder(pngFileUploaded.entry.id); - await apiService.getInstance().core.sitesApi.deleteSite(site.entry.id, { permanent: true }); - }); - - beforeEach(async() => { - await loginPage.login(acsUser.email, acsUser.password); - - await navigationBarPage.goToSite(site); - await contentServicesPage.checkAcsContainer(); - }); - - it('[C277251] Should display the icon when the icon property is defined', async () => { - await viewerPage.viewFile(pngFileUploaded.entry.name); - await viewerPage.clickLeftSidebarButton(); - await viewerPage.enableShowTabWithIcon(); - await viewerPage.enableShowTabWithIconAndLabel(); - await viewerPage.checkTabHasNoIcon(0); - await expect(await viewerPage.getTabIconById(1)).toBe('face'); - await expect(await viewerPage.getTabIconById(2)).toBe('comment'); - }); - - it('[C277252] Should display the label when the label property is defined', async () => { - await viewerPage.viewFile(pngFileUploaded.entry.name); - await viewerPage.clickLeftSidebarButton(); - await viewerPage.enableShowTabWithIcon(); - await viewerPage.enableShowTabWithIconAndLabel(); - await expect(await viewerPage.getTabLabelById(0)).toBe('SETTINGS'); - await viewerPage.checkTabHasNoLabel(1); - await expect(await viewerPage.getTabLabelById(2)).toBe('COMMENTS'); - }); -}); 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 3dc5b0e8c1..766799d9ec 100644 --- a/e2e/process-services-cloud/pages/tasks-cloud-demo.page.ts +++ b/e2e/process-services-cloud/pages/tasks-cloud-demo.page.ts @@ -40,9 +40,9 @@ export class TasksCloudDemoPage { selectedRows = element(by.xpath("//div[text()=' Selected Rows: ']")); noOfSelectedRows = element.all(by.xpath("//div[text()=' Selected Rows: ']//li")); addActionTitle = element(by.cssContainingText('.mat-card-title', 'Add Action')); - keyInputField = element(by.css('input[placeholder="Key"]')); - titleInputField = element(by.css('input[placeholder="Title"]')); - iconInputField = element(by.css('input[placeholder="Icon"]')); + keyInputField = element(by.css('input[data-placeholder="Key"]')); + titleInputField = element(by.css('input[data-placeholder="Title"]')); + iconInputField = element(by.css('input[data-placeholder="Icon"]')); addActionButton = element(by.cssContainingText('button span', 'Add')); disableCheckbox = element(by.css(`mat-checkbox[formcontrolname='disabled']`)); visibleCheckbox = element(by.css(`mat-checkbox[formcontrolname='visible']`)); diff --git a/e2e/process-services-cloud/process-list-cloud-action-menu.e2e.ts b/e2e/process-services-cloud/process-list-cloud-action-menu.e2e.ts index c664f0b8c8..7ab3ecc83b 100644 --- a/e2e/process-services-cloud/process-list-cloud-action-menu.e2e.ts +++ b/e2e/process-services-cloud/process-list-cloud-action-menu.e2e.ts @@ -52,34 +52,27 @@ describe('Process list cloud', () => { let testUser, groupInfo, editProcess, deleteProcess; beforeAll(async () => { - await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password); + await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password); - testUser = await identityService.createIdentityUserWithRole( [identityService.ROLES.ACTIVITI_USER]); - groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr'); - await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id); + 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); - const processDefinition = await processDefinitionService + await apiService.login(testUser.email, testUser.password); + const processDefinition = await processDefinitionService .getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.simpleProcess, simpleApp); - editProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp, { + editProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp, { 'name': StringUtil.generateRandomString(), 'businessKey': StringUtil.generateRandomString() }); - deleteProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp, { + deleteProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp, { 'name': StringUtil.generateRandomString(), 'businessKey': StringUtil.generateRandomString() }); - await loginSSOPage.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); - }); - - beforeAll(async () => { await navigationBarPage.navigateToProcessServicesCloudPage(); await appListCloudComponent.checkApsContainer(); await appListCloudComponent.goToApp(simpleApp); @@ -101,6 +94,11 @@ describe('Process list cloud', () => { await processCloudDemoPage.processFilterCloudComponent.clickRunningProcessesFilter(); }); + afterAll(async () => { + await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password); + await identityService.deleteIdentityUser(testUser.idIdentityService); + }); + it('[C315236] Should be able to see and execute custom action menu', async () => { await processCloudDemoPage.editProcessFilterCloudComponent().openFilter(); await processCloudDemoPage.editProcessFilterCloudComponent().setProcessName(editProcess.entry.name); diff --git a/e2e/process-services/comment-component-tasks.e2e.ts b/e2e/process-services/comment-component-tasks.e2e.ts index 4ab7665fac..7b7dfe1a5f 100644 --- a/e2e/process-services/comment-component-tasks.e2e.ts +++ b/e2e/process-services/comment-component-tasks.e2e.ts @@ -116,6 +116,7 @@ describe('Comment component for Processes', () => { await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/); await expect(await commentsPage.getTime(1)).toMatch(/(ago|few)/); + await navigationBarPage.clickLogoutButton(); await loginPage.login(secondUser.email, secondUser.password); await apiService.getInstance().activiti.taskApi.addTaskComment(thirdTaskComment, newTaskId); diff --git a/e2e/process-services/custom-process-filters-sorting.e2e.ts b/e2e/process-services/custom-process-filters-sorting.e2e.ts index 343c8ffc76..273ae4f61a 100644 --- a/e2e/process-services/custom-process-filters-sorting.e2e.ts +++ b/e2e/process-services/custom-process-filters-sorting.e2e.ts @@ -70,7 +70,9 @@ describe('Sorting for process filters', () => { await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId); - }); + + await navigationBarPage.clickLogoutButton(); + }); it('[C260476] Should be able to create a filter on APS for running processes - Oldest first and check on ADF', async () => { await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({ diff --git a/e2e/process-services/custom-tasks-filters.e2e.ts b/e2e/process-services/custom-tasks-filters.e2e.ts index 51b92ff3ba..bcf5e4b15d 100644 --- a/e2e/process-services/custom-tasks-filters.e2e.ts +++ b/e2e/process-services/custom-tasks-filters.e2e.ts @@ -144,7 +144,7 @@ describe('Start Task - Custom App', () => { it('[C286367] 20 Items per page', async () => { await taskListSinglePage.typeItemsPerPage(itemsPerPage.twentyValue); - await taskListSinglePage.taskList().getDataTable().waitForTableBody(); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty); await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfTasks + ' of ' + nrOfTasks); await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(nrOfTasks); @@ -158,7 +158,7 @@ describe('Start Task - Custom App', () => { it('[C286365] 5 Items per page', async () => { await taskListSinglePage.typeItemsPerPage(itemsPerPage.fiveValue); - await taskListSinglePage.taskList().getDataTable().waitForTableBody(); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks); await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue); @@ -170,7 +170,7 @@ describe('Start Task - Custom App', () => { await paginationPage.clickOnNextPage(); currentPage++; - await taskListSinglePage.taskList().getDataTable().waitForTableBody(); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks); await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue); @@ -181,7 +181,7 @@ describe('Start Task - Custom App', () => { await paginationPage.clickOnNextPage(); currentPage++; - await taskListSinglePage.taskList().getDataTable().waitForTableBody(); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks); await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue); @@ -192,7 +192,7 @@ describe('Start Task - Custom App', () => { await paginationPage.clickOnNextPage(); currentPage++; - await taskListSinglePage.taskList().getDataTable().waitForTableBody(); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks); await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue); @@ -204,7 +204,7 @@ describe('Start Task - Custom App', () => { it('[C286364] 10 Items per page', async () => { currentPage = 1; await taskListSinglePage.typeItemsPerPage(itemsPerPage.tenValue); - await taskListSinglePage.taskList().getDataTable().waitForTableBody(); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten); await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks); await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue); @@ -213,7 +213,7 @@ describe('Start Task - Custom App', () => { }); await paginationPage.clickOnNextPage(); currentPage++; - await taskListSinglePage.taskList().getDataTable().waitForTableBody(); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten); await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks); await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue); @@ -225,7 +225,7 @@ describe('Start Task - Custom App', () => { it('[C286363] 15 Items per page', async () => { currentPage = 1; await taskListSinglePage.typeItemsPerPage(itemsPerPage.fifteenValue); - await taskListSinglePage.taskList().getDataTable().waitForTableBody(); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen); await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + nrOfTasks); await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fifteenValue); @@ -234,7 +234,7 @@ describe('Start Task - Custom App', () => { }); currentPage++; await paginationPage.clickOnNextPage(); - await taskListSinglePage.taskList().getDataTable().waitForTableBody(); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen); await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfTasks + ' of ' + nrOfTasks); await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(nrOfTasks - itemsPerPage.fifteenValue); @@ -260,7 +260,7 @@ describe('Start Task - Custom App', () => { currentPage = 1; await taskListSinglePage.typeItemsPerPage(itemsPerPage.fiveValue); await taskListSinglePage.typePage(currentPage); - await taskListSinglePage.taskList().getDataTable().waitForTableBody(); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage); await expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages); await paginationPage.checkPageSelectorIsDisplayed(); @@ -271,7 +271,7 @@ describe('Start Task - Custom App', () => { currentPage++; await taskListSinglePage.typePage(currentPage); - await taskListSinglePage.taskList().getDataTable().waitForTableBody(); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage); await expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages); await paginationPage.checkPageSelectorIsDisplayed(); @@ -282,7 +282,7 @@ describe('Start Task - Custom App', () => { currentPage++; await taskListSinglePage.typePage(currentPage); - await taskListSinglePage.taskList().getDataTable().waitForTableBody(); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage); await expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages); await paginationPage.checkPageSelectorIsDisplayed(); @@ -293,7 +293,7 @@ describe('Start Task - Custom App', () => { currentPage++; await taskListSinglePage.typePage(currentPage); - await taskListSinglePage.taskList().getDataTable().waitForTableBody(); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage); await expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages); await paginationPage.checkPageSelectorIsDisplayed(); @@ -315,7 +315,7 @@ describe('Start Task - Custom App', () => { it('[C286413] Task is displayed when typing into dueAfter field a date before the tasks due date', async () => { await taskListSinglePage.typeDueAfter(beforeDate); - await taskListSinglePage.taskList().checkContentIsDisplayed(paginationTasksName[0]); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1); }); @@ -336,7 +336,7 @@ describe('Start Task - Custom App', () => { it('[C286425] Task is displayed when typing into dueBefore field a date after the task due date', async () => { await taskListSinglePage.typeDueBefore(afterDate); - await taskListSinglePage.taskList().checkContentIsDisplayed(paginationTasksName[0]); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1); }); @@ -354,7 +354,7 @@ describe('Start Task - Custom App', () => { it('[C286427] Task is displayed when typing into dueAfter field a date before the tasks due date and into dueBefore a date after', async () => { await taskListSinglePage.typeDueBefore(afterDate); await taskListSinglePage.typeDueAfter(beforeDate); - await taskListSinglePage.taskList().checkContentIsDisplayed(paginationTasksName[0]); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1); }); @@ -362,6 +362,7 @@ describe('Start Task - Custom App', () => { await taskListSinglePage.typeDueBefore(afterDate); await taskListSinglePage.typeDueAfter(afterDate); await taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed(); + await expect(await taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage); }); it('[C280515] Should be able to see only the tasks of a specific app when typing the apps id in the appId field', async () => { @@ -397,6 +398,7 @@ describe('Start Task - Custom App', () => { it('[C280629] Should be able to see only the task with specific taskId when typing it in the task Id field', async () => { await taskListSinglePage.typeTaskId(taskWithDueDate.id); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await taskListSinglePage.getTaskId()).toEqual(taskWithDueDate.id); await taskListSinglePage.taskList().checkContentIsDisplayed(taskWithDueDate.name); @@ -405,6 +407,7 @@ describe('Start Task - Custom App', () => { it('[C280630] Should be able to see No tasks found when typing an invalid taskId', async () => { await taskListSinglePage.typeTaskId(invalidTaskId); + await expect(await taskListSinglePage.getTaskId()).toEqual(invalidTaskId); await expect(await taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage); @@ -412,6 +415,7 @@ describe('Start Task - Custom App', () => { it('[C286589] Should be able to see only completed tasks when choosing Completed from state drop down', async () => { await taskListSinglePage.selectState('Completed'); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[0].name); await taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[1].name); @@ -421,6 +425,7 @@ describe('Start Task - Custom App', () => { it('[C286597] Should be able to see only running tasks when choosing Active from state drop down', async () => { await taskListSinglePage.selectState('Active'); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await taskListSinglePage.taskList().checkContentIsNotDisplayed(completedTasks[0].name); await taskListSinglePage.taskList().checkContentIsNotDisplayed(completedTasks[1].name); @@ -433,6 +438,7 @@ describe('Start Task - Custom App', () => { it('[C286598] Should be able to see all tasks when choosing All from state drop down', async () => { await taskListSinglePage.selectState('All'); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[0].name); await taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[1].name); @@ -452,7 +458,7 @@ describe('Start Task - Custom App', () => { await taskListSinglePage.clickResetButton(); await taskListSinglePage.typeProcessDefinitionId(processDefinitionId.processDefinitionId); - + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(4); await taskListSinglePage.getAllProcessDefinitionIds().then(async (list) => { await expect(ArrayUtil.arrayContainsArray(list, processDefinitionIds)).toEqual(true); @@ -475,6 +481,7 @@ describe('Start Task - Custom App', () => { await taskListSinglePage.clickResetButton(); await taskListSinglePage.typeProcessInstanceId(processDefinitionId.id); + await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded(); await expect(await taskListSinglePage.getProcessInstanceId()).toEqual(processDefinitionId.id); await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1); diff --git a/e2e/process-services/dynamic-table-date-picker.e2e.ts b/e2e/process-services/dynamic-table-date-picker.e2e.ts index e9e64a0c3f..d6c71a8ccf 100644 --- a/e2e/process-services/dynamic-table-date-picker.e2e.ts +++ b/e2e/process-services/dynamic-table-date-picker.e2e.ts @@ -78,6 +78,7 @@ describe('Dynamic Table', () => { afterAll(async () => { await apiService.getInstance().login(user.email, user.password); await apiService.getInstance().activiti.modelsApi.deleteModel(appId); + await navigationBarPage.clickLogoutButton(); }); beforeEach(async () => { diff --git a/e2e/process-services/empty-process-list-component.e2e.ts b/e2e/process-services/empty-process-list-component.e2e.ts index 13c18f3763..55f0d2c7c7 100644 --- a/e2e/process-services/empty-process-list-component.e2e.ts +++ b/e2e/process-services/empty-process-list-component.e2e.ts @@ -65,8 +65,10 @@ describe('Empty Process List Test', () => { await processFiltersPage.clickCreateProcessButton(); await processFiltersPage.clickNewProcessDropdown(); + await processFiltersPage.checkStartProcessIsDisplay(); await startProcessPage.selectFromProcessDropdown(appWithProcess.process_wse_name); await startProcessPage.clickStartProcessButton(); + await expect(await processFiltersPage.numberOfProcessRows()).toEqual(1); await processDetailsPage.checkProcessDetailsCard(); @@ -78,6 +80,7 @@ describe('Empty Process List Test', () => { await processFiltersPage.clickCreateProcessButton(); await processFiltersPage.clickNewProcessDropdown(); + await processFiltersPage.checkStartProcessIsDisplay(); await startProcessPage.selectFromProcessDropdown(simpleAppWithUserForm.processName); await startProcessPage.clickStartProcessButton(); diff --git a/e2e/process-services/form-widgets-component.e2e.ts b/e2e/process-services/form-widgets-component.e2e.ts index 1f89ec4ce3..dc8160bfb4 100644 --- a/e2e/process-services/form-widgets-component.e2e.ts +++ b/e2e/process-services/form-widgets-component.e2e.ts @@ -18,7 +18,6 @@ import { ApiService, ApplicationsUtil, - BrowserActions, LoginPage, ProcessUtil, UsersActions, @@ -44,12 +43,12 @@ describe('Form widgets', () => { const newTask = 'First task'; let processUserModel; - let appModel; + let appModelWidget; describe('Form widgets', () => { - const app = browser.params.resources.Files.WIDGETS_SMOKE_TEST; - const appFields = app.form_fields; + const appWidget = browser.params.resources.Files.WIDGETS_SMOKE_TEST; + const appFields = appWidget.form_fields; beforeAll(async () => { await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); @@ -58,17 +57,17 @@ describe('Form widgets', () => { await apiService.getInstance().login(processUserModel.email, processUserModel.password); - appModel = await applicationsService.importPublishDeployApp(app.file_path); + appModelWidget = await applicationsService.importPublishDeployApp(appWidget.file_path); await loginPage.login(processUserModel.email, processUserModel.password); - await (await new NavigationBarPage().navigateToProcessServicesPage()).goToApp(appModel.name); + await (await new NavigationBarPage().navigateToProcessServicesPage()).goToApp(appModelWidget.name); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); const task = await taskPage.createNewTask(); await task.addName(newTask); await task.addDescription('Description'); - await task.selectForm(app.formName); + await task.selectForm(appWidget.formName); await task.clickStartButton(); await taskPage.tasksListPage().checkContentIsDisplayed(newTask); @@ -83,9 +82,11 @@ describe('Form widgets', () => { }); afterAll(async () => { + await new NavigationBarPage().clickLogoutButton(); await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId); + await apiService.getInstance().logout(); }); it('[C272778] Should display text and multi-line in form', async () => { @@ -193,8 +194,9 @@ describe('Form widgets', () => { describe('with fields involving other people', () => { const app = browser.params.resources.Files.FORM_ADF; - let deployedApp, process; + let process; const appFields = app.form_fields; + let appModel; beforeAll(async () => { await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); @@ -204,18 +206,14 @@ describe('Form widgets', () => { await apiService.getInstance().login(processUserModel.email, processUserModel.password); appModel = await applicationsService.importPublishDeployApp(app.file_path); - const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions(); - deployedApp = appDefinitions.data.find((currentApp) => { - return currentApp.modelId === appModel.id; - }); const processUtil = new ProcessUtil(apiService); process = await processUtil.startProcessOfApp(appModel.name); await loginPage.login(processUserModel.email, processUserModel.password); }); beforeEach(async () => { - const urlToNavigateTo = `${browser.baseUrl}/activiti/apps/${deployedApp.id}/tasks/`; - await BrowserActions.getUrl(urlToNavigateTo); + await (await new NavigationBarPage().navigateToProcessServicesPage()).goToApp(appModel.name); + await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.formFields().checkFormIsDisplayed(); }); diff --git a/e2e/process-services/info-drawer.e2e.ts b/e2e/process-services/info-drawer.e2e.ts index c426412433..0c7b79ca9c 100644 --- a/e2e/process-services/info-drawer.e2e.ts +++ b/e2e/process-services/info-drawer.e2e.ts @@ -39,7 +39,6 @@ import moment = require('moment'); describe('Info Drawer', () => { const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; - const loginPage = new LoginPage(); const navigationBarPage = new NavigationBarPage(); const taskPage = new TasksPage(); @@ -138,8 +137,12 @@ describe('Info Drawer', () => { await taskPage.checkTaskTitle(name); await expect(await taskPage.taskDetails().getPriority()).toEqual(taskDetails.priority); await taskPage.taskDetails().updatePriority('40'); + await taskPage.taskDetails().checkTaskDetailsDisplayed(); + await browser.sleep(2000); await expect(await taskPage.taskDetails().getPriority()).toEqual('40'); await taskPage.taskDetails().updatePriority(); + await taskPage.taskDetails().checkTaskDetailsDisplayed(); + await browser.sleep(2000); await expect(await taskPage.taskDetails().getPriority()).toEqual('0'); await taskPage.taskDetails().clickCompleteFormTask(); @@ -254,10 +257,12 @@ describe('Info Drawer', () => { await taskPage.tasksListPage().checkTaskListIsLoaded(); await taskPage.tasksListPage().getDataTable().waitForTableBody(); await taskPage.tasksListPage().checkContentIsNotDisplayed(app.taskName); + await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS); await taskPage.tasksListPage().checkTaskListIsLoaded(); - await taskPage.tasksListPage().getDataTable().waitForTableBody(); + await taskPage.taskDetails().checkTaskDetailsDisplayed(); + await browser.sleep(2000); await shouldHaveInfoDrawerDetails({ ...taskDetails, dueDate: date.header, @@ -277,10 +282,13 @@ describe('Info Drawer', () => { await taskPage.tasksListPage().checkTaskListIsLoaded(); await taskPage.tasksListPage().getDataTable().waitForTableBody(); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS); + await taskPage.tasksListPage().checkContentIsDisplayed(app.taskName); await taskPage.tasksListPage().selectRow(app.taskName); await taskPage.checkTaskTitle(app.taskName); + await taskPage.taskDetails().checkTaskDetailsDisplayed(); + await browser.sleep(2000); await shouldHaveInfoDrawerDetails({ ...taskDetails, dueDate: 'No date', @@ -303,6 +311,8 @@ describe('Info Drawer', () => { await taskPage.tasksListPage().selectRow(name); await taskPage.checkTaskTitle(name); + await taskPage.taskDetails().checkTaskDetailsDisplayed(); + await browser.sleep(2000); await expect(await taskPage.taskDetails().isAssigneeClickable()).toBeTruthy(); await shouldHaveInfoDrawerDetails({ ...taskDetails, diff --git a/e2e/process-services/pages/attachment-list.page.ts b/e2e/process-services/pages/attachment-list.page.ts index 3141c0c62f..ce682f9e94 100644 --- a/e2e/process-services/pages/attachment-list.page.ts +++ b/e2e/process-services/pages/attachment-list.page.ts @@ -17,7 +17,6 @@ import { element, by, protractor, browser } from 'protractor'; import * as path from 'path'; -import * as remote from 'selenium-webdriver/remote'; import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; export class AttachmentListPage { @@ -34,8 +33,6 @@ export class AttachmentListPage { } async clickAttachFileButton(fileLocation: string): Promise { - browser.setFileDetector(new remote.FileDetector()); - 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/dialog/create-checklist-dialog.page.ts b/e2e/process-services/pages/dialog/create-checklist-dialog.page.ts index ac3c0a7db0..1013c4b8cb 100644 --- a/e2e/process-services/pages/dialog/create-checklist-dialog.page.ts +++ b/e2e/process-services/pages/dialog/create-checklist-dialog.page.ts @@ -43,7 +43,7 @@ export class ChecklistDialog { async getNameFieldPlaceholder(): Promise { await BrowserVisibility.waitUntilElementIsVisible(this.nameField); - return this.nameField.getAttribute('placeholder'); + return this.nameField.getAttribute('data-placeholder'); } async checkCancelButtonIsEnabled(): Promise { diff --git a/e2e/process-services/pages/dialog/start-task-dialog.page.ts b/e2e/process-services/pages/dialog/start-task-dialog.page.ts index bc6aaede58..03e0e80978 100644 --- a/e2e/process-services/pages/dialog/start-task-dialog.page.ts +++ b/e2e/process-services/pages/dialog/start-task-dialog.page.ts @@ -59,7 +59,7 @@ export class StartTaskDialogPage { async getAssignee(): Promise { await BrowserVisibility.waitUntilElementIsVisible(this.assignee); - return this.assignee.getAttribute('placeholder'); + return this.assignee.getAttribute('data-placeholder'); } async selectForm(form): Promise { diff --git a/e2e/process-services/pages/filters.page.ts b/e2e/process-services/pages/filters.page.ts index 4b38ebf646..11df766eb2 100644 --- a/e2e/process-services/pages/filters.page.ts +++ b/e2e/process-services/pages/filters.page.ts @@ -29,7 +29,8 @@ export class FiltersPage { async goToFilter(filterName): Promise { await BrowserActions.closeMenuAndDialogs(); - await BrowserActions.clickExecuteScript(`[data-automation-id="${filterName}_filter"]`); + const filter = element(by.css(`button[data-automation-id="${filterName}_filter"]`)); + await BrowserActions.click(filter); } 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 bcda1a046e..30a71f3561 100644 --- a/e2e/process-services/pages/process-filters.page.ts +++ b/e2e/process-services/pages/process-filters.page.ts @@ -16,7 +16,7 @@ */ import { BrowserActions, BrowserVisibility, DataTableComponentPage, StartProcessPage } from '@alfresco/adf-testing'; -import { by, element } from 'protractor'; +import { Locator, by, element } from 'protractor'; export class ProcessFiltersPage { @@ -30,10 +30,11 @@ export class ProcessFiltersPage { accordionMenu = element(by.css('.app-processes-menu mat-accordion')); buttonWindow = element(by.css('div > button[data-automation-id="btn-start-process"] > div')); noContentMessage = element.all(by.css('.adf-empty-content__title')).first(); - rows = by.css('adf-process-instance-list .adf-datatable-body adf-datatable-row[class*="adf-datatable-row"]'); + rows: Locator = by.css('adf-process-instance-list .adf-datatable-body adf-datatable-row[class*="adf-datatable-row"]'); tableBody = element.all(by.css('adf-datatable .adf-datatable-body')).first(); - nameColumn = by.css('div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"] div[title="Name"] span'); - processIcon = by.css('adf-icon[data-automation-id="adf-filter-icon"]'); + nameColumn: Locator = by.css('div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"] div[title="Name"] span'); + processIcon: Locator = by.css('adf-icon[data-automation-id="adf-filter-icon"]'); + startProcessEl = element(by.css('adf-start-process .adf-start-process')); async startProcess(): Promise { await this.clickCreateProcessButton(); @@ -67,6 +68,10 @@ export class ProcessFiltersPage { await BrowserActions.click(this.newProcessButton); } + async checkStartProcessIsDisplay(): Promise { + await BrowserVisibility.waitUntilElementIsVisible(this.startProcessEl); + } + async checkNoContentMessage(): Promise { await BrowserVisibility.waitUntilElementIsVisible(this.noContentMessage); } @@ -83,6 +88,7 @@ export class ProcessFiltersPage { } async numberOfProcessRows(): Promise { + await BrowserVisibility.waitUntilElementIsVisible(element.all(this.rows).first()); return element.all(this.rows).count(); } diff --git a/e2e/process-services/pages/process-services.page.ts b/e2e/process-services/pages/process-services.page.ts index 17a5dee1d8..123b0d065e 100644 --- a/e2e/process-services/pages/process-services.page.ts +++ b/e2e/process-services/pages/process-services.page.ts @@ -17,15 +17,15 @@ import { ProcessServiceTabBarPage } from './process-service-tab-bar.page'; -import { element, by } from 'protractor'; +import { Locator, element, by } from 'protractor'; import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; export class ProcessServicesPage { apsAppsContainer = element(by.css('.adf-app-listgrid')); taskApp = element(by.css('mat-card[title="Task App"]')); - iconTypeLocator = by.css('mat-icon[class*="card-logo-icon"]'); - descriptionLocator = by.css('mat-card-subtitle[class*="subtitle"]'); + iconTypeLocator: Locator = by.css('mat-icon[class*="card-logo-icon"]'); + descriptionLocator: Locator = by.css('mat-card-subtitle[class*="subtitle"]'); async checkApsContainer(): Promise { await BrowserVisibility.waitUntilElementIsVisible(this.apsAppsContainer); diff --git a/e2e/process-services/pages/task-details.page.ts b/e2e/process-services/pages/task-details.page.ts index fbf7e41c04..3bcf76605c 100644 --- a/e2e/process-services/pages/task-details.page.ts +++ b/e2e/process-services/pages/task-details.page.ts @@ -16,7 +16,7 @@ */ import { BrowserActions, BrowserVisibility, DropdownPage, TabsPage } from '@alfresco/adf-testing'; -import { browser, by, element, Key } from 'protractor'; +import { Locator, browser, by, element, Key } from 'protractor'; import { AppSettingsTogglesPage } from './dialog/app-settings-toggles.page'; export class TaskDetailsPage { @@ -24,6 +24,7 @@ export class TaskDetailsPage { appSettingsTogglesClass = new AppSettingsTogglesPage(); formContent = element(by.css('adf-form')); + formNameField = element(by.css('[data-automation-id="card-textitem-value-formName"]')); formNameButton = element(by.css('[data-automation-id="card-textitem-toggle-formName"]')); assigneeField = element(by.css('[data-automation-id="card-textitem-value-assignee"]')); @@ -43,8 +44,8 @@ export class TaskDetailsPage { addCommentButton = element(by.css('[data-automation-id="comments-input-add"]')); involvePeopleButton = element(by.css('div[class*="add-people"]')); addPeopleField = element(by.css('input[data-automation-id="adf-people-search-input"]')); - addInvolvedUserButton = element(by.css('button[id="add-people"] span')); - emailInvolvedUser = by.xpath('following-sibling::div[@class="adf-people-email"]'); + addInvolvedUserButton = element(by.css('button[id="add-people"]')); + emailInvolvedUser: Locator = by.css('[data-automation-id="adf-people-email"]'); taskDetailsInfoDrawer = element(by.tagName('adf-info-drawer')); taskDetailsSection = element(by.css('div[data-automation-id="app-tasks-details"]')); taskDetailsEmptySection = element(by.css('div[data-automation-id="adf-tasks-details--empty"]')); @@ -110,24 +111,17 @@ export class TaskDetailsPage { await this.attachFormDropdown.selectDropdownOption(option); } - async checkCancelAttachFormIsDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.cancelAttachForm); - } - async noFormIsDisplayed(): Promise { await BrowserVisibility.waitUntilElementIsNotVisible(this.formContent); } - async clickCancelAttachForm(): Promise { - await BrowserActions.click(this.cancelAttachForm); - } - async checkRemoveAttachFormIsDisplayed() { await BrowserVisibility.waitUntilElementIsVisible(this.removeAttachForm); } async clickRemoveAttachForm(): Promise { await BrowserActions.click(this.removeAttachForm); + await browser.sleep(2000); } async checkAttachFormButtonIsDisplayed(): Promise { @@ -142,9 +136,8 @@ export class TaskDetailsPage { return BrowserActions.click(this.attachFormButton); } - async checkFormIsAttached(formName): Promise { - const attachedFormName = await BrowserActions.getInputValue(this.formNameField); - await expect(attachedFormName).toEqual(formName); + async checkFormIsAttached(formName: string): Promise { + await BrowserVisibility.waitUntilElementHasValue(this.formNameField, formName); } getFormName(): Promise { @@ -210,7 +203,7 @@ export class TaskDetailsPage { async getDescriptionPlaceholder(): Promise { await BrowserVisibility.waitUntilElementIsPresent(this.descriptionField); - return this.descriptionField.getAttribute('placeholder'); + return this.descriptionField.getAttribute('data-placeholder'); } getDueDate(): Promise { @@ -226,11 +219,13 @@ export class TaskDetailsPage { await BrowserActions.clearWithBackSpace(this.priority); await BrowserActions.clearSendKeys(element(by.css('input[data-automation-id="card-textitem-value-priority"]')), priority ? priority : ' '); await this.priority.sendKeys(Key.TAB); + await browser.sleep(1000); } async updateDueDate(): Promise { await BrowserActions.click(this.dueDateField); await BrowserActions.click(element.all(by.css('.mat-datetimepicker-calendar-body-cell')).first()); + await browser.sleep(1000); } async updateDescription(description?: string): Promise { @@ -238,12 +233,16 @@ export class TaskDetailsPage { await BrowserActions.clearWithBackSpace(this.descriptionField); await BrowserActions.clearSendKeys(element(by.css('[data-automation-id="card-textitem-value-description"]')), description ? description : ''); await this.descriptionField.sendKeys(Key.TAB); + await browser.sleep(1000); } async updateAssignee(fullName: string): Promise { await BrowserActions.click(this.assigneeButton); await BrowserActions.clearSendKeys(element(by.css('[id="userSearchText"]')), fullName); await BrowserActions.click(element(by.cssContainingText('.adf-people-full-name', fullName))); + await BrowserVisibility.waitUntilElementIsVisible(element(by.css(`adf-datatable-row[class*='is-selected']`))); + + await browser.sleep(2000); await BrowserActions.click(element(by.css('button[id="add-people"]'))); } @@ -293,7 +292,7 @@ export class TaskDetailsPage { } async checkUserIsSelected(user: string): Promise { - const row = element(by.cssContainingText('div[class*="search-list-container"] div[class*="people-full-name"]', user)); + const row = this.getRowsUser(user); await BrowserVisibility.waitUntilElementIsVisible(row); } @@ -302,7 +301,7 @@ export class TaskDetailsPage { } getRowsUser(user: string) { - return element(by.cssContainingText('div[class*="people-full-name"]', user)); + return element(by.css(`div[data-automation-id="adf-people-full-name-${user.replace(' ', '-')}"]`)); } async removeInvolvedUser(user): Promise { @@ -349,7 +348,7 @@ export class TaskDetailsPage { async getInvolvePeoplePlaceholder(): Promise { await BrowserVisibility.waitUntilElementIsVisible(this.addPeopleField); - return this.addPeopleField.getAttribute('placeholder'); + return this.addPeopleField.getAttribute('data-placeholder'); } async checkCancelButtonIsEnabled(): Promise { @@ -408,7 +407,7 @@ export class TaskDetailsPage { } async clickCompleteFormTask(): Promise { - await BrowserActions.clickScript(this.completeFormTask); + await BrowserActions.click(this.completeFormTask); } async getEmptyTaskDetailsMessage(): Promise { diff --git a/e2e/process-services/pages/task-filters.page.ts b/e2e/process-services/pages/task-filters.page.ts index 020c0238ca..1a1d96d6ef 100644 --- a/e2e/process-services/pages/task-filters.page.ts +++ b/e2e/process-services/pages/task-filters.page.ts @@ -15,13 +15,13 @@ * limitations under the License. */ -import { by, ElementFinder } from 'protractor'; +import { Locator, by, ElementFinder } from 'protractor'; import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; export class TaskFiltersPage { filter; - taskIcon = by.css('adf-icon[data-automation-id="adf-filter-icon"]'); + taskIcon: Locator = by.css('adf-icon[data-automation-id="adf-filter-icon"]'); constructor(filter: ElementFinder) { this.filter = filter; diff --git a/e2e/process-services/pages/tasks-list.page.ts b/e2e/process-services/pages/tasks-list.page.ts index e79f814010..fb33eb6cad 100644 --- a/e2e/process-services/pages/tasks-list.page.ts +++ b/e2e/process-services/pages/tasks-list.page.ts @@ -16,7 +16,7 @@ */ import { BrowserActions, BrowserVisibility, DataTableComponentPage } from '@alfresco/adf-testing'; -import { by, element } from 'protractor'; +import { browser, by, element } from 'protractor'; export class TasksListPage { @@ -46,6 +46,7 @@ export class TasksListPage { async selectRow(taskName: string): Promise { await this.dataTable.selectRow('Name', taskName); + await browser.sleep(1000); } getAllRowsNameColumn(): Promise { diff --git a/e2e/process-services/pages/tasks.page.ts b/e2e/process-services/pages/tasks.page.ts index ba933f4cd6..e140aca0e2 100644 --- a/e2e/process-services/pages/tasks.page.ts +++ b/e2e/process-services/pages/tasks.page.ts @@ -21,7 +21,7 @@ import { TaskDetailsPage } from './task-details.page'; import { FiltersPage } from './filters.page'; import { ChecklistDialog } from './dialog/create-checklist-dialog.page'; import { TasksListPage } from './tasks-list.page'; -import { element, by } from 'protractor'; +import { Locator, element, by } from 'protractor'; import { BrowserVisibility, BrowserActions, FormFields } from '@alfresco/adf-testing'; export class TasksPage { @@ -29,14 +29,14 @@ export class TasksPage { newTaskButton = element(by.css('button[data-automation-id="btn-start-task"]')); addChecklistButton = element(by.css('button[class*="adf-add-to-checklist-button"]')); rowByRowName = by.xpath('ancestor::mat-chip'); - checklistContainer = by.css('div[class*="checklist-menu"]'); + checklistContainer: Locator = by.css('div[class*="checklist-menu"]'); taskTitle = '.adf-activiti-task-details__header span'; - rows = by.css('div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"] div[class*="adf-datatable-cell"]'); + rows: Locator = by.css('div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"] div[class*="adf-datatable-cell"]'); completeButtonNoForm = element(by.id('adf-no-form-complete-button')); checklistDialog = element(by.id('checklist-dialog')); checklistNoMessage = element(by.id('checklist-none-message')); numberOfChecklists = element(by.css('[data-automation-id="checklist-label"] mat-chip')); - sortByName = by.css('div[data-automation-id="auto_id_name"]'); + sortByName: Locator = by.css('div[data-automation-id="auto_id_name"]'); async createNewTask(): Promise { await this.clickOnCreateButton(); diff --git a/e2e/process-services/people-component.e2e.ts b/e2e/process-services/people-component.e2e.ts index 95e9d01ab4..27b8861dbb 100644 --- a/e2e/process-services/people-component.e2e.ts +++ b/e2e/process-services/people-component.e2e.ts @@ -71,6 +71,10 @@ describe('People component', () => { await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); }); + afterEach(async () => { + await navigationBarPage.clickLogoutButton(); + }); + it('[C279989] Should no people be involved when no user is typed', async () => { await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]); await taskPage.tasksListPage().selectRow(tasks[0]); diff --git a/e2e/process-services/start-process-component.e2e.ts b/e2e/process-services/start-process-component.e2e.ts index a22c4b9b7a..71634069d9 100644 --- a/e2e/process-services/start-process-component.e2e.ts +++ b/e2e/process-services/start-process-component.e2e.ts @@ -18,7 +18,7 @@ import CONSTANTS = require('../util/constants'); import { ApiService, - ApplicationsUtil, + ApplicationsUtil, BrowserActions, FileBrowserUtil, LocalStorageUtil, LoginPage, @@ -81,6 +81,7 @@ describe('Start Process Component', () => { }); describe('Provider: BPM', () => { + beforeAll(async () => { await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); @@ -110,6 +111,10 @@ describe('Start Process Component', () => { await processServicesPage.checkApsContainer(); }); + afterEach(async () => { + await navigationBarPage.clickLogoutButton(); + }); + it('[C260458] Should NOT be able to start a process without process model', async () => { await processServicesPage.goToApp('Task App'); await processServiceTabBarPage.clickProcessButton(); @@ -120,15 +125,17 @@ describe('Start Process Component', () => { }); describe(' Once logged with user with app', () => { - beforeAll(async () => { - await loginPage.login(secondProcUserModel.email, secondProcUserModel.password); - }); beforeEach(async () => { + await loginPage.login(secondProcUserModel.email, secondProcUserModel.password); await navigationBarPage.navigateToProcessServicesPage(); await processServicesPage.checkApsContainer(); }); + afterEach(async () => { + await navigationBarPage.clickLogoutButton(); + }); + it('[C260441] Should display start process form and default name when creating a new process after selecting the process definition', async () => { await processServicesPage.goToApp('Task App'); await processServiceTabBarPage.clickProcessButton(); @@ -373,7 +380,6 @@ describe('Start Process Component', () => { }); it('[C260457] Should display process in Completed when cancelled', async () => { - await loginPage.login(secondProcUserModel.email, secondProcUserModel.password); await navigationBarPage.navigateToProcessServicesPage(); await processServicesPage.checkApsContainer(); await processServicesPage.goToApp(app.title); @@ -494,11 +500,9 @@ describe('Start Process Component', () => { await applicationsService.importPublishDeployApp(startProcessAttachFileApp.file_path); }); - afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - }); - it('[C260490] Should be able to start a Process within ACS', async () => { + await BrowserActions.getUrl(`${browser.baseUrl}/settings`); + await LocalStorageUtil.setStorageItem('providers', 'ALL'); await loginPage.login(processUserModel.email, processUserModel.password); diff --git a/e2e/process-services/start-task-task-app.e2e.ts b/e2e/process-services/start-task-task-app.e2e.ts index 283d585a38..a27e047716 100644 --- a/e2e/process-services/start-task-task-app.e2e.ts +++ b/e2e/process-services/start-task-task-app.e2e.ts @@ -86,6 +86,7 @@ describe('Start Task - Task App', () => { await task.clickStartButton(); await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]); const taskDetails = await taskPage.taskDetails(); + await taskDetails.clickInvolvePeopleButton(); await taskDetails.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName); await taskDetails.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName); diff --git a/e2e/process-services/task-assignee.e2e.ts b/e2e/process-services/task-assignee.e2e.ts index 15dca47713..c494829c74 100644 --- a/e2e/process-services/task-assignee.e2e.ts +++ b/e2e/process-services/task-assignee.e2e.ts @@ -82,6 +82,7 @@ describe('Task Assignee', () => { afterAll(async () => { await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId); + await navigationBarPage.clickLogoutButton(); }); beforeEach(async () => { @@ -214,6 +215,7 @@ describe('Task Assignee', () => { await taskPage.tasksListPage().checkTaskListIsLoaded(); await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.candidateTask); + await navigationBarPage.clickLogoutButton(); await loginPage.login(candidate2.email, candidate2.password); await navigationBarPage.navigateToProcessServicesPage(); await processServicesPage.checkApsContainer(); @@ -225,6 +227,7 @@ describe('Task Assignee', () => { await taskPage.tasksListPage().checkTaskListIsLoaded(); await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.candidateTask); + await navigationBarPage.clickLogoutButton(); await loginPage.login(candidate1.email, candidate1.password); await navigationBarPage.navigateToProcessServicesPage(); await processServicesPage.checkApsContainer(); @@ -253,6 +256,7 @@ describe('Task Assignee', () => { await taskPage.tasksListPage().checkContentIsDisplayed(app.userTasks.candidateTask); await taskPage.taskDetails().checkClaimEnabled(); + await navigationBarPage.clickLogoutButton(); await loginPage.login(candidate2.email, candidate2.password); await navigationBarPage.navigateToProcessServicesPage(); await processServicesPage.checkApsContainer(); diff --git a/e2e/process-services/task-details-form.e2e.ts b/e2e/process-services/task-details-form.e2e.ts index 7653a75f6d..c5489ae09d 100644 --- a/e2e/process-services/task-details-form.e2e.ts +++ b/e2e/process-services/task-details-form.e2e.ts @@ -150,6 +150,7 @@ describe('Task Details - Form', () => { await taskDetailsPage.checkRemoveAttachFormIsDisplayed(); await tasksListPage.selectRow(otherTask.name); + await taskDetailsPage.checkFormIsAttached(otherAttachedForm.name); }); @@ -214,6 +215,7 @@ describe('Task Details - Form', () => { await tasksListPage.checkTaskListIsLoaded(); await tasksListPage.checkContentIsDisplayed(newTask.name); await tasksListPage.selectRow(newTask.name); + await widget.tab().checkTabIsDisplayedByLabel(tab.tabWithFields); await widget.tab().checkTabIsDisplayedByLabel(tab.tabFieldValue); }); diff --git a/e2e/process-services/task-filters-component.e2e.ts b/e2e/process-services/task-filters-component.e2e.ts index 81ebac748c..f11829de60 100644 --- a/e2e/process-services/task-filters-component.e2e.ts +++ b/e2e/process-services/task-filters-component.e2e.ts @@ -65,6 +65,7 @@ describe('Task', () => { await apiService.getInstance().activiti.modelsApi.deleteModel(appId); await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId); + await navigationBarPage.clickLogoutButton(); }); it('[C279967] Should display default filters when an app is deployed', async () => { diff --git a/e2e/process-services/task-list-pagination.e2e.ts b/e2e/process-services/task-list-pagination.e2e.ts index 901b8d6dc8..a4b77c0553 100644 --- a/e2e/process-services/task-list-pagination.e2e.ts +++ b/e2e/process-services/task-list-pagination.e2e.ts @@ -96,13 +96,16 @@ describe('Task List Pagination', () => { await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + nrOfTasks); await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue); + await paginationPage.clickOnNextPage(); currentPage++; + await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks); await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue); await paginationPage.clickOnNextPage(); currentPage++; + await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks); await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue); diff --git a/e2e/process-services/widgets/typeahead-widget.e2e.ts b/e2e/process-services/widgets/typeahead-widget.e2e.ts index dad3ee7662..b37902bafe 100644 --- a/e2e/process-services/widgets/typeahead-widget.e2e.ts +++ b/e2e/process-services/widgets/typeahead-widget.e2e.ts @@ -68,6 +68,7 @@ describe('Typeahead widget', () => { await expect(suggestions.sort()).toEqual(typeaheadWidget.case1.result.sort()); await widget.typeahedWidget().fillTypeaheadField(typeaheadWidget.case2.searchTerm); + await widget.typeahedWidget().checkDropDownListIsDisplayed(); suggestions = await widget.typeahedWidget().getDropDownList(); await expect(suggestions.sort()).toEqual(typeaheadWidget.case2.result); @@ -80,6 +81,9 @@ describe('Typeahead widget', () => { await taskPage.tasksListPage().selectRow(name); await widget.typeahedWidget().checkTypeaheadFieldIsDisplayed(); + + await browser.sleep(1000); + await expect(await widget.typeahedWidget().getFieldValue('1583773306434')).toBe(typeaheadWidget.case2.result[0]); }); }); diff --git a/e2e/protractor.conf.js b/e2e/protractor.conf.js index 4afe50310e..cf9cbfe374 100644 --- a/e2e/protractor.conf.js +++ b/e2e/protractor.conf.js @@ -176,12 +176,14 @@ exports.config = { SELENIUM_PROMISE_MANAGER: false, plugins: [{ - package: 'jasmine2-protractor-utils', - disableScreenshot: false, - screenshotOnExpectFailure: true, - screenshotOnSpecFailure: false, - clearFoldersBeforeTest: true, - screenshotPath: path.resolve(__dirname, 'e2e-output/screenshots/') + package: 'protractor-screenshoter-plugin', + screenshotPath: path.resolve(__dirname, '../e2e-output/'), + screenshotOnExpect: 'failure', + withLogs: true, + writeReportFreq: 'end', + imageToAscii: 'none', + htmlOnExpect: 'none', + htmlOnSpec: 'none' }], onCleanUp(results) { @@ -219,7 +221,7 @@ exports.config = { jasmine.getEnv().addReporter( new SpecReporter({ spec: { - displayStacktrace: true, + displayStacktrace: 'raw', displayDuration: true } }) @@ -239,10 +241,12 @@ exports.config = { await LocalStorageUtil.setStorageItem('providers', browser.params.testConfig.appConfig.provider); await LocalStorageUtil.setStorageItem('baseShareUrl', HOST); + // @ts-ignore + await LocalStorageUtil.setStorageItem('authType', browser.params.testConfig.appConfig.authType); + // @ts-ignore if (browser.params.testConfig.appConfig.authType === 'OAUTH') { - // @ts-ignore - await LocalStorageUtil.setStorageItem('authType', browser.params.testConfig.appConfig.authType); + // @ts-ignore await LocalStorageUtil.setStorageItem('identityHost', browser.params.testConfig.appConfig.identityHost); // @ts-ignore @@ -270,19 +274,19 @@ exports.config = { afterLaunch: async function () { if (SAVE_SCREENSHOT) { - console.log(`Save screenshot failures enabled`); + console.log(`Save screenshot enabled`); let retryCount = 1; if (argv.retry) { retryCount = ++argv.retry; } try { - await uploadScreenshot(retryCount); + await uploadScreenshot(retryCount, (process.env.FOLDER || '')); } catch (error) { console.error('Error saving screenshot', error); } }else{ - console.log(`Save screenshot failures disabled`); + console.log(`Save screenshot disabled`); } return retry.afterLaunch(MAX_RETRIES); diff --git a/e2e/protractor.excludes.json b/e2e/protractor.excludes.json index 595cbb08a3..7d43e283af 100644 --- a/e2e/protractor.excludes.json +++ b/e2e/protractor.excludes.json @@ -2,6 +2,36 @@ "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", "C362242": "Include once ADF starts using ACS 7, https://issues.alfresco.com/jira/browse/ADF-5182", - "C362265": "Include once ADF starts using ACS 7, https://issues.alfresco.com/jira/browse/ADF-5182" + "C362265": "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", + "C277751": "setting problem APS not basic", + "C277752": "setting problem APS not basic", + "C277753": "setting problem APS not basic", + "C260049": "login problem APS not basic", + "C260051": "login problem APS not basic", + "C279932": "login problem APS not basic", + "C279931": "login problem APS not basic", + "C279930": "login problem APS not basic", + "C282010": "Select user or Select form issue", + "C263942": "Select user or Select form issue", + "C263947": "Select user or Select form issue", + "C260383": "Select user or Select form issue", + "C260422": "Select user or Select form issue", + "C212922": "Select user or Select form issue", + "C315268": "Select user or Select form issue", + "C246522": "Select user or Select form issue", + "C299040": "Select user or Select form issue", + "C286516": "Select user or Select form issue", + "C261030": "Select user or Select form issue", + "C280013": "Select user or Select form issue", + "C261031": "Select user or Select form issue", + "C280014": "Select user or Select form issue", + "C279990": "Select user or Select form issue", + "C246534": "Attach file issue", + "C279886": "Attach file issue", + "C291893": "flaky test" } diff --git a/e2e/protractor/save-remote.js b/e2e/protractor/save-remote.js index 79084321ff..2ef0a8a6b6 100644 --- a/e2e/protractor/save-remote.js +++ b/e2e/protractor/save-remote.js @@ -13,65 +13,55 @@ function buildNumber() { return process.env.TRAVIS_BUILD_NUMBER; } -async function uploadScreenshot(retryCount) { - console.log(`Start uploading failures screenshot ${retryCount}`); +async function uploadScreenshot(retryCount, suffixFileName) { + console.log(`Start uploading report ${retryCount}`); - let files = fs.readdirSync(path.join(__dirname, '../e2e-output/screenshots')); + let alfrescoJsApi = new AlfrescoApi({ + provider: 'ECM', + hostEcm: TestConfig.screenshot.url + }); - if (files && files.length > 0) { + await alfrescoJsApi.login(TestConfig.screenshot.username, TestConfig.screenshot.password); - let alfrescoJsApi = new AlfrescoApi({ - provider: 'ECM', - hostEcm: TestConfig.screenshot.url + let folderNode; + + try { + folderNode = await alfrescoJsApi.nodes.addNode('-my-', { + 'name': `retry-${retryCount}`, + 'relativePath': `Builds/${buildNumber()}/`, + 'nodeType': 'cm:folder' + }, {}, { + 'overwrite': true + }); + } catch (error) { + folderNode = await alfrescoJsApi.nodes.getNode('-my-', { + 'relativePath': `Builds/${buildNumber()}/retry-${retryCount}`, + 'nodeType': 'cm:folder' + }, {}, { + 'overwrite': true }); - - await alfrescoJsApi.login(TestConfig.screenshot.username, TestConfig.screenshot.password); - - let folder; - - try { - folder = await alfrescoJsApi.nodes.addNode('-my-', { - 'name': `retry-${retryCount}`, - 'relativePath': `Builds/${buildNumber()}/screenshot`, - 'nodeType': 'cm:folder' - }, {}, { - 'overwrite': true - }); - } catch (error) { - folder = await alfrescoJsApi.nodes.getNode('-my-', { - 'relativePath': `Builds/${buildNumber()}/screenshot/retry-${retryCount}`, - 'nodeType': 'cm:folder' - }, {}, { - 'overwrite': true - }); - } - - for (const fileName of files) { - let pathFile = path.join(__dirname, '../e2e-output/screenshots', fileName); - let file = fs.createReadStream(pathFile); - - let safeFileName = fileName.match(/\[(.*?)\]/); - - if (safeFileName) { - const safeFileNameMatch = `${safeFileName[1]}.png`; - try { - await alfrescoJsApi.upload.uploadFile( - file, - '', - folder.entry.id, - null, - { - 'name': safeFileNameMatch, - 'nodeType': 'cm:content', - 'autoRename': true - } - ); - } catch (error) { - console.log(error); - } - } - } } + + fs.renameSync(path.resolve(__dirname, '../../e2e-output/'), path.resolve(__dirname, `../../e2e-output-${retryCount}/`)) + + const child_process = require("child_process"); + child_process.execSync(` tar -czvf ../e2e-result-${suffixFileName}-${retryCount}.tar .`, { + cwd: path.resolve(__dirname, `../../e2e-output-${retryCount}/`) + }); + + let pathFile = path.join(__dirname, `../../e2e-result-${suffixFileName}-${retryCount}.tar`); + let file = fs.createReadStream(pathFile); + await alfrescoJsApi.upload.uploadFile( + file, + '', + folderNode.entry.id, + null, + { + 'name': `e2e-result-${suffixFileName}-${retryCount}.tar`, + 'nodeType': 'cm:content', + 'autoRename': true + } + ); } module.exports = { diff --git a/e2e/resources/adf/allFileTypes/documents/other/a_eps_file.eps b/e2e/resources/adf/allFileTypes/documents/other/a_eps_file.eps deleted file mode 100644 index b89e9d2bf0..0000000000 Binary files a/e2e/resources/adf/allFileTypes/documents/other/a_eps_file.eps and /dev/null differ diff --git a/e2e/resources/adf/allFileTypes/documents/other/a_png_file.png b/e2e/resources/adf/allFileTypes/documents/other/a_png_file.png new file mode 100644 index 0000000000..e50d31fca3 Binary files /dev/null and b/e2e/resources/adf/allFileTypes/documents/other/a_png_file.png differ diff --git a/e2e/search/components/search-check-list.e2e.ts b/e2e/search/components/search-check-list.e2e.ts index d6b53a093e..9053a6b7a7 100644 --- a/e2e/search/components/search-check-list.e2e.ts +++ b/e2e/search/components/search-check-list.e2e.ts @@ -27,7 +27,7 @@ import { } from '@alfresco/adf-testing'; import { SearchResultsPage } from '../pages/search-results.page'; import { SearchFiltersPage } from '../pages/search-filters.page'; -import { SearchDialogPage } from '../pages/search-dialog.page'; +import { SearchBarPage } from '../pages/search-bar.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { SearchConfiguration } from '../search.config'; import { browser } from 'protractor'; @@ -36,7 +36,7 @@ describe('Search Checklist Component', () => { const loginPage = new LoginPage(); const searchFiltersPage = new SearchFiltersPage(); - const searchDialog = new SearchDialogPage(); + const searchBarPage = new SearchBarPage(); const searchResults = new SearchResultsPage(); const navigationBarPage = new NavigationBarPage(); @@ -151,9 +151,9 @@ describe('Search Checklist Component', () => { } await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(randomName); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(randomName); await searchFiltersPage.clickCheckListFilter(); await expect(await searchFiltersPage.checkListFiltersPage().getCheckListOptionsNumberOnPage()).toBe(5); @@ -190,9 +190,9 @@ describe('Search Checklist Component', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(randomName); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(randomName); await searchFiltersPage.clickCheckListFilter(); await expect(await searchFiltersPage.checkListFiltersPage().getCheckListOptionsNumberOnPage()).toBe(10); @@ -204,9 +204,9 @@ describe('Search Checklist Component', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(randomName); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(randomName); await searchFiltersPage.clickCheckListFilter(); await expect(await searchFiltersPage.checkListFiltersPage().getCheckListOptionsNumberOnPage()).toBe(10); @@ -219,9 +219,9 @@ describe('Search Checklist Component', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(randomName); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(randomName); await searchFiltersPage.clickCheckListFilter(); await expect(await searchFiltersPage.checkListFiltersPage().getCheckListOptionsNumberOnPage()).toBe(9); @@ -243,9 +243,9 @@ describe('Search Checklist Component', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(randomName); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(randomName); await searchFiltersPage.clickCheckListFilter(); await expect(await searchFiltersPage.checkListFiltersPage().getCheckListOptionsNumberOnPage()).toBe(5); @@ -266,9 +266,9 @@ describe('Search Checklist Component', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(randomName); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(randomName); await searchFiltersPage.clickCheckListFilter(); await expect(await searchFiltersPage.checkListFiltersPage().getCheckListOptionsNumberOnPage()).toBe(5); @@ -303,9 +303,9 @@ describe('Search Checklist Component', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(randomName); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(randomName); await searchFiltersPage.clickCheckListFilter(); await searchFiltersPage.checkListFiltersPage().clickCheckListOption(filterType.folder); @@ -330,9 +330,9 @@ describe('Search Checklist Component', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(randomName); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(randomName); await searchFiltersPage.clickCheckListFilter(); await searchFiltersPage.checkListFiltersPage().checkCheckListOptionIsDisplayed(filterType.folder); diff --git a/e2e/search/components/search-date-range.e2e.ts b/e2e/search/components/search-date-range.e2e.ts index 309865df17..cdebfd8b4b 100644 --- a/e2e/search/components/search-date-range.e2e.ts +++ b/e2e/search/components/search-date-range.e2e.ts @@ -17,7 +17,7 @@ import { DataTableComponentPage, DatePickerCalendarPage, DateUtil, LocalStorageUtil, LoginPage } from '@alfresco/adf-testing'; import { browser, ElementFinder } from 'protractor'; -import { SearchDialogPage } from '../pages/search-dialog.page'; +import { SearchBarPage } from '../pages/search-bar.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { SearchFiltersPage } from '../pages/search-filters.page'; import { SearchResultsPage } from '../pages/search-results.page'; @@ -26,7 +26,7 @@ import { SearchConfiguration } from '../search.config'; describe('Search Date Range Filter', () => { const loginPage = new LoginPage(); - const searchDialog = new SearchDialogPage(); + const searchBarPage = new SearchBarPage(); const searchFilters = new SearchFiltersPage(); const dateRangeFilter = searchFilters.createdDateRangeFilterPage(); const searchResults = new SearchResultsPage(); @@ -37,9 +37,9 @@ describe('Search Date Range Filter', () => { beforeAll(async () => { await loginPage.login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('*'); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); }); beforeEach(async () => { @@ -181,8 +181,8 @@ describe('Search Date Range Filter', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('*'); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); 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 958ef6913d..ba3e9823e6 100644 --- a/e2e/search/components/search-number-range.e2e.ts +++ b/e2e/search/components/search-number-range.e2e.ts @@ -25,7 +25,7 @@ import { UserModel, UsersActions } from '@alfresco/adf-testing'; -import { SearchDialogPage } from '../pages/search-dialog.page'; +import { SearchBarPage } from '../pages/search-bar.page'; import { SearchResultsPage } from '../pages/search-results.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { SearchFiltersPage } from '../pages/search-filters.page'; @@ -36,7 +36,7 @@ import { SearchConfiguration } from '../search.config'; describe('Search Number Range Filter', () => { const loginPage = new LoginPage(); - const searchDialog = new SearchDialogPage(); + const searchBarPage = new SearchBarPage(); const searchFilters = new SearchFiltersPage(); const sizeRangeFilter = searchFilters.sizeRangeFilterPage(); const searchResults = new SearchResultsPage(); @@ -74,9 +74,9 @@ describe('Search Number Range Filter', () => { await loginPage.login(acsUser.email, acsUser.password); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('*'); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); }); afterAll(async () => { @@ -375,9 +375,9 @@ describe('Search Number Range Filter', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('*'); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); await searchFilters.checkSizeRangeFilterIsDisplayed(); await searchFilters.clickSizeRangeFilterHeader(); @@ -412,9 +412,9 @@ describe('Search Number Range Filter', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('*'); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); await searchFilters.checkSizeRangeFilterIsDisplayed(); await searchFilters.clickSizeRangeFilterHeader(); @@ -448,9 +448,9 @@ describe('Search Number Range Filter', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('*'); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); await searchFilters.checkSizeRangeFilterIsDisplayed(); await searchFilters.clickSizeRangeFilterHeader(); diff --git a/e2e/search/components/search-radio.e2e.ts b/e2e/search/components/search-radio.e2e.ts index 79273de46d..577296c32a 100644 --- a/e2e/search/components/search-radio.e2e.ts +++ b/e2e/search/components/search-radio.e2e.ts @@ -28,7 +28,7 @@ import { import { SearchFiltersPage } from '../pages/search-filters.page'; import { SearchResultsPage } from '../pages/search-results.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { SearchDialogPage } from '../pages/search-dialog.page'; +import { SearchBarPage } from '../pages/search-bar.page'; import { SearchConfiguration } from '../search.config'; import { browser } from 'protractor'; @@ -37,7 +37,7 @@ describe('Search Radio Component', () => { const loginPage = new LoginPage(); const searchFiltersPage = new SearchFiltersPage(); const navigationBarPage = new NavigationBarPage(); - const searchDialog = new SearchDialogPage(); + const searchBarPage = new SearchBarPage(); const searchResults = new SearchResultsPage(); const acsUser = new UserModel(); @@ -148,9 +148,9 @@ describe('Search Radio Component', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(randomName); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(randomName); await searchFiltersPage.clickTypeFilterHeader(); await expect(await searchFiltersPage.typeFiltersPage().getRadioButtonsNumberOnPage()).toBe(10); @@ -161,9 +161,9 @@ describe('Search Radio Component', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(randomName); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(randomName); await searchFiltersPage.clickTypeFilterHeader(); await expect(await searchFiltersPage.typeFiltersPage().getRadioButtonsNumberOnPage()).toBe(10); @@ -173,9 +173,9 @@ describe('Search Radio Component', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(randomName); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(randomName); await searchFiltersPage.clickTypeFilterHeader(); await expect(await searchFiltersPage.typeFiltersPage().getRadioButtonsNumberOnPage()).toBe(9); @@ -200,9 +200,9 @@ describe('Search Radio Component', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(randomName); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(randomName); await searchFiltersPage.clickTypeFilterHeader(); await expect(await searchFiltersPage.typeFiltersPage().getRadioButtonsNumberOnPage()).toBe(5); @@ -229,9 +229,9 @@ describe('Search Radio Component', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(randomName); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(randomName); await searchFiltersPage.clickTypeFilterHeader(); await expect(await searchFiltersPage.typeFiltersPage().getRadioButtonsNumberOnPage()).toBe(5); @@ -276,9 +276,9 @@ describe('Search Radio Component', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(randomName); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(randomName); 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 ee24122620..c5503f6d0b 100644 --- a/e2e/search/components/search-slider.e2e.ts +++ b/e2e/search/components/search-slider.e2e.ts @@ -24,7 +24,7 @@ import { UserModel, UsersActions } from '@alfresco/adf-testing'; -import { SearchDialogPage } from '../pages/search-dialog.page'; +import { SearchBarPage } from '../pages/search-bar.page'; import { SearchResultsPage } from '../pages/search-results.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { SearchFiltersPage } from '../pages/search-filters.page'; @@ -35,7 +35,7 @@ import { SearchConfiguration } from '../search.config'; describe('Search Slider Filter', () => { const loginPage = new LoginPage(); - const searchDialog = new SearchDialogPage(); + const searchBarPage = new SearchBarPage(); const searchFilters = new SearchFiltersPage(); const sizeSliderFilter = searchFilters.sizeSliderFilterPage(); const searchResults = new SearchResultsPage(); @@ -67,9 +67,9 @@ describe('Search Slider Filter', () => { await loginPage.login(acsUser.email, acsUser.password); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('*'); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); }); afterAll(async () => { @@ -162,9 +162,9 @@ describe('Search Slider Filter', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('*'); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); await searchFilters.checkSizeSliderFilterIsDisplayed(); await searchFilters.clickSizeSliderFilterHeader(); @@ -179,9 +179,9 @@ describe('Search Slider Filter', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('*'); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); await searchFilters.checkSizeSliderFilterIsDisplayed(); await searchFilters.clickSizeSliderFilterHeader(); @@ -198,9 +198,9 @@ describe('Search Slider Filter', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('*'); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); await searchFilters.checkSizeSliderFilterIsDisplayed(); await searchFilters.clickSizeSliderFilterHeader(); @@ -217,9 +217,9 @@ describe('Search Slider Filter', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('*'); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); 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 82902b6b5e..ae140a2f58 100644 --- a/e2e/search/components/search-sorting-picker.e2e.ts +++ b/e2e/search/components/search-sorting-picker.e2e.ts @@ -24,7 +24,7 @@ import { UserModel, UsersActions } from '@alfresco/adf-testing'; -import { SearchDialogPage } from '../pages/search-dialog.page'; +import { SearchBarPage } from '../pages/search-bar.page'; import { SearchResultsPage } from '../pages/search-results.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { SearchFiltersPage } from '../pages/search-filters.page'; @@ -35,7 +35,7 @@ import { SearchConfiguration } from '../search.config'; describe('Search Sorting Picker', () => { const loginPage = new LoginPage(); - const searchDialog = new SearchDialogPage(); + const searchBarPage = new SearchBarPage(); const searchFilters = new SearchFiltersPage(); const searchResults = new SearchResultsPage(); const navigationBarPage = new NavigationBarPage(); @@ -83,8 +83,8 @@ describe('Search Sorting Picker', () => { }); beforeEach(async () => { - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(search); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(search); }); afterEach(async () => { @@ -111,9 +111,9 @@ describe('Search Sorting Picker', () => { }); await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(search); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(search); await searchSortingPicker.checkSortingDropdownIsDisplayed(); await searchSortingPicker.clickSortingDropdown(); @@ -127,9 +127,9 @@ describe('Search Sorting Picker', () => { const removedOption = jsonFile.sorting.options.splice(0, 1); await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(search); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(search); await searchSortingPicker.checkSortingDropdownIsDisplayed(); await searchSortingPicker.clickSortingDropdown(); @@ -152,9 +152,9 @@ describe('Search Sorting Picker', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(search); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(search); await searchSortingPicker.checkSortingDropdownIsDisplayed(); await searchSortingPicker.clickSortingDropdown(); @@ -203,9 +203,9 @@ describe('Search Sorting Picker', () => { }); await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(search); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(search); 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 6c0c5b7819..6a83639648 100644 --- a/e2e/search/components/search-text.e2e.ts +++ b/e2e/search/components/search-text.e2e.ts @@ -27,7 +27,7 @@ import { UserModel, UsersActions } from '@alfresco/adf-testing'; -import { SearchDialogPage } from '../pages/search-dialog.page'; +import { SearchBarPage } from '../pages/search-bar.page'; import { SearchResultsPage } from '../pages/search-results.page'; import { SearchFiltersPage } from '../pages/search-filters.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; @@ -40,7 +40,7 @@ describe('Search component - Text widget', () => { const searchFiltersPage = new SearchFiltersPage(); const loginPage = new LoginPage(); - const searchDialog = new SearchDialogPage(); + const searchBarPage = new SearchBarPage(); const searchResultPage = new SearchResultsPage(); const apiService = new ApiService(); @@ -101,8 +101,8 @@ describe('Search component - Text widget', () => { await navigationBarPage.clickContentServicesButton(); await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('*'); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); await searchResultPage.tableIsLoaded(); await searchFiltersPage.checkCheckListFilterIsDisplayed(); diff --git a/e2e/search/pages/search-dialog.page.ts b/e2e/search/pages/search-bar.page.ts similarity index 89% rename from e2e/search/pages/search-dialog.page.ts rename to e2e/search/pages/search-bar.page.ts index d3039af72a..a4590f27a3 100644 --- a/e2e/search/pages/search-dialog.page.ts +++ b/e2e/search/pages/search-bar.page.ts @@ -15,19 +15,19 @@ * limitations under the License. */ -import { browser, by, element, ElementFinder, protractor } from 'protractor'; +import { Locator, browser, by, element, ElementFinder, protractor } from 'protractor'; import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; -export class SearchDialogPage { +export class SearchBarPage { searchIcon = element(by.css(`button[class*='adf-search-button']`)); searchBar = element(by.css(`adf-search-control input`)); searchBarExpanded = element(by.css(`adf-search-control mat-form-field[class*="mat-focused"] input`)); noResultMessage = element(by.css(`p[class*='adf-search-fixed-text']`)); - rowsAuthor = by.css(`.mat-list-text p[class*='adf-search-fixed-text']`); - completeName = by.css(`h4[class*='adf-search-fixed-text']`); - highlightName = by.css(`.adf-highlight`); - searchDialog = element(by.css(`mat-list[id='autocomplete-search-result-list']`)); + rowsAuthor: Locator = by.css(`.mat-list-text p[class*='adf-search-fixed-text']`); + completeName: Locator = by.css(`h4[class*='adf-search-fixed-text']`); + highlightName: Locator = by.css(`.adf-highlight`); + 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); @@ -70,7 +70,7 @@ export class SearchDialogPage { } async resultTableContainsRow(name: string): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.searchDialog); + await BrowserVisibility.waitUntilElementIsVisible(this.searchBarPage); await BrowserVisibility.waitUntilElementIsVisible(this.getRowByRowName(name)); } diff --git a/e2e/search/search-component.e2e.ts b/e2e/search/search-component.e2e.ts index 0d6740d30e..0a4905a748 100644 --- a/e2e/search/search-component.e2e.ts +++ b/e2e/search/search-component.e2e.ts @@ -28,7 +28,7 @@ import { UsersActions, ViewerPage } from '@alfresco/adf-testing'; -import { SearchDialogPage } from './pages/search-dialog.page'; +import { SearchBarPage } from './pages/search-bar.page'; import { ContentServicesPage } from '../core/pages/content-services.page'; import { SearchResultsPage } from './pages/search-results.page'; import { FileModel } from '../models/ACS/file.model'; @@ -51,7 +51,7 @@ describe('Search component - Search Bar', () => { const contentServicesPage = new ContentServicesPage(); const navigationBarPage = new NavigationBarPage(); - const searchDialog = new SearchDialogPage(); + const searchBarPage = new SearchBarPage(); const searchResultPage = new SearchResultsPage(); const viewerPage = new ViewerPage(); @@ -126,140 +126,140 @@ describe('Search component - Search Bar', () => { }); it('[C272798] Search bar should be visible', async () => { - await searchDialog.checkSearchBarIsNotVisible(); - await searchDialog.checkSearchIconIsVisible(); + await searchBarPage.checkSearchBarIsNotVisible(); + await searchBarPage.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.checkSearchIconIsVisible(); await BrowserActions.closeMenuAndDialogs(); - await searchDialog.checkSearchBarIsNotVisible(); - await searchDialog.checkSearchIconIsVisible(); + await searchBarPage.checkSearchBarIsNotVisible(); + await searchBarPage.checkSearchIconIsVisible(); }); it('[C272799] Should be possible to hide search bar after input', async () => { - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterText(firstFolderModel.shortName); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterText(firstFolderModel.shortName); }); it('[C260255] Should display message when searching for an inexistent file', async () => { - await searchDialog.checkSearchBarIsNotVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkNoResultMessageIsNotDisplayed(); - await searchDialog.enterText(search.inactive.name); - await searchDialog.checkNoResultMessageIsDisplayed(); + await searchBarPage.checkSearchBarIsNotVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkNoResultMessageIsNotDisplayed(); + await searchBarPage.enterText(search.inactive.name); + await searchBarPage.checkNoResultMessageIsDisplayed(); }); it('[C260256] Should display file/folder in search suggestion when typing first characters', async () => { - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterText(firstFolderModel.shortName); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterText(firstFolderModel.shortName); - await searchDialog.resultTableContainsRow(firstFolderModel.name); + await searchBarPage.resultTableContainsRow(firstFolderModel.name); - await expect(await searchDialog.getSpecificRowsHighlightName(firstFolderModel.name)).toEqual(firstFolderModel.shortName); - await expect(await searchDialog.getSpecificRowsAuthor(firstFolderModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName); - await expect(await searchDialog.getSpecificRowsCompleteName(firstFolderModel.name)).toEqual(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.getSpecificRowsCompleteName(firstFolderModel.name)).toEqual(firstFolderModel.name); - await searchDialog.clearText(); + await searchBarPage.clearText(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterText(firstFileModel.shortName); - await searchDialog.resultTableContainsRow(firstFileModel.name); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterText(firstFileModel.shortName); + await searchBarPage.resultTableContainsRow(firstFileModel.name); - await expect(await searchDialog.getSpecificRowsHighlightName(firstFileModel.name)).toEqual(firstFileModel.shortName); - await expect(await searchDialog.getSpecificRowsAuthor(firstFileModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName); + 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 searchDialog.getSpecificRowsCompleteName(firstFileModel.name)).toEqual(firstFileModel.name); + await expect(await searchBarPage.getSpecificRowsCompleteName(firstFileModel.name)).toEqual(firstFileModel.name); }); it('[C272800] Should display file/folder in search suggestion when typing name', async () => { - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterText(firstFolderModel.name); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterText(firstFolderModel.name); - await searchDialog.resultTableContainsRow(firstFolderModel.name); + await searchBarPage.resultTableContainsRow(firstFolderModel.name); - await expect(await searchDialog.getSpecificRowsHighlightName(firstFolderModel.name)).toEqual(firstFolderModel.name); - await expect(await searchDialog.getSpecificRowsAuthor(firstFolderModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName); - await expect(await searchDialog.getSpecificRowsCompleteName(firstFolderModel.name)).toEqual(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.getSpecificRowsCompleteName(firstFolderModel.name)).toEqual(firstFolderModel.name); - await searchDialog.clearText(); + await searchBarPage.clearText(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterText(firstFileModel.name); - await searchDialog.resultTableContainsRow(firstFileModel.name); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterText(firstFileModel.name); + await searchBarPage.resultTableContainsRow(firstFileModel.name); - await expect(await searchDialog.getSpecificRowsHighlightName(firstFileModel.name)).toEqual(firstFileModel.name); - await expect(await searchDialog.getSpecificRowsAuthor(firstFileModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName); - await expect(await searchDialog.getSpecificRowsCompleteName(firstFileModel.name)).toEqual(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.getSpecificRowsCompleteName(firstFileModel.name)).toEqual(firstFileModel.name); }); it('[C260257] Should display content when clicking on folder from search suggestions', async () => { - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterText(firstFolderModel.shortName); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterText(firstFolderModel.shortName); - await searchDialog.resultTableContainsRow(firstFolderModel.name); - await searchDialog.clickOnSpecificRow(firstFolderModel.name); + await searchBarPage.resultTableContainsRow(firstFolderModel.name); + await searchBarPage.clickOnSpecificRow(firstFolderModel.name); await expect(await contentServicesPage.currentFolderName()).toEqual(firstFolderModel.name); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterText(firstFileModel.name); - await searchDialog.resultTableContainsRow(firstFileModel.name); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterText(firstFileModel.name); + await searchBarPage.resultTableContainsRow(firstFileModel.name); - await searchDialog.clickOnSpecificRow(firstFileModel.name); + await searchBarPage.clickOnSpecificRow(firstFileModel.name); await expect(await viewerPage.getDisplayedFileName()).toEqual(firstFileModel.name); await viewerPage.clickCloseButton(); }); it('[C272801] Should display message when searching for non-existent folder', async () => { - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(search.inactive.name); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(search.inactive.name); await searchResultPage.checkNoResultMessageIsDisplayed(); }); it('[C272802] Should be able to find an existent folder in search results', async () => { - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(firstFolderModel.name); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(firstFolderModel.name); await searchResultPage.checkContentIsDisplayed(firstFolderModel.name); }); it('[C260258] Should be able to find an existent file in search results', async () => { - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(firstFileModel.name); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(firstFileModel.name); await searchResultPage.checkContentIsDisplayed(firstFileModel.name); }); it('[C91321] Should be able to use down arrow key when navigating throw suggestions', async () => { - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterText(secondFolder.shortName); - await searchDialog.pressDownArrowAndEnter(); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterText(secondFolder.shortName); + await searchBarPage.pressDownArrowAndEnter(); await expect(await contentServicesPage.currentFolderName()).toEqual(secondFolder.name); }); it('[C290137] Should be able to search by \'%\'', async () => { - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('%'); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('%'); await searchResultPage.tableIsLoaded(); }); @@ -271,10 +271,10 @@ describe('Search component - Search Bar', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(searchConfiguration)); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.checkSearchBarIsVisible(); - await searchDialog.enterTextAndPressEnter(term); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.checkSearchBarIsVisible(); + await searchBarPage.enterTextAndPressEnter(term); }); 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 cc0db2d910..3b5fde1bf0 100644 --- a/e2e/search/search-filters.e2e.ts +++ b/e2e/search/search-filters.e2e.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { SearchDialogPage } from './pages/search-dialog.page'; +import { SearchBarPage } from './pages/search-bar.page'; import { SearchFiltersPage } from './pages/search-filters.page'; import { SearchResultsPage } from './pages/search-results.page'; import { FileModel } from '../models/ACS/file.model'; @@ -38,7 +38,7 @@ import { SearchConfiguration } from './search.config'; describe('Search Filters', () => { const loginPage = new LoginPage(); - const searchDialog = new SearchDialogPage(); + const searchBarPage = new SearchBarPage(); const searchFiltersPage = new SearchFiltersPage(); const paginationPage = new PaginationPage(); const contentList = new DocumentListPage(); @@ -119,10 +119,10 @@ describe('Search Filters', () => { }); it('[C286298] Should be able to cancel a filter using "x" button from the toolbar', async () => { - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(fileUploaded.entry.name); + await searchBarPage.enterTextAndPressEnter(fileUploaded.entry.name); await searchFiltersPage.checkSearchFiltersIsDisplayed(); @@ -181,8 +181,8 @@ describe('Search Filters', () => { jsonFile['filterWithContains'] = true; await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('*'); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); await searchResults.tableIsLoaded(); @@ -191,7 +191,10 @@ describe('Search Filters', () => { }); it('[C291980] Should group search facets under specified labels', async () => { - await BrowserActions.getUrl(`${browser.baseUrl}/search;q=*`); + await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); + + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); await searchFiltersPage.checkDefaultFacetQueryGroupIsDisplayed(); await searchFiltersPage.checkTypeFacetQueryGroupIsDisplayed(); @@ -203,8 +206,8 @@ describe('Search Filters', () => { await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('*'); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); await searchResults.tableIsLoaded(); @@ -214,7 +217,9 @@ describe('Search Filters', () => { }); it('[C297509] Should display search intervals under specified labels from config', async () => { - await BrowserActions.getUrl(`${browser.baseUrl}/search;q=*`); + await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); await searchFiltersPage.checkFacetIntervalsByCreatedIsDisplayed(); await searchFiltersPage.checkFacetIntervalsByCreatedIsExpanded(); @@ -232,9 +237,9 @@ describe('Search Filters', () => { it('[C299200] Should reset the filters facet with search query', async () => { await navigationBarPage.clickContentServicesButton(); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(fileTypeTxt1.entry.name); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(fileTypeTxt1.entry.name); await searchFiltersPage.checkSearchFiltersIsDisplayed(); await searchResults.tableIsLoaded(); @@ -242,10 +247,10 @@ describe('Search Filters', () => { await searchFiltersPage.checkFileTypeFacetLabelIsDisplayed('Plain Text (1)'); await searchFiltersPage.checkFileTypeFacetLabelIsNotDisplayed('JPEG Image'); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(fileNamePrefix); + await searchBarPage.enterTextAndPressEnter(fileNamePrefix); await searchFiltersPage.checkSearchFiltersIsDisplayed(); await searchResults.tableIsLoaded(); await searchResults.checkContentIsDisplayed(fileTypeTxt1.entry.name); @@ -262,8 +267,8 @@ describe('Search Filters', () => { jsonFile.facetFields.fields[1].label = 'My File Sizes'; await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile)); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('*'); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); await searchResults.tableIsLoaded(); await searchFiltersPage.checkCustomFacetFieldLabelIsDisplayed('My File Types'); diff --git a/e2e/search/search-multiselect.e2e.ts b/e2e/search/search-multiselect.e2e.ts index 4c4d12ca2c..b8dde80762 100644 --- a/e2e/search/search-multiselect.e2e.ts +++ b/e2e/search/search-multiselect.e2e.ts @@ -17,7 +17,7 @@ import { ApiService, LoginPage, StringUtil, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing'; import { browser } from 'protractor'; -import { SearchDialogPage } from './pages/search-dialog.page'; +import { SearchBarPage } from './pages/search-bar.page'; import { SearchResultsPage } from './pages/search-results.page'; import { SearchFiltersPage } from './pages/search-filters.page'; import { FileModel } from '../models/ACS/file.model'; @@ -26,7 +26,7 @@ import CONSTANTS = require('../util/constants'); describe('Search Component - Multi-Select Facet', () => { const loginPage = new LoginPage(); - const searchDialog = new SearchDialogPage(); + const searchBarPage = new SearchBarPage(); const searchResultsPage = new SearchResultsPage(); const searchFiltersPage = new SearchFiltersPage(); const navigationBarPage = new NavigationBarPage(); @@ -75,9 +75,9 @@ describe('Search Component - Multi-Select Facet', () => { await loginPage.login(acsUser.email, acsUser.password); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(`${randomName}`); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(`${randomName}`); userOption = `${acsUser.firstName} ${acsUser.lastName}`; @@ -100,9 +100,9 @@ describe('Search Component - Multi-Select Facet', () => { it('[C280054] Should be able to select multiple items from a search facet filter', async () => { await loginPage.login(acsUser.email, acsUser.password); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(`${randomName}`); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(`${randomName}`); userOption = `${acsUser.firstName} ${acsUser.lastName}`; @@ -167,9 +167,9 @@ describe('Search Component - Multi-Select Facet', () => { await loginPage.login(userUploadingImg.email, userUploadingImg.password); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(`*${randomName}*`); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(`*${randomName}*`); await searchFiltersPage.checkSearchFiltersIsDisplayed(); await searchFiltersPage.creatorCheckListFiltersPage().filterBy(`${userUploadingTxt.firstName} ${userUploadingTxt.lastName}`); @@ -214,9 +214,9 @@ describe('Search Component - Multi-Select Facet', () => { await loginPage.login(acsUser.email, acsUser.password); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(`*${randomName}*`); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(`*${randomName}*`); await searchFiltersPage.checkSearchFiltersIsDisplayed(); }); @@ -229,9 +229,9 @@ describe('Search Component - Multi-Select Facet', () => { it('[C280058] Should update filter facets items number when another filter facet item is selected', async () => { await loginPage.login(acsUser.email, acsUser.password); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(`*${randomName}*`); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(`*${randomName}*`); await searchFiltersPage.checkSearchFiltersIsDisplayed(); await searchFiltersPage.fileTypeCheckListFiltersPage().filterBy('Plain Text'); diff --git a/e2e/search/search-page.e2e.ts b/e2e/search/search-page.e2e.ts index 66d945f35f..a019ee558a 100644 --- a/e2e/search/search-page.e2e.ts +++ b/e2e/search/search-page.e2e.ts @@ -19,7 +19,7 @@ import { browser } from 'protractor'; import { ApiService, LoginPage, StringUtil, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing'; -import { SearchDialogPage } from './pages/search-dialog.page'; +import { SearchBarPage } from './pages/search-bar.page'; import { ContentServicesPage } from '../core/pages/content-services.page'; import { SearchResultsPage } from './pages/search-results.page'; import { FolderModel } from '../models/ACS/folder.model'; @@ -42,7 +42,7 @@ describe('Search component - Search Page', () => { const loginPage = new LoginPage(); const contentServicesPage = new ContentServicesPage(); - const searchDialog = new SearchDialogPage(); + const searchBarPage = new SearchBarPage(); const searchResultPage = new SearchResultsPage(); const navigationBarPage = new NavigationBarPage(); @@ -97,24 +97,24 @@ describe('Search component - Search Page', () => { it('[C260264] Should display message when no results are found', async() => { const notExistentFileName = StringUtil.generateRandomString(); - await searchDialog.checkSearchBarIsNotVisible(); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(notExistentFileName); + await searchBarPage.checkSearchBarIsNotVisible(); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(notExistentFileName); await searchResultPage.checkNoResultMessageIsDisplayed(); }); it('[C272810] Should display only files corresponding to search', async () => { - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(search.active.firstFile); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(search.active.firstFile); await searchResultPage.checkContentIsDisplayed(search.active.firstFile); await expect(await searchResultPage.numberOfResultsDisplayed()).toBe(1); }); it('[C260267] Should display content when opening a folder from search results', async () => { - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(emptyFolderModel.name); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(emptyFolderModel.name); await searchResultPage.checkNoResultMessageIsNotDisplayed(); await searchResultPage.checkContentIsDisplayed(emptyFolderModel.name); @@ -124,8 +124,8 @@ describe('Search component - Search Page', () => { }); it('[C260261] Should be able to delete a file from search results', async () => { - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(search.active.firstFile); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(search.active.firstFile); await searchResultPage.checkContentIsDisplayed(search.active.firstFile); @@ -134,16 +134,16 @@ describe('Search component - Search Page', () => { await searchResultPage.checkNoResultMessageIsDisplayed(); await searchResultPage.checkContentIsNotDisplayed(search.active.firstFile); - await searchDialog.checkSearchBarIsNotVisible(); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(search.active.firstFile); + await searchBarPage.checkSearchBarIsNotVisible(); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(search.active.firstFile); await searchResultPage.checkNoResultMessageIsDisplayed(); }); it('[C272809] Should be able to delete a folder from search results', async () => { - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(emptyFolderModel.name); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(emptyFolderModel.name); await searchResultPage.checkContentIsDisplayed(emptyFolderModel.name); await searchResultPage.checkNoResultMessageIsNotDisplayed(); @@ -151,16 +151,16 @@ describe('Search component - Search Page', () => { await searchResultPage.deleteContent(emptyFolderModel.name); await searchResultPage.checkNoResultMessageIsDisplayed(); - await searchDialog.checkSearchBarIsNotVisible(); - await searchDialog.checkSearchIconIsVisible(); - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter(emptyFolderModel.name); + await searchBarPage.checkSearchBarIsNotVisible(); + await searchBarPage.checkSearchIconIsVisible(); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter(emptyFolderModel.name); await searchResultPage.checkNoResultMessageIsDisplayed(); }); it('[C286675] Should display results when searching for all elements', async () => { - await searchDialog.clickOnSearchIcon(); - await searchDialog.enterTextAndPressEnter('*'); + await searchBarPage.clickOnSearchIcon(); + await searchBarPage.enterTextAndPressEnter('*'); await searchResultPage.checkNoResultMessageIsNotDisplayed(); }); diff --git a/e2e/test.config.js b/e2e/test.config.js index f378eae227..a8f4ed2a24 100644 --- a/e2e/test.config.js +++ b/e2e/test.config.js @@ -15,7 +15,7 @@ const HOST_BPM = process.env.PROXY_HOST_ADF || HOST || 'bpm'; const PROVIDER = process.env.PROVIDER ? process.env.PROVIDER : 'ALL'; const AUTH_TYPE = process.env.AUTH_TYPE ? process.env.AUTH_TYPE : 'BASIC'; -const OAUTH_HOST = process.env.HOST_SSO || process.env.PROXY_HOST_ADF || HOST || 'oauth'; +const HOST_SSO = process.env.HOST_SSO || process.env.PROXY_HOST_ADF || HOST || 'oauth'; const OAUTH_CLIENT_ID = process.env.OAUTH_CLIENDID || 'alfresco'; const IDENTITY_ADMIN_EMAIL = process.env.IDENTITY_ADMIN_EMAIL || "defaultadmin"; @@ -30,10 +30,6 @@ const PASSWORD_ADF = process.env.PASSWORD_ADF || "defaultuserpassword"; const REDIRECT_URI = process.env.REDIRECT_URI || "/"; const REDIRECT_URI_LOGOUT = process.env.REDIRECT_URI_LOGOUT || "/logout"; -const SCREENSHOT_URL = process.env.SCREENSHOT_URL || HOST; -const SCREENSHOT_PASSWORD = process.env.SCREENSHOT_PASSWORD || process.env.PASSWORD_ADF; -const SCREENSHOT_USERNAME = process.env.SCREENSHOT_USERNAME || process.env.USERNAME_ADF; - const EXTERNAL_ACS_HOST = process.env.EXTERNAL_ACS_HOST; const LOG_LEVEL = process.env.LOG_LEVEL || 'ERROR'; @@ -41,11 +37,11 @@ const appConfig = { "log": LOG_LEVEL, "ecmHost": HOST_ECM, "bpmHost": HOST_BPM, - "identityHost": `${OAUTH_HOST}/auth/admin/realms/alfresco`, + "identityHost": `${HOST_SSO}/auth/admin/realms/alfresco`, "provider": PROVIDER, "authType": AUTH_TYPE, "oauth2": { - "host": `${OAUTH_HOST}/auth/realms/alfresco`, + "host": `${HOST_SSO}/auth/realms/alfresco`, "clientId": OAUTH_CLIENT_ID, "scope": "openid", "secret": "", @@ -98,9 +94,9 @@ module.exports = { }, screenshot: { - url: SCREENSHOT_URL, - password: SCREENSHOT_PASSWORD, - username: SCREENSHOT_USERNAME + url: HOST_ECM, + username: USERNAME_ADF, + password: PASSWORD_ADF }, adf_external_acs: { diff --git a/e2e/util/resources.js b/e2e/util/resources.js index 8c20440670..a679ec2fe7 100644 --- a/e2e/util/resources.js +++ b/e2e/util/resources.js @@ -676,9 +676,9 @@ exports.Files = { folder_name: "images-rendition" }, ADF_FOLDER: { - folder_location: "/resources/adf", - folder_path: path.join(__dirname, '../resources/adf'), - folder_name: "adf" + folder_location: "/resources/adf/allFileTypes/images", + folder_path: path.join(__dirname, '../resources/adf/allFileTypes/images'), + folder_name: "images" }, }, diff --git a/lib/cli/scripts/check-cs-env.ts b/lib/cli/scripts/check-cs-env.ts index 595de82a63..8b6faac67b 100755 --- a/lib/cli/scripts/check-cs-env.ts +++ b/lib/cli/scripts/check-cs-env.ts @@ -31,14 +31,14 @@ async function checkEnv() { }); await alfrescoJsApi.login(program.username, program.password); - } catch (e) { + } catch (error) { console.log('Login error environment down or inaccessible'); counter++; if (MAX_RETRY === counter) { console.log('Give up'); process.exit(1); } else { - console.log(`Retry in 1 minute attempt N ${counter}`); + console.log(`Retry in 1 minute attempt N ${counter}`, error); sleep(TIMEOUT); checkEnv(); } @@ -74,8 +74,8 @@ async function checkDiskSpaceFullEnv() { 'overwrite': true }); } + let pathFile = path.join(__dirname, '../', 'README.md'); - let pathFile = path.join(__dirname, '../../', 'README.md'); let file = fs.createReadStream(pathFile); let uploadedFile = await alfrescoJsApi.upload.uploadFile( @@ -94,6 +94,8 @@ async function checkDiskSpaceFullEnv() { } catch (error) { counter++; + console.log('error', error); + if (MAX_RETRY === counter) { console.log('============================================================='); console.log('================ Not able to upload a file =================='); @@ -101,7 +103,7 @@ async function checkDiskSpaceFullEnv() { console.log('============================================================='); process.exit(1); } else { - console.log(`Retry in 1 minute attempt N ${counter}`); + console.log(`Retry in 1 minute attempt N ${counter}`, error); sleep(TIMEOUT); checkDiskSpaceFullEnv(); } diff --git a/lib/cli/scripts/init-aae-env.ts b/lib/cli/scripts/init-aae-env.ts index aeb1be61df..f964183def 100644 --- a/lib/cli/scripts/init-aae-env.ts +++ b/lib/cli/scripts/init-aae-env.ts @@ -65,20 +65,24 @@ async function healthCheck(nameService: string) { logger.info(`${nameService} is UP!`); } } catch (error) { - logger.error(`${nameService} is not reachable ${error.status} `); + logger.error(`${nameService} is not reachable error: `, error); isValid = false; } } -function getApplicationByStatus(status: string) { +async function getApplicationByStatus(status: string) { const url = `${args.host}/deployment-service/v1/applications/`; const pathParams = {}, queryParams = { status: status }, headerParams = {}, formParams = {}, bodyParam = {}, contentTypes = ['application/json'], accepts = ['application/json']; try { + await alfrescoJsApiDevops.login(args.devopsUsername, args.devopsPassword); + return alfrescoJsApiDevops.oauth2Auth.callCustomApi(url, 'GET', pathParams, queryParams, headerParams, formParams, bodyParam, - contentTypes, accepts); + contentTypes, accepts).on('error',(error)=>{ + logger.error(`Get application by status ${error} `); + }); } catch (error) { logger.error(`Get application by status ${error.status} `); @@ -203,6 +207,7 @@ function deploy(model: any) { function getAlfrescoJsApiInstance(configArgs: ConfigArgs) { const config = { provider: 'BPM', + hostEcm: `${configArgs.host}`, hostBpm: `${configArgs.host}`, authType: 'OAUTH', oauth2: { @@ -395,6 +400,11 @@ async function main(configArgs: ConfigArgs) { } alfrescoJsApiModeler = getAlfrescoJsApiInstance(args); + + AAE_MICROSERVICES.map(async (serviceName) => { + await healthCheck(serviceName); + }); + await alfrescoJsApiModeler.login(args.modelerUsername, args.modelerPassword).then(() => { logger.info('login SSO ok'); }, (error) => { @@ -402,10 +412,6 @@ async function main(configArgs: ConfigArgs) { process.exit(1); }); - AAE_MICROSERVICES.map(async (serviceName) => { - await healthCheck(serviceName); - }); - if (isValid) { logger.error('The environment is up and running'); alfrescoJsApiDevops = getAlfrescoJsApiInstance(args); diff --git a/lib/process-services/src/lib/people/components/people-search-field/people-search-field.component.html b/lib/process-services/src/lib/people/components/people-search-field/people-search-field.component.html index 19378a98eb..fcdd0c4b06 100644 --- a/lib/process-services/src/lib/people/components/people-search-field/people-search-field.component.html +++ b/lib/process-services/src/lib/people/components/people-search-field/people-search-field.component.html @@ -24,7 +24,7 @@ -
{{ getDisplayUser(entry.row.obj.firstName, entry.row.obj.lastName, ' ') }}
+
{{ getDisplayUser(entry.row.obj.firstName, entry.row.obj.lastName, ' ') }}
diff --git a/lib/process-services/src/lib/people/components/people/people.component.html b/lib/process-services/src/lib/people/components/people/people.component.html index 16dd1549ea..ea99617edb 100644 --- a/lib/process-services/src/lib/people/components/people/people.component.html +++ b/lib/process-services/src/lib/people/components/people/people.component.html @@ -41,8 +41,8 @@ diff --git a/lib/testing/ng-package.json b/lib/testing/ng-package.json index 3c7e87dc7c..72cc5b7dd8 100644 --- a/lib/testing/ng-package.json +++ b/lib/testing/ng-package.json @@ -8,7 +8,6 @@ "@alfresco/js-api": "@alfresco/js-api", "moment-es6": "moment-es6", "protractor": "protractor", - "selenium-webdriver/remote": "selenium-webdriver/remote", "selenium-webdriver": "selenium-webdriver", "fs": "fs", "path": "path" 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 8f0310206a..dd538c74fb 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 @@ -15,8 +15,7 @@ * limitations under the License. */ -import { by, element, browser } from 'protractor'; -import * as remote from 'selenium-webdriver/remote'; +import { by, element } from 'protractor'; import { DocumentListPage } from '../pages/document-list.page'; import { BrowserVisibility } from '../../core/utils/browser-visibility'; import { BrowserActions } from '../../core/utils/browser-actions'; @@ -137,7 +136,6 @@ export class ContentNodeSelectorDialogPage { await this.dataTable.waitForTableBody(); await this.breadcrumbDropdownPage.checkCurrentFolderIsDisplayed(); - await browser.setFileDetector(new remote.FileDetector()); const uploadButton = element(by.css('adf-upload-button input')); await BrowserVisibility.waitUntilElementIsPresent(uploadButton); await uploadButton.sendKeys(fileLocation); diff --git a/lib/testing/src/lib/content-services/pages/document-list.page.ts b/lib/testing/src/lib/content-services/pages/document-list.page.ts index a2904a40e1..284d213066 100644 --- a/lib/testing/src/lib/content-services/pages/document-list.page.ts +++ b/lib/testing/src/lib/content-services/pages/document-list.page.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { by, element, ElementFinder, browser } from 'protractor'; +import { Locator, by, element, ElementFinder, browser } from 'protractor'; import { DataTableComponentPage } from '../../core/pages/data-table-component.page'; import { BrowserVisibility } from '../../core/utils/browser-visibility'; import { BrowserActions } from '../../core/utils/browser-actions'; @@ -23,7 +23,7 @@ import { BrowserActions } from '../../core/utils/browser-actions'; export class DocumentListPage { rootElement: ElementFinder; - optionButton = by.css('button[data-automation-id*="action_menu_"]'); + optionButton: Locator = by.css('button[data-automation-id*="action_menu_"]'); tableBody: ElementFinder; dataTable: DataTableComponentPage; 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 6f5cd26695..1430966b89 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 @@ -15,17 +15,17 @@ * limitations under the License. */ -import { element, by, ElementFinder, browser } from 'protractor'; +import { Locator, element, by, ElementFinder, browser } from 'protractor'; import { BrowserActions } from '../../../core/utils/browser-actions'; import { BrowserVisibility } from '../../../core/utils/browser-visibility'; export class SearchCheckListPage { filter: ElementFinder; - inputBy = by.css('div[class*="mat-expansion-panel-content"] input'); - showMoreBy = by.css('button[title="Show more"]'); - showLessBy = by.css('button[title="Show less"]'); - clearAllButton = by.css('button'); + inputBy: Locator = by.css('div[class*="mat-expansion-panel-content"] input'); + showMoreBy: Locator = by.css('button[title="Show more"]'); + showLessBy: Locator = by.css('button[title="Show less"]'); + clearAllButton: Locator = by.css('button'); constructor(filter: ElementFinder) { this.filter = filter; diff --git a/lib/testing/src/lib/content-services/pages/search/search-slider.page.ts b/lib/testing/src/lib/content-services/pages/search/search-slider.page.ts index c874ffa9ae..8ab359eac0 100644 --- a/lib/testing/src/lib/content-services/pages/search/search-slider.page.ts +++ b/lib/testing/src/lib/content-services/pages/search/search-slider.page.ts @@ -15,16 +15,16 @@ * limitations under the License. */ -import { browser, by, ElementFinder } from 'protractor'; +import { Locator, browser, by, ElementFinder } from 'protractor'; import { BrowserVisibility } from '../../../core/utils/browser-visibility'; import { BrowserActions } from '../../../core/utils/browser-actions'; export class SearchSliderPage { filter: ElementFinder; - slider = by.css('mat-slider[data-automation-id="slider-range"]'); - clearButton = by.css('button[data-automation-id="slider-btn-clear"]'); - sliderWithThumbLabel = by.css('mat-slider[data-automation-id="slider-range"][class*="mat-slider-thumb-label-showing"]'); + slider: Locator = by.css('mat-slider[data-automation-id="slider-range"]'); + clearButton: Locator = by.css('button[data-automation-id="slider-btn-clear"]'); + sliderWithThumbLabel: Locator = by.css('mat-slider[data-automation-id="slider-range"][class*="mat-slider-thumb-label-showing"]'); constructor(filter: ElementFinder) { this.filter = filter; diff --git a/lib/testing/src/lib/core/actions/api.service.ts b/lib/testing/src/lib/core/actions/api.service.ts index f9e070b1f7..ed349862f4 100644 --- a/lib/testing/src/lib/core/actions/api.service.ts +++ b/lib/testing/src/lib/core/actions/api.service.ts @@ -39,12 +39,16 @@ export class ApiService { constructor(clientIdOrAppConfig?: AlfrescoApiConfig | string, host?: string, hostSso?: string, provider?: string) { if (browser.params.testConfig && browser.params.testConfig.appConfig) { + Logger.log('Get Config ApiService from browser params'); + this.config = { ...browser.params.testConfig.appConfig }; this.config.hostEcm = browser.params.testConfig.appConfig.ecmHost; this.config.hostBpm = browser.params.testConfig.appConfig.bpmHost; } if (clientIdOrAppConfig && typeof clientIdOrAppConfig !== 'string') { + Logger.log('overwrite ApiService config param'); + this.config = { ...this.config, ...clientIdOrAppConfig }; this.config.hostEcm = clientIdOrAppConfig.hostEcm ? clientIdOrAppConfig.hostEcm : this.config.hostEcm; @@ -54,6 +58,8 @@ export class ApiService { } if (hostSso) { + Logger.log('overwrite ApiService hostSso param'); + this.config.oauth2.host = hostSso; } diff --git a/lib/testing/src/lib/core/actions/drop.actions.ts b/lib/testing/src/lib/core/actions/drop.actions.ts index c3b1b38acd..e8dc6d1126 100644 --- a/lib/testing/src/lib/core/actions/drop.actions.ts +++ b/lib/testing/src/lib/core/actions/drop.actions.ts @@ -18,7 +18,6 @@ import { browser, ElementFinder } from 'protractor'; import * as path from 'path'; import * as fs from 'fs'; -import * as remote from 'selenium-webdriver/remote'; import { BrowserActions } from '../utils/browser-actions'; const JS_BIND_INPUT = function(target) { @@ -78,8 +77,6 @@ const JS_BIND_INPUT_FOLDER = function(target) { export class DropActions { static async dropFile(dropArea, filePath) { - browser.setFileDetector(new remote.FileDetector()); - const absolutePath = path.resolve(path.join(browser.params.testConfig.main.rootPath, filePath)); fs.accessSync(absolutePath, fs.constants.F_OK); @@ -89,8 +86,6 @@ export class DropActions { } static async dropFolder(dropArea, folderPath) { - browser.setFileDetector(new remote.FileDetector()); - const absolutePath = path.resolve(path.join(browser.params.testConfig.main.rootPath, folderPath)); fs.accessSync(absolutePath, fs.constants.F_OK); diff --git a/lib/testing/src/lib/core/actions/users.actions.ts b/lib/testing/src/lib/core/actions/users.actions.ts index 9075f14ddb..658bdec6e1 100644 --- a/lib/testing/src/lib/core/actions/users.actions.ts +++ b/lib/testing/src/lib/core/actions/users.actions.ts @@ -17,7 +17,6 @@ import * as path from 'path'; import * as fs from 'fs'; -import * as remote from 'selenium-webdriver/remote'; import { browser } from 'protractor'; import { ImageUploadRepresentation, UserRepresentation } from '@alfresco/js-api'; @@ -99,6 +98,11 @@ export class UsersActions { return user; } + async createUserWithName(firstName: string, lastName: string): Promise { + const user = new UserModel({ firstName: firstName, lastName: lastName}); + return this.createUser(user); + } + async createTenantAndUser(email?: string, firstName?: string, lastName?: string, password?: string): Promise { const newTenant = await this.api.apiService.activiti.adminTenantsApi.createTenant(new Tenant()); @@ -127,8 +131,6 @@ export class UsersActions { } async changeProfilePictureAps(fileLocation: string): Promise { - browser.setFileDetector(new remote.FileDetector()); - const pathFile = path.join(browser.params.testConfig.main.rootPath + fileLocation); const file = fs.createReadStream(pathFile); diff --git a/lib/testing/src/lib/core/pages/card-view/card-view-date-item.page.ts b/lib/testing/src/lib/core/pages/card-view/card-view-date-item.page.ts index 69cd028dea..d832ed4e42 100644 --- a/lib/testing/src/lib/core/pages/card-view/card-view-date-item.page.ts +++ b/lib/testing/src/lib/core/pages/card-view/card-view-date-item.page.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { element, by, ElementFinder } from 'protractor'; +import { Locator, element, by, ElementFinder } from 'protractor'; import { DateTimePickerPage } from '../material/date-time-picker.page'; import { DatePickerPage } from '../material/date-picker.page'; import { BrowserVisibility } from '../../utils/browser-visibility'; @@ -26,10 +26,10 @@ export class CardDateItemPage { dateTimePickerPage: DateTimePickerPage; datePickerPage = new DatePickerPage(); - labelLocator = by.css('div[data-automation-id*="card-dateitem-label"]'); - valueLocator = by.css('span[data-automation-id*="card-date"]'); + labelLocator: Locator = by.css('div[data-automation-id*="card-dateitem-label"]'); + valueLocator: Locator = by.css('span[data-automation-id*="card-date"]'); dateTimePicker = element.all(by.css('.mat-datetimepicker-toggle')).first(); - saveButton = by.css('button[data-automation-id*="card-dateitem-update"]'); + saveButton: Locator = by.css('button[data-automation-id*="card-dateitem-update"]'); constructor(label: string = 'minDate') { this.rootElement = element(by.xpath(`//div[contains(@data-automation-id, "label-${label}")]/ancestor::adf-card-view-dateitem`)); diff --git a/lib/testing/src/lib/core/pages/card-view/card-view-text-item.page.ts b/lib/testing/src/lib/core/pages/card-view/card-view-text-item.page.ts index 87c9e5e0b1..49230af0ff 100644 --- a/lib/testing/src/lib/core/pages/card-view/card-view-text-item.page.ts +++ b/lib/testing/src/lib/core/pages/card-view/card-view-text-item.page.ts @@ -15,19 +15,19 @@ * limitations under the License. */ -import { element, by, ElementFinder, Key } from 'protractor'; +import { Locator, element, by, ElementFinder, Key } from 'protractor'; import { BrowserActions, BrowserVisibility } from '../../utils/public-api'; export class CardTextItemPage { rootElement: ElementFinder; - textField = by.css('[data-automation-id*="card-textitem-value"]'); - saveButton = by.css('button[data-automation-id*="card-textitem-update"]'); - clearButton = by.css('button[data-automation-id*="card-textitem-reset"]'); - field = by.css('[data-automation-id*="card-textitem-value"]'); - labelLocator = by.css('div[data-automation-id*="card-textitem-label"]'); - errorMessage = by.css('.adf-textitem-editable-error'); - clickableElement = by.css('.adf-textitem-clickable'); - readOnlyField = by.css('.adf-property-read-only'); + textField: Locator = by.css('[data-automation-id*="card-textitem-value"]'); + saveButton: Locator = by.css('button[data-automation-id*="card-textitem-update"]'); + clearButton: Locator = by.css('button[data-automation-id*="card-textitem-reset"]'); + field: Locator = by.css('[data-automation-id*="card-textitem-value"]'); + labelLocator: Locator = by.css('div[data-automation-id*="card-textitem-label"]'); + errorMessage: Locator = by.css('.adf-textitem-editable-error'); + clickableElement: Locator = by.css('.adf-textitem-clickable'); + readOnlyField: Locator = by.css('.adf-property-read-only'); constructor(label: string = 'assignee') { this.rootElement = element(by.xpath(`//div[contains(@data-automation-id, "label-${label}")]/ancestor::adf-card-view-textitem`)); 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 d820763f8a..708c20d70e 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 @@ -15,9 +15,10 @@ * limitations under the License. */ -import { browser, by, element, protractor, ElementFinder, ElementArrayFinder } from 'protractor'; +import { Locator, browser, by, element, protractor, ElementFinder, ElementArrayFinder } from 'protractor'; import { BrowserVisibility } from '../utils/browser-visibility'; import { BrowserActions } from '../utils/browser-actions'; +import { Logger } from '../utils/logger'; export class DataTableComponentPage { @@ -25,7 +26,7 @@ export class DataTableComponentPage { list: ElementArrayFinder; contents: ElementArrayFinder; tableBody: ElementFinder; - rows = by.css(`adf-datatable div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row']`); + rows: Locator = by.css(`adf-datatable div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row']`); allColumns: ElementArrayFinder; selectedRowNumber: ElementFinder; allSelectedRows: ElementArrayFinder; @@ -177,7 +178,12 @@ export class DataTableComponentPage { } async numberOfRows(): Promise { - return this.rootElement.all(this.rows).count(); + try { + await this.waitForFirstRow(); + return this.rootElement.all(this.rows).count(); + } catch (e) { + return 0; + } } async waitForFirstRow(): Promise { @@ -186,7 +192,7 @@ export class DataTableComponentPage { async getAllRowsColumnValues(column: string): Promise { let columnValues: string[] = []; - const columnLocator = by.css("adf-datatable div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row'] div[title='" + column + "'] span"); + const columnLocator: Locator = by.css("adf-datatable div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row'] div[title='" + column + "'] span"); try { await BrowserVisibility.waitUntilElementIsPresent(element.all(columnLocator).first(), 1000); @@ -200,7 +206,7 @@ export class DataTableComponentPage { } async getRowsWithSameColumnValues(columnName: string, columnValue: string) { - const columnLocator = by.css(`div[title='${columnName}'] div[data-automation-id="text_${columnValue}"] span`); + const columnLocator: Locator = by.css(`div[title='${columnName}'] div[data-automation-id="text_${columnValue}"] span`); await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.all(columnLocator).first()); return this.rootElement.all(columnLocator).getText(); } @@ -230,7 +236,7 @@ export class DataTableComponentPage { * @param sortOrder : 'ASC' to sort the list ascendant and 'DESC' for descendant */ async sortByColumn(sortOrder: string, titleColumn: string): Promise { - const locator = by.css(`div[data-automation-id="auto_id_${titleColumn}"]`); + const locator: Locator = by.css(`div[data-automation-id="auto_id_${titleColumn}"]`); await BrowserVisibility.waitUntilElementIsVisible(element(locator)); const result = await element(locator).getAttribute('class'); if (sortOrder.toLocaleLowerCase() === 'asc') { @@ -281,7 +287,18 @@ export class DataTableComponentPage { } async waitTillContentLoaded(): Promise { - await browser.driver.sleep(500); + await browser.sleep(500); + Logger.log('wait datatable loading'); + + if (element(by.tagName('mat-spinner')).isPresent()) { + await BrowserVisibility.waitUntilElementIsNotPresent(element(by.tagName('mat-spinner'))); + } else { + try { + await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-spinner')), 500); + } catch (error) { + } + } + await BrowserVisibility.waitUntilElementIsVisible(this.contents.first()); } diff --git a/lib/testing/src/lib/core/pages/form/form-fields.ts b/lib/testing/src/lib/core/pages/form/form-fields.ts index e3b1e3483f..a07e2dcb32 100644 --- a/lib/testing/src/lib/core/pages/form/form-fields.ts +++ b/lib/testing/src/lib/core/pages/form/form-fields.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { by, element, ElementFinder } from 'protractor'; +import { Locator, by, element, ElementFinder } from 'protractor'; import { BrowserVisibility, BrowserActions } from '../../utils/public-api'; import { DropdownPage } from '../material/dropdown.page'; @@ -24,8 +24,8 @@ export class FormFields { formContent = element(by.css('adf-form-renderer')); refreshButton = element(by.css('div[class*="form-reload-button"] mat-icon')); saveButton = element(by.cssContainingText('mat-card-actions[class*="adf-for"] span', 'SAVE')); - valueLocator = by.css('input'); - labelLocator = by.css('label'); + valueLocator: Locator = by.css('input'); + labelLocator: Locator = by.css('label'); noFormMessage = element(by.css('.adf-empty-content__title')); noFormMessageStandaloneTask = element(by.css('adf-task-standalone #adf-no-form-message')); noFormTemplate = element(by.css('adf-empty-content')); @@ -35,7 +35,7 @@ export class FormFields { completeButton = element(by.id('adf-form-complete')); completeNoFormButton = element(by.id('adf-no-form-complete-button')); cancelButton = element(by.css('#adf-no-form-cancel-button')); - errorMessage = by.css('.adf-error-text-container .adf-error-text'); + errorMessage: Locator = by.css('.adf-error-text-container .adf-error-text'); selectFormDropdown = new DropdownPage(element.all(by.css('.adf-attach-form .mat-select-arrow')).first()); @@ -89,7 +89,7 @@ export class FormFields { async getFieldPlaceHolder(fieldId: string, locator = 'input'): Promise { const placeHolderLocator = element(by.css(`${locator}#${fieldId}`)); await BrowserVisibility.waitUntilElementIsVisible(placeHolderLocator); - return placeHolderLocator.getAttribute('placeholder'); + return placeHolderLocator.getAttribute('data-placeholder'); } async checkFieldValue(locator, field, val): Promise { diff --git a/lib/testing/src/lib/core/pages/form/widgets/attach-file-widget.page.ts b/lib/testing/src/lib/core/pages/form/widgets/attach-file-widget.page.ts index e2ab396fda..6f5f01184f 100644 --- a/lib/testing/src/lib/core/pages/form/widgets/attach-file-widget.page.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/attach-file-widget.page.ts @@ -17,15 +17,14 @@ import { FormFields } from '../form-fields'; import { BrowserVisibility, BrowserActions } from '../../../utils/public-api'; -import * as remote from 'selenium-webdriver/remote'; -import { element, by, browser } from 'protractor'; +import { Locator, element, by, browser } from 'protractor'; export class AttachFileWidgetPage { formFields = new FormFields(); - uploadLocator = by.css('button[id="attachfile"]'); + uploadLocator: Locator = by.css('button[id="attachfile"]'); localStorageButton = element(by.css('input[id="attachfile"]')); - filesListLocator = by.css('div[id="adf-attach-widget-readonly-list"]'); + filesListLocator: Locator = by.css('div[id="adf-attach-widget-readonly-list"]'); attachFileWidget = element(by.css('#attachfile')); attachedFileMenu = element(by.css('mat-list-item button')); attachedFileOptions = element(by.css('.mat-menu-panel .mat-menu-content')); @@ -34,7 +33,6 @@ export class AttachFileWidgetPage { removeFileOptionButton = element(by.css(`.mat-menu-panel .mat-menu-content button[id$="remove"]`)); async attachFile(fieldId, fileLocation): Promise { - browser.setFileDetector(new remote.FileDetector()); const widget = await this.formFields.getWidget(fieldId); const uploadButton = await widget.element(this.uploadLocator); await BrowserActions.click(uploadButton); @@ -107,7 +105,6 @@ export class AttachFileWidgetPage { } async checkUploadIsNotVisible(fieldId): Promise { - browser.setFileDetector(new remote.FileDetector()); const widget = await this.formFields.getWidget(fieldId); const uploadButton = await widget.element(this.uploadLocator); await BrowserVisibility.waitUntilElementIsNotPresent(uploadButton); @@ -119,7 +116,6 @@ export class AttachFileWidgetPage { } async clickUploadButton(fieldId): Promise { - browser.setFileDetector(new remote.FileDetector()); await BrowserActions.closeMenuAndDialogs(); const widget = await this.formFields.getWidget(fieldId); const uploadButton = await widget.element(this.uploadLocator); diff --git a/lib/testing/src/lib/core/pages/form/widgets/attach-folder-widget.page.ts b/lib/testing/src/lib/core/pages/form/widgets/attach-folder-widget.page.ts index 88fc855f91..7e803b8bf6 100644 --- a/lib/testing/src/lib/core/pages/form/widgets/attach-folder-widget.page.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/attach-folder-widget.page.ts @@ -15,18 +15,16 @@ * limitations under the License. */ -import * as remote from 'selenium-webdriver/remote'; -import { browser, by, element } from 'protractor'; +import { Locator, by, element } from 'protractor'; import { FormFields } from '../form-fields'; import { BrowserActions, BrowserVisibility } from '../../../utils/public-api'; export class AttachFolderWidgetPage { formFields: FormFields = new FormFields(); - foldersListLocator = by.css('.adf-attach-folder-result'); + foldersListLocator: Locator = by.css('.adf-attach-folder-result'); async clickWidget(fieldId: string): Promise { - browser.setFileDetector(new remote.FileDetector()); const widget = await this.formFields.getWidget(fieldId).element(by.css(`button[id="folder-${fieldId}-button"]`)); await BrowserActions.click(widget); } diff --git a/lib/testing/src/lib/core/pages/form/widgets/checkbox-widget.page.ts b/lib/testing/src/lib/core/pages/form/widgets/checkbox-widget.page.ts index 2fe6a35738..753c32192e 100644 --- a/lib/testing/src/lib/core/pages/form/widgets/checkbox-widget.page.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/checkbox-widget.page.ts @@ -17,13 +17,13 @@ import { FormFields } from '../form-fields'; import { BrowserActions, BrowserVisibility } from '../../../utils/public-api'; -import { by, element } from 'protractor'; +import { Locator, by, element } from 'protractor'; export class CheckboxWidgetPage { formFields = new FormFields(); checkboxLabel = element(by.css('span[class*="mat-checkbox-label"]')); - checkboxLocator = by.css('mat-checkbox'); + checkboxLocator: Locator = by.css('mat-checkbox'); getCheckboxLabel(): Promise { return BrowserActions.getText(this.checkboxLabel); diff --git a/lib/testing/src/lib/core/pages/form/widgets/dynamic-table-widget.page.ts b/lib/testing/src/lib/core/pages/form/widgets/dynamic-table-widget.page.ts index cc8287cf61..f0392d782c 100644 --- a/lib/testing/src/lib/core/pages/form/widgets/dynamic-table-widget.page.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/dynamic-table-widget.page.ts @@ -16,15 +16,15 @@ */ import { FormFields } from '../form-fields'; -import { by, element, protractor } from 'protractor'; +import { Locator, by, element, protractor } from 'protractor'; import { BrowserVisibility, BrowserActions } from '../../../utils/public-api'; export class DynamicTableWidgetPage { formFields = new FormFields(); - labelLocator = by.css('dynamic-table-widget div div'); - columnNameLocator = by.css('table[id*="dynamic-table"] th'); + labelLocator: Locator = by.css('dynamic-table-widget div div'); + columnNameLocator: Locator = by.css('table[id*="dynamic-table"] th'); cancelButton = element(by.cssContainingText('button span', 'Cancel')); editButton = element(by.cssContainingText('button span', 'edit')); columnDateTime = element(by.id('columnDateTime')); diff --git a/lib/testing/src/lib/core/pages/form/widgets/group-widget.page.ts b/lib/testing/src/lib/core/pages/form/widgets/group-widget.page.ts index 52b00dede0..23768daa2a 100644 --- a/lib/testing/src/lib/core/pages/form/widgets/group-widget.page.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/group-widget.page.ts @@ -16,7 +16,7 @@ */ import { FormFields } from '../form-fields'; -import { by, element } from 'protractor'; +import { Locator, by, element } from 'protractor'; import { BrowserVisibility, BrowserActions } from '../../../utils/public-api'; export class GroupWidgetPage { @@ -24,7 +24,7 @@ export class GroupWidgetPage { groupField = element(by.css('input[data-automation-id="adf-group-search-input"]')); firstResult = element(by.id('adf-group-widget-user-0')); formFields = new FormFields(); - groupDropDownList = by.css('.mat-autocomplete-panel'); + groupDropDownList: Locator = by.css('.mat-autocomplete-panel'); getFieldLabel(fieldId: string): Promise { return this.formFields.getFieldLabel(fieldId); @@ -52,7 +52,7 @@ export class GroupWidgetPage { } async getDropDownList(): Promise { - const user = by.css('[id="adf-group-label-name"]'); + const user: Locator = by.css('[id="adf-group-label-name"]'); await BrowserVisibility.waitUntilElementIsVisible(element(user)); return element.all(user).map((elementFinder) => elementFinder.getText()); } diff --git a/lib/testing/src/lib/core/pages/form/widgets/hyperlink-widget.page.ts b/lib/testing/src/lib/core/pages/form/widgets/hyperlink-widget.page.ts index 9f8d87c14d..e69015fd8f 100644 --- a/lib/testing/src/lib/core/pages/form/widgets/hyperlink-widget.page.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/hyperlink-widget.page.ts @@ -16,13 +16,13 @@ */ import { FormFields } from '../form-fields'; -import { by, element } from 'protractor'; +import { Locator, by, element } from 'protractor'; import { BrowserActions } from '../../../utils/public-api'; export class HyperlinkWidgetPage { formFields = new FormFields(); - fieldLocator = by.css('.adf-hyperlink-widget a'); + fieldLocator: Locator = by.css('.adf-hyperlink-widget a'); async getFieldText(fieldId: string): Promise { return this.formFields.getFieldText(fieldId, this.fieldLocator); diff --git a/lib/testing/src/lib/core/pages/form/widgets/multiline-text-widget.page.ts b/lib/testing/src/lib/core/pages/form/widgets/multiline-text-widget.page.ts index 59823aa26b..e013382fdd 100644 --- a/lib/testing/src/lib/core/pages/form/widgets/multiline-text-widget.page.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/multiline-text-widget.page.ts @@ -16,7 +16,7 @@ */ import { FormFields } from '../form-fields'; -import { by, Locator } from 'protractor'; +import { Locator, by } from 'protractor'; export class MultilineTextWidgetPage { diff --git a/lib/testing/src/lib/core/pages/form/widgets/people-widget.page.ts b/lib/testing/src/lib/core/pages/form/widgets/people-widget.page.ts index 3c0885f14e..f8ea411740 100644 --- a/lib/testing/src/lib/core/pages/form/widgets/people-widget.page.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/people-widget.page.ts @@ -16,7 +16,7 @@ */ import { FormFields } from '../form-fields'; -import { by, element } from 'protractor'; +import { by, element, Locator } from 'protractor'; import { BrowserVisibility, BrowserActions } from '../../../utils/public-api'; export class PeopleWidgetPage { @@ -24,9 +24,9 @@ export class PeopleWidgetPage { peopleField = element(by.css('input[data-automation-id="adf-people-search-input"]')); firstResult = element(by.id('adf-people-widget-user-0')); formFields = new FormFields(); - labelLocator = by.css('div[class*="display-text-widget"]'); - inputLocator = by.id('involvepeople'); - peopleDropDownList = by.css('div[class*="adf-people-widget-list"]'); + labelLocator: Locator = by.css('div[class*="display-text-widget"]'); + inputLocator: Locator = by.id('involvepeople'); + peopleDropDownList: Locator = by.css('div[class*="adf-people-widget-list"]'); getFieldLabel(fieldId: string): Promise { return this.formFields.getFieldLabel(fieldId, this.labelLocator); @@ -60,7 +60,7 @@ export class PeopleWidgetPage { async getDropDownList(): Promise { await this.checkDropDownListIsDisplayed(); - const users = by.css('.adf-people-label-name'); + const users: Locator = by.css('.adf-people-label-name'); await BrowserVisibility.waitUntilElementIsVisible(element(users)); return element.all(users).map((elementFinder) => elementFinder.getText()); } diff --git a/lib/testing/src/lib/core/pages/form/widgets/radio-buttons-widget.page.ts b/lib/testing/src/lib/core/pages/form/widgets/radio-buttons-widget.page.ts index 08592c3120..a8c2a09213 100644 --- a/lib/testing/src/lib/core/pages/form/widgets/radio-buttons-widget.page.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/radio-buttons-widget.page.ts @@ -26,14 +26,14 @@ export class RadioButtonsWidgetPage { formFields: FormFields = new FormFields(); async getSpecificOptionLabel(fieldId, optionNumber): Promise { - const optionLocator = by.css('label[for*="radiobuttons-option_' + optionNumber + '"]'); + const optionLocator: Locator = by.css('label[for*="radiobuttons-option_' + optionNumber + '"]'); const widget = await this.formFields.getWidget(fieldId); const option = widget.element(optionLocator); return BrowserActions.getText(option); } async selectOption(fieldId, optionNumber): Promise { - const optionLocator = by.css(`label[for*="${fieldId}-option_${optionNumber}"]`); + const optionLocator: Locator = by.css(`label[for*="${fieldId}-option_${optionNumber}"]`); const widget = await this.formFields.getWidget(fieldId); const option = widget.element(optionLocator); await BrowserActions.click(option); diff --git a/lib/testing/src/lib/core/pages/form/widgets/typeahead-widget.page.ts b/lib/testing/src/lib/core/pages/form/widgets/typeahead-widget.page.ts index e2611f4401..f0090d4497 100644 --- a/lib/testing/src/lib/core/pages/form/widgets/typeahead-widget.page.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/typeahead-widget.page.ts @@ -16,7 +16,7 @@ */ import { FormFields } from '../form-fields'; -import { by, element } from 'protractor'; +import { Locator, by, element } from 'protractor'; import { BrowserVisibility, BrowserActions } from '../../../utils/public-api'; export class TypeaheadWidgetPage { @@ -24,7 +24,7 @@ export class TypeaheadWidgetPage { field = element(by.css('input[data-automation-id="adf-typeahed-search-input"]')); firstResult = element(by.id('adf-typeahed-widget-user-0')); formFields = new FormFields(); - groupDropDownList = by.css('.mat-autocomplete-panel'); + groupDropDownList: Locator = by.css('.mat-autocomplete-panel'); getFieldLabel(fieldId: string): Promise { return this.formFields.getFieldLabel(fieldId); @@ -52,7 +52,7 @@ export class TypeaheadWidgetPage { } async getDropDownList(): Promise { - const option = by.css('[id="adf-typeahed-label-name"]'); + const option: Locator = by.css('[id="adf-typeahed-label-name"]'); await BrowserVisibility.waitUntilElementIsVisible(element(option)); return element.all(option).map((elementFinder) => elementFinder.getText()); } @@ -68,7 +68,7 @@ export class TypeaheadWidgetPage { async fillTypeaheadField(value: string): Promise { await BrowserVisibility.waitUntilElementIsClickable(this.field); - await BrowserActions.clearSendKeys(this.field, value); + await BrowserActions.clearSendKeys(this.field, value, 10); } async selectOptionFromDropdown(): Promise { diff --git a/lib/testing/src/lib/core/pages/info-drawer.page.ts b/lib/testing/src/lib/core/pages/info-drawer.page.ts index cc738c691f..5b4409d1a6 100644 --- a/lib/testing/src/lib/core/pages/info-drawer.page.ts +++ b/lib/testing/src/lib/core/pages/info-drawer.page.ts @@ -15,14 +15,14 @@ * limitations under the License. */ -import { element, by, ElementFinder } from 'protractor'; +import { Locator, element, by, ElementFinder } from 'protractor'; import { BrowserVisibility } from './../utils/browser-visibility'; import { TabsPage } from './material/tabs.page'; export class InfoDrawerPage { rootElement: ElementFinder; - infoDrawerHeader = by.css('adf-info-drawer-layout-header'); + infoDrawerHeader: Locator = by.css('adf-info-drawer-layout-header'); tabsPage: TabsPage = new TabsPage(); constructor(classLocator: string = 'adf-info-drawer') { diff --git a/lib/testing/src/lib/core/pages/login.page.ts b/lib/testing/src/lib/core/pages/login.page.ts index e71ad79134..67eeace954 100644 --- a/lib/testing/src/lib/core/pages/login.page.ts +++ b/lib/testing/src/lib/core/pages/login.page.ts @@ -70,8 +70,8 @@ export class LoginPage { const loginURL: string = browser.baseUrl + (browser.params.loginRoute ? browser.params.loginRoute : ''); - await BrowserActions.getUrl(loginURL); const oauth2 = await LocalStorageUtil.getConfigField('oauth2'); + await BrowserActions.getUrl(loginURL); if (oauth2 && oauth2.silentLogin === false) { await this.clickOnSSOButton(); diff --git a/lib/testing/src/lib/core/pages/material/date-time-picker-calendar.page.ts b/lib/testing/src/lib/core/pages/material/date-time-picker-calendar.page.ts index 9ef893cb2d..696052c1a9 100644 --- a/lib/testing/src/lib/core/pages/material/date-time-picker-calendar.page.ts +++ b/lib/testing/src/lib/core/pages/material/date-time-picker-calendar.page.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { element, by } from 'protractor'; +import { Locator, element, by } from 'protractor'; import { BrowserVisibility } from '../../utils/browser-visibility'; import { BrowserActions } from '../../utils/browser-actions'; @@ -26,8 +26,8 @@ export class DateTimePickerCalendarPage { timePicker = element(by.css('.mat-datetimepicker-clock')); hourTime = element.all(by.css('.mat-datetimepicker-clock-hours .mat-datetimepicker-clock-cell')).first(); minutesTime = element.all(by.css('.mat-datetimepicker-clock-minutes .mat-datetimepicker-clock-cell')).first(); - firstEnabledHourSelector = by.css('.mat-datetimepicker-clock-cell:not(.mat-datetimepicker-clock-cell-disabled)'); - firstEnabledMinutesSelector = by.css('.mat-datetimepicker-clock-cell:not(.mat-datetimepicker-clock-cell-disabled)'); + firstEnabledHourSelector: Locator = by.css('.mat-datetimepicker-clock-cell:not(.mat-datetimepicker-clock-cell-disabled)'); + firstEnabledMinutesSelector: Locator = by.css('.mat-datetimepicker-clock-cell:not(.mat-datetimepicker-clock-cell-disabled)'); hoursPicker = element(by.css('.mat-datetimepicker-clock-hours')); minutePicker = element(by.css('.mat-datetimepicker-clock-minutes')); diff --git a/lib/testing/src/lib/core/pages/material/dropdown.page.ts b/lib/testing/src/lib/core/pages/material/dropdown.page.ts index a3dd544483..95fe3070c8 100644 --- a/lib/testing/src/lib/core/pages/material/dropdown.page.ts +++ b/lib/testing/src/lib/core/pages/material/dropdown.page.ts @@ -28,10 +28,12 @@ export class DropdownPage { } async clickDropdown(): Promise { + await BrowserVisibility.waitUntilElementIsVisible(this.dropDownElement); await BrowserActions.click(this.dropDownElement); } async selectOption(option: string): Promise { + await BrowserVisibility.waitUntilElementIsVisible(element.all(by.cssContainingText('mat-option span.mat-option-text', option)).first()); const optionElement = element.all(by.cssContainingText('mat-option span.mat-option-text', option)).first(); await BrowserActions.click(optionElement); } diff --git a/lib/testing/src/lib/core/pages/pagination.page.ts b/lib/testing/src/lib/core/pages/pagination.page.ts index d11cb81693..4019bd79a1 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 { browser, by, element } from 'protractor'; +import { Locator, by, element } from 'protractor'; import { BrowserVisibility } from '../utils/browser-visibility'; import { BrowserActions } from '../utils/browser-actions'; @@ -25,7 +25,7 @@ export class PaginationPage { pageSelectorArrow = element(by.css('button[data-automation-id="page-selector"]')); itemsPerPage = element(by.css('.adf-pagination__max-items')); itemsPerPageOpenDropdown = element(by.css('.adf-pagination__perpage-block button')); - itemsPerPageOptions = by.css('.adf-pagination__page-selector .mat-menu-item'); + itemsPerPageOptions: Locator = by.css('.adf-pagination__page-selector .mat-menu-item'); currentPage = element(by.css('.adf-pagination__current-page')); totalPages = element(by.css('.adf-pagination__total-pages')); paginationRange = element(by.css('.adf-pagination__range')); @@ -33,13 +33,13 @@ export class PaginationPage { nextButtonDisabled = element(by.css('button[class*="adf-pagination__next-button"][disabled]')); previousButtonDisabled = element(by.css('button[class*="adf-pagination__previous-button"][disabled]')); pageDropDown = element(by.css('div[class*="adf-pagination__actualinfo-block"] button')); - pageDropDownOptions = by.css('div[class*="mat-menu-content"] button'); + pageDropDownOptions: Locator = by.css('div[class*="mat-menu-content"] button'); paginationSection = element(by.css('adf-pagination')); paginationSectionEmpty = element(by.css('adf-pagination[class*="adf-pagination__empty"]')); totalFiles = element(by.css('.adf-pagination__range')); async selectItemsPerPage(numberOfItem: string): Promise { - await browser.executeScript(`document.querySelector('div[class*="adf-pagination__perpage-block"] button').click();`); + await BrowserActions.clickExecuteScript(`div[class*="adf-pagination__perpage-block"] button`); await BrowserVisibility.waitUntilElementIsVisible(this.pageSelectorDropDown); const itemsPerPage = element.all(by.cssContainingText('.mat-menu-item', numberOfItem)).first(); await BrowserVisibility.waitUntilElementIsPresent(itemsPerPage); @@ -80,7 +80,7 @@ export class PaginationPage { } async clickOnNextPage(): Promise { - await browser.executeScript(`document.querySelector('button[class*="adf-pagination__next-button"]').click();`); + return BrowserActions.click(this.nextPageButton); } async clickOnPageDropdown(): Promise { @@ -138,13 +138,4 @@ export class PaginationPage { const totalNumberOfFiles = await BrowserActions.getText(this.totalFiles); return totalNumberOfFiles.split('of ')[1]; } - - /* - * Wait until the total number of items is less then specified value - */ - async waitUntilNoOfItemsIsLessThenValue(expectedValue: number): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.totalFiles); - const condition = () => this.totalFiles.getText().then(value => value && +value.split('of ')[1] < expectedValue); - return browser.wait(condition, 10000); - } } diff --git a/lib/testing/src/lib/core/pages/snackbar.page.ts b/lib/testing/src/lib/core/pages/snackbar.page.ts index a0d2837422..cdffb23704 100644 --- a/lib/testing/src/lib/core/pages/snackbar.page.ts +++ b/lib/testing/src/lib/core/pages/snackbar.page.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { element, by } from 'protractor'; +import { Locator, element, by } from 'protractor'; import { BrowserVisibility } from '../utils/browser-visibility'; import { BrowserActions } from '../utils/browser-actions'; @@ -23,7 +23,7 @@ export class SnackbarPage { notificationSnackBar = element.all(by.css('simple-snack-bar span')).first(); snackBarAction = element(by.css('simple-snack-bar button span')); - snackBarContainerCss = by.css('.mat-snack-bar-container'); + snackBarContainerCss: Locator = by.css('.mat-snack-bar-container'); async waitForSnackBarToAppear() { return BrowserVisibility.waitUntilElementIsVisible(element.all(this.snackBarContainerCss).first(), 5000, diff --git a/lib/testing/src/lib/core/utils/browser-actions.ts b/lib/testing/src/lib/core/utils/browser-actions.ts index ddd5521e63..19bfc2420c 100644 --- a/lib/testing/src/lib/core/utils/browser-actions.ts +++ b/lib/testing/src/lib/core/utils/browser-actions.ts @@ -37,11 +37,15 @@ export class BrowserActions { } static async clickScript(elementFinder: ElementFinder): Promise { + Logger.info(`Click script ${elementFinder.locator().toString()}`); + await browser.executeScript(`arguments[0].scrollIntoView();`, elementFinder); await browser.executeScript(`arguments[0].click();`, elementFinder); } static async clickExecuteScript(elementCssSelector: string): Promise { + Logger.info(`Click execute script ${elementCssSelector}`); + await BrowserVisibility.waitUntilElementIsPresent(element(by.css(elementCssSelector))); await browser.executeScript(`document.querySelector('${elementCssSelector}').click();`); } @@ -69,13 +73,26 @@ export class BrowserActions { Logger.info(`Get Text ${elementFinder.locator().toString()}`); const present = await BrowserVisibility.waitUntilElementIsPresent(elementFinder); + if (present) { - return elementFinder.getText(); + let text = await elementFinder.getText(); + + if (text === '') { // DO NOT REMOVE BUG sometime wrongly return empty text for cdk elements + text = await this.getTextScript(elementFinder); + return text?.trim(); + } + + return text; } else { + Logger.error(`Get Text ${elementFinder.locator().toString()} not present`); return ''; } } + 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()}`); @@ -83,6 +100,7 @@ export class BrowserActions { if (present) { return elementFinder.getAttribute('value'); } else { + Logger.error(`Get Input value ${elementFinder.locator().toString()} not present`); return ''; } } @@ -109,13 +127,22 @@ export class BrowserActions { } } - static async clearSendKeys(elementFinder: ElementFinder, text: string): Promise { + static async clearSendKeys(elementFinder: ElementFinder, text: string, sleepTime: number = 0): Promise { Logger.info(`Clear and sendKeys text:${text} locator:${elementFinder.locator().toString()}`); await this.click(elementFinder); await elementFinder.sendKeys(''); await elementFinder.clear(); - await elementFinder.sendKeys(text); + + if (sleepTime === 0) { + await elementFinder.sendKeys(text); + } else { + for (let i = 0; i < text.length; i++) { + await elementFinder.sendKeys(text[i]); + await browser.sleep(sleepTime); + } + } + } static async checkIsDisabled(elementFinder: ElementFinder): Promise { @@ -138,7 +165,7 @@ export class BrowserActions { const container = element(by.css('div.cdk-overlay-backdrop.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing')); await browser.actions().sendKeys(protractor.Key.ESCAPE).perform(); - await BrowserVisibility.waitUntilElementIsNotVisible(container); + await BrowserVisibility.waitUntilElementIsNotVisible(container, 1000); } static async closeDisabledMenu(): Promise { diff --git a/lib/testing/src/lib/core/utils/browser-visibility.ts b/lib/testing/src/lib/core/utils/browser-visibility.ts index 446ca84063..6c3fd66437 100644 --- a/lib/testing/src/lib/core/utils/browser-visibility.ts +++ b/lib/testing/src/lib/core/utils/browser-visibility.ts @@ -83,7 +83,16 @@ export class BrowserVisibility { static async waitUntilElementHasValue(elementToCheck: ElementFinder, elementValue, waitTimeout: number = BrowserVisibility.DEFAULT_TIMEOUT): Promise { Logger.info(`Wait Until Element has value ${elementToCheck.locator().toString()} for ${waitTimeout}`); - return browser.wait(protractor.ExpectedConditions.textToBePresentInElementValue(elementToCheck, elementValue), waitTimeout, 'Element doesn\'t have a value ' + elementToCheck.locator()); + return browser.wait(protractor.ExpectedConditions.textToBePresentInElementValue(elementToCheck, elementValue), waitTimeout, `Element doesn\'t have a value ${elementValue} ${elementToCheck.locator()}`); + } + + /* + * Wait for element to have text + */ + static async waitUntilElementHasText(elementToCheck: ElementFinder, text, waitTimeout: number = BrowserVisibility.DEFAULT_TIMEOUT): Promise { + Logger.info(`Wait Until Element has value ${elementToCheck.locator().toString()} for ${waitTimeout}`); + + return browser.wait(protractor.ExpectedConditions.textToBePresentInElement(elementToCheck, text), waitTimeout, `Element doesn\'t have the text ${text} ${elementToCheck.locator()}`); } static async waitUntilElementIsNotPresent(elementToCheck: ElementFinder, waitTimeout: number = BrowserVisibility.NOT_VISIBLE_DEFAULT_TIMEOUT): Promise { diff --git a/lib/testing/src/lib/process-services-cloud/pages/dialog/edit-process-filter-dialog.page.ts b/lib/testing/src/lib/process-services-cloud/pages/dialog/edit-process-filter-dialog.page.ts index 03ce37ec44..95617cf47b 100644 --- a/lib/testing/src/lib/process-services-cloud/pages/dialog/edit-process-filter-dialog.page.ts +++ b/lib/testing/src/lib/process-services-cloud/pages/dialog/edit-process-filter-dialog.page.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { browser, by, element } from 'protractor'; +import { Locator, browser, by, element } from 'protractor'; import { BrowserVisibility } from '../../../core/utils/browser-visibility'; import { BrowserActions } from '../../../core/utils/browser-actions'; @@ -24,8 +24,8 @@ export class EditProcessFilterDialogPage { componentElement = element(by.css('adf-cloud-process-filter-dialog-cloud')); title = element(by.id('adf-process-filter-dialog-title')); filterNameInput = element(by.id('adf-filter-name-id')); - saveButtonLocator = by.id('adf-save-button-id'); - cancelButtonLocator = by.id('adf-cancel-button-id'); + saveButtonLocator: Locator = by.id('adf-save-button-id'); + cancelButtonLocator: Locator = by.id('adf-cancel-button-id'); async clickOnSaveButton(): Promise { const saveButton = this.componentElement.element(this.saveButtonLocator); diff --git a/lib/testing/src/lib/process-services-cloud/pages/dialog/edit-task-filter-dialog.page.ts b/lib/testing/src/lib/process-services-cloud/pages/dialog/edit-task-filter-dialog.page.ts index e158a8893d..38386c92af 100644 --- a/lib/testing/src/lib/process-services-cloud/pages/dialog/edit-task-filter-dialog.page.ts +++ b/lib/testing/src/lib/process-services-cloud/pages/dialog/edit-task-filter-dialog.page.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { browser, by, element } from 'protractor'; +import { browser, by, element, Locator } from 'protractor'; import { BrowserVisibility } from '../../../core/utils/browser-visibility'; import { BrowserActions } from '../../../core/utils/browser-actions'; @@ -24,8 +24,8 @@ export class EditTaskFilterDialogPage { componentElement = element(by.css('adf-cloud-task-filter-dialog')); title = element(by.id('adf-task-filter-dialog-title')); filterNameInput = element(by.id('adf-filter-name-id')); - saveButtonLocator = by.id('adf-save-button-id'); - cancelButtonLocator = by.id('adf-cancel-button-id'); + saveButtonLocator: Locator = by.id('adf-save-button-id'); + cancelButtonLocator: Locator = by.id('adf-cancel-button-id'); async clickOnSaveButton(): Promise { const saveButton = this.componentElement.element(this.saveButtonLocator); 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 acf968bcf9..6668fc957e 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 @@ -30,8 +30,8 @@ export class EditTaskFilterCloudComponentPage { id = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-taskId"]')); processDefinitionId = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-processDefinitionId"]')); processInstanceId = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-processInstanceId"]')); - lastModifiedFrom = element(by.css('input[placeholder="LastModifiedFrom"]')); - lastModifiedTo = element(by.css('input[placeholder="LastModifiedTo"]')); + lastModifiedFrom = element(by.css('input[data-placeholder="LastModifiedFrom"]')); + lastModifiedTo = element(by.css('input[data-placeholder="LastModifiedTo"]')); parentTaskId = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-parentTaskId"]')); owner = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-owner"]')); saveButton = element(by.css('[data-automation-id="adf-filter-action-save"]')); diff --git a/lib/testing/src/lib/process-services-cloud/pages/form/widget/attach-file-widget-cloud.page.ts b/lib/testing/src/lib/process-services-cloud/pages/form/widget/attach-file-widget-cloud.page.ts index de2565ee8f..c63949989d 100644 --- a/lib/testing/src/lib/process-services-cloud/pages/form/widget/attach-file-widget-cloud.page.ts +++ b/lib/testing/src/lib/process-services-cloud/pages/form/widget/attach-file-widget-cloud.page.ts @@ -15,15 +15,14 @@ * limitations under the License. */ -import * as remote from 'selenium-webdriver/remote'; -import { element, by, browser, ElementFinder } from 'protractor'; +import { Locator, element, by, ElementFinder } from 'protractor'; import { BrowserActions } from '../../../../core/utils/browser-actions'; import { BrowserVisibility } from '../../../../core/utils/browser-visibility'; export class AttachFileWidgetCloudPage { widget: ElementFinder; - filesListLocator = by.css('div[id="adf-attach-widget-readonly-list"]'); + filesListLocator: Locator = by.css('div[id="adf-attach-widget-readonly-list"]'); constructor(fieldId: string) { this.assignWidget(fieldId); @@ -34,7 +33,6 @@ export class AttachFileWidgetCloudPage { } async attachLocalFile(fileLocation: string): Promise { - await browser.setFileDetector(new remote.FileDetector()); const uploadButton = element(by.css('adf-upload-button input')); await BrowserVisibility.waitUntilElementIsPresent(uploadButton); await uploadButton.sendKeys(fileLocation); diff --git a/lib/testing/src/lib/process-services-cloud/pages/people-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/people-cloud-component.page.ts index d96b84c3db..cfb7e89ef9 100644 --- a/lib/testing/src/lib/process-services-cloud/pages/people-cloud-component.page.ts +++ b/lib/testing/src/lib/process-services-cloud/pages/people-cloud-component.page.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { by, element, protractor } from 'protractor'; +import { Locator, by, element, protractor } from 'protractor'; import { BrowserVisibility } from '../../core/utils/browser-visibility'; import { BrowserActions } from '../../core/utils/browser-actions'; import { FormFields } from '../../core/pages/form/form-fields'; @@ -26,8 +26,8 @@ export class PeopleCloudComponentPage { assigneeField = element(by.css('input[data-automation-id="adf-people-cloud-search-input"]')); selectionReady = element(by.css('div[data-automation-id="adf-people-cloud-row"]')); formFields = new FormFields(); - labelLocator = by.css("label[class*='adf-label']"); - inputLocator = by.css('input'); + labelLocator: Locator = by.css("label[class*='adf-label']"); + inputLocator: Locator = by.css('input'); assigneeChipList = element(by.css('mat-chip-list[data-automation-id="adf-cloud-people-chip-list"]')); async clearAssignee(): Promise { diff --git a/lib/testing/src/lib/process-services-cloud/pages/process-filters-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/process-filters-cloud-component.page.ts index 0b6a23358b..5e6ade2166 100644 --- a/lib/testing/src/lib/process-services-cloud/pages/process-filters-cloud-component.page.ts +++ b/lib/testing/src/lib/process-services-cloud/pages/process-filters-cloud-component.page.ts @@ -15,14 +15,14 @@ * limitations under the License. */ -import { by, element, ElementFinder } from 'protractor'; +import { Locator, by, element, ElementFinder } from 'protractor'; import { BrowserVisibility } from '../../core/utils/browser-visibility'; import { BrowserActions } from '../../core/utils/browser-actions'; export class ProcessFiltersCloudComponentPage { filter: ElementFinder; - filterIcon = by.css('adf-icon[data-automation-id="adf-filter-icon"]'); + filterIcon: Locator = by.css('adf-icon[data-automation-id="adf-filter-icon"]'); processFilters = element(by.css("mat-expansion-panel[data-automation-id='Process Filters']")); diff --git a/lib/testing/src/lib/process-services-cloud/pages/process-list-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/process-list-cloud-component.page.ts index 3099c24a64..54dd1c18d7 100644 --- a/lib/testing/src/lib/process-services-cloud/pages/process-list-cloud-component.page.ts +++ b/lib/testing/src/lib/process-services-cloud/pages/process-list-cloud-component.page.ts @@ -17,7 +17,7 @@ import { BrowserVisibility } from '../../core/utils/browser-visibility'; import { DataTableComponentPage } from '../../core/pages/data-table-component.page'; -import { element, by, browser } from 'protractor'; +import { Locator, element, by, browser } from 'protractor'; import { BrowserActions } from '../../core/utils/browser-actions'; export class ProcessListCloudComponentPage { @@ -30,7 +30,7 @@ export class ProcessListCloudComponentPage { processList = element(by.css('adf-cloud-process-list')); noProcessFound = element.all(by.css('.adf-empty-content__title')).first(); actionMenu = element(by.css('*[role="menu"]')); - optionButton = by.css('button[data-automation-id*="action_menu_"]'); + optionButton: Locator = by.css('button[data-automation-id*="action_menu_"]'); dataTable = new DataTableComponentPage(this.processList); diff --git a/lib/testing/src/lib/process-services-cloud/pages/task-list-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/task-list-cloud-component.page.ts index 2f26ad3b7f..0ca9e6c00b 100644 --- a/lib/testing/src/lib/process-services-cloud/pages/task-list-cloud-component.page.ts +++ b/lib/testing/src/lib/process-services-cloud/pages/task-list-cloud-component.page.ts @@ -17,7 +17,7 @@ import { BrowserVisibility } from '../../core/utils/browser-visibility'; import { DataTableComponentPage } from '../../core/pages/data-table-component.page'; -import { element, by, ElementFinder } from 'protractor'; +import { element, by, ElementFinder, Locator } from 'protractor'; import { BrowserActions } from '../../core/utils/browser-actions'; const column = { @@ -37,7 +37,7 @@ export class TaskListCloudComponentPage { taskList = element(by.css('adf-cloud-task-list')); noTasksFound = element.all(by.css('.adf-empty-content__title')).first(); actionMenu = element(by.css('*[role="menu"]')); - optionButton = by.css('button[data-automation-id*="action_menu_"]'); + optionButton: Locator = by.css('button[data-automation-id*="action_menu_"]'); dataTable = new DataTableComponentPage(this.taskList); diff --git a/lib/testing/src/lib/process-services/actions/applications.util.ts b/lib/testing/src/lib/process-services/actions/applications.util.ts index 3224b4064f..6e4e3334cc 100644 --- a/lib/testing/src/lib/process-services/actions/applications.util.ts +++ b/lib/testing/src/lib/process-services/actions/applications.util.ts @@ -16,7 +16,6 @@ */ import { Logger } from '../../core/utils/logger'; -import * as remote from 'selenium-webdriver/remote'; import { browser } from 'protractor'; import { ApiService } from '../../core/actions/api.service'; import { AppDefinitionUpdateResultRepresentation } from '@alfresco/js-api'; @@ -50,8 +49,6 @@ export class ApplicationsUtil { } async publishDeployApp(appId: number): Promise { - browser.setFileDetector(new remote.FileDetector()); - const publishApp = await this.api.getInstance().activiti.appsApi.publishAppDefinition(appId, new AppPublish()); await this.api.getInstance().activiti.appsApi.deployAppDefinitions({ appDefinitions: [{ id: publishApp.appDefinition.id }] }); @@ -71,8 +68,6 @@ export class ApplicationsUtil { } async importNewVersionAppDefinitionPublishDeployApp(appFileLocation: string, modelId: number) { - browser.setFileDetector(new remote.FileDetector()); - const pathFile = path.join(browser.params.testConfig.main.rootPath + appFileLocation); const file = fs.createReadStream(pathFile); @@ -87,7 +82,6 @@ export class ApplicationsUtil { async importApplication(appFileLocation: string, options = {}): Promise { try { - browser.setFileDetector(new remote.FileDetector()); const file = fs.createReadStream(appFileLocation); return await this.api.getInstance().activiti.appsDefinitionApi.importAppDefinition(file, options); } catch (error) { diff --git a/lib/testing/src/lib/process-services/pages/filters.page.ts b/lib/testing/src/lib/process-services/pages/filters.page.ts index 407c8b9602..f0e4457a6f 100644 --- a/lib/testing/src/lib/process-services/pages/filters.page.ts +++ b/lib/testing/src/lib/process-services/pages/filters.page.ts @@ -17,13 +17,13 @@ import { BrowserVisibility } from '../../core/utils/browser-visibility'; import { BrowserActions } from '../../core/utils/browser-actions'; -import { by, element, ElementFinder } from 'protractor'; +import { Locator, by, element, ElementFinder } from 'protractor'; export class FiltersPage { accordionMenu = element(by.css('.app-processes-menu mat-accordion')); buttonWindow = element(by.css('div > button[data-automation-id="btn-start-process"] > div')); - processIcon = by.css('adf-icon[data-automation-id="adf-filter-icon"]'); + processIcon: Locator = by.css('adf-icon[data-automation-id="adf-filter-icon"]'); async clickFilterButton(filterElement: ElementFinder): Promise { await BrowserActions.click(filterElement); diff --git a/lib/testing/src/lib/process-services/pages/form-fields.page.ts b/lib/testing/src/lib/process-services/pages/form-fields.page.ts index 1f51f62f4f..82a1aef8c6 100644 --- a/lib/testing/src/lib/process-services/pages/form-fields.page.ts +++ b/lib/testing/src/lib/process-services/pages/form-fields.page.ts @@ -26,13 +26,13 @@ export class FormFieldsPage { formContent = element(by.css('adf-form')); refreshButton = element(by.css('div[class*="form-reload-button"] mat-icon')); saveButton = element(by.cssContainingText('mat-card-actions[class*="adf-for"] span', 'SAVE')); - valueLocator = by.css('input'); - labelLocator = by.css('label'); + valueLocator: Locator = by.css('input'); + labelLocator: Locator = by.css('label'); noFormMessage = element(by.css('.adf-empty-content__title')); completedTaskNoFormMessage = element(by.css('div[id*="completed-form-message"] p')); attachFormButton = element(by.id('adf-attach-form-attach-button')); completeButton = element(by.id('adf-form-complete')); - errorMessage = by.css('.adf-error-text-container .adf-error-text'); + errorMessage: Locator = by.css('.adf-error-text-container .adf-error-text'); selectFormDropdown = new DropdownPage(element.all(by.css('.adf-attach-form .mat-select-arrow')).first()); @@ -86,7 +86,7 @@ export class FormFieldsPage { async getFieldPlaceHolder(fieldId: string, locator = 'input'): Promise { const placeHolderLocator = element(by.css(`${locator}#${fieldId}`)); await BrowserVisibility.waitUntilElementIsVisible(placeHolderLocator); - return placeHolderLocator.getAttribute('placeholder'); + return placeHolderLocator.getAttribute('data-placeholder'); } async checkFieldValue(locator, field, val): Promise { diff --git a/lib/testing/src/lib/process-services/pages/start-process.page.ts b/lib/testing/src/lib/process-services/pages/start-process.page.ts index 3a10050107..4f83401fae 100644 --- a/lib/testing/src/lib/process-services/pages/start-process.page.ts +++ b/lib/testing/src/lib/process-services/pages/start-process.page.ts @@ -75,6 +75,7 @@ export class StartProcessPage { } async clickProcessDropdownArrow(): Promise { + await BrowserVisibility.waitUntilElementIsVisible(this.selectProcessDropdownArrow); await BrowserActions.click(this.selectProcessDropdownArrow); } diff --git a/package-lock.json b/package-lock.json index c3bd3b8a24..8c3fc436c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4131,9 +4131,9 @@ } }, "@types/selenium-webdriver": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.17.tgz", - "integrity": "sha512-tGomyEuzSC1H28y2zlW6XPCaDaXFaD6soTdb4GNdmte2qfHtrKqhy0ZFs4r/1hpazCfEZqeTSRLvSasmEx89uw==", + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-4.0.9.tgz", + "integrity": "sha512-HopIwBE7GUXsscmt/J0DhnFXLSmO04AfxT6b8HAprknwka7pqEWquWDMXxCjd+NUHK9MkCe1SDKKsMiNmCItbQ==", "dev": true }, "@types/semver": { @@ -6960,6 +6960,12 @@ "integrity": "sha512-7p4Kn/gffhQaavNfyDFg7LS5S/UT1JAjyGd4UqR2+jzoYF02eDkj0Ec3+48TsIa4zghjLY87nQHIh/ecK9qLdw==", "dev": true }, + "circular-json": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.5.9.tgz", + "integrity": "sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ==", + "dev": true + }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -7325,6 +7331,12 @@ "simple-swizzle": "^0.2.2" } }, + "colorette": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz", + "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==", + "dev": true + }, "colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", @@ -8083,6 +8095,12 @@ "minimatch": "^3.0.4" }, "dependencies": { + "commander": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.1.0.tgz", + "integrity": "sha512-wl7PNrYWd2y5mp1OK/LhTlv8Ff4kQJQRXXAvF+uU/TPNiVJUxZLRYGj/B0y/lPGAVcSbJqH2Za/cvHmrPMC8mA==", + "dev": true + }, "fs-extra": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", @@ -8861,9 +8879,9 @@ } }, "date-fns": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.15.0.tgz", - "integrity": "sha512-ZCPzAMJZn3rNUvvQIMlXhDr4A+Ar07eLeGsGREoWU19a3Pqf5oYa+ccd+B3F6XVtQY6HANMFdOQ8A+ipFnvJdQ==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.16.1.tgz", + "integrity": "sha512-sAJVKx/FqrLYHAQeN7VpJrPhagZc9R4ImZIWYRFZaaohR3KzmuK88touwsSwSVT8Qcbd4zoDsnGfX4GFB4imyQ==", "dev": true }, "date-format": { @@ -10309,6 +10327,12 @@ "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==" }, + "fastest-levenshtein": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", + "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", + "dev": true + }, "fastparse": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", @@ -13371,59 +13395,6 @@ "colors": "1.4.0" } }, - "jasmine2-protractor-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jasmine2-protractor-utils/-/jasmine2-protractor-utils-1.3.0.tgz", - "integrity": "sha1-lARqq7x0rQpLdGvNTcMFB1h7Z+M=", - "dev": true, - "requires": { - "fs-extra": "^0.26.5", - "mkdirp": "^0.5.1", - "q": "^1.4.1" - }, - "dependencies": { - "fs-extra": { - "version": "0.26.7", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.26.7.tgz", - "integrity": "sha1-muH92UiXeY7at20JGM9C0MMYT6k=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - } - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, "jasminewd2": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/jasminewd2/-/jasminewd2-2.2.0.tgz", @@ -13694,24 +13665,23 @@ } }, "karma": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/karma/-/karma-5.1.1.tgz", - "integrity": "sha512-xAlOr5PMqUbiKXSv5PCniHWV3aiwj6wIZ0gUVcwpTCPVQm/qH2WAMFWxtnpM6KJqhkRWrIpovR4Rb0rn8GtJzQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/karma/-/karma-5.2.0.tgz", + "integrity": "sha512-xT6n0ZVEB48jRHiwA+0nMx5uIah2daQNUZG9wDn9BC/XhFZbmiEid58GykV5m7gYLMa4q2sIFyET6gYuzIwcUw==", "dev": true, "requires": { "body-parser": "^1.19.0", "braces": "^3.0.2", - "chokidar": "^3.0.0", + "chokidar": "^3.4.2", "colors": "^1.4.0", "connect": "^3.7.0", "di": "^0.0.1", "dom-serialize": "^2.2.1", - "flatted": "^2.0.2", "glob": "^7.1.6", "graceful-fs": "^4.2.4", "http-proxy": "^1.18.1", "isbinaryfile": "^4.0.6", - "lodash": "^4.17.15", + "lodash": "^4.17.19", "log4js": "^6.2.1", "mime": "^2.4.5", "minimatch": "^3.0.4", @@ -13719,7 +13689,7 @@ "range-parser": "^1.2.1", "rimraf": "^3.0.2", "socket.io": "^2.3.0", - "source-map": "^0.6.1", + "source-map": "^0.7.3", "tmp": "0.2.1", "ua-parser-js": "0.7.21", "yargs": "^15.3.1" @@ -13814,9 +13784,9 @@ "dev": true }, "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", "dev": true }, "string-width": { @@ -14007,13 +13977,13 @@ "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", "dev": true, "requires": { - "graceful-fs": "^4.1.9" + "graceful-fs": "^4.1.11" } }, "kleur": { @@ -14287,6 +14257,12 @@ "color-name": "~1.1.4" } }, + "commander": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.1.0.tgz", + "integrity": "sha512-wl7PNrYWd2y5mp1OK/LhTlv8Ff4kQJQRXXAvF+uU/TPNiVJUxZLRYGj/B0y/lPGAVcSbJqH2Za/cvHmrPMC8mA==", + "dev": true + }, "cosmiconfig": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", @@ -15478,9 +15454,9 @@ "dev": true }, "meow": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.0.tgz", - "integrity": "sha512-kq5F0KVteskZ3JdfyQFivJEj2RaA8NFsS4+r9DaMKLcUHpk5OcHS3Q0XkCXONB1mZRPsu/Y/qImKri0nwSEZog==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz", + "integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==", "dev": true, "requires": { "@types/minimist": "^1.2.0", @@ -15712,9 +15688,9 @@ "dev": true }, "mini-css-extract-plugin": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.10.0.tgz", - "integrity": "sha512-QgKgJBjaJhxVPwrLNqqwNS0AGkuQQ31Hp4xGXEK/P7wehEg6qmNtReHKai3zRXqY60wGVWLYcOMJK2b98aGc3A==", + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.10.1.tgz", + "integrity": "sha512-9B10gZixtNjHerADBrMxPXM5G0uL0CRGMcLRV67I8nd1SKbwJrI0okKUzD+PxKsUZ9Dxt8/hPvtzF0DrRnrOyA==", "dev": true, "requires": { "loader-utils": "^1.1.0", @@ -18720,29 +18696,6 @@ } } }, - "postcss-reporter": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/postcss-reporter/-/postcss-reporter-6.0.1.tgz", - "integrity": "sha512-LpmQjfRWyabc+fRygxZjpRxfhRf9u/fdlKf4VHG4TSPbV2XNsuISzYW1KL+1aQzx53CAppa1bKG4APIB/DOXXw==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "lodash": "^4.17.11", - "log-symbols": "^2.2.0", - "postcss": "^7.0.7" - }, - "dependencies": { - "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", - "dev": true, - "requires": { - "chalk": "^2.0.1" - } - } - } - }, "postcss-resolve-nested-selector": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz", @@ -18995,6 +18948,12 @@ "integrity": "sha1-vShOV8hPEyXacCur/IKlMoGQwMU=", "dev": true }, + "@types/selenium-webdriver": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.17.tgz", + "integrity": "sha512-tGomyEuzSC1H28y2zlW6XPCaDaXFaD6soTdb4GNdmte2qfHtrKqhy0ZFs4r/1hpazCfEZqeTSRLvSasmEx89uw==", + "dev": true + }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -19506,6 +19465,45 @@ } } }, + "protractor-screenshoter-plugin": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/protractor-screenshoter-plugin/-/protractor-screenshoter-plugin-0.10.3.tgz", + "integrity": "sha512-OF9kGe1rMxBQY4uXzXQUFT14EB83rz8DlDcxmH5HcOHPBpUhGh+Nwo7+K87w1LoLcTuGdG7Bz+/hGwoGguDfsA==", + "dev": true, + "requires": { + "circular-json": "^0.5.1", + "fs-extra": "^7.0.0", + "klaw-sync": "^6.0.0", + "lodash": "^4.17.11", + "mkdirp": "^0.5.1", + "moment": "^2.20.1", + "q": "^1.5.1", + "screenshoter-report-analyzer": "^0.6", + "uuid": "^3.1.0" + }, + "dependencies": { + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + } + } + }, "protractor-smartrunner": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/protractor-smartrunner/-/protractor-smartrunner-0.1.1.tgz", @@ -20105,6 +20103,17 @@ "stringify-entities": "^3.0.0", "unherit": "^1.0.4", "xtend": "^4.0.1" + }, + "dependencies": { + "mdast-util-compact": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-2.0.1.tgz", + "integrity": "sha512-7GlnT24gEwDrdAwEHrU4Vv5lLWrEer4KOkAiKT9nYstsTad7Oc1TwqT2zIMKRdZF7cTuaf+GA1E4Kv7jJh8mPA==", + "dev": true, + "requires": { + "unist-util-visit": "^2.0.0" + } + } } }, "remove-trailing-separator": { @@ -20848,6 +20857,12 @@ "ajv-keywords": "^3.4.1" } }, + "screenshoter-report-analyzer": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/screenshoter-report-analyzer/-/screenshoter-report-analyzer-0.6.0.tgz", + "integrity": "sha1-Cm+I1fXRrBa2z3Ji7/ujH+5I7RI=", + "dev": true + }, "scss-bundle": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/scss-bundle/-/scss-bundle-2.3.2.tgz", @@ -23315,19 +23330,21 @@ } }, "stylelint": { - "version": "13.6.1", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-13.6.1.tgz", - "integrity": "sha512-XyvKyNE7eyrqkuZ85Citd/Uv3ljGiuYHC6UiztTR6sWS9rza8j3UeQv/eGcQS9NZz/imiC4GKdk1EVL3wst5vw==", + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-13.7.0.tgz", + "integrity": "sha512-1wStd4zVetnlHO98VjcHQbjSDmvcA39smkZQMct2cf+hom40H0xlQNdzzbswoG/jGBh61/Ue9m7Lu99PY51O6A==", "dev": true, "requires": { - "@stylelint/postcss-css-in-js": "^0.37.1", + "@stylelint/postcss-css-in-js": "^0.37.2", "@stylelint/postcss-markdown": "^0.36.1", - "autoprefixer": "^9.8.0", + "autoprefixer": "^9.8.6", "balanced-match": "^1.0.0", "chalk": "^4.1.0", - "cosmiconfig": "^6.0.0", + "cosmiconfig": "^7.0.0", "debug": "^4.1.1", "execall": "^2.0.0", + "fast-glob": "^3.2.4", + "fastest-levenshtein": "^1.0.12", "file-entry-cache": "^5.0.1", "get-stdin": "^8.0.0", "global-modules": "^2.0.0", @@ -23338,18 +23355,16 @@ "import-lazy": "^4.0.0", "imurmurhash": "^0.1.4", "known-css-properties": "^0.19.0", - "leven": "^3.1.0", - "lodash": "^4.17.15", + "lodash": "^4.17.20", "log-symbols": "^4.0.0", "mathml-tag-names": "^2.1.3", - "meow": "^7.0.1", + "meow": "^7.1.1", "micromatch": "^4.0.2", "normalize-selector": "^0.2.0", "postcss": "^7.0.32", "postcss-html": "^0.36.0", "postcss-less": "^3.1.4", "postcss-media-query-parser": "^0.2.3", - "postcss-reporter": "^6.0.1", "postcss-resolve-nested-selector": "^0.1.1", "postcss-safe-parser": "^4.0.2", "postcss-sass": "^0.4.4", @@ -23365,7 +23380,7 @@ "style-search": "^0.1.0", "sugarss": "^2.0.0", "svg-tags": "^1.0.0", - "table": "^5.4.6", + "table": "^6.0.1", "v8-compile-cache": "^2.1.1", "write-file-atomic": "^3.0.3" }, @@ -23376,14 +23391,19 @@ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true }, - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "autoprefixer": { + "version": "9.8.6", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.8.6.tgz", + "integrity": "sha512-XrvP4VVHdRBCdX1S3WXVD8+RyG9qeb1D5Sn1DeLiG2xfSpzellk5k54xbUERJ3M5DggQxes39UGOTP8CFrEGbg==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "browserslist": "^4.12.0", + "caniuse-lite": "^1.0.30001109", + "colorette": "^1.2.1", + "normalize-range": "^0.1.2", + "num2fraction": "^1.2.2", + "postcss": "^7.0.32", + "postcss-value-parser": "^4.1.0" } }, "chalk": { @@ -23394,6 +23414,33 @@ "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "color-convert": { @@ -23406,16 +23453,16 @@ } }, "cosmiconfig": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", - "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", + "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", "dev": true, "requires": { "@types/parse-json": "^4.0.0", - "import-fresh": "^3.1.0", + "import-fresh": "^3.2.1", "parse-json": "^5.0.0", "path-type": "^4.0.0", - "yaml": "^1.7.2" + "yaml": "^1.10.0" } }, "emoji-regex": { @@ -23444,12 +23491,6 @@ "slash": "^3.0.0" } }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, "import-fresh": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", @@ -23512,15 +23553,6 @@ "supports-color": "^6.1.0" }, "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -23542,36 +23574,6 @@ } } } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } } } }, @@ -23608,12 +23610,12 @@ } }, "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", "dev": true, "requires": { - "has-flag": "^4.0.0" + "has-flag": "^3.0.0" } } } @@ -23785,43 +23787,95 @@ "dev": true }, "table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.0.1.tgz", + "integrity": "sha512-fmr6168splcy/3XIvhSm5w6hYYOqyr3plAsd7OqoerzyoMnIpoxYuwrpdO2Cm22dh6KCnvirvigPrFZp+tdWFA==", "dev": true, "requires": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" + "ajv": "^6.12.4", + "lodash": "^4.17.20", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0" }, "dependencies": { - "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "ajv": { + "version": "6.12.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", + "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, "requires": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" } }, "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" } } } @@ -25690,6 +25744,12 @@ "selenium-webdriver": "^3.0.1" }, "dependencies": { + "@types/selenium-webdriver": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.17.tgz", + "integrity": "sha512-tGomyEuzSC1H28y2zlW6XPCaDaXFaD6soTdb4GNdmte2qfHtrKqhy0ZFs4r/1hpazCfEZqeTSRLvSasmEx89uw==", + "dev": true + }, "rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", diff --git a/package.json b/package.json index 28437d0b25..0ab5d7695e 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "@types/node": "^14.6.0", "@types/pdfjs-dist": "^2.1.5", "@types/request": "^2.48.5", - "@types/selenium-webdriver": "^3.0.8", + "@types/selenium-webdriver": "^4.0.9", "ajv-cli": "^3.0.0", "codelyzer": "^6.0.0", "commander": "6.0.0", @@ -136,7 +136,6 @@ "jasmine-core": "~2.8.0", "jasmine-reporters": "^2.3.2", "jasmine-spec-reporter": "~5.0.2", - "jasmine2-protractor-utils": "1.3.0", "js-yaml": "^3.14.0", "karma": "^5.1.1", "karma-chrome-launcher": "~3.1.0", @@ -161,6 +160,7 @@ "protractor": "^5.4.2", "protractor-retry": "^1.2.9", "protractor-smartrunner": "^0.1.1", + "protractor-screenshoter-plugin": "0.10.3", "remark": "^12.0.1", "remark-frontmatter": "^1.2.0", "rimraf": "^3.0.2", diff --git a/scripts/README.md b/scripts/README.md index c45b7c042d..ca1c761fc3 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -218,27 +218,6 @@ This script test the distribution of ADF against the demo shell ./test-dist ``` -# rancher-update.sh - -***rancher-update.sh*** - -Internal script for update the rancher env - -| Option | Description | -| --- | --- | -|--access_key |rancher access key| -|--secret_key |rancher secret key| -|--url |rancher_url| -|--environment_name s|ervice name to replace in rancher| -|--image |image to gater and load in the service, example: docker:alfresco/demo-shell:latest| - -## Examples - -```sh -/rancher-update.sh --access_key ACCESS_KEY --secret_key SECRET_KEY --url RANCHER_URL--environment_name adf-master --image docker:alfresco/demo-shell:master -``` - - # test-e2e-lib.sh ***test-e2e-lib.sh*** diff --git a/scripts/build/build-cli.sh b/scripts/build/build-cli.sh index 953ca24397..808268d375 100755 --- a/scripts/build/build-cli.sh +++ b/scripts/build/build-cli.sh @@ -2,8 +2,14 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $DIR/../../ +rm -rf lib/cli/dist +rm -rf lib/dist/cli + cd $DIR/../../lib/cli/ + + echo "====== Cli ======" echo "====== Build ======" npm i @@ -11,6 +17,7 @@ npm run dist cd $DIR/../../ cp -R ./lib/cli/dist lib/dist/cli/ +cp ./lib/cli/README.md lib/dist/cli/README.md echo "====== Move to node_modules ======" rm -rf ./node_modules/@alfresco/adf-cli/ && \ diff --git a/scripts/test-e2e-lib.sh b/scripts/test-e2e-lib.sh index e7f942ae54..1544c12c74 100755 --- a/scripts/test-e2e-lib.sh +++ b/scripts/test-e2e-lib.sh @@ -4,7 +4,6 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "$DIR/../" BROWSER_RUN=false DEVELOPMENT=false -EXECLINT=false LITESERVER=false EXEC_VERSION_JSAPI=false TIMEOUT=120000 @@ -18,7 +17,6 @@ show_help() { echo "-p or --password" echo "-identity_admin_email" echo "-identity_admin_password" - echo "-e or --email" echo "-b or --browser run the test in the browser (No headless mode)" echo "-s or --spec run a single test file" echo "-f or --folder run a single folder test" @@ -29,7 +27,6 @@ show_help() { echo "-host_sso the entire path including the name of the realm" echo "-save save the error screenshot and report in the remote env" echo "-timeout or --timeout override the timeout foe the wait utils" - echo "-l --lint enable lint" echo "-m --maxInstances max instances parallel for tests" echo "-log or --log print all the browser log" echo "-db or --debug run the debugger" @@ -58,10 +55,7 @@ set_identity_admin_password(){ IDENTITY_ADMIN_PASSWORD=$1 export IDENTITY_ADMIN_PASSWORD=$IDENTITY_ADMIN_PASSWORD } -set_email(){ - EMAIL=$1 - export EMAIL_ADF=$EMAIL -} + set_host(){ HOST=$1 export URL_HOST_ADF=$HOST @@ -120,10 +114,6 @@ set_prefix(){ export PREFIX=$PREFIX } -lint(){ - EXECLINT=true -} - debug(){ export DEBUG=true; } @@ -155,7 +145,6 @@ while [[ $1 == -* ]]; do -p|--password) set_password $2; shift 2;; -identity_admin_email) set_identity_admin_email $2; shift 2;; -identity_admin_password) set_identity_admin_password $2; shift 2;; - -e|--email) set_email $2; shift 2;; -f|--folder) set_test_folder $2; shift 2;; -timeout|--timeout) set_timeout $2; shift 2;; -b|--browser) set_browser; shift;; @@ -167,11 +156,10 @@ while [[ $1 == -* ]]; do -ud|--use-dist) lite_server; shift;; -save) set_save_screenshot; shift;; -proxy|--proxy) set_proxy $2; shift 2;; - -s|--seleniumServer) set_selenium $2; shift 2;; + --seleniumServer) set_selenium $2; shift 2;; -host|--host) set_host $2; shift 2;; -log|--log) set_log; shift ;; -host_sso|--host_sso) set_host_sso $2; shift 2;; - -l|--lint) lint; shift;; -m|--maxInstances) max_instances $2; shift 2;; -vjsapi) version_js_api $2; shift 2;; -*) echo "invalid option: $1" 1>&2; show_help; exit 1;; @@ -188,10 +176,6 @@ if $EXEC_VERSION_JSAPI == true; then npm install alfresco-js-api@${JSAPI_VERSION} fi -if [[ $EXECLINT == "true" ]]; then - npm run lint-e2e || exit 1 -fi - echo "====== Update webdriver-manager =====" if [ "$CI" = "true" ]; then export chrome=$(google-chrome --product-version) @@ -220,6 +204,7 @@ else npm run lite-server-e2e>/dev/null & $DEBUG_OPTION ./node_modules/protractor/bin/protractor ./e2e/protractor.conf.js || exit 1 else + echo "====== Run without lite-server =====" $DEBUG_OPTION ./node_modules/protractor/bin/protractor ./e2e/protractor.conf.js || exit 1 fi fi diff --git a/scripts/travis/deploy/deploy-pr.sh b/scripts/travis/deploy/deploy-pr.sh deleted file mode 100755 index 1c3ba9d082..0000000000 --- a/scripts/travis/deploy/deploy-pr.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -cd $DIR/../../../ - -# Get Tag Image -TAG_VERSION=$(./scripts/travis/deploy/get-docker-image-tag-name.sh) -echo "Running the docker with tag" $TAG_VERSION - -# Publish Image to docker - -sed s%href=\".\"%href=\".\"%g \ --i ./dist/demo-shell/index.html - -mkdir "./demo-shell/tmp/" -mv ./dist/demo-shell/* ./demo-shell/tmp - -mkdir -p "./dist/demo-shell/${TRAVIS_BUILD_NUMBER}" -mv ./demo-shell/tmp/* ./dist/demo-shell/${TRAVIS_BUILD_NUMBER} - -./node_modules/@alfresco/adf-cli/bin/adf-cli docker-publish --loginCheck --loginUsername "$DOCKER_REPOSITORY_USER" --loginPassword "$DOCKER_REPOSITORY_PASSWORD" --loginRepo "$DOCKER_REPOSITORY_DOMAIN" --dockerRepo "$DOCKER_REPOSITORY" --dockerTags "$TAG_VERSION" --pathProject "$(pwd)" - -echo "Update rancher with docker tag" $TAG_VERSION --url $REPO_RANCHER --environment_name $REPO_RANCHER_ADF_NAME - -# Deploy PR in Rancher env -(node --no-deprecation ./scripts/travis/deploy/rancher-pr-deploy.js -n $TRAVIS_BUILD_NUMBER -u $RANCHER_TOKEN -p $RANCHER_SECRET -s $REPO_RANCHER --image "alfresco/demo-shell:develop-$TRAVIS_BUILD_NUMBER" --env $ENVIRONMENT_NAME -r $ENVIRONMENT_URL || exit 1); - -# Restore the app in the main run the unit test -mv ./dist/demo-shell/${TRAVIS_BUILD_NUMBER} "./demo-shell/tmp/" -mv "./dist/demo-shell/" "./dist/demo-shell/" diff --git a/scripts/travis/deploy/deploy.sh b/scripts/travis/deploy/deploy.sh deleted file mode 100755 index 9e29b383b8..0000000000 --- a/scripts/travis/deploy/deploy.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -cd $DIR/../../../ - -# Get Tag Image -TAG_VERSION=$(./scripts/travis/deploy/get-docker-image-tag-name.sh) -echo "Running the docker with tag" $TAG_VERSION - -# Publish Image to docker -./node_modules/@alfresco/adf-cli/bin/adf-cli docker-publish --loginCheck --loginUsername "$DOCKER_REPOSITORY_USER" --loginPassword "$DOCKER_REPOSITORY_PASSWORD" --loginRepo "$DOCKER_REPOSITORY_DOMAIN" --dockerRepo "$DOCKER_REPOSITORY" --dockerTags "$TAG_VERSION,$TRAVIS_BRANCH" --pathProject "$(pwd)" - -echo "Update rancher with docker tag" $TAG_VERSION --url $REPO_RANCHER --environment_name $REPO_RANCHER_ADF_NAME - -# Deploy PR in Rancher env -./scripts/travis/deploy/rancher-update.sh --access_key $RANCHER_TOKEN --secret_key $RANCHER_SECRET --url $REPO_RANCHER --environment_name $REPO_RANCHER_ADF_NAME --image docker:$DOCKER_REPOSITORY:$TAG_VERSION diff --git a/scripts/travis/deploy/rancher-pr-deploy.js b/scripts/travis/deploy/rancher-pr-deploy.js deleted file mode 100644 index 88525d0ed1..0000000000 --- a/scripts/travis/deploy/rancher-pr-deploy.js +++ /dev/null @@ -1,262 +0,0 @@ -var program = require('commander'); -var request = require('request'); - -function asyncRequest(option) { - return new Promise(function (resolve, reject) { - request(option, function (error, res, body) { - if (!error && (res.statusCode == 200 || res.statusCode == 201)) { - resolve(body); - } else { - console.log("Error " + JSON.stringify(body)); - reject(error + JSON.stringify(body)); - throw "Error"; - } - }); - }); -} - -async function main() { - - program - .version('0.1.0') - .option('-n, --name [type]', 'Name to give at the service in rancher') - .option('-r, --remote [type]', 'Remote environment host adf.lab.com ') - .option('-e, --env [type]', 'Name to give at the service in rancher') - .option('-i, --image [type]', 'Docker image to load') - .option('-s, --server [type]', 'Server RANCHER_SERVER URL') - .option('-p, --password [type]', 'password RANCHER') - .option('-u, --username [type]', 'username RANCHER') - .parse(process.argv); - - auth = 'Basic ' + new Buffer(program.username + ':' + program.password).toString('base64'); - - var project = await asyncRequest({ - url: program.server + `/v1/project?name=${program.env}`, - method: 'GET', - json: true, - headers: { - "content-type": "application/json", - "accept": "application/json", - "Authorization": auth - }, - body: "" - }).catch((error) => { - console.log('Project name error'+ error); - }); - - var stacks = await asyncRequest({ - url: `${program.server}/v2-beta/projects/${project.data[0].id}/stacks?limit=-1&sort=name`, - method: 'GET', - json: true, - headers: { - "content-type": "application/json", - "accept": "application/json", - "Authorization": auth - }, - body: "" - }).catch((error) => { - console.log('Stacks error'+ error); - }); - - - var stackId = stacks.data[0].id; - var environmentId = project.data[0].id; - - console.log("StackId " + stackId); - console.log("ID environment " + environmentId); - console.log("image to Load " + program.image); - - var postData = { - "scale": 1, - "assignServiceIpAddress": false, - "startOnCreate": true, - "type": "service", - "stackId": stackId, - "launchConfig": { - "instanceTriggeredStop": "stop", - "kind": "container", - "networkMode": "managed", - "privileged": false, - "publishAllPorts": false, - "readOnly": false, - "runInit": false, - "startOnCreate": true, - "stdinOpen": true, - "tty": true, - "vcpu": 1, - "drainTimeoutMs": 0, - "type": "launchConfig", - "labels": {"io.rancher.container.pull_image": "always"}, - "restartPolicy": {"name": "always"}, - "secrets": [], - "dataVolumes": [], - "dataVolumesFrom": [], - "dns": [], - "dnsSearch": [], - "capAdd": [], - "capDrop": [], - "devices": [], - "logConfig": {"driver": "", "config": {}}, - "dataVolumesFromLaunchConfigs": [], - "imageUuid": "docker:"+program.image, - "ports": [], - "blkioWeight": null, - "cgroupParent": null, - "count": null, - "cpuCount": null, - "cpuPercent": null, - "cpuPeriod": null, - "cpuQuota": null, - "cpuRealtimePeriod": null, - "cpuRealtimeRuntime": null, - "cpuSet": null, - "cpuSetMems": null, - "cpuShares": null, - "createIndex": null, - "created": null, - "deploymentUnitUuid": null, - "description": null, - "diskQuota": null, - "domainName": null, - "externalId": null, - "firstRunning": null, - "healthInterval": null, - "healthRetries": null, - "healthState": null, - "healthTimeout": null, - "hostname": null, - "ioMaximumBandwidth": null, - "ioMaximumIOps": null, - "ip": null, - "ip6": null, - "ipcMode": null, - "isolation": null, - "kernelMemory": null, - "memory": null, - "memoryMb": null, - "memoryReservation": null, - "memorySwap": null, - "memorySwappiness": null, - "milliCpuReservation": null, - "oomScoreAdj": null, - "pidMode": null, - "pidsLimit": null, - "removed": null, - "requestedIpAddress": null, - "shmSize": null, - "startCount": null, - "stopSignal": null, - "stopTimeout": null, - "user": null, - "userdata": null, - "usernsMode": null, - "uts": null, - "uuid": null, - "volumeDriver": null, - "workingDir": null, - "networkLaunchConfig": null - }, - "secondaryLaunchConfigs": [], - "name": program.name, - "createIndex": null, - "created": null, - "description": null, - "externalId": null, - "healthState": null, - "kind": null, - "removed": null, - "selectorContainer": null, - "selectorLink": null, - "uuid": null, - "vip": null, - "fqdn": null - }; - - console.log("Create Service "); - - var createService = await asyncRequest({ - url: `${program.server}/v2-beta/projects/${environmentId}/service`, - method: 'POST', - json: true, - headers: { - "content-type": "application/json", - "accept": "application/json", - "Authorization": auth - }, - body: postData, - }).catch((error) => { - console.log('Error createService'+ error); - }); - - if (!createService) { - return; - } - - console.log("New environment ID " + createService.id); - - var loadBalancer = await asyncRequest({ - url: `${program.server}/v1/projects/${environmentId}/loadbalancerservices`, - method: 'GET', - json: true, - headers: { - "content-type": "application/json", - "accept": "application/json", - "Authorization": auth - }, - body: postData, - }).catch((error) => { - console.log('Error loadBalancer'+ error); - }); - - if (!loadBalancer) { - return; - } - - var loadBalancerId = loadBalancer.data[0].id; - console.log("Load balancer ID " + loadBalancerId); - - var loadBalancerGet = await asyncRequest({ - url: `${program.server}/v2-beta/projects/${environmentId}/loadbalancerservices/${loadBalancerId}`, - method: 'GET', - json: true, - headers: { - "content-type": "application/json", - "accept": "application/json", - "Authorization": auth - } - }).catch((error) => { - console.log('Error get load balancer'+ error); - }); - - //console.log("Load balancer ID " + JSON.stringify(loadBalancerGet.lbConfig.portRules)); - - var newRule = { - "type": "portRule", - "hostname": program.remote, - "path": `/${program.name}`, - "priority": 1, - "protocol": "http", - "serviceId": createService.id, - "sourcePort": 80, - "targetPort": 8080 - }; - - loadBalancerGet.lbConfig.portRules.push(newRule); - - await asyncRequest({ - url: `${program.server}/v2-beta/projects/${environmentId}/loadbalancerservices/${loadBalancerId}`, - method: 'PUT', - json: true, - headers: { - "content-type": "application/json", - "accept": "application/json", - "Authorization": auth - }, - body: loadBalancerGet - }).catch((error) => { - console.log('Error Update load balancer'+ error); - }); - -} - -main(); diff --git a/scripts/travis/deploy/rancher-update.sh b/scripts/travis/deploy/rancher-update.sh deleted file mode 100755 index 1c576fe706..0000000000 --- a/scripts/travis/deploy/rancher-update.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -show_help() { - echo "Usage: docker_publish.sh" - echo "" - echo "--access_key rancher access key" - echo "--secret_key rancher secret key" - echo "--url rancher_url" - echo "--environment_name service name to replace in rancher" - echo "--image image to gater and load in the service, example: docker:alfresco/demo-shell:latest" -} - -access_key(){ - ACCESSKEY=$1 -} - -secret_key(){ - SECRETKEY=$1 -} - -url(){ - RANCHERURL=$1 -} - -environment_name(){ - ENVIRONMENTNAME=$1 -} - -image_name(){ - IMAGE=$1 -} - -while [[ $1 == -* ]]; do - case "$1" in - -h|--help|-\?) show_help; exit 0;; - --access_key) access_key $2; shift 2;; - --secret_key) secret_key $2; shift 2;; - --url) url $2; shift 2;; - --environment_name) environment_name $2; shift 2;; - --image) image_name $2; shift 2;; - -*) echo "invalid option: $1" 1>&2; show_help; exit 1;; - esac -done - -docker pull etlweather/gaucho:alpine - -docker=$(which docker) - -echo "getting the id" - -ENVIRONMENTID=$($docker run --rm -e CATTLE_ACCESS_KEY=$ACCESSKEY \ - -e CATTLE_SECRET_KEY=$SECRETKEY \ - -e CATTLE_URL=$RANCHERURL \ - etlweather/gaucho:alpine id_of $ENVIRONMENTNAME) - -echo "id retrieved! is $ENVIRONMENTID" - -$docker run --rm -e CATTLE_ACCESS_KEY=$ACCESSKEY \ - -e CATTLE_SECRET_KEY=$SECRETKEY \ - -e CATTLE_URL=$RANCHERURL \ - etlweather/gaucho:alpine upgrade $ENVIRONMENTID --imageUuid $IMAGE --auto_complete true --timeout 600 diff --git a/scripts/travis/e2e/content-services-e2e.sh b/scripts/travis/e2e/content-services-e2e.sh index 88ea711452..bddd9cfc7e 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" -e "$E2E_EMAIL" --use-dist -b -save -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 -b -m 4 || 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 cd993a8978..d4e339421e 100755 --- a/scripts/travis/e2e/core-e2e.sh +++ b/scripts/travis/e2e/core-e2e.sh @@ -9,7 +9,7 @@ cd $DIR/../../../ export CONTEXT_ENV="core" export PROVIDER='ALL' -export AUTH_TYPE='BASIC' +export AUTH_TYPE='OAUTH' if [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then echo "Calculate affected e2e $BASE_HASH $HEAD_HASH" @@ -20,9 +20,9 @@ if [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then echo "Affected e2e ${AFFECTED_E2E}" fi; -./node_modules/@alfresco/adf-cli/bin/adf-cli check-ps-env --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 +#./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" -e "$E2E_EMAIL" --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 -m 2 || 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/insights-e2e.sh b/scripts/travis/e2e/insights-e2e.sh index 1b34eb7142..a46617495a 100755 --- a/scripts/travis/e2e/insights-e2e.sh +++ b/scripts/travis/e2e/insights-e2e.sh @@ -5,7 +5,7 @@ echo "Start insight e2e" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" export PROVIDER='BPM' -export AUTH_TYPE='BASIC' +export AUTH_TYPE='OAUTH' cd $DIR/../../../ @@ -20,5 +20,5 @@ fi; if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "insight" || "${TRAVIS_EVENT_TYPE}" == "push" ]]; then ./node_modules/@alfresco/adf-cli/bin/adf-cli check-ps-env --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1; - ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --folder insights --use-dist || exit 1; + ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --folder insights --use-dist || exit 1; fi; diff --git a/scripts/travis/e2e/process-services-cloud-e2e.sh b/scripts/travis/e2e/process-services-cloud-e2e.sh index 15f198b25f..8e33b2bdaa 100755 --- a/scripts/travis/e2e/process-services-cloud-e2e.sh +++ b/scripts/travis/e2e/process-services-cloud-e2e.sh @@ -19,10 +19,10 @@ 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" -e "$E2E_EMAIL" -host_sso "$E2E_HOST" -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 -m 2 -save -b ) check_env(){ - ./node_modules/@alfresco/adf-cli/bin/adf-cli init-aae-env --host "$E2E_HOST" --oauth "$E2E_HOST" --modelerUsername "$E2E_MODELER_USERNAME" --modelerPassword "$E2E_MODELER_PASSWORD" --devopsUsername "$E2E_DEVOPS_USERNAME" --devopsPassword "$E2E_DEVOPS_PASSWORD" --clientId 'activiti' || exit 1 + ./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 ./node_modules/@alfresco/adf-cli/bin/adf-cli check-cs-env --host "$E2E_HOST" -u "$E2E_ADMIN_EMAIL_IDENTITY" -p "$E2E_ADMIN_PASSWORD_IDENTITY" || exit 1 } diff --git a/scripts/travis/e2e/process-services-e2e.sh b/scripts/travis/e2e/process-services-e2e.sh index 2ca62a6da6..3e155f75e4 100755 --- a/scripts/travis/e2e/process-services-e2e.sh +++ b/scripts/travis/e2e/process-services-e2e.sh @@ -6,7 +6,7 @@ cd $DIR/../../../ export CONTEXT_ENV="process-services" export PROVIDER='BPM' -export AUTH_TYPE='BASIC' +export AUTH_TYPE="OAUTH" echo "Start process services e2e" @@ -19,8 +19,9 @@ if [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then echo "Affected e2e ${AFFECTED_E2E}" fi; -./node_modules/@alfresco/adf-cli/bin/adf-cli check-ps-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" -e "$E2E_EMAIL" --use-dist -m 2 || exit 1) +#./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) 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 bc336df348..2fac7ca55e 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" -e "$E2E_EMAIL" --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 -m 2 || exit 1) if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "content-services" || "${TRAVIS_EVENT_TYPE}" == "push" ]]; then diff --git a/scripts/travis/deploy/get-docker-image-tag-name.sh b/scripts/travis/release/get-docker-image-tag-name.sh old mode 100755 new mode 100644 similarity index 100% rename from scripts/travis/deploy/get-docker-image-tag-name.sh rename to scripts/travis/release/get-docker-image-tag-name.sh diff --git a/scripts/travis/release/release-docker.sh b/scripts/travis/release/release-docker.sh new file mode 100644 index 0000000000..b524f9c9d0 --- /dev/null +++ b/scripts/travis/release/release-docker.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +if [[ $TRAVIS_BRANCH == "develop" || $TRAVIS_BRANCH == "master" ]]; +then + + cd $DIR/../../../ + + # Get Tag Image + TAG_VERSION=$(./scripts/travis/release/get-docker-image-tag-name.sh) + echo "Running the docker with tag" $TAG_VERSION + + # Publish Image to docker + ./node_modules/@alfresco/adf-cli/bin/adf-cli docker-publish --loginCheck --loginUsername "$DOCKER_REPOSITORY_USER" --loginPassword "$DOCKER_REPOSITORY_PASSWORD" --loginRepo "$DOCKER_REPOSITORY_DOMAIN" --dockerRepo "$DOCKER_REPOSITORY" --dockerTags "$TAG_VERSION,$TRAVIS_BRANCH" --pathProject "$(pwd)" + +fi;