mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
Fix e2e (#6087)
* fix protractor conf * remove update env * fix cli error script cs * change screenshot plugin * remove unused param * fix * fix * fix * moment comment nvm * fix * fix * fix * fix * remove adf redirect * fix * fix * save remote report * report fix * improve save result * fix folder save * fix folder save * fix placeholder pointer , they needs refactor later * fix * fix lint * fix * remove test already covered by unit fix the test in core needed exclude the one impossible to make it works without APS basic support * lint * fix some logout missing * fix * Fix the custom-tasks-filters.e2e * fix lint * fix * fix * fix * Fix wait on start process and on process definition options * Fix logout before login again * fix uplaod test * fix * Fix infodrawer with check detail and sleep * lint * increase list of excluded test * fix * fix lint * change wait method datatable * fix * fix * revert check value * fix * fix * change tag test Co-authored-by: maurizio vitale <maurizio.vitale@alfresco.com>
This commit is contained in:
parent
f17270621b
commit
a630cfb390
4
.gitignore
vendored
4
.gitignore
vendored
@ -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-*
|
||||
|
20
.travis.yml
20
.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)
|
||||
|
@ -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 () => {
|
||||
|
@ -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);
|
||||
});
|
||||
|
||||
|
@ -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');
|
||||
|
@ -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<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.newTagInput);
|
||||
return this.newTagInput.getAttribute('placeholder');
|
||||
return this.newTagInput.getAttribute('data-placeholder');
|
||||
}
|
||||
|
||||
async addTagButtonIsEnabled(): Promise<boolean> {
|
||||
|
@ -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'));
|
||||
|
||||
|
@ -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 () => {
|
||||
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
});
|
||||
});
|
@ -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();
|
||||
|
@ -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"]'));
|
||||
|
@ -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<ElementFinder> {
|
||||
const rows = this.getRowsByName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(rows);
|
||||
return rows.element(this.rowByRowName);
|
||||
}
|
||||
|
||||
async fileIsUploaded(content: string): Promise<void> {
|
||||
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<void> {
|
||||
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<string> {
|
||||
|
@ -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<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.checkBox);
|
||||
}
|
||||
|
||||
async checkChooseHeaderColourIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.headerColor);
|
||||
}
|
||||
|
||||
async checkChangeTitleIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.titleInput);
|
||||
}
|
||||
|
||||
async checkChangeUrlPathIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.iconInput);
|
||||
}
|
||||
|
||||
async clickShowMenuButton(): Promise<void> {
|
||||
const checkBox = element(by.css('mat-checkbox'));
|
||||
await BrowserActions.click(checkBox.get(0));
|
||||
}
|
||||
|
||||
async changeHeaderColor(color: string): Promise<void> {
|
||||
const headerColor = element(by.css('option[value="' + color + '"]'));
|
||||
await BrowserActions.click(headerColor);
|
||||
}
|
||||
|
||||
async checkAppTitle(name: string): Promise<void> {
|
||||
const title = element(by.cssContainingText('.adf-app-title', name));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(title);
|
||||
}
|
||||
|
||||
async addTitle(title: string): Promise<void> {
|
||||
await BrowserActions.click(this.titleInput);
|
||||
await BrowserActions.clearSendKeys(this.titleInput, title);
|
||||
await this.titleInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
async checkIconIsDisplayed(url: string): Promise<void> {
|
||||
const icon = element(by.css('img[src="' + url + '"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(icon);
|
||||
}
|
||||
|
||||
async addIcon(url: string): Promise<void> {
|
||||
await BrowserActions.click(this.iconInput);
|
||||
await BrowserActions.clearSendKeys(this.iconInput, url);
|
||||
await this.iconInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
async checkHexColorInputIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.hexColorInput);
|
||||
}
|
||||
|
||||
async checkLogoHyperlinkInputIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.logoHyperlinkInput);
|
||||
}
|
||||
|
||||
async checkLogoTooltipInputIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.logoTooltipInput);
|
||||
}
|
||||
|
||||
async addHexCodeColor(hexCode: string): Promise<void> {
|
||||
await BrowserActions.click(this.hexColorInput);
|
||||
await this.hexColorInput.sendKeys(hexCode);
|
||||
await this.hexColorInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
async addLogoHyperlink(hyperlink: string): Promise<void> {
|
||||
await BrowserActions.click(this.logoHyperlinkInput);
|
||||
await this.logoHyperlinkInput.sendKeys(hyperlink);
|
||||
await this.logoHyperlinkInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
async addLogoTooltip(tooltip: string): Promise<void> {
|
||||
await BrowserActions.click(this.logoTooltipInput);
|
||||
await this.logoTooltipInput.sendKeys(tooltip);
|
||||
await this.logoTooltipInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
async sideBarPositionStart(): Promise<void> {
|
||||
await BrowserActions.click(this.positionStart);
|
||||
}
|
||||
|
||||
async sideBarPositionEnd(): Promise<void> {
|
||||
await BrowserActions.click(this.positionEnd);
|
||||
}
|
||||
|
||||
async checkSidebarPositionStart(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.sideBarPositionLeft);
|
||||
}
|
||||
|
||||
async checkSidebarPositionEnd(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.sideBarPositionRight);
|
||||
}
|
||||
|
||||
}
|
@ -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<void> {
|
||||
await BrowserActions.click(this.loadMoreButton);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.loading);
|
||||
}
|
||||
|
||||
async checkLoadMoreButtonIsNotDisplayed(): Promise<void> {
|
||||
|
@ -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']`));
|
||||
|
@ -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'));
|
||||
|
@ -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();
|
||||
});
|
||||
|
||||
|
@ -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);
|
||||
};
|
||||
});
|
@ -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);
|
||||
|
||||
|
@ -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');
|
||||
});
|
||||
});
|
@ -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']`));
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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({
|
||||
|
@ -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);
|
||||
|
@ -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 () => {
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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();
|
||||
});
|
||||
|
@ -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,
|
||||
|
@ -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<void> {
|
||||
browser.setFileDetector(new remote.FileDetector());
|
||||
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.attachFileButton);
|
||||
await this.attachFileButton.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, fileLocation)));
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ export class ChecklistDialog {
|
||||
|
||||
async getNameFieldPlaceholder(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.nameField);
|
||||
return this.nameField.getAttribute('placeholder');
|
||||
return this.nameField.getAttribute('data-placeholder');
|
||||
}
|
||||
|
||||
async checkCancelButtonIsEnabled(): Promise<void> {
|
||||
|
@ -59,7 +59,7 @@ export class StartTaskDialogPage {
|
||||
|
||||
async getAssignee(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.assignee);
|
||||
return this.assignee.getAttribute('placeholder');
|
||||
return this.assignee.getAttribute('data-placeholder');
|
||||
}
|
||||
|
||||
async selectForm(form): Promise<void> {
|
||||
|
@ -29,7 +29,8 @@ export class FiltersPage {
|
||||
|
||||
async goToFilter(filterName): Promise<void> {
|
||||
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<void> {
|
||||
|
@ -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<StartProcessPage> {
|
||||
await this.clickCreateProcessButton();
|
||||
@ -67,6 +68,10 @@ export class ProcessFiltersPage {
|
||||
await BrowserActions.click(this.newProcessButton);
|
||||
}
|
||||
|
||||
async checkStartProcessIsDisplay(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.startProcessEl);
|
||||
}
|
||||
|
||||
async checkNoContentMessage(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.noContentMessage);
|
||||
}
|
||||
@ -83,6 +88,7 @@ export class ProcessFiltersPage {
|
||||
}
|
||||
|
||||
async numberOfProcessRows(): Promise<number> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element.all(this.rows).first());
|
||||
return element.all(this.rows).count();
|
||||
}
|
||||
|
||||
|
@ -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<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.apsAppsContainer);
|
||||
|
@ -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<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.cancelAttachForm);
|
||||
}
|
||||
|
||||
async noFormIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.formContent);
|
||||
}
|
||||
|
||||
async clickCancelAttachForm(): Promise<void> {
|
||||
await BrowserActions.click(this.cancelAttachForm);
|
||||
}
|
||||
|
||||
async checkRemoveAttachFormIsDisplayed() {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.removeAttachForm);
|
||||
}
|
||||
|
||||
async clickRemoveAttachForm(): Promise<void> {
|
||||
await BrowserActions.click(this.removeAttachForm);
|
||||
await browser.sleep(2000);
|
||||
}
|
||||
|
||||
async checkAttachFormButtonIsDisplayed(): Promise<void> {
|
||||
@ -142,9 +136,8 @@ export class TaskDetailsPage {
|
||||
return BrowserActions.click(this.attachFormButton);
|
||||
}
|
||||
|
||||
async checkFormIsAttached(formName): Promise<void> {
|
||||
const attachedFormName = await BrowserActions.getInputValue(this.formNameField);
|
||||
await expect(attachedFormName).toEqual(formName);
|
||||
async checkFormIsAttached(formName: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementHasValue(this.formNameField, formName);
|
||||
}
|
||||
|
||||
getFormName(): Promise<string> {
|
||||
@ -210,7 +203,7 @@ export class TaskDetailsPage {
|
||||
|
||||
async getDescriptionPlaceholder(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.descriptionField);
|
||||
return this.descriptionField.getAttribute('placeholder');
|
||||
return this.descriptionField.getAttribute('data-placeholder');
|
||||
}
|
||||
|
||||
getDueDate(): Promise<string> {
|
||||
@ -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<void> {
|
||||
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<void> {
|
||||
@ -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<void> {
|
||||
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<void> {
|
||||
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<void> {
|
||||
@ -349,7 +348,7 @@ export class TaskDetailsPage {
|
||||
|
||||
async getInvolvePeoplePlaceholder(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.addPeopleField);
|
||||
return this.addPeopleField.getAttribute('placeholder');
|
||||
return this.addPeopleField.getAttribute('data-placeholder');
|
||||
}
|
||||
|
||||
async checkCancelButtonIsEnabled(): Promise<void> {
|
||||
@ -408,7 +407,7 @@ export class TaskDetailsPage {
|
||||
}
|
||||
|
||||
async clickCompleteFormTask(): Promise<void> {
|
||||
await BrowserActions.clickScript(this.completeFormTask);
|
||||
await BrowserActions.click(this.completeFormTask);
|
||||
}
|
||||
|
||||
async getEmptyTaskDetailsMessage(): Promise<string> {
|
||||
|
@ -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;
|
||||
|
@ -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<void> {
|
||||
await this.dataTable.selectRow('Name', taskName);
|
||||
await browser.sleep(1000);
|
||||
}
|
||||
|
||||
getAllRowsNameColumn(): Promise<string[]> {
|
||||
|
@ -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<StartTaskDialogPage> {
|
||||
await this.clickOnCreateButton();
|
||||
|
@ -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]);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
});
|
||||
|
@ -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 () => {
|
||||
|
@ -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);
|
||||
|
@ -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]);
|
||||
});
|
||||
});
|
||||
|
@ -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);
|
||||
|
@ -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"
|
||||
}
|
||||
|
||||
|
@ -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 = {
|
||||
|
Binary file not shown.
BIN
e2e/resources/adf/allFileTypes/documents/other/a_png_file.png
Normal file
BIN
e2e/resources/adf/allFileTypes/documents/other/a_png_file.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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');
|
||||
|
@ -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();
|
||||
|
@ -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<void> {
|
||||
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<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchDialog);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchBarPage);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.getRowByRowName(name));
|
||||
}
|
||||
|
@ -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 () => {
|
||||
|
@ -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');
|
||||
|
@ -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');
|
||||
|
@ -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();
|
||||
});
|
||||
|
@ -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: {
|
||||
|
@ -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"
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -24,7 +24,7 @@
|
||||
</data-column>
|
||||
<data-column key="email" class="adf-full-width">
|
||||
<ng-template let-entry="$implicit">
|
||||
<div class="adf-people-full-name">{{ getDisplayUser(entry.row.obj.firstName, entry.row.obj.lastName, ' ') }}</div>
|
||||
<div data-automation-id="adf-people-full-name" class="adf-people-full-name">{{ getDisplayUser(entry.row.obj.firstName, entry.row.obj.lastName, ' ') }}</div>
|
||||
</ng-template>
|
||||
</data-column>
|
||||
</data-columns>
|
||||
|
@ -41,8 +41,8 @@
|
||||
<data-column key="email" class="adf-full-width">
|
||||
<ng-template let-entry="$implicit">
|
||||
<div class="adf-people-user-info">
|
||||
<div class="adf-people-full-name">{{ getDisplayUser(entry.row.obj.firstName, entry.row.obj.lastName, ' ') }}</div>
|
||||
<div class="adf-people-email">{{ entry.row.obj.email }}</div>
|
||||
<div data-automation-id="adf-people-full-name" class="adf-people-full-name">{{ getDisplayUser(entry.row.obj.firstName, entry.row.obj.lastName, ' ') }}</div>
|
||||
<div data-automation-id="adf-people-email" class="adf-people-email">{{ entry.row.obj.email }}</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
</data-column>
|
||||
|
@ -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"
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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<UserModel> {
|
||||
const user = new UserModel({ firstName: firstName, lastName: lastName});
|
||||
return this.createUser(user);
|
||||
}
|
||||
|
||||
async createTenantAndUser(email?: string, firstName?: string, lastName?: string, password?: string): Promise<UserRepresentation> {
|
||||
const newTenant = await this.api.apiService.activiti.adminTenantsApi.createTenant(new Tenant());
|
||||
|
||||
@ -127,8 +131,6 @@ export class UsersActions {
|
||||
}
|
||||
|
||||
async changeProfilePictureAps(fileLocation: string): Promise<ImageUploadRepresentation> {
|
||||
browser.setFileDetector(new remote.FileDetector());
|
||||
|
||||
const pathFile = path.join(browser.params.testConfig.main.rootPath + fileLocation);
|
||||
const file = fs.createReadStream(pathFile);
|
||||
|
||||
|
@ -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`));
|
||||
|
@ -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`));
|
||||
|
@ -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<number> {
|
||||
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<void> {
|
||||
@ -186,7 +192,7 @@ export class DataTableComponentPage {
|
||||
|
||||
async getAllRowsColumnValues(column: string): Promise<string[]> {
|
||||
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<void> {
|
||||
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<void> {
|
||||
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());
|
||||
}
|
||||
|
||||
|
@ -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<string> {
|
||||
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<void> {
|
||||
|
@ -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<void> {
|
||||
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<void> {
|
||||
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<void> {
|
||||
browser.setFileDetector(new remote.FileDetector());
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
const widget = await this.formFields.getWidget(fieldId);
|
||||
const uploadButton = await widget.element(this.uploadLocator);
|
||||
|
@ -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<void> {
|
||||
browser.setFileDetector(new remote.FileDetector());
|
||||
const widget = await this.formFields.getWidget(fieldId).element(by.css(`button[id="folder-${fieldId}-button"]`));
|
||||
await BrowserActions.click(widget);
|
||||
}
|
||||
|
@ -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<string> {
|
||||
return BrowserActions.getText(this.checkboxLabel);
|
||||
|
@ -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'));
|
||||
|
@ -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<string> {
|
||||
return this.formFields.getFieldLabel(fieldId);
|
||||
@ -52,7 +52,7 @@ export class GroupWidgetPage {
|
||||
}
|
||||
|
||||
async getDropDownList(): Promise<any[]> {
|
||||
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());
|
||||
}
|
||||
|
@ -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<string> {
|
||||
return this.formFields.getFieldText(fieldId, this.fieldLocator);
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { FormFields } from '../form-fields';
|
||||
import { by, Locator } from 'protractor';
|
||||
import { Locator, by } from 'protractor';
|
||||
|
||||
export class MultilineTextWidgetPage {
|
||||
|
||||
|
@ -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<string> {
|
||||
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
|
||||
@ -60,7 +60,7 @@ export class PeopleWidgetPage {
|
||||
|
||||
async getDropDownList(): Promise<any[]> {
|
||||
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());
|
||||
}
|
||||
|
@ -26,14 +26,14 @@ export class RadioButtonsWidgetPage {
|
||||
formFields: FormFields = new FormFields();
|
||||
|
||||
async getSpecificOptionLabel(fieldId, optionNumber): Promise<string> {
|
||||
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<void> {
|
||||
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);
|
||||
|
@ -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<string> {
|
||||
return this.formFields.getFieldLabel(fieldId);
|
||||
@ -52,7 +52,7 @@ export class TypeaheadWidgetPage {
|
||||
}
|
||||
|
||||
async getDropDownList(): Promise<any[]> {
|
||||
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<void> {
|
||||
await BrowserVisibility.waitUntilElementIsClickable(this.field);
|
||||
await BrowserActions.clearSendKeys(this.field, value);
|
||||
await BrowserActions.clearSendKeys(this.field, value, 10);
|
||||
}
|
||||
|
||||
async selectOptionFromDropdown(): Promise<void> {
|
||||
|
@ -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') {
|
||||
|
@ -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();
|
||||
|
@ -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'));
|
||||
|
||||
|
@ -28,10 +28,12 @@ export class DropdownPage {
|
||||
}
|
||||
|
||||
async clickDropdown(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.dropDownElement);
|
||||
await BrowserActions.click(this.dropDownElement);
|
||||
}
|
||||
|
||||
async selectOption(option: string): Promise<void> {
|
||||
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);
|
||||
}
|
||||
|
@ -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<void> {
|
||||
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<void> {
|
||||
await browser.executeScript(`document.querySelector('button[class*="adf-pagination__next-button"]').click();`);
|
||||
return BrowserActions.click(this.nextPageButton);
|
||||
}
|
||||
|
||||
async clickOnPageDropdown(): Promise<void> {
|
||||
@ -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<any> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.totalFiles);
|
||||
const condition = () => this.totalFiles.getText().then(value => value && +value.split('of ')[1] < expectedValue);
|
||||
return browser.wait(condition, 10000);
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user