AAE-25664 Remove adf-testing lib (#10389)

* Remove adf-testing lib

* remove adf-testing references

* remove testing:bundle from CI workflows
This commit is contained in:
Matthias Holzer 2024-11-28 09:21:44 +01:00 committed by GitHub
parent b09f4cacf9
commit 35543a634a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
183 changed files with 1 additions and 13998 deletions

View File

@ -170,7 +170,6 @@ jobs:
npm ci
npx nx run js-api:bundle
npx nx run cli:bundle
npx nx run testing:bundle
- uses: ./.github/actions/upload-node-modules-and-artifacts
unit-tests:

View File

@ -62,7 +62,6 @@ jobs:
npm ci
npx nx run js-api:bundle
npx nx run cli:bundle
npx nx run testing:bundle
- uses: ./.github/actions/upload-node-modules-and-artifacts
release-npm:

View File

@ -69,7 +69,6 @@ jobs:
npm ci
npx nx run js-api:bundle
npx nx run cli:bundle
npx nx run testing:bundle
- uses: ./.github/actions/upload-node-modules-and-artifacts
release-storybook:

View File

@ -45,7 +45,6 @@ const nonStandardLicenses = {
};
const missingRepositories = {
'@alfresco/adf-testing': 'https://github.com/Alfresco/alfresco-ng2-components',
'@webassemblyjs/helper-api-error': 'https://github.com/xtuc/webassemblyjs',
'@webassemblyjs/helper-fsm': 'https://github.com/xtuc/webassemblyjs',
'@webassemblyjs/ieee754': 'https://github.com/xtuc/webassemblyjs',

View File

@ -1,17 +0,0 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support
# You can see what browsers were selected by your queries by running:
# npx browserslist
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major version
last 2 iOS major versions
Firefox ESR
not IE 9-11 # For IE 9-11 support, remove 'not'.

View File

@ -1,74 +0,0 @@
{
"extends": ["../../.eslintrc.js"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nx/angular"],
"parserOptions": {
"project": ["lib/testing/tsconfig.lib.json"],
"createDefaultProgram": true
},
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "lib",
"style": "kebab-case"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "lib",
"style": "camelCase"
}
],
"@angular-eslint/no-host-metadata-property": "off",
"@angular-eslint/no-input-prefix": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-var-requires": "error",
"comma-dangle": "error",
"default-case": "error",
"import/order": "off",
"max-len": [
"error",
{
"code": 240
}
],
"no-bitwise": "off",
"no-console": "off",
"no-duplicate-imports": "error",
"no-multiple-empty-lines": "error",
"no-redeclare": "error",
"no-return-await": "error",
"rxjs/no-create": "error",
"rxjs/no-subject-unsubscribe": "error",
"rxjs/no-subject-value": "error",
"rxjs/no-unsafe-takeuntil": "error",
"unicorn/filename-case": "error"
}
},
{
"files": ["*.html"],
"parserOptions": {
"project": ["lib/testing/tsconfig.lib.json"],
"createDefaultProgram": true
},
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
}

View File

@ -1,3 +0,0 @@
# Alfresco Testing Library
> This library is deprecated and will be removed in a future release.

View File

@ -1,20 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
/** @deprecated */
// TODO: We need to split adf-testing into smaller chunks
export * from './src/public-api';

View File

@ -1,30 +0,0 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../../coverage'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['ChromeHeadless'],
singleRun: true
});
};

View File

@ -1,8 +0,0 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/libs/testing",
"lib": {
"entryFile": "src/public-api.ts",
"flatModuleFile": "adf-testing"
}
}

View File

@ -1,23 +0,0 @@
{
"name": "@alfresco/adf-testing",
"description": "Alfresco ADF testing page and utils",
"version": "7.0.0-alpha.7",
"author": "Hyland Software, Inc. and its affiliates",
"repository": {
"type": "git",
"url": "https://github.com/Alfresco/alfresco-ng2-components.git"
},
"bugs": {
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
},
"peerDependencies": {
"@alfresco/js-api": ">=8.0.0-alpha.7-0"
},
"keywords": [
"testing",
"alfresco-component",
"angular",
"components"
],
"license": "Apache-2.0"
}

View File

@ -1,75 +0,0 @@
{
"name": "testing",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "lib/testing/src",
"projectType": "library",
"prefix": "adf",
"targets": {
"build": {
"executor": "@nrwl/webpack:webpack",
"options": {
"projectRoot": "lib/testing",
"outputPath": "dist/libs/testing",
"main": "lib/testing/index.ts",
"generatePackageJson": true,
"tsConfig": "lib/testing/tsconfig.lib.prod.json",
"stylePreprocessorOptions": {
"includePaths": ["lib", "lib/core/src/lib"]
},
"target": "node",
"compiler": "tsc"
},
"configurations": {
"production": {
"projectRoot": "lib/testing",
"outputPath": "dist/libs/testing",
"main": "lib/testing/index.ts",
"generatePackageJson": true,
"tsConfig": "lib/testing/tsconfig.lib.prod.json"
}
},
"defaultConfiguration": "production"
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["lib/testing/**/*.ts", "lib/testing/**/*.html"]
}
},
"bundle": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "echo testing bundle created"
}
]
},
"dependsOn": ["copyToNodeModules"]
},
"copyToNodeModules": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "rm -rf ./node_modules/@alfresco/adf-testing/ && mkdir -p ./node_modules/@alfresco/adf-testing/ && cp -R ./dist/libs/testing/* ./node_modules/@alfresco/adf-testing/"
}
]
},
"dependsOn": ["build"]
},
"npm-publish": {
"executor": "nx:run-commands",
"dependsOn": ["build"],
"options": {
"cwd": "dist/libs/testing",
"commands": [
{
"command": "npm publish --tag {args.tag}",
"forwardAllArgs": true
}
]
}
}
}
}

View File

@ -1,73 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { CustomModel, CustomModelApi, CustomModelProperty, CustomType, TypePaging, TypesApi } from '@alfresco/js-api';
import { ApiService } from '../../../shared/api/api.service';
import { ApiUtil } from '../../../shared/api/api.util';
import { Logger } from '../../core/utils/logger';
export class ModelActions {
customModelApi: CustomModelApi;
typesApi: TypesApi;
constructor(apiService: ApiService) {
this.customModelApi = new CustomModelApi(apiService.getInstance());
this.typesApi = new TypesApi(apiService.getInstance());
}
async createModel({status, description, name, namespaceUri, namespacePrefix, author}: CustomModel): Promise<{ entry: CustomModel }> {
return this.customModelApi.createCustomModel(status, description, name, namespaceUri, namespacePrefix, author);
}
async createType(modelName, { name, parentName, title, description}: CustomType ): Promise<{ entry: CustomType }> {
return this.customModelApi.createCustomType(modelName, name, parentName, title, description);
}
async addPropertyToType(modelName: string, typeName: string, properties?: CustomModelProperty[]): Promise<CustomType> {
return this.customModelApi.addPropertyToType(modelName , typeName, properties);
}
async activateCustomModel(modelName: string): Promise<{ entry: CustomModel }> {
return this.customModelApi.activateCustomModel(modelName);
}
async deactivateCustomModel(modelName: string): Promise<{ entry: CustomModel }> {
return this.customModelApi.deactivateCustomModel(modelName);
}
async deleteCustomModel(modelName: string): Promise<void> {
return this.customModelApi.deleteCustomModel(modelName);
}
async listTypes(opts?: any): Promise<TypePaging> {
return this.typesApi.listTypes(opts);
}
async isCustomTypeSearchable(title: string): Promise<any> {
const predicate = (result: TypePaging) => !!result.list.entries.find(({entry}) => entry.title === title);
const apiCall = async () => {
try {
return this.listTypes({where: `(not namespaceUri matches('http://www.alfresco.*'))`});
} catch (error) {
Logger.error('Failed to list types', error);
return null;
}
};
return ApiUtil.waitForApi(apiCall, predicate);
}
}

View File

@ -1,19 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export * from './upload.actions';
export * from './model.actions';

View File

@ -1,118 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 * as path from 'path';
import * as fs from 'fs';
import { NodeEntry, UploadApi, NodesApi } from '@alfresco/js-api';
import { ApiUtil } from '../../../shared/api/api.util';
import { Logger } from '../../core/utils/logger';
import { ApiService } from '../../../shared/api/api.service';
export class UploadActions {
api: ApiService;
uploadApi: UploadApi;
nodesApi: NodesApi;
constructor(apiService: ApiService) {
this.api = apiService;
this.uploadApi = new UploadApi(apiService.getInstance());
this.nodesApi = new NodesApi(apiService.getInstance());
}
async uploadFile(fileLocation: fs.PathLike, fileName: string, parentFolderId: string): Promise<NodeEntry> {
const file = fs.createReadStream(fileLocation);
const uploadPromise = this.uploadApi.uploadFile(
file,
'',
parentFolderId,
null,
{
name: fileName,
nodeType: 'cm:content',
renditions: 'doclib'
}
);
await uploadPromise.then(() => {
Logger.info(`${fileName} uploaded in ${parentFolderId}`);
});
return uploadPromise;
}
async createEmptyFiles(emptyFileNames: string[], parentFolderId: string): Promise<NodeEntry> {
const filesRequest = [];
// eslint-disable-next-line @typescript-eslint/prefer-for-of
for (let i = 0; i < emptyFileNames.length; i++) {
const jsonItem = {};
jsonItem['name'] = emptyFileNames[i];
jsonItem['nodeType'] = 'cm:content';
filesRequest.push(jsonItem);
}
return this.nodesApi.createNode(parentFolderId, filesRequest as any, {});
}
async createFolder(folderName: string, parentFolderId: string): Promise<NodeEntry> {
return this.nodesApi.createNode(parentFolderId, {
name: folderName,
nodeType: 'cm:folder'
}, {});
}
async deleteFileOrFolder(nodeId: string) {
const apiCall = async () => {
try {
Logger.info(`Deleting ${nodeId}`);
return this.nodesApi.deleteNode(nodeId, { permanent: true });
} catch (error) {
Logger.error('Error delete file or folder');
}
};
return ApiUtil.waitForApi(apiCall, () => true);
}
async uploadFolder(sourcePath: string, folder: string): Promise<any[]> {
const files = fs.readdirSync(sourcePath);
let uploadedFiles: any[];
const promises = [];
if (files && files.length > 0) {
for (const fileName of files) {
const pathFile = path.join(sourcePath, fileName);
const uploadPromise = this.uploadFile(pathFile, fileName, folder);
await uploadPromise.then(() => {
Logger.info(`File ${fileName} uploaded successfully in ${folder}!`);
}).catch(() => {
Logger.error(`File ${fileName} error during the upload in ${folder}!`);
});
promises.push(uploadPromise);
}
uploadedFiles = await Promise.all(promises);
}
return uploadedFiles;
}
}

View File

@ -1,205 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { $, $$, by } from 'protractor';
import { DocumentListPage } from '../pages/document-list.page';
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { BrowserActions } from '../../core/utils/browser-actions';
import { DropdownPage } from '../../core/pages/material/dropdown.page';
import { BreadcrumbDropdownPage } from '../pages/breadcrumb/breadcrumb-dropdown.page';
import { Logger } from '../../core/utils/logger';
import { TabPage } from '../../core/pages/form/widgets/tab.page';
import { UploadButtonPage } from '../pages/upload-button.page';
import { FileModel } from '../../core/models/file.model';
import { TestElement } from '../../core/public-api';
export class ContentNodeSelectorDialogPage {
dialog = $(`adf-content-node-selector`);
header = this.dialog.$(`h1[data-automation-id='content-node-selector-title']`);
searchInputElement = this.dialog.$(`input[data-automation-id='content-node-selector-search-input']`);
searchLabel = this.dialog.$('.adf-content-node-selector-content-input .mat-form-field-label');
selectedRow = this.dialog.$(`adf-datatable-row[class*="adf-is-selected"]`);
cancelButton = $(`button[data-automation-id='content-node-selector-actions-cancel']`);
moveCopyButton = $(`button[data-automation-id='content-node-selector-actions-choose']`);
contentList = new DocumentListPage(this.dialog);
dataTable = this.contentList.dataTablePage();
siteListDropdown = new DropdownPage(this.dialog.$(`mat-select[data-automation-id='site-my-files-option']`));
breadcrumbDropdown = new BreadcrumbDropdownPage();
tab: TabPage = new TabPage();
uploadButtonComponent = new UploadButtonPage();
selectedFileCounter = TestElement.byCss('adf-node-counter');
uploadFromLocalTab = $$('*[role="tab"]').get(1);
uploadFromLocalTabName = 'Upload from your device';
repositoryTabName = 'Repository';
breadcrumbDropdownPage(): BreadcrumbDropdownPage {
return this.breadcrumbDropdown;
}
tabPage(): TabPage {
return this.tab;
}
uploadButtonPage(): UploadButtonPage {
return this.uploadButtonComponent;
}
async checkDialogIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.dialog);
}
async checkDialogIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.dialog);
}
async getDialogHeaderText(): Promise<string> {
return BrowserActions.getText(this.header);
}
async checkSearchInputIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.searchInputElement);
}
async getSearchLabel(): Promise<string> {
return BrowserActions.getText(this.searchLabel);
}
async checkSelectedSiteIsDisplayed(siteName: string): Promise<void> {
await this.siteListDropdown.checkOptionIsSelected(siteName);
}
async checkSelectedFolder(folderName: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.selectedRow.element(by.cssContainingText('adf-name-location-cell', folderName)));
}
async checkCancelButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.cancelButton);
}
async clickCancelButton(): Promise<void> {
await BrowserActions.click(this.cancelButton);
}
async checkCancelButtonIsEnabled(): Promise<boolean> {
return this.cancelButton.isEnabled();
}
async checkCopyMoveButtonIsEnabled(): Promise<boolean> {
return this.moveCopyButton.isEnabled();
}
async checkMoveCopyButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.moveCopyButton);
}
async getMoveCopyButtonText(): Promise<string> {
return BrowserActions.getText(this.moveCopyButton);
}
async clickMoveCopyButton(): Promise<void> {
await BrowserActions.click(this.moveCopyButton);
}
async numberOfResultsDisplayed(): Promise<number> {
return this.dataTable.numberOfRows();
}
async typeIntoNodeSelectorSearchField(text: string): Promise<void> {
Logger.log(`Search Node content node selector ${text}`);
await BrowserVisibility.waitUntilElementIsVisible(this.searchInputElement);
await BrowserActions.clearSendKeys(this.searchInputElement, text, 100);
await this.dataTable.waitTillContentLoaded();
}
async clickContentNodeSelectorResult(name: string): Promise<void> {
await this.dataTable.clickRowByContent(name);
await this.dataTable.checkRowByContentIsSelected(name);
}
async doubleClickContentNodeSelectorResult(name: string): Promise<void> {
await this.dataTable.doubleClickRowByContent(name);
}
async attachFileFromContentNode(folderName: string, fileName: string): Promise<void> {
await this.checkDialogIsDisplayed();
await this.checkSearchInputIsDisplayed();
await this.checkCancelButtonIsDisplayed();
await this.dataTable.waitForTableBody();
await this.dataTable.waitTillContentLoaded();
await this.dataTable.checkRowContentIsDisplayed(folderName);
await this.dataTable.doubleClickRowByContent(folderName);
await this.dataTable.waitForTableBody();
await this.dataTable.waitTillContentLoaded();
await this.dataTable.checkRowContentIsDisplayed(fileName);
await this.clickContentNodeSelectorResult(fileName);
await this.checkCopyMoveButtonIsEnabled();
await this.clickMoveCopyButton();
}
async checkFileServerTabIsLoaded(): Promise<void> {
await this.checkDialogIsDisplayed();
await this.dataTable.waitForTableBody();
await this.breadcrumbDropdown.checkCurrentFolderIsDisplayed();
}
async attachFilesFromLocal(files: FileModel[]): Promise<void> {
await this.checkFileServerTabIsLoaded();
await this.tab.clickTabByLabel(this.uploadFromLocalTabName);
await this.uploadButtonComponent.attachFiles(files);
await this.tab.clickTabByLabel(this.repositoryTabName);
await this.dataTable.waitForTableBody();
await this.dataTable.waitTillContentLoaded();
for ( const file of files) {
await this.dataTable.checkRowContentIsDisplayed(file.getName());
}
await this.checkCopyMoveButtonIsEnabled();
await this.clickMoveCopyButton();
}
async searchAndSelectResult(searchText: string, name: string) {
await this.typeIntoNodeSelectorSearchField(searchText);
await this.contentListPage().dataTablePage().waitTillContentLoaded();
await this.contentListPage().dataTablePage().waitForFirstRow();
try {
await this.contentListPage().dataTablePage().checkRowContentIsDisplayed(name);
} catch (e) {
Logger.error(`failed to get search result :: ${name}`);
}
await this.clickContentNodeSelectorResult(name);
}
contentListPage(): DocumentListPage {
return this.contentList;
}
async isUploadFromLocalTabEnabled(): Promise<boolean> {
await BrowserVisibility.waitUntilElementIsPresent(this.uploadFromLocalTab);
const disabled = await BrowserActions.getAttribute(this.uploadFromLocalTab, 'aria-disabled');
return disabled === 'false';
}
}

View File

@ -1,18 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export * from './content-node-selector-dialog.page';

View File

@ -1,62 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { $, $$ } from 'protractor';
import { BrowserActions } from '../../../core/utils/browser-actions';
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
import { DropdownPage } from '../../../core/pages/material/dropdown.page';
export class BreadcrumbDropdownPage {
breadCrumb = $(`adf-dropdown-breadcrumb[data-automation-id='content-node-selector-content-breadcrumb']`);
parentFolder = this.breadCrumb.$(`button[data-automation-id='dropdown-breadcrumb-trigger']`);
currentFolder = this.breadCrumb.$(`div span[data-automation-id="current-folder"]`);
breadCrumbDropdown = new DropdownPage($$(`div[class*='mat-select-panel']`).first());
async choosePath(pathName: string): Promise<void> {
await this.breadCrumbDropdown.selectOption(pathName);
}
async clickParentFolder(): Promise<void> {
await BrowserActions.click(this.parentFolder);
}
async checkBreadCrumbDropdownIsDisplayed(): Promise<void> {
await this.breadCrumbDropdown.checkDropdownIsVisible();
}
async checkBreadCrumbDropdownIsNotDisplayed(): Promise<void> {
await this.breadCrumbDropdown.checkDropdownIsNotVisible();
}
async checkBreadCrumbOptionIsDisplayed(optionName: string): Promise<void> {
await this.breadCrumbDropdown.checkOptionIsDisplayed(optionName);
}
async checkBreadCrumbOptionIsNotDisplayed(optionName: string): Promise<void> {
await this.breadCrumbDropdown.checkOptionIsNotDisplayed(optionName);
}
async getTextOfCurrentFolder(): Promise<string> {
return BrowserActions.getText(this.currentFolder);
}
async checkCurrentFolderIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.currentFolder);
}
}

View File

@ -1,18 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export * from './breadcrumb-dropdown.page';

View File

@ -1,89 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { ElementFinder, browser, $$, protractor } 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';
import { Logger } from '../../core/utils/logger';
export class DocumentListPage {
rootElement: ElementFinder;
optionButton = 'button[data-automation-id*="action_menu_"]';
tableBody: ElementFinder;
dataTable: DataTableComponentPage;
constructor(rootElement = $$('adf-document-list').first()) {
this.rootElement = rootElement;
this.dataTable = new DataTableComponentPage(this.rootElement);
this.tableBody = rootElement.$$('.adf-datatable-body').first();
}
async waitForTableBody(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.tableBody);
}
async getTooltip(nodeName: string): Promise<string> {
return this.dataTable.getTooltip('Display name', nodeName);
}
async selectRow(nodeName: string): Promise<void> {
await this.dataTable.selectRow('Display name', nodeName);
}
// @deprecated Use Playwright API instead
async selectRowsWithKeyboard(...contentNames: string[]): Promise<void> {
let option: any;
await browser.actions().sendKeys(protractor.Key.COMMAND).perform();
for (const name of contentNames) {
option = await this.dataTable.getRow('Display name', name);
await option.click();
await this.dataTable.checkRowIsSelected('Display name', name);
}
await browser.actions().sendKeys(protractor.Key.NULL).perform();
}
async rightClickOnRow(nodeName: string): Promise<void> {
await this.dataTable.rightClickOnRow('Display name', nodeName);
}
async clickOnActionMenu(content: string): Promise<void> {
Logger.log(`Click action menu ${content}`);
await BrowserActions.closeMenuAndDialogs();
const row = this.dataTable.getRow('Display name', content);
await BrowserActions.click(row.$(this.optionButton));
await BrowserActions.waitUntilActionMenuIsVisible();
await browser.sleep(500);
}
async checkActionMenuIsNotDisplayed(): Promise<void> {
await BrowserActions.waitUntilActionMenuIsNotVisible();
}
dataTablePage(): DataTableComponentPage {
return new DataTableComponentPage(this.rootElement);
}
async getAllRowsColumnValues(column: string) {
return this.dataTable.getAllRowsColumnValues(column);
}
async doubleClickRow(nodeName: string): Promise<void> {
await this.dataTable.doubleClickRow('Display name', nodeName);
}
}

View File

@ -1,19 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export * from './document-list.page';
export * from './breadcrumb/public-api';

View File

@ -1,32 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { $ } from 'protractor';
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { FileModel } from '../../core/models/file.model';
export class UploadButtonPage {
uploadButton = $('adf-upload-button input');
async attachFiles(files: FileModel[]): Promise<void> {
await BrowserVisibility.waitUntilElementIsPresent(this.uploadButton);
for ( const file of files) {
await this.uploadButton.sendKeys(file.getLocation());
}
}
}

View File

@ -1,20 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export * from './pages/public-api';
export * from './actions/public-api';
export * from './dialog/public-api';

View File

@ -1,47 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { AlfrescoApiConfig } from '@alfresco/js-api';
import { ApiService } from '../../../shared/api/api.service';
import { Logger } from '../utils/logger';
import { browser } from 'protractor';
export const createApiService = (
/** @deprecated */
appConfigOverride: Partial<AlfrescoApiConfig> = {}
) => {
const patchedAppConfig = {
...browser.params.testConfig.appConfig,
oauth2: {
...browser.params.testConfig.appConfig.oauth2,
// For some reason protractor e2es must have this value hardcoded
implicitFlow: false
},
// Legacy debt...
hostEcm: browser.params.testConfig.appConfig.ecmHost,
hostBpm: browser.params.testConfig.appConfig.bpmHost,
...appConfigOverride
};
return new ApiService(
{
appConfig: new AlfrescoApiConfig(patchedAppConfig),
users: browser.params.testConfig.users
},
Logger
);
};

View File

@ -1,122 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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, ElementFinder } from 'protractor';
import * as path from 'path';
import * as fs from 'fs';
import { BrowserActions } from '../utils/browser-actions';
const JS_BIND_INPUT = (target) => {
const input = document.createElement('input');
input.type = 'file';
input.style.display = 'none';
input.addEventListener(
'change',
() => {
target.scrollIntoView(true);
const rect = target.getBoundingClientRect();
const x = rect.left + (rect.width >> 1);
const y = rect.top + (rect.height >> 1);
const data = { files: input.files };
['dragenter', 'dragover', 'drop'].forEach((name) => {
const mouseEvent: any = document.createEvent('MouseEvent');
mouseEvent.initMouseEvent(name, !0, !0, window, 0, 0, 0, x, y, !1, !1, !1, !1, 0, null);
mouseEvent.dataTransfer = data;
target.dispatchEvent(mouseEvent);
});
document.body.removeChild(input);
},
false
);
document.body.appendChild(input);
return input;
};
const JS_BIND_INPUT_FOLDER = (target) => {
const input: any = document.createElement('input');
input.type = 'file';
input.style.display = 'none';
input.multiple = true;
input.webkitdirectory = true;
input.addEventListener(
'change',
() => {
target.scrollIntoView(true);
const rect = target.getBoundingClientRect();
const x = rect.left + (rect.width >> 1);
const y = rect.top + (rect.height >> 1);
const data = { files: input.files };
['dragenter', 'dragover', 'drop'].forEach((name) => {
const mouseEvent: any = document.createEvent('MouseEvent');
mouseEvent.initMouseEvent(name, !0, !0, window, 0, 0, 0, x, y, !1, !1, !1, !1, 0, null);
mouseEvent.dataTransfer = data;
target.dispatchEvent(mouseEvent);
});
document.body.removeChild(input);
},
false
);
document.body.appendChild(input);
return input;
};
export class DropActions {
static async dropFile(dropArea, filePath) {
const absolutePath = path.resolve(path.join(browser.params.testConfig.main.rootPath, filePath));
fs.accessSync(absolutePath, fs.constants.F_OK);
const elem = await dropArea.getWebElement();
const input: any = await browser.executeScript(JS_BIND_INPUT, elem);
return input.sendKeys(absolutePath);
}
static async dropFolder(dropArea, folderPath) {
const absolutePath = path.resolve(path.join(browser.params.testConfig.main.rootPath, folderPath));
fs.accessSync(absolutePath, fs.constants.F_OK);
const elem = await dropArea.getWebElement();
const input: any = await browser.executeScript(JS_BIND_INPUT_FOLDER, elem);
return input.sendKeys(absolutePath);
}
static async dragAndDrop(elementToDrag: ElementFinder, locationToDragTo: ElementFinder, locationOffset = { x: 230, y: 280 }) {
await BrowserActions.click(elementToDrag);
await browser.actions().mouseDown(elementToDrag).mouseMove(locationToDragTo, locationOffset).mouseUp().perform();
await browser.actions().doubleClick(locationToDragTo).perform();
}
static async dragAndDropNotClickableElement(elementToDrag: ElementFinder, locationToDragTo: ElementFinder) {
await browser.actions().mouseMove(elementToDrag).perform();
await browser.actions().mouseDown(elementToDrag).perform();
await browser.actions().mouseMove({ x: 10, y: 100 }).perform();
await browser.actions().mouseMove(locationToDragTo).perform();
return browser.actions().mouseUp().perform();
}
static async dropElement(locationToDragTo: ElementFinder) {
await browser.actions().mouseDown(locationToDragTo).perform();
}
}

View File

@ -1,139 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { ApiService } from '../../../../shared/api/api.service';
import { StringUtil } from '../../../../shared/utils/string.util';
import { ApiUtil } from '../../../../shared/api/api.util';
import { Logger } from '../../utils/logger';
import { browser } from 'protractor';
export class GroupIdentityService {
api: ApiService;
constructor(api: ApiService) {
this.api = api;
}
async createIdentityGroup(groupName = StringUtil.generateRandomString(5)): Promise<any> {
await this.createGroup(groupName);
const group = await this.getGroupInfoByGroupName(groupName);
return group;
}
async deleteIdentityGroup(groupId): Promise<void> {
await this.deleteGroup(groupId);
}
async createGroup(groupName: string): Promise<any> {
const path = '/groups';
const method = 'POST';
const queryParams = {};
const postBody = {
name: `${groupName}-${browser.params.groupSuffix}`
};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data;
}
async deleteGroup(groupId: string): Promise<any> {
const path = `/groups/${groupId}`;
const method = 'DELETE';
const queryParams = {};
const postBody = {};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data;
}
async getGroupInfoByGroupName(groupName: string): Promise<any> {
Logger.log(`Get GroupInfoByGroupName ${groupName}`);
const predicate = (result: any) => !!result;
const apiCall = async () => {
try {
const path = `/groups`;
const method = 'GET';
const queryParams = { search: groupName };
const postBody = {};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
Logger.log(`Data ${JSON.stringify(data)}`);
return data[0];
Logger.error('Group not found');
} catch (error) {
Logger.error('Group not found');
return null;
}
};
return ApiUtil.waitForApi(apiCall, predicate);
}
async assignRole(groupId: string, roleId: string, roleName: string): Promise<any> {
Logger.log(`Assign to group ${groupId} Role ${roleName}`);
const path = `/groups/${groupId}/role-mappings/realm`;
const method = 'POST';
const queryParams = {};
const postBody = [{ id: roleId, name: roleName }];
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data;
}
/**
* Add client roles.
*
* @param groupId ID of the target group
* @param clientId ID of the client
* @param roleId ID of the clientRole
* @param roleName of the clientRole
*/
async addClientRole(groupId: string, clientId: string, roleId: string, roleName: string): Promise<any> {
const path = `/groups/${groupId}/role-mappings/clients/${clientId}`;
const method = 'POST';
const queryParams = {};
const postBody = [
{
id: roleId,
name: roleName,
composite: false,
clientRole: true,
containerId: clientId
}
];
return this.api.performIdentityOperation(path, method, queryParams, postBody);
}
/**
* Gets the client ID using the app name.
*
* @param applicationName Name of the app
* @returns client ID string
*/
async getClientIdByApplicationName(applicationName: string): Promise<any> {
const path = `/clients`;
const method = 'GET';
const queryParams = { clientId: applicationName };
const postBody = {};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data[0].id;
}
}

View File

@ -1,151 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
/* eslint-disable @typescript-eslint/naming-convention */
import { ApiService } from '../../../../shared/api/api.service';
import { UserModel } from '../../models/user.model';
import { RolesService } from './roles.service';
import { Logger } from '../../utils/logger';
export class IdentityService {
ROLES = {
ACTIVITI_USER: 'ACTIVITI_USER',
ACTIVITI_ADMIN: 'ACTIVITI_ADMIN',
ACTIVITI_DEVOPS: 'ACTIVITI_DEVOPS',
ACTIVITI_IDENTITY: 'ACTIVITI_IDENTITY'
};
constructor(public api: ApiService) {}
async createIdentityUserWithRole(roles: string[]): Promise<any> {
const rolesService = new RolesService(this.api);
const user = await this.createIdentityUser();
// eslint-disable-next-line @typescript-eslint/prefer-for-of
for (let i = 0; i < roles.length; i++) {
const roleId = await rolesService.getRoleIdByRoleName(roles[i]);
await this.assignRole(user.idIdentityService, roleId, roles[i]);
}
return user;
}
async createIdentityUser(user: UserModel = new UserModel()): Promise<any> {
Logger.log(`Create Identity User ${user.email}`);
await this.createUser(user);
const userIdentity = await this.getUserInfoByUsername(user.username);
await this.resetPassword(userIdentity.id, user.password);
user.idIdentityService = userIdentity.id;
return user;
}
async deleteIdentityUser(userId: string): Promise<void> {
await this.deleteUser(userId);
}
async createUser(user: UserModel): Promise<any> {
try {
const path = '/users';
const method = 'POST';
const queryParams = {};
const postBody = {
username: user.username,
firstName: user.firstName,
lastName: user.lastName,
enabled: true,
email: user.email
};
return this.api.performIdentityOperation(path, method, queryParams, postBody);
} catch (error) {
Logger.error('Create User - Service error, Response: ', JSON.parse(JSON.stringify(error))?.response?.text);
}
}
async deleteUser(userId: string): Promise<any> {
const path = `/users/${userId}`;
const method = 'DELETE';
const queryParams = {};
const postBody = {};
const deletePromise = this.api.performIdentityOperation(path, method, queryParams, postBody);
await deletePromise.then(() => {
Logger.info(`user ${userId} delete`);
});
return deletePromise;
}
async getUserInfoByUsername(username: string): Promise<any> {
const path = `/users`;
const method = 'GET';
const queryParams = { username };
const postBody = {};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data[0];
}
async resetPassword(id: string, password: string): Promise<any> {
const path = `/users/${id}/reset-password`;
const method = 'PUT';
const queryParams = {};
const postBody = { type: 'password', value: password, temporary: false };
return this.api.performIdentityOperation(path, method, queryParams, postBody);
}
async addUserToGroup(userId: string, groupId: string): Promise<any> {
Logger.log(`Add user to group userId ${userId} ${groupId}`);
try {
const path = `/users/${userId}/groups/${groupId}`;
const method = 'PUT';
const queryParams = {};
const postBody = { realm: 'alfresco', userId, groupId };
return this.api.performIdentityOperation(path, method, queryParams, postBody);
} catch (error) {
Logger.error('Add User To Group - Service error, Response: ', JSON.parse(JSON.stringify(error)));
}
}
async assignRole(userId: string, roleId: string, roleName: string): Promise<any> {
const path = `/users/${userId}/role-mappings/realm`;
const method = 'POST';
const queryParams = {};
const postBody = [{ id: roleId, name: roleName }];
return this.api.performIdentityOperation(path, method, queryParams, postBody);
}
async deleteClientRole(userId: string, clientId: string, roleId: string, roleName: string): Promise<any> {
const path = `/users/${userId}/role-mappings/clients/${clientId}`;
const method = 'DELETE';
const queryParams = {};
const postBody = [{
id: roleId,
name: roleName,
composite: false,
clientRole: true,
containerId: clientId
}];
return this.api.performIdentityOperation(path, method, queryParams, postBody);
}
}

View File

@ -1,21 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export * from './identity.service';
export * from './group-identity.service';
export * from './roles.service';
export * from './query.service';

View File

@ -1,247 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { ApiService } from '../../../../shared/api/api.service';
import { Logger } from '../../utils/logger';
import { ApiUtil } from '../../../../shared/api/api.util';
export type TaskStatus = 'COMPLETED' | 'CREATED' | 'ASSIGNED' | 'SUSPENDED' | 'CANCELLED' | 'RUNNING';
export class QueryService {
api: ApiService;
constructor(api: ApiService) {
this.api = api;
}
async getProcessInstanceTasks(processInstanceId, appName): Promise<any> {
const predicate = (result: any) => result.list && result.list.entries.length > 0;
const apiCall = async () => {
try {
const path = '/' + appName + '/query/v1/process-instances/' + processInstanceId + '/tasks';
const method = 'GET';
const queryParams = {};
const postBody = {};
return this.api.performBpmOperation(path, method, queryParams, postBody);
} catch (error) {
Logger.error('get process-instances tasks Service error');
}
};
return ApiUtil.waitForApi(apiCall, predicate);
}
async getProcessInstance(processInstanceId, appName): Promise<any> {
const predicate = (result: any) => !!result;
const apiCall = async () => {
try {
const path = '/' + appName + '/query/v1/process-instances/' + processInstanceId;
const method = 'GET';
const queryParams = {};
const postBody = {};
return this.api.performBpmOperation(path, method, queryParams, postBody);
} catch (error) {
Logger.error('get process-instances Service error');
}
};
return ApiUtil.waitForApi(apiCall, predicate);
}
async getProcessInstanceSubProcesses(processInstanceId, appName): Promise<any> {
const predicate = (result: any) => result.list && result.list.entries.length > 0;
const apiCall = async () => {
try {
const path = '/' + appName + '/query/v1/process-instances/' + processInstanceId + '/subprocesses';
const method = 'GET';
const queryParams = {};
const postBody = {};
return this.api.performBpmOperation(path, method, queryParams, postBody);
} catch (error) {
Logger.error('get subprocesses process-instances Service error');
}
};
return ApiUtil.waitForApi(apiCall, predicate);
}
async getProcessInstanceTaskByStatus(processInstanceId, appName, taskName, status: TaskStatus): Promise<any> {
const predicate = (result: any) => !!result;
const apiCall = async () => {
try {
const path = '/' + appName + '/query/v1/process-instances/' + processInstanceId + '/tasks';
const method = 'GET';
const queryParams = {};
const postBody = {};
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
return data.list?.entries.length && data.list.entries.find(task => task.entry.name === taskName && task.entry.status === status);
} catch (error) {
Logger.error('get process-instances tasks by status - Service error');
}
};
return ApiUtil.waitForApi(apiCall, predicate);
}
async getTaskByStatus(taskName, appName, status: TaskStatus, standalone = false): Promise<any> {
const predicate = (result: any) => !!result;
const apiCall = async () => {
try {
const path = `/${appName}/query/v1/tasks?standalone=${standalone}&status=${status}&maxItems=1000&skipCount=0&sort=createdDate`;
const method = 'GET';
const queryParams = {};
const postBody = {};
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
// eslint-disable-next-line @typescript-eslint/prefer-for-of
for (let i = 0; i < data.list.entries.length; i++) {
if (data.list.entries[i].entry.name === taskName) {
return data.list.entries[i];
}
}
} catch (error) {
Logger.error('Get Task By Status - Service error');
}
};
return ApiUtil.waitForApi(apiCall, predicate);
}
async getTaskByName(taskName, processInstanceId, appName): Promise<any> {
const predicate = (result: any) => !!result;
const apiCall = async () => {
try {
const path = '/' + appName + '/query/v1/process-instances/' + processInstanceId + '/tasks';
const method = 'GET';
const queryParams = {};
const postBody = {};
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
// eslint-disable-next-line @typescript-eslint/prefer-for-of
for (let i = 0; i < data.list.entries.length; i++) {
if (data.list.entries[i].entry.name === taskName) {
return data.list.entries[i];
}
}
} catch (error) {
Logger.error('Get Task By Name - Service error');
}
};
return ApiUtil.waitForApi(apiCall, predicate);
}
async getTask(taskName: string, processInstanceId: string, appName: string, status: string, retryCount = 15): Promise<any> {
const path = '/' + appName + '/query/v1/process-instances/' + processInstanceId + '/tasks';
const method = 'GET';
const queryParams = {};
const postBody = {};
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
// eslint-disable-next-line @typescript-eslint/prefer-for-of
for (let i = 0; i < data.list.entries.length; i++) {
if (data.list.entries[i].entry.name === taskName) {
const task = data.list.entries[i];
if (task.entry.status === status) {
return task;
} else if (retryCount > 0) {
return this.getTask(taskName, processInstanceId, appName, status, retryCount--);
} else {
return task;
}
}
}
}
async getTaskByNameAndStatus(taskName, processInstanceId, appName, status: TaskStatus): Promise<any> {
const predicate = (result: any) => !!result;
const apiCall = async () => {
try {
return this.getTask(taskName, processInstanceId, appName, status);
} catch (error) {
Logger.error('Get Task By Name - Service error');
}
};
return ApiUtil.waitForApi(apiCall, predicate);
}
async getProcessInstanceId(processName: string, appName: string): Promise<any> {
const predicate = (result: any) => !!result;
const apiCall = async () => {
try {
const path = '/' + appName + '/query/v1/process-instances';
const method = 'GET';
const queryParams = { name: processName };
const postBody = {};
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
return data.list.entries && data.list.entries.length > 0 ? data.list.entries[0].entry.id : null;
} catch (error) {
Logger.error('Get Process Instance Id - Service error, Response: ', JSON.parse(JSON.stringify(error))?.response?.text);
}
};
return ApiUtil.waitForApi(apiCall, predicate);
}
async getProcessInstances(processName: string, appName: string, status?: TaskStatus): Promise<any> {
const predicate = (result: any) => !!result;
const apiCall = async () => {
try {
const path = '/' + appName + '/query/v1/process-instances';
const method = 'GET';
let queryParams;
if (status) {
queryParams = { name: processName, status };
} else {
queryParams = { name: processName };
}
const postBody = {};
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
return data.list.entries ?? null;
} catch (error) {
Logger.error('Get Process Instances - Service error, Response: ', JSON.parse(JSON.stringify(error))?.response?.text);
}
};
return ApiUtil.waitForApi(apiCall, predicate, 2, 1000);
}
}

View File

@ -1,78 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { ApiService } from '../../../../shared/api/api.service';
export class RolesService {
api: ApiService;
constructor(api: ApiService) {
this.api = api;
}
async createRole(roleName: string): Promise<any> {
const path = '/roles';
const method = 'POST';
const queryParams = {};
const postBody = {
name: roleName + 'TestRole'
};
return this.api.performIdentityOperation(path, method, queryParams, postBody);
}
async deleteRole(roleId: string): Promise<any> {
const path = `/roles-by-id/${roleId}`;
const method = 'DELETE';
const queryParams = {};
const postBody = {};
return this.api.performIdentityOperation(path, method, queryParams, postBody);
}
async getRoleIdByRoleName(roleName: string): Promise<string> {
const path = `/roles`;
const method = 'GET';
const queryParams = {};
const postBody = {};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
for (const key in data) {
if (data[key].name === roleName) {
return data[key].id;
}
}
return undefined;
}
async getClientRoleIdByRoleName(groupId: string, clientId: string, clientRoleName: string): Promise<any> {
const path = `/groups/${groupId}/role-mappings/clients/${clientId}/available`;
const method = 'GET';
const queryParams = {};
const postBody = {};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
for (const key in data) {
if (data[key].name === clientRoleName) {
return data[key].id;
}
}
return undefined;
}
}

View File

@ -1,22 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export * from './identity/public-api';
export * from './api.service.factory';
export * from './drop.actions';
export * from './users.actions';
export * from './search.service';

View File

@ -1,75 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { ApiService } from '../../../shared/api/api.service';
import { ResultSetPaging, SearchApi } from '@alfresco/js-api';
import { Logger } from '../utils/logger';
import { ApiUtil } from '../../../shared/api/api.util';
export class SearchService {
apiService: ApiService;
searchApi: SearchApi;
constructor(apiService: ApiService) {
this.apiService = apiService;
this.searchApi = new SearchApi(this.apiService.getInstance());
}
async isSearchable(name: string): Promise<any> {
const query = this.createSearchQuery(name);
const predicate = (result: ResultSetPaging) => !!result?.list?.entries?.find(({ entry }) => entry.name === name);
return this.performSearch(query, predicate, 'Failed to search folder');
}
async performSearch(query, predicate, errorMessage): Promise<any> {
const apiCall = async () => {
try {
return this.searchApi.search(query);
} catch (error) {
Logger.error(errorMessage);
return null;
}
};
return ApiUtil.waitForApi(apiCall, predicate);
}
private createSearchQuery(name: string) {
return {
query: {
query: `${name}*`
},
include: ['path', 'allowableOperations', 'properties'],
paging: {
maxItems: 20,
skipCount: 0
},
filterQueries: [
{
query: `TYPE:'cm:folder' OR TYPE:'cm:content'`
},
{
query: 'NOT cm:creator:System'
}
],
scope: {
locations: ['nodes']
}
};
}
}

View File

@ -1,138 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { UserProfileApi, AdminUsersApi, AdminTenantsApi, PeopleApi, UserRepresentation } from '@alfresco/js-api';
import { IdentityService } from './identity/identity.service';
import { UserModel } from '../models/user.model';
import { ApiService } from '../../../shared/api/api.service';
import { Logger } from '../utils/logger';
import { Tenant } from '../models/tenant';
export class UsersActions {
api: ApiService;
identityService: IdentityService;
peopleApi: PeopleApi;
adminTenantsApi: AdminTenantsApi;
adminUsersApi: AdminUsersApi;
userProfileApi: UserProfileApi;
constructor(apiService: ApiService) {
this.api = apiService;
this.peopleApi = new PeopleApi(apiService.getInstance());
this.adminTenantsApi = new AdminTenantsApi(apiService.getInstance());
this.adminUsersApi = new AdminUsersApi(apiService.getInstance());
this.userProfileApi = new UserProfileApi(apiService.getInstance());
if (this.api.apiService.isOauthConfiguration()) {
this.identityService = new IdentityService(this.api);
}
}
async createUser(userModel?: UserModel): Promise<UserModel> {
if (!this.api.apiService.isLoggedIn()) {
await this.api.apiService.login(browser.params.testConfig.users.admin.username, browser.params.testConfig.users.admin.password);
}
const user = new UserModel({ ...(userModel ? userModel : {}) });
try {
if (this.api.apiService.isEcmConfiguration() || this.api.apiService.isEcmBpmConfiguration()) {
Logger.log(`Create user ECM ${user.email}`);
await this.peopleApi.createPerson({
id: user.username,
email: user.email,
firstName: user.firstName,
lastName: user.lastName,
password: user.password
});
}
} catch (e) {
if (e.status === 409) {
Logger.error('ACS user already created');
} else {
Logger.error('Not able to create ACS user: ' + JSON.stringify(e));
}
}
try {
if (this.api.apiService.isBpmConfiguration() || this.api.apiService.isEcmBpmConfiguration()) {
Logger.log('Create user BPM');
if (user.tenantId) {
const apsUser = await this.createApsUser(user.tenantId, user.email, user.firstName, user.lastName, user.password);
user.id = apsUser.id;
} else {
const apsUser = await this.createTenantAndUser(user.email, user.firstName, user.lastName, user.password);
user.tenantId = apsUser.tenantId;
user.id = apsUser.id;
}
}
} catch (e) {
if (e.status === 409) {
Logger.error('BPM user already created');
} else {
Logger.error('Not able to create BPM user: ' + JSON.stringify(e));
}
}
try {
if (this.api.apiService.isOauthConfiguration()) {
Logger.log('Create user identity');
const identityUser = await this.identityService.createIdentityUser(user);
user.idIdentityService = identityUser.idIdentityService;
}
} catch (e) {
if (e.status === 409) {
Logger.error('Identity user already created');
} else {
Logger.error('Not able to create identity user: ' + JSON.stringify(e));
}
}
return user;
}
async createTenantAndUser(email?: string, firstName?: string, lastName?: string, password?: string): Promise<UserRepresentation> {
const newTenant = await this.adminTenantsApi.createTenant(new Tenant());
const user = new UserModel({
tenantId: newTenant.id,
email,
firstName,
lastName,
password
});
return this.adminUsersApi.createNewUser(user.getAPSModel());
}
async createApsUser(tenantId?: number, email?: string, firstName?: string, lastName?: string, password?: string): Promise<UserRepresentation> {
const user = new UserModel({
tenantId,
email,
firstName,
lastName,
password
});
return this.adminUsersApi.createNewUser(user.getAPSModel());
}
async deleteTenant(tenantId: number) {
await this.adminTenantsApi.deleteTenant(tenantId);
}
}

View File

@ -1,45 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { $, by, element } from 'protractor';
import { BrowserActions } from '../../core/utils/browser-actions';
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { materialLocators } from '../public-api';
export class EditJsonDialog {
dialog = $(`.adf-edit-json-dialog`);
closeButton = element(by.cssContainingText(`button span`, 'Close'));
dialogContent = this.dialog.$(`${materialLocators.Dialog.content.root} textarea`);
async checkDialogIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.dialog);
}
async checkDialogIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.dialog);
}
async clickCloseButton(): Promise<void> {
await BrowserActions.click(this.closeButton);
}
async getDialogContent(): Promise<string> {
return BrowserActions.getInputValue(this.dialogContent);
}
}

View File

@ -1,18 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export * from './edit-json-dialog';

View File

@ -1,34 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export interface ApplicationRepresentation {
releaseId: string;
security: SecurityRepresentation[];
name: string;
infrastructure?: InfrastructureRepresentation;
}
export interface SecurityRepresentation {
role: string;
users: string[];
groups: string[];
}
export interface InfrastructureRepresentation {
connectors?: any;
bridges?: any;
}

View File

@ -1,36 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { StringUtil } from '../../../shared/utils/string.util';
export class FileModel {
name = StringUtil.generateRandomString();
location = StringUtil.generateRandomString();
constructor(details?: any) {
Object.assign(this, details);
}
getName() {
return this.name;
}
getLocation() {
return this.location;
}
}

View File

@ -1,21 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export * from './user.model';
export * from './application-model';
export * from './file.model';
export * from './tenant';

View File

@ -1,37 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { StringUtil } from '../../../shared/utils/string.util';
/**
* Create tenant JSON Object
*
* @param details - JSON object used to overwrite the default values
*/
export class Tenant {
active = true;
configuration = 'DefaultConfig';
domain = 'DefaultDomain';
maxUsers = 10;
name = StringUtil.generateRandomString();
constructor(details?: any) {
Object.assign(this, details);
}
}

View File

@ -1,69 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { StringUtil } from '../../../shared/utils/string.util';
import { browser } from 'protractor';
import { UserRepresentation } from '@alfresco/js-api';
export class UserModel {
firstName?: string = StringUtil.generateRandomLowercaseString();
lastName?: string = StringUtil.generateRandomLowercaseString();
password?: string = StringUtil.generateRandomLowercaseString(4) + StringUtil.generateRandomString(4).toUpperCase();
email?: string;
username?: string;
idIdentityService?: string;
type = 'enterprise';
tenantId?: number;
company?: string;
id: number;
constructor(details: any = {}) {
const EMAIL_DOMAIN = browser.params?.testConfig?.emailDomain ? browser.params.testConfig.emailDomain : 'example.com';
this.firstName = details.firstName ? details.firstName : this.firstName;
this.lastName = details.lastName ? details.lastName : this.lastName;
const USER_IDENTIFY = `${this.firstName}${this.lastName}.${StringUtil.generateRandomLowercaseString(5)}`;
this.password = details.password ? details.password : this.password;
this.email = details.email ? details.email : `${USER_IDENTIFY}@${EMAIL_DOMAIN}`;
this.username = details.username ? details.username : USER_IDENTIFY;
this.idIdentityService = details.idIdentityService ? details.idIdentityService : this.idIdentityService;
this.type = details.type ? details.type : this.type;
this.tenantId = details.tenantId ? details.tenantId : this.tenantId;
this.company = details.company ? details.company : this.company;
this.id = details.id ? details.id : this.id;
}
get fullName() {
return `${this.firstName ?? ''} ${this.lastName ?? ''}`;
}
getAPSModel() {
return new UserRepresentation({
firstName: this.firstName,
lastName: this.lastName,
password: this.password,
email: this.email,
type: this.type,
tenantId: this.tenantId,
company: this.company,
id: this.id
});
}
}

View File

@ -1,35 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { $ } from 'protractor';
import { BrowserActions } from '../utils/browser-actions';
export class BreadcrumbPage {
breadcrumb = $(`adf-breadcrumb nav[data-automation-id='breadcrumb']`);
currentItem = $('.adf-breadcrumb-item-current');
async chooseBreadCrumb(breadCrumbItem: string): Promise<void> {
const path = this.breadcrumb.$(`a[data-automation-id='breadcrumb_${breadCrumbItem}']`);
await BrowserActions.click(path);
}
async getActiveBreadCrumbItemName(): Promise<string> {
return BrowserActions.getText(this.currentItem);
}
}

View File

@ -1,40 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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, ElementFinder } from 'protractor';
import { BrowserActions, BrowserVisibility } from '../../utils/public-api';
import { materialLocators } from '../public-api';
export class CardBooleanItemPage {
rootElement: ElementFinder;
labelLocator = 'div[data-automation-id*="card-boolean-label"]';
checkbox = `${materialLocators.Checkbox.root}[data-automation-id*="card-boolean"]`;
constructor(label: string = 'required') {
this.rootElement = element(by.xpath(`//div[contains(@data-automation-id, "label-${label}")]/ancestor::adf-card-view-boolitem`));
}
async checkboxClick(): Promise<void> {
await BrowserActions.click(this.rootElement.$(this.checkbox));
}
async checkLabelIsPresent(): Promise<void> {
const labelElement = this.rootElement.$(this.labelLocator);
await BrowserVisibility.waitUntilElementIsPresent(labelElement);
}
}

View File

@ -1,56 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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, ElementFinder, $$ } from 'protractor';
import { DateTimePickerPage } from '../material/date-time-picker.page';
import { DatePickerPage } from '../material/date-picker.page';
import { BrowserVisibility } from '../../utils/browser-visibility';
import { materialLocators } from '../public-api';
export class CardDateItemPage {
rootElement: ElementFinder;
dateTimePickerPage: DateTimePickerPage;
datePickerPage = new DatePickerPage();
labelLocator = 'label[data-automation-id*="card-dateitem-label"]';
valueLocator = 'span[data-automation-id*="card-date"]';
dateTimePicker = $$(materialLocators.DatetimePicker.toggle.class).first();
saveButton = 'button[data-automation-id*="card-dateitem-update"]';
constructor(label: string = 'minDate') {
this.rootElement = element(by.xpath(`//label[contains(@data-automation-id, "label-${label}")]/ancestor::adf-card-view-dateitem`));
this.dateTimePickerPage = new DateTimePickerPage(this.rootElement);
}
async setTodayDateValue(): Promise<void> {
await this.dateTimePickerPage.setTodayDateValue();
}
async setDateValue(date: string): Promise<boolean> {
return this.dateTimePickerPage.setDate(date);
}
async getDateValue(): Promise<string> {
return this.rootElement.$(this.valueLocator).getText();
}
async checkLabelIsVisible(): Promise<void> {
const labelElement = this.rootElement.$(this.labelLocator);
await BrowserVisibility.waitUntilElementIsVisible(labelElement);
}
}

View File

@ -1,56 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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, ElementFinder } from 'protractor';
import { BrowserActions, BrowserVisibility } from '../../utils/public-api';
import { DropdownPage } from '../material/dropdown.page';
import { materialLocators } from '../public-api';
export class CardSelectItemPage {
rootElement: ElementFinder;
labelLocator = 'div[data-automation-id*="card-select-label"]';
readOnlyField = '[data-automation-class="read-only-value"]';
dropdown: DropdownPage;
constructor(label: string = 'fileSource') {
this.rootElement = element(by.xpath(`//div[contains(@data-automation-id, "label-${label}")]/ancestor::adf-card-view-selectitem`));
this.dropdown = new DropdownPage(this.rootElement.$(materialLocators.Select.root));
}
async checkLabelIsPresent(): Promise<void> {
const labelElement = this.rootElement.$(this.labelLocator);
await BrowserVisibility.waitUntilElementIsPresent(labelElement);
}
async getSelectedOptionText(): Promise<string> {
return this.dropdown.getSelectedOptionText();
}
async getReadonlyValue(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.$(this.readOnlyField));
return BrowserActions.getText(this.rootElement.$(this.readOnlyField));
}
async selectDropdownOption(option: string): Promise<void> {
await this.dropdown.selectDropdownOption(option);
}
async checkElementIsReadonly(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.$(this.readOnlyField));
}
}

View File

@ -1,84 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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, ElementFinder, Key } from 'protractor';
import { BrowserActions, BrowserVisibility } from '../../utils/public-api';
import { materialLocators } from '../public-api';
export class CardTextItemPage {
rootElement: ElementFinder;
textField = '[data-automation-id*="card-textitem-value"]';
saveButton = 'button[data-automation-id*="card-textitem-update"]';
clearButton = 'button[data-automation-id*="card-textitem-reset"]';
field = '[data-automation-id*="card-textitem-value"]';
labelLocator = '[data-automation-id*="card-textitem-label"]';
errorMessage = '.adf-textitem-error';
clickableElement = '.adf-textitem-clickable';
readOnlyField = '.adf-property-read-only';
constructor(label: string = 'assignee') {
this.rootElement = element(by.xpath(`//${materialLocators.Label.root}[contains(@data-automation-id, "card-textitem-label-${label}")]//ancestor::adf-card-view-textitem`));
}
async getFieldValue(): Promise<string> {
const fieldElement = this.rootElement.$(this.field);
return BrowserActions.getInputValue(fieldElement);
}
async checkLabelIsPresent(): Promise<void> {
const labelElement = this.rootElement.$(this.labelLocator);
await BrowserVisibility.waitUntilElementIsPresent(labelElement);
}
async checkLabelIsVisible(): Promise<void> {
const labelElement = this.rootElement.$(this.labelLocator);
await BrowserVisibility.waitUntilElementIsVisible(labelElement);
}
async enterTextField(text: string, pauseBetweenTypingChars = 500): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.$(this.textField));
await BrowserActions.clearSendKeys(this.rootElement.$(this.textField), text, pauseBetweenTypingChars);
await this.rootElement.$(this.textField).sendKeys(Key.TAB);
}
async clickOnSaveButton(): Promise<void> {
await BrowserActions.click(this.rootElement.$(this.saveButton));
}
async clickOnClearButton(): Promise<void> {
await BrowserActions.click(this.rootElement.$(this.clearButton));
}
async getErrorMessage(): Promise<string> {
const errorField = this.rootElement.$(this.errorMessage);
return BrowserActions.getText(errorField);
}
async checkElementIsReadonly(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.$(this.readOnlyField));
}
async checkElementIsClickable(): Promise<void> {
const clickableElement = this.rootElement.$(this.clickableElement);
await BrowserVisibility.waitUntilElementIsVisible(clickableElement);
}
async clickField(): Promise<void> {
const clickableElement = this.rootElement.$(this.clickableElement);
await BrowserActions.click(clickableElement);
}
}

View File

@ -1,21 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export * from './card-view-text-item.page';
export * from './card-view-boolean-item.page';
export * from './card-view-date-item.page';
export * from './card-view-select-item.page';

View File

@ -1,37 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { $ } from 'protractor';
import { BrowserActions } from '../utils/browser-actions';
import { BrowserVisibility } from '../utils/browser-visibility';
export class ContextMenuPage {
contextMenu = $('#adf-context-menu-content');
async isContextMenuDisplayed(): Promise<boolean> {
try {
await BrowserVisibility.waitUntilElementIsVisible(this.contextMenu);
return true;
} catch (error) {
return false;
}
}
async clickContextMenuActionNamed(actionName: string): Promise<void> {
await BrowserActions.click($(`button[data-automation-id="context-${actionName}"]`));
}
}

View File

@ -1,571 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { browser, by, element, protractor, ElementFinder, ElementArrayFinder, $, $$ } from 'protractor';
import { BrowserVisibility } from '../utils/browser-visibility';
import { BrowserActions } from '../utils/browser-actions';
import { Logger } from '../utils/logger';
import { materialLocators } from './public-api';
const MAX_LOADING_TIME = 120000;
export class DataTableComponentPage {
rootElement: ElementFinder;
list: ElementArrayFinder;
contents: ElementArrayFinder;
tableBody: ElementFinder;
allColumns: ElementArrayFinder;
selectedRowNumber: ElementFinder;
allSelectedRows: ElementArrayFinder;
selectAll: ElementFinder;
selectAllChecked: ElementFinder;
emptyList: ElementFinder;
emptyListTitle: ElementFinder;
emptyListSubtitle: ElementFinder;
noContentContainer: ElementFinder;
mainMenuButton: ElementFinder;
rows = `adf-datatable div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row']`;
constructor(rootElement = $$('adf-datatable').first()) {
this.rootElement = rootElement;
this.list = this.rootElement.$$(`div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row']`);
this.contents = this.rootElement.$$('.adf-datatable-body span');
this.tableBody = this.rootElement.$$(`.adf-datatable-body`).first();
this.allColumns = this.rootElement.$$('div[data-automation-id*="auto_header_content_id"]');
this.mainMenuButton = this.rootElement.$('[data-automation-id="adf-datatable-main-menu-button"]');
this.selectedRowNumber = this.rootElement.$(`adf-datatable-row[class*='is-selected'] div[data-automation-id*='text_']`);
this.allSelectedRows = this.rootElement.$$(`adf-datatable-row[class*='is-selected']`);
this.selectAllChecked = this.rootElement.$(`div[class*='adf-datatable-header'] ${materialLocators.Checkbox.root}.mat-mdc-checkbox-checked`);
this.selectAll = this.rootElement.$(`div[class*='adf-datatable-header'] ${materialLocators.Checkbox.root}`);
this.emptyList = this.rootElement.$(`adf-empty-content`);
this.emptyListTitle = this.rootElement.$(`.adf-empty-content__title`);
this.emptyListSubtitle = this.rootElement.$(`.adf-empty-content__subtitle`);
this.noContentContainer = $(`div[class*='adf-no-content-container']`);
}
geCellElementDetail(detail: string): ElementArrayFinder {
return $$(`adf-datatable div[title="${detail}"] span`);
}
async checkAllRowsButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.selectAll);
}
async checkAllRows(): Promise<void> {
await BrowserActions.click(this.selectAll);
await BrowserVisibility.waitUntilElementIsVisible(this.selectAllChecked);
}
async uncheckAllRows(): Promise<void> {
await BrowserActions.click(this.selectAll);
await BrowserVisibility.waitUntilElementIsNotVisible(this.selectAllChecked);
}
async clickCheckbox(columnName: string, columnValue: string): Promise<void> {
const checkbox = this.getRowCheckbox(columnName, columnValue);
await BrowserActions.click(checkbox);
}
async checkRowIsNotChecked(columnName: string, columnValue: string): Promise<void> {
const rowSelector = this.getRowCheckboxChecked(columnName, columnValue);
await BrowserVisibility.waitUntilElementIsNotVisible(rowSelector);
}
async checkRowIsChecked(columnName: string, columnValue: string): Promise<void> {
const rowCheckbox = this.getRowCheckboxChecked(columnName, columnValue);
await BrowserVisibility.waitUntilElementIsVisible(rowCheckbox);
}
getRowCheckbox(columnName: string, columnValue: string): ElementFinder {
return this.getRow(columnName, columnValue).$(materialLocators.Checkbox.root);
}
getRowCheckboxChecked(columnName: string, columnValue: string): ElementFinder {
return this.getRow(columnName, columnValue).$('mat-checkbox.mat-mdc-checkbox-checked');
}
async checkNoRowIsSelected(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.selectedRowNumber);
}
async getNumberOfSelectedRows(): Promise<number> {
return this.allSelectedRows.count();
}
async selectRow(columnName: string, columnValue: string): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
const row = this.getRow(columnName, columnValue);
await BrowserActions.click(row);
}
async selectRowWithKeyboard(columnName: string, columnValue: string): Promise<void> {
await browser.actions().sendKeys(protractor.Key.COMMAND).perform();
await this.selectRow(columnName, columnValue);
await browser.actions().sendKeys(protractor.Key.NULL).perform();
}
async checkRowIsSelected(columnName: string, columnValue: string): Promise<void> {
const selectedRow = this.getCellElementByValue(columnName, columnValue).element(
by.xpath(`ancestor::adf-datatable-row[contains(@class, 'is-selected')]`)
);
await BrowserVisibility.waitUntilElementIsVisible(selectedRow);
}
async checkRowIsNotSelected(columnName: string, columnValue: string): Promise<void> {
const selectedRow = this.getCellElementByValue(columnName, columnValue).element(
by.xpath(`ancestor::adf-datatable-row[contains(@class, 'is-selected')]`)
);
await BrowserVisibility.waitUntilElementIsNotVisible(selectedRow);
}
async getColumnValueForRow(identifyingColumn: string, identifyingValue: string, columnName: string): Promise<string> {
const row = this.getRow(identifyingColumn, identifyingValue);
await BrowserVisibility.waitUntilElementIsVisible(row);
const rowColumn = row.$(`div[title="${columnName}"] span`);
return BrowserActions.getText(rowColumn);
}
/**
* Check the list is sorted.
*
* @param sortOrder 'ASC' if the list is await expected to be sorted ascending and 'DESC' for descending
* @param columnTitle titleColumn column
* @param listType 'string' for string typed lists and 'number' for number typed (int, float) lists
* @returns 'true' if the list is sorted as await expected and 'false' if it isn't
*/
async checkListIsSorted(sortOrder: string, columnTitle: string, listType: string = 'STRING'): Promise<any> {
const column = $$(`div.adf-datatable-cell[title='${columnTitle}'] span`);
await BrowserVisibility.waitUntilElementIsVisible(column.first());
const initialList: string[] = [];
const length = await column.count();
for (let i = 0; i < length; i++) {
const text: string = await BrowserActions.getText(column.get(i));
if (text.length !== 0) {
initialList.push(text.toLowerCase());
}
}
let sortedList = [...initialList];
if (listType.toLocaleLowerCase() === 'string') {
sortedList = sortedList.sort();
} else if (listType.toLocaleLowerCase() === 'number') {
sortedList = sortedList.sort((a, b) => parseInt(a, 10) - parseInt(b, 10));
} else if (listType.toLocaleLowerCase() === 'priority') {
sortedList = sortedList.sort(this.sortPriority);
}
if (['desc', 'descending'].includes(sortOrder.toLocaleLowerCase())) {
sortedList = sortedList.reverse();
}
return initialList.toString() === sortedList.toString();
}
sortPriority(a: string, b: string) {
if (a === b) {
return 0;
}
if (a.toLocaleLowerCase() === 'none') {
return -1;
}
if (a.toLocaleLowerCase() === 'low') {
if (b === 'none') {
return 1;
} else {
return -1;
}
}
if (a.toLocaleLowerCase() === 'normal') {
if (b.toLocaleLowerCase() === 'high') {
return -1;
} else {
return 1;
}
}
return 1;
}
async rightClickOnRow(columnName: string, columnValue: string): Promise<void> {
await this.rightClickOnItem(columnName, columnValue);
await BrowserVisibility.waitUntilElementIsVisible($('#adf-context-menu-content'));
}
async getTooltip(columnName: string, columnValue: string): Promise<string> {
return BrowserActions.getAttribute(this.getCellElementByValue(columnName, columnValue), 'title');
}
async rightClickOnItem(columnName: string, columnValue: string): Promise<void> {
const row = this.getRow(columnName, columnValue);
await BrowserActions.rightClick(row);
}
getFileHyperlink(filename: string): ElementFinder {
return element(by.cssContainingText('adf-name-column[class*="adf-datatable-link"] span', filename));
}
async numberOfRows(): Promise<number> {
try {
await this.waitForFirstRow();
return this.rootElement.$$(this.rows).count();
} catch (e) {
return 0;
}
}
async waitForFirstRow(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.$$(this.rows).first());
}
async getAllRowsColumnValues(column: string): Promise<string[]> {
let columnValues: string[] = [];
const columnLocator = $$(
`adf-datatable div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row'] div[title="${column}"] span`
);
await BrowserVisibility.waitUntilElementIsPresent(columnLocator.first(), 1000);
try {
await BrowserVisibility.waitUntilElementIsPresent(columnLocator.first(), 1000);
columnValues = await columnLocator.filter(async (el) => el.isPresent()).map(async (el) => el.getText());
} catch (error) {
Logger.log(error);
}
return columnValues;
}
async getRowsWithSameColumnValues(columnName: string, columnValue: string) {
const columnLocator = `div[title='${columnName}'] div[data-automation-id="text_${columnValue}"] span`;
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.$$(columnLocator).first());
return this.rootElement.$$(columnLocator).getText();
}
async doubleClickRow(columnName: string, columnValue: string): Promise<void> {
const row = this.getRow(columnName, columnValue);
await BrowserActions.click(row);
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
}
async waitForTableBody(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.tableBody);
}
// @deprecated Use Playwright API instead
async getFirstElementDetail(detail: string): Promise<string> {
const firstNode = $$(`adf-datatable div[title="${detail}"] span`).first();
return BrowserActions.getText(firstNode);
}
/**
* Sort the list by name column.
*
* @param sortOrder 'ASC' to sort the list ascendant and 'DESC' for descendant
* @param titleColumn column title
*/
async sortByColumn(sortOrder: string, titleColumn: string): Promise<void> {
const locator = $(`div[data-automation-id="auto_id_${titleColumn}"]`);
await BrowserVisibility.waitUntilElementIsVisible(locator);
const result = await BrowserActions.getAttribute(locator, 'class');
if (sortOrder.toLocaleLowerCase() === 'asc') {
if (!result.includes('sorted-asc')) {
if (result.includes('sorted-desc') || result.includes('sortable')) {
await BrowserActions.click(locator);
}
}
} else {
if (result.includes('sorted-asc')) {
await BrowserActions.click(locator);
} else if (result.includes('sortable')) {
await BrowserActions.click(locator);
await BrowserActions.click(locator);
}
}
}
async checkContentIsDisplayed(columnName: string, columnValue: string, retry = 0): Promise<void> {
Logger.log(`Wait content is displayed ${columnName} ${columnValue} retry: ${retry}`);
const row = this.getCellElementByValue(columnName, columnValue);
try {
await BrowserVisibility.waitUntilElementIsVisible(row);
} catch (error) {
if (retry < 3) {
retry++;
await this.checkContentIsDisplayed(columnName, columnValue, retry);
} else {
throw error;
}
}
}
async checkContentIsNotDisplayed(columnName: string, columnValue: string, retry = 0): Promise<void> {
Logger.log(`Wait content is displayed ${columnName} ${columnValue} retry: ${retry}`);
const row = this.getCellElementByValue(columnName, columnValue);
try {
await BrowserVisibility.waitUntilElementIsNotVisible(row);
} catch (error) {
if (retry < 3) {
retry++;
await this.checkContentIsNotDisplayed(columnName, columnValue, retry);
} else {
throw error;
}
}
}
getRow(columnName: string, columnValue: string): ElementFinder {
return this.rootElement
.all(
by.xpath(
`//div[starts-with(@title, '${columnName}')]//div[contains(@data-automation-id, '${columnValue}')]//ancestor::adf-datatable-row[contains(@class, 'adf-datatable-row')]`
)
)
.first();
}
// @deprecated use Playwright instead
getRowByIndex(index: number): ElementFinder {
return this.rootElement.element(
by.xpath(`//div[contains(@class,'adf-datatable-body')]//adf-datatable-row[contains(@class,'adf-datatable-row')][${index}]`)
);
}
async contentInPosition(position: number): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.contents.first());
return BrowserActions.getText(this.contents.get(position - 1));
}
getCellElementByValue(columnName: string, columnValue: string, columnPrefix = 'text_'): ElementFinder {
return this.rootElement.$$(`div[title="${columnName}"] div[data-automation-id="${columnPrefix}${columnValue}"] span`).first();
}
async tableIsLoaded(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement);
}
async waitTillContentLoaded(): Promise<void> {
if (await this.isSpinnerPresent()) {
Logger.log('wait datatable loading spinner disappear');
await BrowserVisibility.waitUntilElementIsNotVisible(
this.rootElement.element(by.tagName(materialLocators.Progress.spinner.root)),
MAX_LOADING_TIME
);
if (await this.isEmpty()) {
Logger.log('empty page');
} else {
await this.waitFirstElementPresent();
}
} else if (await this.isEmpty()) {
Logger.log('empty page');
} else {
try {
Logger.log('wait datatable loading spinner is present');
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.element(by.tagName(materialLocators.Progress.spinner.root)), 2000);
await BrowserVisibility.waitUntilElementIsNotVisible(
this.rootElement.element(by.tagName(materialLocators.Progress.spinner.root)),
MAX_LOADING_TIME
);
} catch (error) {
Logger.error('Loading spinner is not present');
}
if (await this.isEmpty()) {
Logger.log('empty page');
} else {
await this.waitFirstElementPresent();
}
}
}
async waitTillContentLoadedInfinitePagination(): Promise<void> {
await browser.sleep(500);
if (await this.isInfiniteSpinnerPresent()) {
Logger.log('wait datatable loading spinner disappear');
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.tagName(materialLocators.Progress.bar.root)));
if (await this.isEmpty()) {
Logger.log('empty page');
} else {
await this.waitFirstElementPresent();
}
} else {
try {
Logger.log('wait datatable loading spinner is present');
await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName(materialLocators.Progress.bar.root)));
} catch (error) {
Logger.error('Infinite pagination spinner is not present');
}
if (await this.isEmpty()) {
Logger.log('empty page');
} else {
await this.waitFirstElementPresent();
}
}
}
// @deprecated use Playwright instead
async isColumnDisplayed(columnTitle: string): Promise<boolean> {
const isColumnDisplayed = (await this.allColumns).some(async (column) => {
const columnText = await column.getText();
return columnText === columnTitle;
});
return isColumnDisplayed;
}
// @deprecated use Playwright instead
async getNumberOfColumns(): Promise<number> {
return this.allColumns.count();
}
async getNumberOfRows(): Promise<number> {
return this.list.count();
}
getCellByRowNumberAndColumnName(rowNumber: number, columnName: string): ElementFinder {
return this.list.get(rowNumber).$$(`div[title="${columnName}"] span`).first();
}
getCellByRowContentAndColumn(rowColumn: string, rowContent: string, columnName: string): ElementFinder {
return this.getRow(rowColumn, rowContent).$(`div[title='${columnName}']`);
}
async selectRowByContent(content: string): Promise<void> {
const row = this.getCellByContent(content);
await BrowserActions.click(row);
}
async checkRowByContentIsSelected(folderName: string): Promise<void> {
const selectedRow = this.getCellByContent(folderName).element(by.xpath(`ancestor::adf-datatable-row[contains(@class, 'is-selected')]`));
await BrowserVisibility.waitUntilElementIsVisible(selectedRow);
}
async checkRowByContentIsNotSelected(folderName: string): Promise<void> {
const selectedRow = this.getCellByContent(folderName).element(by.xpath(`ancestor::adf-datatable-row[contains(@class, 'is-selected')]`));
await BrowserVisibility.waitUntilElementIsNotVisible(selectedRow);
}
getCellByContent(content: string): ElementFinder {
return this.rootElement
.all(by.cssContainingText(`adf-datatable-row[class*='adf-datatable-row'] div[class*='adf-datatable-cell']`, content))
.first();
}
async checkCellByHighlightContent(content: string): Promise<void> {
const cell = this.rootElement.element(
by.cssContainingText(
`adf-datatable-row[class*='adf-datatable-row'] div[class*='adf-name-location-cell-name'] span.adf-highlight`,
content
)
);
await BrowserVisibility.waitUntilElementIsVisible(cell);
}
async clickRowByContent(name: string): Promise<void> {
const resultElement = this.rootElement.$$(`div[data-automation-id='${name}']`).first();
await BrowserActions.click(resultElement);
}
async clickRowByContentCheckbox(name: string): Promise<void> {
const resultElement = this.rootElement
.$$(`div[data-automation-id='${name}']`)
.first()
.element(by.xpath(`ancestor::adf-datatable-row/label/${materialLocators.Checkbox.root}`));
browser.actions().mouseMove(resultElement);
await BrowserActions.click(resultElement);
}
async checkRowContentIsDisplayed(content: string): Promise<void> {
const resultElement = this.rootElement.$$(`div[data-automation-id='${content}']`).first();
await BrowserVisibility.waitUntilElementIsVisible(resultElement);
}
async checkRowContentIsNotDisplayed(content: string): Promise<void> {
const resultElement = this.rootElement.$$(`div[data-automation-id='${content}']`).first();
await BrowserVisibility.waitUntilElementIsNotVisible(resultElement);
}
async checkRowContentIsDisabled(content: string): Promise<void> {
const resultElement = this.rootElement.$$(`div[data-automation-id='${content}'] div.adf-cell-value img[aria-label='Disabled']`).first();
await BrowserVisibility.waitUntilElementIsVisible(resultElement);
}
async doubleClickRowByContent(name: string): Promise<void> {
const resultElement = this.rootElement.$$(`div[data-automation-id='${name}']`).first();
await BrowserActions.click(resultElement);
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
}
async isEmpty(): Promise<boolean> {
await browser.sleep(500);
let isDisplayed;
try {
isDisplayed = await this.emptyList.isDisplayed();
} catch (error) {
isDisplayed = false;
}
Logger.log(`empty page isDisplayed ${isDisplayed}`);
return isDisplayed;
}
private async isSpinnerPresent(): Promise<boolean> {
let isSpinnerPresent;
try {
isSpinnerPresent = await this.rootElement.element(by.tagName(materialLocators.Progress.spinner.root)).isDisplayed();
} catch (error) {
isSpinnerPresent = false;
}
return isSpinnerPresent;
}
private async isInfiniteSpinnerPresent(): Promise<boolean> {
let isSpinnerPresent;
try {
isSpinnerPresent = await this.rootElement.element(by.tagName(materialLocators.Progress.bar.root)).isDisplayed();
} catch (error) {
isSpinnerPresent = false;
}
return isSpinnerPresent;
}
private async waitFirstElementPresent(): Promise<void> {
try {
Logger.log('wait first element is present');
await BrowserVisibility.waitUntilElementIsVisible(this.contents.first());
} catch (error) {
Logger.log('Possible empty page');
}
}
}

View File

@ -1,34 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export abstract class Column {
columnName: string;
columnType: string;
constructor(columnName: string, columnType: string ) {
this.columnName = columnName;
this.columnType = columnType;
}
createLocator(columnValue: string): string {
return `//div[@data-automation-id="${this.columnType}_${columnValue}"]`;
}
getColumnName(): string {
return this.columnName;
}
}

View File

@ -1,59 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { by } from 'protractor';
import { TestElement } from '../../test-element';
export class DataTableColumnSelector {
columnsSelectorComponent = TestElement.byCss('[data-automation-id="adf-columns-selector"]');
closeButton = TestElement.byCss('[data-automation-id="adf-columns-selector-close-button"]');
searchInput = TestElement.byCss('[data-automation-id="adf-columns-selector-search-input"]');
applyButton = TestElement.byCss('[data-automation-id="adf-columns-selector-apply-button"]');
columnsListContainer = TestElement.byCss('.adf-columns-selector-list-container');
allColumnsSelectors = this.columnsListContainer.elementFinder.all(
by.css('.adf-columns-selector-column-checkbox')
);
async getAllColumnSelectors(): Promise<{ name: string; isSelected: boolean }[]> {
const columnCheckboxes = this.allColumnsSelectors.map<[string, boolean]>(column => {
const checkBoxElement = column.element(by.tagName('input'));
return Promise.all([
column.getText(),
checkBoxElement.isSelected()
]);
});
const checkboxesValues = await columnCheckboxes;
return checkboxesValues.map(([name, isSelected]) => ({
name,
isSelected
}));
}
async selectColumn(columnName: string): Promise<void> {
const columnSelector = this.allColumnsSelectors.filter(
async column => {
const columnText = await column.getText();
return columnText === columnName;
}
).first();
return columnSelector.click();
}
}

View File

@ -1,43 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { Column } from './column';
import { TextColumn } from './text-column';
import { DateColumn } from './date-column';
import { DataTableItem } from './data-table-item';
import { ElementFinder } from 'protractor';
export class DataTableBuilder {
createDataTable(columns: Column[], rootElement?: ElementFinder): DataTableItem {
const datatable: DataTableItem = new DataTableItem(rootElement);
for (const column of columns) {
switch (column.columnType) {
case 'date': {
datatable.addItem(new DateColumn(column.columnName));
break;
}
case 'custom': {
datatable.addItem(column);
break;
}
default: datatable.addItem(new TextColumn(column.columnName));
}
}
return datatable;
}
}

View File

@ -1,95 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { Column } from './column';
import { by, element, ElementFinder, protractor, browser, $$ } from 'protractor';
import { BrowserActions } from '../../utils/browser-actions';
import { BrowserVisibility } from '../../utils/browser-visibility';
export class DataTableItem {
columns = new Array<Column>();
rootElement: ElementFinder;
rows = `div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row']`;
constructor(rootElement = $$('adf-datatable').first()) {
this.rootElement = rootElement;
}
addItem(column: Column): void {
this.columns.push(column);
}
async getColumn(columnName: string): Promise<Column> {
return this.columns.find(
(column) => column.getColumnName() === columnName
);
}
async getRow(columnName: string, columnValue: string): Promise<ElementFinder> {
const column = await this.getColumn(columnName);
const locator = `//div[@title="${column.columnName}"]` + column.createLocator(columnValue) + `//ancestor::adf-datatable-row[contains(@class, 'adf-datatable-row')]`;
return this.rootElement.element(by.xpath(locator));
}
async selectRow(columnName: string, columnValue: string): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
const row = await this.getRow(columnName, columnValue);
await BrowserActions.click(row);
}
async rightClickOnRow(columnName: string, columnValue: string): Promise<void> {
const row = await this.getRow(columnName, columnValue);
await browser.actions().mouseMove(row).perform();
await browser.actions().click(row, protractor.Button.RIGHT).perform();
}
async waitForFirstRow(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.$$(this.rows).first());
}
async clickAndEnterOnRow(columnName: string, columnValue: string): Promise<void> {
const row = await this.getRow(columnName, columnValue);
await BrowserActions.click(row);
await this.checkRowIsSelected(columnName, columnValue);
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
}
async getColumnValueForRow(identifyingColumnName: string, identifyingColumnValue: string, columnName: string): Promise<string> {
const row = await this.getRow(identifyingColumnName, identifyingColumnValue);
await BrowserVisibility.waitUntilElementIsVisible(row);
const rowColumn = row.$(`div[title="${columnName}"] span`);
return BrowserActions.getText(rowColumn);
}
async checkRowIsSelected(columnName: string, columnValue: string): Promise<void> {
const column = await this.getColumn(columnName);
const locator = `//div[@title="${column.columnName}"]` + column.createLocator(columnValue) + `//ancestor::adf-datatable-row[contains(@class, 'is-selected')]`;
await BrowserVisibility.waitUntilElementIsVisible(element(by.xpath(locator)));
}
async checkRowIsNotSelected(columnName: string, columnValue: string): Promise<void> {
const column = await this.getColumn(columnName);
const locator = `//div[@title="${column.columnName}"]` + column.createLocator(columnValue) + `//ancestor::adf-datatable-row[contains(@class, 'is-selected')]`;
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.xpath(locator)));
}
async selectRowWithKeyboard(columnName: string, columnValue: string): Promise<void> {
await browser.actions().sendKeys(protractor.Key.COMMAND).perform();
await this.selectRow(columnName, columnValue);
await browser.actions().sendKeys(protractor.Key.NULL).perform();
}
}

View File

@ -1,27 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { Column } from './column';
export class DateColumn extends Column {
columnType: string;
columnName: string;
constructor(columnName: string) {
super(columnName, 'date');
}
}

View File

@ -1,21 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export * from './data-table-builder';
export * from './column';
export * from './data-table-item';
export * from './columns-selector';

View File

@ -1,27 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { Column } from './column';
export class TextColumn extends Column {
columnType: string;
columnName: string;
constructor(columnName: string) {
super(columnName, 'text');
}
}

View File

@ -1,248 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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, Locator, by, element, ElementFinder, $, $$ } from 'protractor';
import { BrowserVisibility, BrowserActions } from '../../utils/public-api';
import { DropdownPage } from '../material/dropdown.page';
import { materialLocators } from '../public-api';
export class FormFields {
selectFormDropdown = new DropdownPage($$(`.adf-attach-form ${materialLocators.Select.arrow.class}`).first());
formContent = $('adf-form-renderer');
refreshButton = $(`div[class*="form-reload-button"] ${materialLocators.Icon.root}`);
saveButton = element(by.cssContainingText(`${materialLocators.Card.actions}[class*="adf-for"] span`, 'SAVE'));
valueLocator: Locator = by.css('input');
labelLocator: Locator = by.css('label');
noFormMessage = $('.adf-empty-content__title');
noFormMessageStandaloneTask = $('adf-task-standalone #adf-no-form-message');
noFormTemplate = $('adf-empty-content');
completedTaskNoFormMessage = $('div[id*="completed-form-message"] p');
completedStandaloneTaskNoFormMessage = $('adf-task-standalone #adf-completed-form-message');
attachFormButton = $('#adf-attach-form-attach-button');
completeButton = $('#adf-form-complete');
completeNoFormButton = $('#adf-no-form-complete-button');
cancelButton = $('#adf-no-form-cancel-button');
errorMessage: Locator = by.css('.adf-error-container .adf-error-text');
getWidget = (fieldId: string): ElementFinder => $(`div[id='field-${fieldId}-container']`);
async setFieldValue(field: string, value: string): Promise<void> {
const fieldElement = $(`#${field}`);
await BrowserActions.clearSendKeys(fieldElement, value);
}
async checkFieldValue(field: string, value: string): Promise<void> {
const fieldElement = $(`#${field}`);
await BrowserVisibility.waitUntilElementHasValue(fieldElement, value);
}
async checkWidgetIsVisible(fieldId: string): Promise<void> {
const fieldElement = $$(`div[id='field-${fieldId}-container']`).first();
await BrowserVisibility.waitUntilElementIsVisible(fieldElement);
}
async checkWidgetsAreVisible(fieldsId: string[]): Promise<void> {
for (const fieldId of fieldsId) {
await this.checkWidgetIsVisible(fieldId);
}
}
async checkWidgetIsClickable(fieldId: string): Promise<void> {
const fieldElement = $$(`div[id='field-${fieldId}-container']`).first();
await BrowserVisibility.waitUntilElementIsClickable(fieldElement);
}
async checkWidgetIsHidden(fieldId: string): Promise<void> {
const hiddenElement = $(`div[id='field-${fieldId}-container']`);
await BrowserVisibility.waitUntilElementIsNotVisible(hiddenElement, 6000);
}
async getFieldValue(fieldId: string, valueLocatorParam?: any): Promise<string> {
const valueWidget = await (await this.getWidget(fieldId)).element(valueLocatorParam || this.valueLocator);
await BrowserVisibility.waitUntilElementIsVisible(valueWidget);
return BrowserActions.getInputValue(valueWidget);
}
async getFieldLabel(fieldId: string, labelLocatorParam?: any) {
const label = await (await this.getWidget(fieldId)).all(labelLocatorParam || this.labelLocator).first();
return BrowserActions.getText(label);
}
async getFieldErrorMessage(fieldId: string): Promise<string> {
const error = await this.getWidget(fieldId).element(this.errorMessage);
return BrowserActions.getText(error);
}
async getFieldText(fieldId: string, labelLocatorParam?: any) {
const label = await (await this.getWidget(fieldId)).element(labelLocatorParam || this.labelLocator);
return BrowserActions.getText(label);
}
async getFieldPlaceHolder(fieldId: string, locator = 'input'): Promise<string> {
const placeHolderLocator = $(`${locator}#${fieldId}`);
await BrowserVisibility.waitUntilElementIsVisible(placeHolderLocator);
return BrowserActions.getAttribute(placeHolderLocator, 'placeholder');
}
async refreshForm(): Promise<void> {
await BrowserActions.click(this.refreshButton);
await browser.sleep(500);
}
async saveForm(): Promise<void> {
await BrowserActions.click(this.saveButton);
}
async isNoFormTemplateDisplayed(): Promise<boolean> {
try {
await BrowserVisibility.waitUntilElementIsVisible(
this.noFormTemplate
);
return true;
} catch (error) {
return false;
}
}
async noFormIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.formContent);
}
async checkFormIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.formContent);
}
async getNoFormMessage(): Promise<string> {
return BrowserActions.getText(this.noFormMessage);
}
async getNoFormMessageStandaloneTask(): Promise<string> {
return BrowserActions.getText(this.noFormMessageStandaloneTask);
}
async getCompletedTaskNoFormMessage(): Promise<string> {
return BrowserActions.getText(this.completedTaskNoFormMessage);
}
async getCompletedStandaloneTaskNoFormMessage(): Promise<string> {
return BrowserActions.getText(this.completedStandaloneTaskNoFormMessage);
}
async isStandaloneTaskNoFormMessageDisplayed(): Promise<boolean> {
try {
await BrowserVisibility.waitUntilElementIsVisible(this.noFormMessageStandaloneTask);
return true;
} catch (error) {
return false;
}
}
async isAttachFormButtonDisplayed(): Promise<boolean> {
try {
await BrowserVisibility.waitUntilElementIsVisible(this.attachFormButton);
return true;
} catch (error) {
return false;
}
}
async clickOnAttachFormButton(): Promise<void> {
await BrowserActions.click(this.attachFormButton);
}
async selectForm(formName: string): Promise<void> {
await this.selectFormDropdown.selectDropdownOption(formName);
}
async selectFormFromDropDown(formName: string): Promise<void> {
const formNameElement = element(by.cssContainingText('span', formName));
await BrowserActions.click(formNameElement);
}
async checkWidgetIsReadOnlyMode(fieldId: string): Promise<ElementFinder> {
const widget = $(`adf-form-field #field-${fieldId}-container .adf-readonly`);
await BrowserVisibility.waitUntilElementIsVisible(widget);
return widget;
}
async isFormFieldEnabled(formFieldId: string): Promise<boolean> {
return $(`#${formFieldId}`).isEnabled();
}
async completeForm(): Promise<void> {
await BrowserActions.click(this.completeButton);
}
async completeNoFormTask(): Promise<void> {
await BrowserActions.click(this.completeNoFormButton);
}
async clickCancelButton(): Promise<void> {
await BrowserActions.click(this.cancelButton);
}
async setValueInInputById(fieldId: string, value: string): Promise<void> {
const input = $(`#${fieldId}`);
await BrowserActions.clearSendKeys(input, value);
}
async isCompleteButtonDisplayed(): Promise<boolean> {
try {
await BrowserVisibility.waitUntilElementIsVisible(this.completeButton);
return true;
} catch (error) {
return false;
}
}
async isCompleteNoFormButtonDisplayed(): Promise<boolean> {
try {
await BrowserVisibility.waitUntilElementIsVisible(this.completeNoFormButton);
return true;
} catch (error) {
return false;
}
}
async isSaveFormButtonEnabled(): Promise<boolean> {
return this.saveButton.isEnabled();
}
async isCompleteFormButtonEnabled(): Promise<boolean> {
return this.completeButton.isEnabled();
}
async isCompleteNoFormButtonEnabled(): Promise<boolean> {
return this.completeNoFormButton.isEnabled();
}
async isCancelButtonDisplayed(): Promise<boolean> {
try {
await BrowserVisibility.waitUntilElementIsVisible(this.cancelButton);
return true;
} catch (error) {
return false;
}
}
async isCancelButtonEnabled(): Promise<boolean> {
return this.cancelButton.isEnabled();
}
}

View File

@ -1,80 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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, $ } from 'protractor';
import { BrowserVisibility } from '../../utils/browser-visibility';
import { BrowserActions } from '../../utils/public-api';
import { materialLocators } from '../public-api';
export class FormPage {
errorLog = $('div[class*="console"]');
saveButton = element(by.cssContainingText(`${materialLocators.Card.actions}[class*="adf-for"] span`, 'SAVE'));
async checkErrorMessageForWidgetIsDisplayed(errorMessage: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText('.adf-error-text', errorMessage)));
}
async checkErrorMessageForWidgetIsNotDisplayed(errorMessage: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.cssContainingText('.adf-error-text', errorMessage)));
}
async checkErrorLogMessage(errorMessage: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.errorLog);
await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText('div[class*="console"] p', errorMessage)));
}
async checkErrorMessageIsNotDisplayed(errorMessage: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.errorLog);
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.cssContainingText('div[class*="console"] p', errorMessage)));
}
async saveForm() {
await BrowserActions.click(this.saveButton);
}
async isSaveButtonDisabled(): Promise<boolean> {
const saveButtonDisabled = $('#adf-form-save[disabled]');
try {
await saveButtonDisabled.isDisplayed();
return true;
} catch {
return false;
}
}
async isValidationIconBlue(): Promise<boolean> {
const validationIcon = $('#adf-valid-form-icon');
try {
await validationIcon.isDisplayed();
return true;
} catch {
return false;
}
}
async isValidationIconRed(): Promise<boolean> {
const validationIcon = $('#adf-invalid-form-icon');
try {
await validationIcon.isDisplayed();
return true;
} catch {
return false;
}
}
}

View File

@ -1,22 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export * from './widgets/public-api';
export * from './form-fields';
export * from './form.page';
export * from './start-form.page';

View File

@ -1,22 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { TestElement } from '../../test-element';
export class StartFormPage {
startProcessForm = TestElement.byCss('.adf-start-form-container');
}

View File

@ -1,64 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { $$, $ } from 'protractor';
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
import { FormFields } from '../form-fields';
export class AmountWidgetPage {
currency = '.adf-amount-widget__prefix-spacing';
formFields: FormFields = new FormFields();
async getAmountFieldLabel(fieldId: string): Promise<string> {
const label = $$(`adf-form-field div[id="field-${fieldId}-container"] label`).first();
return BrowserActions.getText(label);
}
async getAmountFieldCurrency(fieldId: string): Promise<string> {
const widget = await this.formFields.getWidget(fieldId);
return BrowserActions.getText(widget.$(this.currency));
}
async setFieldValue(fieldId: string, value: any): Promise<void> {
await this.formFields.setValueInInputById(fieldId, value);
}
async removeFromAmountWidget(fieldId: string) {
const amountWidgetInput = $(`#${fieldId}`);
await BrowserActions.clearWithBackSpace(amountWidgetInput);
}
async clearFieldValue(fieldId: string): Promise<void> {
const numberField = $(`#${fieldId}`);
await BrowserVisibility.waitUntilElementIsVisible(numberField);
await numberField.clear();
}
async checkWidgetIsVisible(fieldId: string): Promise<void> {
await this.formFields.checkWidgetIsVisible(fieldId);
}
async getErrorMessage(fieldId: string): Promise<string> {
const errorMessage = $(`adf-form-field div[id="field-${fieldId}-container"] .adf-error-text`);
return BrowserActions.getText(errorMessage);
}
async getPlaceholder(fieldId: string): Promise<string> {
return this.formFields.getFieldPlaceHolder(fieldId);
}
}

View File

@ -1,169 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
import { by, browser, $ } from 'protractor';
import { TestElement } from '../../../test-element';
import { materialLocators } from '../../public-api';
export class AttachFileWidgetPage {
formFields = new FormFields();
alfrescoTypeUploadLocator = 'button[id="attachfile"]';
localStorageButton = $('input[id="attachfile"]');
filesListLocator = 'div[data-automation-id="adf-attach-widget-readonly-list"]';
attachFileWidget = $('#attachfile');
attachedFileMenu = $(`${materialLocators.List.item.root} button`);
attachedFileOptions = $(`${materialLocators.Menu.panel} ${materialLocators.Menu.content.class}`);
viewFileOptionButton = $(`${materialLocators.Menu.panel} ${materialLocators.Menu.content.class} button[id$="show-file"]`);
downloadFileOptionButton = $(`${materialLocators.Menu.panel} ${materialLocators.Menu.content.class} button[id$="download-file"]`);
removeFileOptionButton = TestElement.byCss(`${materialLocators.Menu.panel} ${materialLocators.Menu.content.class} button[id$="remove"]`);
async attachFile(fieldId: string, fileLocation: string): Promise<void> {
const widget = await this.formFields.getWidget(fieldId);
const uploadButton = await widget.$(this.alfrescoTypeUploadLocator);
await BrowserActions.click(uploadButton);
await BrowserVisibility.waitUntilElementIsPresent(this.localStorageButton);
await this.localStorageButton.sendKeys(fileLocation);
}
async checkNoFileIsAttached(fieldId: string): Promise<void> {
const widget = await this.formFields.getWidget(fieldId);
const fileItem = widget.$(this.filesListLocator).$(materialLocators.List.item.root);
await BrowserVisibility.waitUntilElementIsNotVisible(fileItem);
}
async checkNoFileIsAttachedToWidgets(fieldIds: string[]): Promise<void> {
for (const fieldId of fieldIds) {
await this.checkNoFileIsAttached(fieldId);
}
}
async checkFileIsAttached(fieldId: string, name: string): Promise<void> {
const fileAttached = await this.getFileAttachedNotAttachedLocator(fieldId, name);
await BrowserVisibility.waitUntilElementIsVisible(fileAttached);
}
async checkFilesAreAttachedToWidget(fieldId: string, names: string[]): Promise<void> {
for (const fileName of names) {
await this.checkFileIsAttached(fieldId, fileName);
}
}
async checkFileIsNotAttached(fieldId: string, name: string): Promise<void> {
const fileNotAttached = await this.getFileAttachedNotAttachedLocator(fieldId, name);
await BrowserVisibility.waitUntilElementIsNotVisible(fileNotAttached);
}
async viewFile(name: string): Promise<void> {
const fileView = $(this.filesListLocator).element(by.cssContainingText(`${materialLocators.List.item.root} span `, name));
await BrowserActions.click(fileView);
await browser.actions().doubleClick(fileView).perform();
}
async attachFileWidgetDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.attachFileWidget);
}
async toggleAttachedFileMenu(fieldId: string, fileName: string): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
const widget = await this.formFields.getWidget(fieldId);
const fileAttached = await this.getFileAttachedNotAttachedLocator(fieldId, fileName);
const id = await BrowserActions.getAttribute(fileAttached, 'id');
const optionMenu = widget.$(`button[id='${id}-option-menu']`);
await BrowserActions.click(optionMenu);
}
async checkAttachFileOptionsActiveForm(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.attachedFileOptions);
await BrowserVisibility.waitUntilElementIsVisible(this.viewFileOptionButton);
await BrowserVisibility.waitUntilElementIsVisible(this.downloadFileOptionButton);
await this.removeFileOptionButton.waitVisible();
}
async checkAttachFileOptionsCompletedForm(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.attachedFileOptions);
await BrowserVisibility.waitUntilElementIsVisible(this.viewFileOptionButton);
await BrowserVisibility.waitUntilElementIsVisible(this.downloadFileOptionButton);
await this.removeFileOptionButton.waitNotVisible();
}
async viewAttachedFile(): Promise<void> {
await BrowserActions.click(this.viewFileOptionButton);
}
async downloadFile(): Promise<void> {
await BrowserActions.click(this.downloadFileOptionButton);
}
async removeAttachedFile(): Promise<void> {
await this.removeFileOptionButton.click();
}
async viewFileEnabled(): Promise<boolean> {
return this.viewFileOptionButton.isEnabled();
}
async downloadFileEnabled(): Promise<boolean> {
return this.downloadFileOptionButton.isEnabled();
}
async removeFileEnabled(): Promise<boolean> {
return this.removeFileOptionButton.isEnabled();
}
async checkUploadIsNotVisible(fieldId: string): Promise<void> {
const alfrescoTypeUploadLocator = `button[id="${fieldId}"]`;
const widget = await this.formFields.getWidget(fieldId);
const uploadButton = await widget.$(alfrescoTypeUploadLocator);
await BrowserVisibility.waitUntilElementIsNotPresent(uploadButton);
}
async checkUploadIsVisible(fieldId: string): Promise<void> {
const alfrescoTypeUploadLocator = `button[id="${fieldId}"]`;
const widget = await this.formFields.getWidget(fieldId);
const uploadButton = await widget.$(alfrescoTypeUploadLocator);
await BrowserVisibility.waitUntilElementIsPresent(uploadButton);
}
async checkLocalTypeUploadIsPresent(fieldId: string): Promise<void> {
const localTypeUpload = $(`input[id="${fieldId}"]`);
await BrowserVisibility.waitUntilElementIsPresent(localTypeUpload);
}
async checkLocalTypeUploadIsNotPresent(fieldId: string): Promise<void> {
const localTypeUpload = $(`input[id="${fieldId}"]`);
await BrowserVisibility.waitUntilElementIsNotPresent(localTypeUpload);
}
async selectUploadSource(name: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.attachedFileOptions);
await BrowserActions.click($(`button[id="attach-${name}"]`));
}
async clickUploadButton(fieldId: string): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
const widget = await this.formFields.getWidget(fieldId);
const uploadButton = await widget.$(this.alfrescoTypeUploadLocator);
await BrowserActions.click(uploadButton);
}
private async getFileAttachedNotAttachedLocator(fieldId: string, name: string) {
const widget = await this.formFields.getWidget(fieldId);
return widget.$(this.filesListLocator).element(by.cssContainingText(`.adf-attach-widget__label span`, name));
}
}

View File

@ -1,59 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { by, $ } from 'protractor';
import { FormFields } from '../form-fields';
import { BrowserActions, BrowserVisibility } from '../../../utils/public-api';
export class AttachFolderWidgetPage {
formFields: FormFields = new FormFields();
foldersListLocator = '.adf-attach-folder-result';
async clickWidget(fieldId: string): Promise<void> {
const widget = await this.formFields.getWidget(fieldId).$(`button[id="folder-${fieldId}-button"]`);
await BrowserActions.click(widget);
}
async checkFolderIsAttached(fieldId: string, name: string): Promise<void> {
const folderAttached = await this.getFolderAttachedLocator(fieldId, name);
await BrowserVisibility.waitUntilElementIsVisible(folderAttached);
}
async checkFolderIsNotAttached(fieldId: string, name: string): Promise<void> {
const folderAttached = await this.getFolderAttachedLocator(fieldId, name);
await BrowserVisibility.waitUntilElementIsNotPresent(folderAttached);
}
async attachFileWidgetDisplayed(id: string): Promise<void> {
const locator = $(id ? id : '#attachfolder');
await BrowserVisibility.waitUntilElementIsVisible(locator);
}
async removeFolder(fieldId: string, name: string): Promise<void> {
await this.checkFolderIsAttached(fieldId, name);
const widget = await this.formFields.getWidget(fieldId);
const folderToBeRemoved = widget.$(this.foldersListLocator).$(`[id="folder-${fieldId}-remove"]`);
await BrowserActions.click(folderToBeRemoved);
}
private async getFolderAttachedLocator(fieldId: string, name: string) {
const widget = await this.formFields.getWidget(fieldId);
return widget.$(this.foldersListLocator).element(by.cssContainingText('span', name));
}
}

View File

@ -1,51 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { BrowserActions } from '../../../utils/public-api';
import { $ } from 'protractor';
import { materialLocators } from '../../public-api';
export class CheckboxWidgetPage {
formFields = new FormFields();
checkboxLabel = $(`${materialLocators.Checkbox.root} label`);
checkboxLocator = materialLocators.Checkbox.root;
getCheckboxLabel(): Promise<string> {
return BrowserActions.getText(this.checkboxLabel);
}
async clickCheckboxInput(fieldId: string): Promise<void> {
const checkboxInput = $(`${this.checkboxLocator}[id="${fieldId}"] input`);
await BrowserActions.click(checkboxInput);
}
async isCheckboxDisplayed(fieldId: string): Promise<void> {
await this.formFields.checkWidgetIsVisible(fieldId);
}
async isCheckboxHidden(fieldId: string): Promise<void> {
await this.formFields.checkWidgetIsHidden(fieldId);
}
async isCheckboxChecked(fieldId: string): Promise<boolean> {
const checkboxWidget = await (await this.formFields.getWidget(fieldId)).$(this.checkboxLocator);
const attributeValue = await BrowserActions.getAttribute(checkboxWidget, 'class');
return attributeValue.includes(materialLocators.Checkbox.checked.root);
}
}

View File

@ -1,30 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { by, Locator } from 'protractor';
export class ContainerWidgetPage {
formFields = new FormFields();
fileLocator: Locator = by.css(`div [class*='upload-widget__content-text']`);
getFieldText(fieldId: string): Promise<string> {
return this.formFields.getFieldText(fieldId, this.fileLocator);
}
}

View File

@ -1,93 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { element, by, $ } from 'protractor';
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
import { materialLocators } from '../../public-api';
export class DateTimeWidgetPage {
formFields = new FormFields();
outsideLayer = $('div[class*="cdk-overlay-container"]');
async checkWidgetIsVisible(fieldId: string): Promise<void> {
await this.formFields.checkWidgetIsVisible(fieldId);
}
async getDateTimeLabel(fieldId: string): Promise<string> {
const label = $(`adf-form-field div[id="field-${fieldId}-container"] label`);
return BrowserActions.getText(label);
}
async setDateTimeInput(fieldId: string, value: string): Promise<void> {
await this.formFields.setValueInInputById(fieldId, value);
}
async clickOutsideWidget(fieldId: string): Promise<void> {
const form = await this.formFields.getWidget(fieldId);
await BrowserActions.click(form);
}
async closeDataTimeWidget(): Promise<void> {
await BrowserActions.click(this.outsideLayer);
}
async getErrorMessage(fieldId: string): Promise<string> {
const errorMessage = $(`adf-form-field div[id="field-${fieldId}-container"] .adf-error-text`);
return BrowserActions.getText(errorMessage);
}
async selectDay(day: string): Promise<void> {
const selectedDay = element(by.cssContainingText(`div[class*="${materialLocators.DatetimePicker.calendar.body.cell.root}"]`, day));
await BrowserActions.click(selectedDay);
}
async openDatepicker(fieldId: string): Promise<void> {
await BrowserActions.click($(`#${fieldId}`));
}
async selectTime(time: string): Promise<void> {
const selectedTime = element.all(by.cssContainingText(`div[class*="${materialLocators.DatetimePicker.clock.cell()}"]`, time)).first();
await BrowserActions.click(selectedTime);
}
async selectHour(hour: string): Promise<void> {
return this.selectTime(hour);
}
async selectMinute(minute: string): Promise<void> {
return this.selectTime(minute);
}
async getPlaceholder(fieldId: string): Promise<string> {
return this.formFields.getFieldPlaceHolder(fieldId);
}
async removeFromDatetimeWidget(fieldId: string): Promise<void> {
const amountWidgetInput = $(`#${fieldId}`);
await BrowserVisibility.waitUntilElementIsVisible(await this.formFields.getWidget(fieldId));
await BrowserActions.clearWithBackSpace(amountWidgetInput);
}
async clearDateTimeInput(fieldId: string): Promise<void> {
const dateInput = $(`#${fieldId}`);
await BrowserVisibility.waitUntilElementIsVisible(dateInput);
await dateInput.clear();
}
}

View File

@ -1,73 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { $$, $ } from 'protractor';
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
export class DateWidgetPage {
formFields = new FormFields();
async checkWidgetIsVisible(fieldId: string): Promise<void> {
await this.formFields.checkWidgetIsVisible(fieldId);
}
async checkLabelIsVisible(fieldId: string): Promise<void> {
await this.formFields.checkWidgetIsVisible(fieldId);
}
async getDateLabel(fieldId: string): Promise<string> {
const label = $$(`adf-form-field div[id="field-${fieldId}-container"] label`).first();
return BrowserActions.getText(label);
}
async setDateInput(fieldId: string, value: string): Promise<void> {
await this.removeFromDatetimeWidget(fieldId);
await this.formFields.setValueInInputById(fieldId, value);
}
async getDateInput(fieldId: string): Promise<string> {
return this.formFields.getFieldValue(fieldId);
}
async clearDateInput(fieldId: string): Promise<void> {
const dateInput = $(`#${fieldId}`);
await BrowserActions.clearWithBackSpace(dateInput);
}
async clickOutsideWidget(fieldId: string): Promise<void> {
const form = await this.formFields.getWidget(fieldId);
await BrowserActions.click(form);
}
async checkErrorMessageIsNotDisplayed(fieldId: string): Promise<void> {
const errorMessage = $(`adf-form-field div[id="field-${fieldId}-container"] .adf-error-text`);
await BrowserVisibility.waitUntilElementIsNotVisible(errorMessage);
}
async getErrorMessage(fieldId: string): Promise<string> {
const errorMessage = $(`adf-form-field div[id="field-${fieldId}-container"] .adf-error-text`);
return BrowserActions.getText(errorMessage);
}
async removeFromDatetimeWidget(fieldId: string): Promise<void> {
const widget = await this.formFields.getWidget(fieldId);
await BrowserVisibility.waitUntilElementIsVisible(widget);
await BrowserActions.clearSendKeys($(`#${fieldId}`), '');
}
}

View File

@ -1,39 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { by, Locator } from 'protractor';
export class DisplayTextWidgetPage {
formFields: FormFields = new FormFields();
labelLocator: Locator = by.css('div[class*="adf-display-text-widget"]');
inputLocator: Locator = by.css('input');
getFieldLabel(fieldId): Promise<string> {
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
}
getFieldValue(fieldId): Promise<string> {
return this.formFields.getFieldValue(fieldId, this.inputLocator);
}
getFieldText(fieldId): Promise<string> {
return this.formFields.getFieldText(fieldId, this.labelLocator);
}
}

View File

@ -1,71 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { by, Locator, $ } from 'protractor';
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
import { EditJsonDialog } from '../../../dialog/public-api';
export class DisplayValueWidgetPage {
formFields: FormFields = new FormFields();
labelLocator: Locator = by.css(`label[class*='adf-label']`);
inputLocator: Locator = by.css('input');
editJsonDialog = new EditJsonDialog();
getFieldLabel(fieldId): Promise<string> {
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
}
getFieldValue(fieldId): Promise<string> {
return this.formFields.getFieldValue(fieldId, this.inputLocator);
}
async isDisplayValueWidgetVisible(fieldId: string): Promise<boolean> {
try {
await this.formFields.checkWidgetIsVisible(fieldId);
return true;
} catch {
return false;
}
}
async checkDisplayValueWidgetIsHidden(fieldId: string): Promise<boolean> {
const hiddenElement = $(`adf-form-field div[id='field-${fieldId}-container'][hidden]`);
try {
await BrowserVisibility.waitUntilElementIsNotVisible(hiddenElement);
return true;
} catch {
return false;
}
}
async clickOnDisplayJsonValueWidget(fieldId: string) {
const jsonButton = $(`adf-form-field div[id='field-${fieldId}-container'] button`);
await BrowserActions.click(jsonButton);
await this.editJsonDialog.checkDialogIsDisplayed();
}
async getDisplayJsonValueDialogContent(): Promise<any> {
return JSON.parse(await this.editJsonDialog.getDialogContent());
}
async closeDisplayJsonValuedDialog() {
await this.editJsonDialog.clickCloseButton();
await this.editJsonDialog.checkDialogIsNotDisplayed();
}
}

View File

@ -1,86 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { $, by, protractor } from 'protractor';
import { TestElement } from '../../../test-element';
import { materialLocators } from '../../public-api';
export class DropdownWidgetPage {
formFields: FormFields = new FormFields();
readonly searchElementLocator = TestElement.byCss('[aria-label="Search options"]');
async getSelectedOptionText(fieldId: string = 'dropdown'): Promise<string> {
return this.formFields.getFieldText(fieldId, by.css(`${materialLocators.Select.root}[id="${fieldId}"] ${materialLocators.Select.value.text} span`));
}
async selectOption(option: string, locator: string = '#dropdown'): Promise<void> {
await this.openDropdown(locator);
const row = TestElement.byText(`${materialLocators.Option.root} span`, option);
await row.click();
}
async selectMultipleOptions(options: string[]): Promise<void> {
for (const option of options) {
await this.clickOption(option);
}
}
async closeDropdownFor(dropdownId: string): Promise<void> {
const dropdownElement = TestElement.byCss(`#${dropdownId}-panel`);
await $('body').sendKeys(protractor.Key.ESCAPE);
await dropdownElement.waitNotPresent();
}
async openDropdown(locator: string = '#dropdown'): Promise<void> {
await this.checkDropdownIsDisplayed(locator);
const dropdown = TestElement.byCss(`${locator}`);
await dropdown.click();
}
async searchAndChooseOptionFromList(name: string): Promise<void> {
await this.searchElementLocator.typeText(name);
await this.clickOption(name);
}
async searchAndChooseOptionsFromList(...names: string[]): Promise<void> {
for (const name of names) {
await this.searchElementLocator.typeText(name);
await this.clickOption(name);
}
}
async checkDropdownIsDisplayed(locator: string = '#dropdown'): Promise<void> {
const dropdown = TestElement.byCss(`${locator}`);
await dropdown.waitVisible();
}
async isWidgetVisible(fieldId: string): Promise<void> {
await this.formFields.checkWidgetIsVisible(fieldId);
}
async isWidgetHidden(fieldId: string): Promise<void> {
await this.formFields.checkWidgetIsHidden(fieldId);
}
private async clickOption(name: string): Promise<void> {
const optionLocator = TestElement.byText(`${materialLocators.Option.root} span`, name);
await optionLocator.click();
}
}

View File

@ -1,128 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { Locator, by, element, protractor, $, $$ } from 'protractor';
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
import { materialLocators } from '../../public-api';
export class DynamicTableWidgetPage {
formFields = new FormFields();
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.css('[data-automation-id="dynamic-table-button-edit"]'));
columnDateTime = $('#columnDateTime');
columnDate = $('#columnDate');
calendarHeader = $(materialLocators.DatetimePicker.calendar.header.date.time);
calendarContent = $(materialLocators.DatetimePicker.calendar.content);
saveButton = element(by.cssContainingText('button span', 'Save'));
errorMessage = $('.adf-error-text');
dateWidget = $$(`${materialLocators.DatetimePicker.toggle.root} button`).first();
tableRow = $$('tbody tr');
getFieldLabel(fieldId: string): Promise<string> {
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
}
getColumnName(fieldId: string): Promise<string> {
return this.formFields.getFieldText(fieldId, this.columnNameLocator);
}
async clickAddRow(id?: string): Promise<void> {
const rowButton = $(`#${id ? id : 'label'}-add-row`);
await BrowserActions.click(rowButton);
}
async clickTableRow(rowNumber): Promise<void> {
const tableRowByIndex = this.getTableRowByIndex(rowNumber);
await BrowserActions.click(tableRowByIndex);
}
async clickEditButton(): Promise<void> {
await BrowserActions.click(this.editButton);
}
async clickCancelButton(): Promise<void> {
await BrowserActions.click(this.cancelButton);
}
async setDatatableInput(text, id = 'id'): Promise<void> {
const dataTableInput = $(`#${id}`);
await BrowserVisibility.waitUntilElementIsVisible(dataTableInput);
await BrowserActions.clearSendKeys(dataTableInput, text);
}
async getTableRowText(rowNumber): Promise<string> {
const tableRowByIndex = this.getTableRowByIndex(rowNumber);
return BrowserActions.getText(tableRowByIndex);
}
async checkTableRowIsNotVisible(rowNumber): Promise<void> {
const tableRowByIndex = this.getTableRowByIndex(rowNumber);
await BrowserVisibility.waitUntilElementIsNotVisible(tableRowByIndex);
}
async clickColumnDateTime(): Promise<void> {
await BrowserActions.click(this.columnDateTime);
await BrowserVisibility.waitUntilElementIsVisible(this.calendarHeader);
await BrowserVisibility.waitUntilElementIsVisible(this.calendarContent);
await BrowserActions.closeMenuAndDialogs();
}
async addRandomStringOnDateTime(randomText: string): Promise<string> {
await BrowserActions.click(this.columnDateTime);
await BrowserActions.closeMenuAndDialogs();
await this.columnDateTime.sendKeys(randomText);
await this.columnDateTime.sendKeys(protractor.Key.ENTER);
return BrowserActions.getInputValue(this.columnDateTime);
}
async addRandomStringOnDate(randomText: string): Promise<void> {
await BrowserActions.click(this.columnDate);
await this.columnDate.sendKeys(randomText);
}
async clickSaveButton(): Promise<void> {
await BrowserActions.click(this.saveButton);
}
async checkErrorMessage(): Promise<string> {
return BrowserActions.getText(this.errorMessage);
}
async clickDateWidget(): Promise<void> {
await BrowserActions.click(this.dateWidget);
}
async getTableRow(rowNumber): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.tableRow.get(rowNumber));
}
async getTableCellText(rowNumber: number, columnNumber: number): Promise<string> {
return BrowserActions.getText(this.tableRow.get(rowNumber).element(by.xpath(`td[${columnNumber}]`)));
}
async checkItemIsPresent(item): Promise<void> {
const row = element(by.cssContainingText('table tbody tr td span', item));
const present = await BrowserVisibility.waitUntilElementIsVisible(row);
expect(present).toBe(true);
}
private getTableRowByIndex = (idx: string) => $(`#dynamictable-row-${idx}`);
}

View File

@ -1,78 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { Locator, by, element, $ } from 'protractor';
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
import { materialLocators } from '../../public-api';
export class GroupWidgetPage {
groupField = $('input[data-automation-id="adf-group-search-input"]');
firstResult = $('#adf-group-widget-user-0');
formFields = new FormFields();
groupDropDownList: Locator = by.css(materialLocators.Autocomplete.panel.class);
getFieldLabel(fieldId: string): Promise<string> {
return this.formFields.getFieldLabel(fieldId);
}
getFieldValue(fieldId: string): Promise<string> {
return this.formFields.getFieldValue(fieldId);
}
getFieldText(fieldId: string): Promise<string> {
return this.formFields.getFieldText(fieldId);
}
insertGroup(fieldId: string, value: string): Promise<void> {
return this.formFields.setValueInInputById(fieldId, value);
}
async checkDropDownListIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(element(this.groupDropDownList));
}
async checkGroupIsListed(group): Promise<void> {
const groupElement = element(by.cssContainingText('[id="adf-group-label-name"]', group));
await BrowserVisibility.waitUntilElementIsVisible(groupElement);
}
async getDropDownList(): Promise<string[]> {
const user: Locator = by.css('[id="adf-group-label-name"]');
await BrowserVisibility.waitUntilElementIsVisible(element(user));
return element.all(user).map((elementFinder) => elementFinder.getText());
}
async selectGroupFromDropDown(groupName: string): Promise<void> {
const group = element(by.cssContainingText('[id="adf-group-label-name"]', groupName));
await BrowserActions.click(group);
}
async checkGroupFieldIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.groupField);
}
async fillGroupField(value): Promise<void> {
await BrowserVisibility.waitUntilElementIsClickable(this.groupField);
await this.groupField.sendKeys(value);
}
async selectGroupFromDropdown(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.firstResult);
await BrowserActions.click(this.firstResult);
}
}

View File

@ -1,30 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { TestElement } from '../../../test-element';
export class HeaderWidgetPage {
formFields: FormFields = new FormFields();
getFieldLabel(fieldId): Promise<string> {
const labelLocator = TestElement.byCss(`span[id="container-header-label-${fieldId}"]`);
return labelLocator.getText();
}
}

View File

@ -1,39 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { Locator, by, $$ } from 'protractor';
import { BrowserActions } from '../../../utils/public-api';
export class HyperlinkWidgetPage {
formFields = new FormFields();
fieldLocator: Locator = by.css('.adf-hyperlink-widget a');
async getFieldText(fieldId: string): Promise<string> {
return this.formFields.getFieldText(fieldId, this.fieldLocator);
}
async getFieldHref(fieldId: string): Promise<string> {
return BrowserActions.getAttribute(this.formFields.getWidget(fieldId).element(this.fieldLocator), 'href');
}
async getFieldLabel(fieldId: string): Promise<string> {
const label = $$(`adf-form-field div[id="field-${fieldId}-container"] label`).first();
return BrowserActions.getText(label);
}
}

View File

@ -1,34 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { BrowserActions } from '../../../utils/public-api';
export class JsonWidgetPage {
formFields = new FormFields();
jsonButtonLocator = 'button';
async clickJsonButton(fieldId: string): Promise<void> {
const widget = await this.formFields.getWidget(fieldId);
const uploadButton = await widget.$(this.jsonButtonLocator);
await BrowserActions.click(uploadButton);
}
async checkWidgetIsVisible(fieldId: string): Promise<void> {
await this.formFields.checkWidgetIsVisible(fieldId);
}
}

View File

@ -1,48 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { Locator, by } from 'protractor';
export class MultilineTextWidgetPage {
formFields: FormFields = new FormFields();
valueLocator: Locator = by.css('textarea');
labelLocator: Locator = by.css(`label[class*='adf-label']`);
getFieldValue(fieldId): Promise<string> {
return this.formFields.getFieldValue(fieldId, this.valueLocator);
}
getFieldLabel(fieldId): Promise<string> {
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
}
getFieldPlaceHolder(fieldId): Promise<string> {
return this.formFields.getFieldPlaceHolder(fieldId, 'textarea');
}
setValue(fieldId, value): Promise<void> {
return this.formFields.setFieldValue(fieldId, value);
}
getErrorMessage(fieldId): Promise<string> {
return this.formFields.getFieldErrorMessage(fieldId);
}
}

View File

@ -1,57 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { $$, $ } from 'protractor';
import { FormFields } from '../form-fields';
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
export class NumberWidgetPage {
formFields = new FormFields();
async getNumberFieldLabel(fieldId: string): Promise<string> {
const label = $$(`adf-form-field div[id="field-${fieldId}-container"] label`).first();
return BrowserActions.getText(label);
}
getFieldValue(fieldId: string): Promise<string> {
return this.formFields.getFieldValue(fieldId);
}
setFieldValue(fieldId: string, value: any): Promise<void> {
return this.formFields.setValueInInputById(fieldId, value);
}
async clearFieldValue(fieldId: string): Promise<void> {
const numberField = $(`#${fieldId}`);
await BrowserVisibility.waitUntilElementIsVisible(numberField);
await numberField.clear();
}
checkWidgetIsVisible(fieldId: string): Promise<void> {
return this.formFields.checkWidgetIsVisible(fieldId);
}
async getErrorMessage(fieldId: string): Promise<string> {
const errorMessage = $(`adf-form-field div[id="field-${fieldId}-container"] .adf-error-text`);
return BrowserActions.getText(errorMessage);
}
getPlaceholder(fieldId: string): Promise<string> {
return this.formFields.getFieldPlaceHolder(fieldId);
}
}

View File

@ -1,81 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { by, element, Locator, $ } from 'protractor';
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
export class PeopleWidgetPage {
peopleField = $('input[data-automation-id="adf-people-search-input"]');
firstResult = $('#adf-people-widget-user-0');
formFields = new FormFields();
labelLocator: Locator = by.css('div[class*="display-text-widget"]');
inputLocator: Locator = by.id('involvepeople');
peopleDropDownList = $('div[class*="adf-people-widget-list"]');
getFieldLabel(fieldId: string): Promise<string> {
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
}
getFieldValue(fieldId: string): Promise<string> {
return this.formFields.getFieldValue(fieldId, this.inputLocator);
}
getFieldText(fieldId: string): Promise<string> {
return this.formFields.getFieldText(fieldId, this.labelLocator);
}
insertUser(fieldId: string, value: string): Promise<void> {
return this.formFields.setValueInInputById(fieldId, value);
}
async checkDropDownListIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.peopleDropDownList);
}
async checkUserIsListed(userName: string): Promise<void> {
const user = element(by.cssContainingText('.adf-people-label-name', userName));
await BrowserVisibility.waitUntilElementIsVisible(user);
}
async selectUserFromDropDown(userName: string): Promise<void> {
const user = element(by.cssContainingText('.adf-people-label-name', userName));
await BrowserActions.click(user);
}
async getDropDownList(): Promise<any[]> {
await this.checkDropDownListIsDisplayed();
const users = by.css('.adf-people-label-name');
await BrowserVisibility.waitUntilElementIsVisible(element(users));
return element.all(users).map((elementFinder) => elementFinder.getText());
}
async checkPeopleFieldIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.peopleField);
}
async fillPeopleField(value): Promise<void> {
await BrowserVisibility.waitUntilElementIsClickable(this.peopleField);
await this.peopleField.sendKeys(value);
}
async selectUserFromDropdown(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.firstResult);
await BrowserActions.click(this.firstResult);
}
}

View File

@ -1,18 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export * from './widget';

View File

@ -1,54 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { $$, by, Locator } from 'protractor';
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
import { materialLocators } from '../../public-api';
export class RadioButtonsWidgetPage {
selectedOption: Locator = by.css(`${materialLocators.Radio.button.root}[ng-pristine]`);
formFields: FormFields = new FormFields();
async getSpecificOptionLabel(fieldId, optionNumber): Promise<string> {
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: Locator = by.css(`label[for*="${fieldId}-option_${optionNumber}"]`);
const widget = await this.formFields.getWidget(fieldId);
const option = widget.element(optionLocator);
await BrowserActions.click(option);
}
async isSelectionClean(fieldId): Promise<void> {
const widget = await this.formFields.getWidget(fieldId);
const option = widget.element(this.selectedOption);
await BrowserVisibility.waitUntilElementIsNotVisible(option);
}
async getRadioWidgetLabel(fieldId): Promise<string> {
const label = $$(`adf-form-field div[id="field-${fieldId}-container"] label`).first();
return BrowserActions.getText(label);
}
}

View File

@ -1,42 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { by, element, $ } from 'protractor';
import { TestElement } from '../../../test-element';
import { BrowserActions, BrowserVisibility } from '../../../utils/public-api';
import { materialLocators } from '../../public-api';
export class TabPage {
changeTabAnimation = $(`${materialLocators.Tab.labels.class} div[class="${materialLocators.Ripple.element.root}"]`);
public disabledContentNodeSelectorTabInfoIcon = TestElement.byCss('[data-automation-id="adf-content-node-selector-disabled-tab-info-icon"]');
async clickTabByLabel(tabLabel): Promise<void> {
const user = element(by.cssContainingText(materialLocators.Tab.label.content.class, tabLabel));
await BrowserActions.click(user);
await BrowserVisibility.waitUntilElementIsNotVisible(this.changeTabAnimation);
}
async checkTabIsDisplayedByLabel(tabLabel): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(materialLocators.Tab.label.content.class, tabLabel)));
}
async checkTabIsNotDisplayedByLabel(tabLabel): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.cssContainingText(materialLocators.Tab.label.content.class, tabLabel)));
}
}

View File

@ -1,58 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { FormFields } from '../form-fields';
import { by, Locator } from 'protractor';
export class TextWidgetPage {
formFields: FormFields = new FormFields();
labelLocator: Locator = by.css(`label[class*='adf-label']`);
getFieldLabel(fieldId): Promise<string> {
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
}
getFieldPlaceHolder(fieldId): Promise<string> {
return this.formFields.getFieldPlaceHolder(fieldId);
}
async setValue(fieldId, value): Promise<void> {
await this.formFields.setFieldValue(fieldId, value);
}
getFieldValue(fieldId): Promise<string> {
return this.formFields.getFieldValue(fieldId);
}
getErrorMessage(fieldId): Promise<string> {
return this.formFields.getFieldErrorMessage(fieldId);
}
async isWidgetVisible(fieldId): Promise<void> {
await this.formFields.checkWidgetIsVisible(fieldId);
}
async isWidgetClickable(fieldId): Promise<void> {
await this.formFields.checkWidgetIsClickable(fieldId);
}
async isWidgetNotVisible(fieldId): Promise<void> {
await this.formFields.checkWidgetIsHidden(fieldId);
}
}

View File

@ -1,124 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { MultilineTextWidgetPage } from './multiline-text-widget.page';
import { HeaderWidgetPage } from './header-widget.page';
import { DisplayTextWidgetPage } from './display-text-widget.page';
import { DisplayValueWidgetPage } from './display-value-widget.page';
import { AttachFileWidgetPage } from './attach-file-widget.page';
import { RadioButtonsWidgetPage } from './radio-buttons-widget.page';
import { HyperlinkWidgetPage } from './hyperlink-widget.page';
import { DropdownWidgetPage } from './dropdown-widget.page';
import { DynamicTableWidgetPage } from './dynamic-table-widget.page';
import { TextWidgetPage } from './text-widget.page';
import { CheckboxWidgetPage } from './checkbox-widget.page';
import { DateWidgetPage } from './date-widget.page';
import { DateTimeWidgetPage } from './date-time-widget.page';
import { NumberWidgetPage } from './number-widget.page';
import { AmountWidgetPage } from './amount-widget.page';
import { ContainerWidgetPage } from './container-widget.page';
import { PeopleWidgetPage } from './people-widget.page';
import { TabPage } from './tab.page';
import { GroupWidgetPage } from './group-widget.page';
import { AttachFolderWidgetPage } from './attach-folder-widget.page';
import { JsonWidgetPage } from './json-widget.page';
export class Widget {
multilineTextWidget(): MultilineTextWidgetPage {
return new MultilineTextWidgetPage();
}
headerWidget(): HeaderWidgetPage {
return new HeaderWidgetPage();
}
displayTextWidget(): DisplayTextWidgetPage {
return new DisplayTextWidgetPage();
}
attachFileWidget(): AttachFileWidgetPage {
return new AttachFileWidgetPage();
}
attachFolderWidget(): AttachFolderWidgetPage {
return new AttachFolderWidgetPage();
}
displayValueWidget(): DisplayValueWidgetPage {
return new DisplayValueWidgetPage();
}
radioWidget(): RadioButtonsWidgetPage {
return new RadioButtonsWidgetPage();
}
hyperlink(): HyperlinkWidgetPage {
return new HyperlinkWidgetPage();
}
dropdown(): DropdownWidgetPage {
return new DropdownWidgetPage();
}
dynamicTable(): DynamicTableWidgetPage {
return new DynamicTableWidgetPage();
}
textWidget(): TextWidgetPage {
return new TextWidgetPage();
}
checkboxWidget(): CheckboxWidgetPage {
return new CheckboxWidgetPage();
}
dateWidget(): DateWidgetPage {
return new DateWidgetPage();
}
dateTimeWidget(): DateTimeWidgetPage {
return new DateTimeWidgetPage();
}
numberWidget(): NumberWidgetPage {
return new NumberWidgetPage();
}
amountWidget(): AmountWidgetPage {
return new AmountWidgetPage();
}
containerWidget(): ContainerWidgetPage {
return new ContainerWidgetPage();
}
peopleWidget(): PeopleWidgetPage {
return new PeopleWidgetPage();
}
groupWidget(): GroupWidgetPage {
return new GroupWidgetPage();
}
tab(): TabPage {
return new TabPage();
}
json(): JsonWidgetPage {
return new JsonWidgetPage();
}
}

View File

@ -1,132 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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, browser, $, $$ } from 'protractor';
import { BrowserVisibility } from '../utils/browser-visibility';
import { BrowserActions } from '../utils/browser-actions';
import { materialLocators } from './public-api';
export class HeaderPage {
checkBox = element(by.cssContainingText(materialLocators.Checkbox.label.class, 'Show menu button'));
headerColor = $('option[value="primary"]');
titleInput = $('input[name="title"]');
iconInput = $('input[placeholder="URL path"]');
hexColorInput = $('input[placeholder="hex color code"]');
logoHyperlinkInput = $('input[placeholder="Redirect URL"]');
logoTooltipInput = $('input[placeholder="Tooltip text"]');
positionStart = $$(`${materialLocators.Radio.button.root}[value="start"]`).first();
positionEnd = $$(`${materialLocators.Radio.button.root}[value="end"]`).first();
sideBarPositionRight = $(`${materialLocators.Sidenav.root}${materialLocators.Drawer.class}${materialLocators.Sidenav.root}${materialLocators.Drawer.end}`);
sideBarPositionLeft = $(`${materialLocators.Sidenav.root}${materialLocators.Drawer.class}${materialLocators.Sidenav.root}`);
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 = $$(materialLocators.Checkbox.root).first();
await BrowserActions.click(checkBox);
}
async changeHeaderColor(color: string): Promise<void> {
const headerColor = $('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 = $('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 BrowserActions.clearSendKeys(this.hexColorInput, hexCode);
await this.hexColorInput.sendKeys(protractor.Key.ENTER);
}
async addLogoHyperlink(hyperlink: string): Promise<void> {
await BrowserActions.click(this.logoHyperlinkInput);
await BrowserActions.clearSendKeys(this.logoHyperlinkInput, hyperlink);
await this.logoHyperlinkInput.sendKeys(protractor.Key.ENTER);
}
async addLogoTooltip(tooltip: string): Promise<void> {
await BrowserActions.click(this.logoTooltipInput);
await BrowserActions.clearSendKeys(this.logoTooltipInput, tooltip);
await this.logoTooltipInput.sendKeys(protractor.Key.ENTER);
}
async sideBarPositionStart(): Promise<void> {
await BrowserActions.click(this.positionStart);
}
async sideBarPositionEnd(): Promise<void> {
await browser.executeScript('arguments[0].scrollIntoView()', this.positionEnd);
await BrowserActions.click(this.positionEnd);
}
async checkSidebarPositionStart(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.sideBarPositionLeft);
}
async checkSidebarPositionEnd(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.sideBarPositionRight);
}
}

View File

@ -1,152 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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, protractor, $ } from 'protractor';
import { BrowserVisibility } from '../utils/browser-visibility';
import { BrowserActions } from '../utils/browser-actions';
import { LocalStorageUtil } from '../utils/local-storage.util';
import { Logger } from '../utils/logger';
export interface LoginOptions {
waitForUserIcon: boolean;
}
export class LoginPage {
loginUrl = `${browser.baseUrl}/login`;
ssoButton = $(`[data-automation-id="login-button-sso"]`);
usernameField = $('#username');
passwordField = $('#password');
loginButton = $('input[type="submit"]');
userIcon = $(`[data-automation-id='user-initials-image']`);
visibilityLabel = $('#v');
txtUsernameBasicAuth = $('input[id="username"]');
txtPasswordBasicAuth = $('input[id="password"]');
signInButtonBasicAuth = $('#login-button');
async goToLoginPage(): Promise<void> {
let currentUrl;
try {
currentUrl = await browser.getCurrentUrl();
} catch (e) {
/* do nothing */
}
if (!currentUrl || currentUrl.indexOf(this.loginUrl) === -1) {
await BrowserActions.getUrl(this.loginUrl);
}
await BrowserVisibility.waitUntilElementIsVisible(this.txtUsernameBasicAuth);
await BrowserVisibility.waitUntilElementIsVisible(this.txtPasswordBasicAuth);
}
async loginWithProfile(profileName: string): Promise<void> {
const profile = browser.params.testConfig.users[profileName];
if (profile) {
await this.login(profile.username, profile.password);
} else {
throw new Error(`Login profile "${profileName}" not found on "browser.params.testConfig".`);
}
}
async login(username: string, password: string, options: LoginOptions = { waitForUserIcon: true }) {
Logger.log('Login With ' + username);
const authType = await LocalStorageUtil.getConfigField('authType');
Logger.log(`AuthType ${authType}`);
if (!authType || authType === 'OAUTH') {
await this.loginSSOIdentityService(username, password, options);
} else {
await this.loginBasicAuth(username, password, options);
}
await browser.waitForAngular();
}
async loginSSOIdentityService(username: string, password: string, options: LoginOptions = { waitForUserIcon: true }) {
browser.ignoreSynchronization = true;
const loginURL: string = browser.baseUrl + (browser.params.loginRoute ? browser.params.loginRoute : '');
const oauth2 = await LocalStorageUtil.getConfigField('oauth2');
await BrowserActions.getUrl(loginURL);
if (oauth2 && oauth2.silentLogin === false) {
Logger.log(`Login SSO`);
await this.clickOnSSOButton();
} else {
Logger.log(`Login SSO silent login`);
}
await BrowserVisibility.waitUntilElementIsVisible(this.usernameField);
await this.displayPassword();
await this.enterUsername(username);
await this.enterPassword(password);
await this.clickLoginButton();
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
if (options.waitForUserIcon) {
await BrowserVisibility.waitUntilElementIsVisible(this.userIcon, BrowserVisibility.DEFAULT_TIMEOUT * 2);
}
}
async loginBasicAuth(username: string, password: string, options: LoginOptions = { waitForUserIcon: true }): Promise<void> {
Logger.log(`Login Basic`);
await this.goToLoginPage();
await this.enterUsernameBasicAuth(username);
await this.enterPasswordBasicAuth(password);
await this.clickSignInBasicAuthButton();
if (options.waitForUserIcon) {
await BrowserVisibility.waitUntilElementIsVisible(this.userIcon);
}
}
async clickSignInBasicAuthButton(): Promise<void> {
await BrowserActions.click(this.signInButtonBasicAuth);
}
async enterUsernameBasicAuth(username: string): Promise<void> {
await BrowserActions.clearSendKeys(this.txtUsernameBasicAuth, username);
}
async enterPasswordBasicAuth(password: string): Promise<void> {
await BrowserActions.clearSendKeys(this.txtPasswordBasicAuth, password);
}
async clickOnSSOButton() {
await BrowserActions.click(this.ssoButton);
}
async enterUsername(username: string) {
await BrowserActions.clearSendKeys(this.usernameField, username);
}
async enterPassword(password: string) {
await BrowserActions.clearSendKeys(this.passwordField, password);
}
async clickLoginButton() {
await BrowserActions.click(this.loginButton);
}
async displayPassword(): Promise<void> {
await BrowserActions.click(this.visibilityLabel);
const passwordInputTypeText = $(`input[name="password"][type="text"]`);
await BrowserVisibility.waitUntilElementIsVisible(passwordInputTypeText);
}
}

View File

@ -1,37 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { ElementFinder } from 'protractor';
import { BrowserActions } from '../../utils/browser-actions';
import { materialLocators } from './material-locators';
export class CheckboxPage {
static async uncheck(el: ElementFinder) {
const classList = await BrowserActions.getAttribute(el, 'class');
if (classList && classList.indexOf(materialLocators.Checked.root) > -1) {
await BrowserActions.click(el);
}
}
static async check(el: ElementFinder) {
const classList = await BrowserActions.getAttribute(el, 'class');
if (classList && classList.indexOf(materialLocators.Checked.root) === -1) {
await BrowserActions.click(el);
}
}
}

View File

@ -1,115 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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, $ } from 'protractor';
import { BrowserVisibility } from '../../utils/browser-visibility';
import { BrowserActions } from '../../utils/browser-actions';
import { TestElement } from '../../test-element';
import { addDays, format, subDays } from 'date-fns';
import { materialLocators } from './material-locators';
export class DatePickerCalendarPage {
datePicker = $(`${materialLocators.Calendar.root}[id*="${materialLocators.Datepicker.root}"]`);
nextMonthButton = $(`button[class*="${materialLocators.Calendar.button('next')}"]`);
previousMonthButton = $(`button[class*="${materialLocators.Calendar.button('previous')}"]`);
todayDate = TestElement.byCss(`${materialLocators.Calendar.body.today.class}`);
periodButton = $(`button[class*=${materialLocators.Calendar.button('period')}]`);
focusedElement = `span${materialLocators.Calendar.body.cell.content.class}${materialLocators.Calendar.focus}`;
async getSelectedDate(): Promise<string> {
return BrowserActions.getAttribute($(`button[class*="${materialLocators.Calendar.body.active.root}"]`), 'aria-label');
}
async checkDatesAfterDateAreDisabled(date: Date): Promise<void> {
const afterDate = format(addDays(date, 1), 'dd-MM-yy');
const afterCalendar = $(`td[class*="${materialLocators.Calendar.body.cell.root}"][aria-label="${afterDate}"]`);
if (await afterCalendar.isPresent()) {
const aria = await BrowserActions.getAttribute(afterCalendar, 'aria-disabled');
expect(aria).toBe('true');
}
const isEnabled = await this.nextMonthButton.isEnabled();
expect(isEnabled).toBe(false);
}
async checkDatesBeforeDateAreDisabled(date: Date): Promise<void> {
const beforeDate = format(subDays(date, 1), 'dd-MM-yy');
const beforeCalendar = $(`td[class*="${materialLocators.Calendar.body.cell.root}"][aria-label="${beforeDate}"]`);
if (await beforeCalendar.isPresent()) {
const aria = await BrowserActions.getAttribute(beforeCalendar, 'aria-disabled');
expect(aria).toBe('true');
}
const isEnabled = await this.previousMonthButton.isEnabled();
expect(isEnabled).toBe(false);
}
async selectTodayDate(): Promise<void> {
await this.todayDate.waitPresent();
await this.todayDate.click();
await this.checkDatePickerIsNotDisplayed();
}
async closeDatePicker(): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
await this.checkDatePickerIsNotDisplayed();
}
async checkDatePickerIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.datePicker);
}
async checkDatePickerIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.datePicker);
}
async selectDateRange(startDay: number, endDay: number): Promise<void> {
const startDayElement = element(by.cssContainingText(this.focusedElement, `${startDay}`));
const endDayElement = element(by.cssContainingText(this.focusedElement, `${endDay}`));
await this.checkDatePickerIsDisplayed();
await BrowserActions.click(startDayElement);
await BrowserActions.click(endDayElement);
await this.checkDatePickerIsNotDisplayed();
}
async selectExactDate(date: Date): Promise<void> {
await this.checkDatePickerIsDisplayed();
await this.setDateUsingPeriodButton(date);
await this.checkDatePickerIsNotDisplayed();
}
async selectExactDateRange(start: Date, end: Date): Promise<void> {
await this.checkDatePickerIsDisplayed();
await this.setDateUsingPeriodButton(start);
await this.setDateUsingPeriodButton(end);
await this.checkDatePickerIsNotDisplayed();
}
private async setDateUsingPeriodButton(date: Date) {
const months = ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'];
const year = date.getFullYear();
const month = months[date.getMonth()];
const day = date.getDate();
const yearElement = element(by.cssContainingText(this.focusedElement, `${year}`));
const monthElement = element(by.cssContainingText(this.focusedElement, `${month}`));
const dayElement = element(by.cssContainingText(this.focusedElement, `${day}`));
await BrowserActions.click(this.periodButton);
await BrowserActions.click(yearElement);
await BrowserActions.click(monthElement);
await BrowserActions.click(dayElement);
}
}

View File

@ -1,45 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { $, ElementFinder } from 'protractor';
import { BrowserActions } from '../../utils/browser-actions';
import { DatePickerCalendarPage } from './date-picker-calendar.page';
import { materialLocators } from './material-locators';
export class DatePickerPage {
datePicker: ElementFinder;
dateTime = new DatePickerCalendarPage();
constructor(datePickerElement?: ElementFinder) {
const locator = $(materialLocators.Datepicker.toggle.class);
this.datePicker = datePickerElement ? datePickerElement : locator;
}
async clickDatePicker() {
await BrowserActions.click(this.datePicker);
}
async setTodayDateValue(): Promise<void> {
await this.dateTime.selectTodayDate();
}
async setDateRange(start: Date, end: Date): Promise<void> {
await this.clickDatePicker();
await this.dateTime.selectExactDateRange(start, end);
}
}

View File

@ -1,73 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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, $, $$ } from 'protractor';
import { BrowserVisibility } from '../../utils/browser-visibility';
import { BrowserActions } from '../../utils/browser-actions';
import { materialLocators } from './material-locators';
export class DateTimePickerCalendarPage {
datePicker = $(`[class*='picker-content']`);
today = $(`[class*='calendar-body-today']`);
timePicker = $(materialLocators.DatetimePicker.clock.class);
hourTime = $$(`${materialLocators.DatetimePicker.clock.hours.class} .${materialLocators.DatetimePicker.clock.cell()}`).first();
minutesTime = $$(`${materialLocators.DatetimePicker.clock.minutes.class} .${materialLocators.DatetimePicker.clock.cell()}`).first();
firstEnabledSelector = `.${materialLocators.DatetimePicker.clock.cell()}:not(.${materialLocators.DatetimePicker.clock.cell('disabled')}`;
hoursPicker = $(materialLocators.DatetimePicker.clock.hours.class);
minutePicker = $(materialLocators.DatetimePicker.clock.minutes.class);
async waitTillDateDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.datePicker);
}
async setToday(): Promise<void> {
await BrowserActions.click(this.today);
}
async setTime(): Promise<void> {
await BrowserActions.clickScript(this.hourTime);
await BrowserActions.clickScript(this.minutesTime);
}
async setDate(date?: string): Promise<boolean> {
try {
if (date) {
await BrowserActions.clickScript(element.all(by.cssContainingText(materialLocators.Datepicker.calendar.body.cell.content.class, date)).first());
} else {
await this.setToday();
}
await this.setTime();
return true;
} catch {
return false;
}
}
async checkCalendarTodayDayIsDisabled(): Promise<void> {
const locatorString = materialLocators.Calendar.body.cell.content.class;
await BrowserVisibility.waitUntilElementIsPresent(element(by.cssContainingText(locatorString, await BrowserActions.getText(this.today))));
}
async setDefaultEnabledHour(): Promise<void> {
await BrowserActions.click(this.hoursPicker.$$(this.firstEnabledSelector).first());
}
async setDefaultEnabledMinutes() {
await BrowserActions.click(this.minutePicker.$$(this.firstEnabledSelector).first());
}
}

View File

@ -1,63 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { ElementFinder, $ } from 'protractor';
import { BrowserActions } from '../../utils/browser-actions';
import { DateTimePickerCalendarPage } from './date-time-picker-calendar.page';
import { materialLocators } from './material-locators';
export class DateTimePickerPage {
rootElement: ElementFinder;
dateTimePicker = $(materialLocators.DatetimePicker.toggle.class);
datePicker = $(materialLocators.Datepicker.toggle.class);
dateTime = new DateTimePickerCalendarPage();
constructor(rootElement?: ElementFinder) {
if (rootElement) {
this.rootElement = rootElement;
this.dateTimePicker = this.rootElement.$(materialLocators.DatetimePicker.toggle.class);
this.datePicker = this.rootElement.$(materialLocators.Datepicker.toggle.class);
}
}
async setTodayDateTimeValue(): Promise<void> {
await BrowserActions.click(this.dateTimePicker);
await this.dateTime.waitTillDateDisplayed();
await this.dateTime.setToday();
await this.dateTime.setTime();
}
async setTodayDateValue(): Promise<void> {
await BrowserActions.click(this.dateTimePicker);
await this.dateTime.waitTillDateDisplayed();
await this.dateTime.setToday();
}
async setDate(date?: string): Promise<boolean> {
await BrowserActions.click(this.datePicker);
return this.dateTime.setDate(date);
}
async clickDateTimePicker(): Promise<void> {
await BrowserActions.click(this.datePicker);
}
async checkCalendarTodayDayIsDisabled(): Promise<void> {
await this.dateTime.checkCalendarTodayDayIsDisabled();
}
}

View File

@ -1,106 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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, ElementFinder, browser, $$, $ } from 'protractor';
import { BrowserVisibility } from '../../utils/browser-visibility';
import { BrowserActions } from '../../utils/browser-actions';
import { Logger } from '../../utils/logger';
import { materialLocators } from './material-locators';
export class DropdownPage {
dropDownElement: ElementFinder;
constructor(dropDownElement = $$(`div[class="${materialLocators.Select.arrow.wrapper.root}"]`).first()) {
this.dropDownElement = dropDownElement;
}
async clickDropdown(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.dropDownElement);
await BrowserActions.click(this.dropDownElement);
}
async selectOption(option: string): Promise<void> {
Logger.log(`Select dropdown option ${option}`);
const optionElement = element
.all(by.cssContainingText(`${materialLocators.Option.root.trim()} span${materialLocators.Option.text.class}`, option))
.first();
await BrowserActions.click(optionElement);
await browser.waitForAngular();
}
async getValue(): Promise<string> {
return BrowserActions.getText($(`${materialLocators.Form.field.root} span`));
}
async getDropdownOptionList(): Promise<string> {
return BrowserActions.getArrayText(this.dropDownElement.$$(`[role*='option']`));
}
async getNumberOfOptions(): Promise<number> {
const dropdownOptions = $$(`${materialLocators.Select.panel.class} ${materialLocators.Option.root}`);
return dropdownOptions.count();
}
async checkDropdownIsVisible(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.dropDownElement);
}
async checkDropdownIsNotVisible(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.dropDownElement);
}
async checkDropdownIsClickable(): Promise<void> {
await BrowserVisibility.waitUntilElementIsClickable(this.dropDownElement);
}
async checkOptionIsSelected(option: string): Promise<void> {
const selectedOption = this.dropDownElement.element(by.cssContainingText(`${materialLocators.Select.value.text} span`, option));
await BrowserVisibility.waitUntilElementIsVisible(selectedOption);
}
async selectOptionFromIndex(index: number): Promise<void> {
const value = element.all(by.className(materialLocators.Option.root)).get(index);
await BrowserActions.click(value);
}
async checkOptionsPanelIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible($$(materialLocators.Select.panel.class).first());
}
async getSelectedOptionText(): Promise<string> {
const selectedOption = this.dropDownElement.$(`${materialLocators.Select.value.text} span`);
return BrowserActions.getText(selectedOption);
}
async checkOptionIsDisplayed(option: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(
element.all(by.cssContainingText(`${materialLocators.Option.root} span${materialLocators.Option.text.class}`, option)).first()
);
}
async checkOptionIsNotDisplayed(option: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(
element.all(by.cssContainingText(`${materialLocators.Option.root} span${materialLocators.Option.text.class}`, option)).first()
);
}
async selectDropdownOption(option: string): Promise<void> {
await this.clickDropdown();
await this.checkOptionsPanelIsDisplayed();
await this.selectOption(option);
}
}

View File

@ -1,453 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export const materialLocators = {
Accent: {
class: '.mat-mdc-accent'
},
Accordion: {
root: 'mat-accordion'
},
Autocomplete: {
panel: {
class: '.mat-mdc-autocomplete-panel',
root: 'mat-autocomplete-panel'
}
},
Button: {
class: '.mat-mdc-button',
disabled: 'mat-button-disabled',
label: '.mdc-button__label'
},
Calendar: {
root: 'mat-calendar',
focus: '.mat-focus-indicator',
body: {
cell: {
root: 'mat-calendar-body-cell',
content: {
class: '.mat-calendar-body-cell-content'
}
},
today: {
class: '.mat-calendar-body-today'
},
active: {
root: 'mat-calendar-body-active'
}
},
button: (navigation: 'next' | 'previous' | 'period') => `mat-calendar-${navigation}-button`
},
Card: {
root: 'mat-card',
class: '.mat-mdc-card',
content: {
class: '.mat-mdc-card-content',
root: 'mat-card-content'
},
title: {
class: '.mat-mdc-card-title',
root: 'mat-card-title'
},
actions: 'mat-card-actions',
subtitle: {
root: 'mat-card-subtitle'
}
},
Checkbox: {
root: 'mat-checkbox',
class: '.mat-mdc-checkbox',
layout: '.mat-mdc-checkbox-layout',
label: {
class: '.mat-mdc-checkbox-label',
root: 'mat-checkbox-label'
},
checked: {
class: '.mat-mdc-checkbox-checked',
root: 'mat-checkbox-checked'
},
disabled: {
root: 'mat-checkbox-disabled'
},
inner: {
container: {
class: '.mat-mdc-checkbox-inner-container'
}
}
},
Checked: {
root: 'mdc-switch--checked'
},
Chip: {
root: 'mat-chip',
class: '.mat-mdc-chip',
list: {
root: 'mat-chip-listbox',
class: '.mat-mdc-chip-list',
option: {
class: 'mat-chip-option',
value: '.mat-mdc-chip-action-label'
}
},
grid: {
root: 'mat-chip-grid',
class: '.mat-mdc-chip-grid',
row: {
root: 'mat-chip-row',
class: '.mat-mdc-chip-row'
}
}
},
Datepicker: {
root: 'mat-datepicker',
calendar: {
body: {
cell: {
content: {
class: '.mat-mdc-datepicker-calendar-body-cell-content'
}
}
}
},
toggle: {
root: 'mat-datepicker-toggle',
class: '.mat-datepicker-toggle'
}
},
DatetimePicker: {
root: 'mat-datetimepicker-content',
popup: '.mat-datetimepicker-popup',
calendar: {
header: {
date: {
class: '.mat-datetimepicker-calendar-header-date',
time: '.mat-datetimepicker-calendar-header-date-time'
},
year: '.mat-datetimepicker-calendar-header-year'
},
body: {
active: '.mat-datetimepicker-calendar-body-active',
cell: {
class: '.mat-datetimepicker-calendar-body-cell-content',
root: 'mat-datetimepicker-calendar-body-cell-content'
}
},
content: '.mat-datetimepicker-calendar-content',
nextButton: '.mat-datetimepicker-calendar-next-button'
},
clock: {
class: '.mat-datetimepicker-clock',
hours: {
class: '.mat-datetimepicker-clock-hours'
},
minutes: {
class: '.mat-datetimepicker-clock-minutes'
},
cell: (attribute?: 'selected' | 'disabled') =>
attribute ? `mat-datetimepicker-clock-cell-${attribute}` : 'mat-datetimepicker-clock-cell'
},
month: {
view: 'mat-datetimepicker-month-view'
},
toggle: {
root: 'mat-datetimepicker-toggle',
class: '.mat-datetimepicker-toggle'
}
},
Dialog: {
container: {
root: 'mat-dialog-container',
class: '.mat-mdc-dialog-container'
},
content: {
root: 'mat-dialog-content',
class: '.mat-mdc-dialog-content'
},
actions: {
class: `.mat-mdc-dialog-actions`,
root: `mat-dialog-actions`
},
title: '.mat-mdc-dialog-title'
},
Disabled: {
root: 'mat-disabled'
},
Drawer: {
class: '.mat-mdc-drawer',
end: '.mat-mdc-drawer-end'
},
Error: {
class: '.mat-mdc-error',
root: 'mat-error'
},
Expanded: {
class: '.mat-expanded',
root: 'mat-expanded'
},
Expansion: {
panel: {
root: 'mat-expansion-panel',
class: '.mat-expansion-panel',
body: {
class: '.mat-mdc-expansion-panel-body'
},
content: {
class: '.mat-expansion-panel-content'
},
header: {
class: '.mat-expansion-panel-header',
root: 'mat-expansion-panel-header'
},
title: '.mat-expansion-panel-header-title',
expanded: '.mat-expanded'
},
indicator: '.mat-expansion-indicator'
},
Focus: {
indicator: '.mat-mdc-focus-indicator'
},
Focused: {
root: 'mat-focused'
},
Form: {
field: {
class: '.mat-mdc-form-field',
root: 'mat-form-field',
label: {
wrapper: '.mat-mdc-form-field-label-wrapper'
}
},
fieldInfix: '.mat-mdc-form-field-infix'
},
Header: {
cell: '.mat-mdc-header-cell'
},
Hint: {
class: 'mat-hint'
},
Icon: {
root: 'mat-icon',
class: '.mat-mdc-icon',
button: {
class: '.mat-mdc-icon-button',
root: 'mat-icon-button'
}
},
Input: {
class: '.mat-mdc-input-element'
},
Label: {
root: 'mat-label'
},
List: {
class: '.mat-mdc-list',
root: 'mat-list',
item: {
root: 'mat-list-item',
class: '.mat-mdc-list-item'
},
option: 'mat-list-option',
text: {
class: '.mat-mdc-list-text'
},
content: {
class: '.mdc-list-item__content'
},
selectionList: 'mat-selection-list'
},
Menu: {
content: {
class: '.mat-mdc-menu-content',
root: 'mat-mdc-menu-content'
},
panel: '.mat-mdc-menu-panel',
item: {
class: '.mat-mdc-menu-item',
submenu: {
trigger: {
root: `mat-menu-item-submenu-trigger`
}
}
}
},
Month: {
content: '.mat-mdc-month-content'
},
Option: {
root: 'mat-option',
class: '.mat-mdc-option',
group: 'mat-optgroup',
text: {
class: '.mdc-list-item__primary-text',
root: 'span'
}
},
Paginator: {
class: '.mat-mdc-paginator',
range: {
label: '.mat-mdc-paginator-range-label'
},
navigation: (rangeAction: string) => `.mat-mdc-paginator-navigation-${rangeAction}`
},
Panel: {
title: 'mat-panel-title'
},
Primary: {
class: '.mat-mdc-primary'
},
Progress: {
bar: {
root: 'mat-progress-bar',
class: '.mat-mdc-progress-bar'
},
spinner: {
root: 'mat-progress-spinner',
class: '.mat-mdc-progress-spinner'
}
},
Radio: {
root: 'mat-radio',
button: {
class: '.mat-mdc-radio-button',
root: 'mat-radio-button'
},
group: 'mat-radio-group',
checked: 'mat-radio-checked',
label: '.mat-mdc-radio-label'
},
Ripple: {
class: '.mat-mdc-ripple',
element: {
class: '.mat-mdc-ripple-element',
root: 'mat-ripple-element'
}
},
Select: {
root: 'mat-select',
class: '.mat-mdc-select',
arrow: {
class: '.mat-mdc-select-arrow',
wrapper: {
root: '.mat-mdc-select-arrow-wrapper'
}
},
placeholder: {
class: '.mat-mdc-select-placeholder'
},
panel: {
class: '.mat-mdc-select-panel',
wrap: '.mat-mdc-select-panel-wrap'
},
value: {
class: '.mat-mdc-select-value',
text: '.mat-mdc-select-value-text'
},
minLine: '.mat-mdc-select-min-line',
trigger: '.mat-mdc-select-trigger'
},
Slide: {
toggle: {
class: '.mat-mdc-slide-toggle',
root: 'mat-slide-toggle',
input: '.mat-mdc-slide-toggle-input',
checked: 'mat-mdc-slide-toggle-checked'
}
},
Selection: {
list: {
root: 'mat-selection-list'
}
},
Sidenav: {
root: 'mat-sidenav'
},
Snackbar: {
container: {
class: '.mat-mdc-snack-bar-container'
}
},
Sort: {
header: {
container: '.mat-mdc-sort-header-container'
}
},
Spinner: {
root: 'mat-spinner'
},
Tab: {
disabled: '.mat-mdc-tab-disabled',
header: {
class: '.mat-mdc-tab-header',
pagination: {
after: '.mat-mdc-tab-header-pagination-after',
before: '.mat-mdc-tab-header-pagination-before',
chevron: '.mat-mdc-tab-header-pagination-chevron'
}
},
body: {
active: '.mat-mdc-tab-body-active',
content: '.mat-mdc-tab-body-content'
},
label: {
class: '.mdc-tab',
root: 'mat-tab-label',
active: {
class: '.mdc-tab--active',
root: 'mat-tab-label-active'
},
content: {
class: '.mdc-tab__content',
root: 'mat-tab-label-content'
}
},
labels: {
class: '.mdc-tab__text-label',
container: {
class: '.mat-mdc-tab-labels'
}
},
list: '.mat-mdc-tab-list'
},
Table: {
class: '.mat-mdc-table',
root: 'mat-table',
row: {
root: 'mat-row',
class: '.mat-mdc-row'
},
cell: {
class: '.mat-mdc-cell',
root: 'mat-cell'
},
column: (matColumn: string) => `.mat-mdc-column-${matColumn}`
},
Toolbar: {
root: 'mat-toolbar',
class: '.mat-mdc-toolbar'
},
Tooltip: {
root: 'mat-tooltip-component',
class: '.mat-mdc-tooltip',
trigger: '.mat-mdc-tooltip-trigger'
},
Tree: {
root: 'mat-tree',
node: {
root: 'mat-tree-node'
}
}
};

View File

@ -1,26 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export * from './material-locators';
export * from './tabs.page';
export * from './date-picker-calendar.page';
export * from './date-time-picker.page';
export * from './date-picker.page';
export * from './date-time-picker-calendar.page';
export * from './dropdown.page';
export * from './toggle.page';
export * from './checkbox.page';

View File

@ -1,46 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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, $$ } from 'protractor';
import { BrowserActions } from '../../utils/browser-actions';
import { BrowserVisibility } from '../../utils/browser-visibility';
import { materialLocators } from './material-locators';
export class TabsPage {
tabs = $$(`div[id*='${materialLocators.Tab.label.root}']`);
async clickTabByTitle(tabTitle): Promise<void> {
const tab = element(by.cssContainingText(`div[id*='${materialLocators.Tab.label.root}']`, tabTitle));
await BrowserActions.click(tab);
}
async checkTabIsSelectedByTitle(tabTitle): Promise<void> {
const tab = element(by.cssContainingText(`div[id*='${materialLocators.Tab.label.root}']`, tabTitle));
const result: string = await BrowserActions.getAttribute(tab, 'aria-selected');
expect(result).toBe('true');
}
async getNoOfTabs(): Promise<number> {
await BrowserVisibility.waitUntilElementIsVisible(this.tabs.first());
return this.tabs.count();
}
async getTabsLabels(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.tabs.first());
return this.tabs.getText();
}
}

View File

@ -1,39 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { ElementFinder } from 'protractor';
import { BrowserActions } from '../../utils/browser-actions';
import { materialLocators } from './material-locators';
export class TogglePage {
async enableToggle(toggle: ElementFinder): Promise<void> {
const slideToggle = await BrowserActions.getAttribute(toggle, 'class');
if (slideToggle.indexOf(materialLocators.Slide.toggle.checked) < 0) {
const elem = toggle.$$('button').first();
await BrowserActions.clickScript(elem);
}
}
async disableToggle(toggle: ElementFinder): Promise<void> {
const slideToggle = await BrowserActions.getAttribute(toggle, 'class');
if (slideToggle.indexOf(materialLocators.Slide.toggle.checked) >= 0) {
const elem = toggle.$$('button').first();
await BrowserActions.clickScript(elem);
}
}
}

View File

@ -1,147 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { by, element, browser, $, $$ } from 'protractor';
import { BrowserVisibility } from '../utils/browser-visibility';
import { BrowserActions } from '../utils/browser-actions';
import { Logger } from '../utils/logger';
import { materialLocators } from './public-api';
export class PaginationPage {
pageSelectorDropDown = $('div[class*="adf-pagination__page-selector"]');
pageSelectorArrow = $('button[data-automation-id="page-selector"]');
itemsPerPage = $('.adf-pagination__max-items');
itemsPerPageOpenDropdown = $('.adf-pagination__perpage-block button');
itemsPerPageOptions = $$(`.adf-pagination__page-selector ${materialLocators.Menu.item.class}`);
currentPage = $('.adf-pagination__current-page');
totalPages = $('.adf-pagination__total-pages');
paginationRange = $('.adf-pagination__range');
nextPageButton = $('button[class*="adf-pagination__next-button"]');
nextButtonDisabled = $('button[class*="adf-pagination__next-button"][disabled]');
previousButtonDisabled = $('button[class*="adf-pagination__previous-button"][disabled]');
pageDropDown = $('div[class*="adf-pagination__actualinfo-block"] button');
pageDropDownOptions = $$(`div[class*="${materialLocators.Menu.content.root}"] button`);
paginationSection = $('adf-pagination');
paginationSectionEmpty = $('adf-pagination[class*="adf-pagination__empty"]');
totalFiles = $('.adf-pagination__range');
async selectItemsPerPage(numberOfItem: string): Promise<void> {
await BrowserActions.clickExecuteScript(`div[class*="adf-pagination__perpage-block"] button`);
await BrowserVisibility.waitUntilElementIsVisible(this.pageSelectorDropDown);
const itemsPerPage = element.all(by.cssContainingText(materialLocators.Menu.item.class, numberOfItem)).first();
await BrowserVisibility.waitUntilElementIsPresent(itemsPerPage);
await BrowserActions.click(itemsPerPage);
await BrowserVisibility.waitUntilElementIsNotVisible(this.pageSelectorDropDown);
Logger.log('Select page size ', numberOfItem);
await browser.sleep(500);
}
async checkPageSelectorIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.pageSelectorArrow);
}
async checkPageSelectorIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.pageSelectorArrow);
}
async clickItemsPerPageDropdown(): Promise<void> {
await BrowserActions.clickScript(this.itemsPerPageOpenDropdown);
}
async checkPaginationIsNotDisplayed() {
await BrowserVisibility.waitUntilElementIsVisible(this.paginationSectionEmpty);
}
async getCurrentItemsPerPage(): Promise<string> {
return BrowserActions.getText(this.itemsPerPage);
}
async getCurrentPage(): Promise<string> {
return BrowserActions.getText(this.currentPage);
}
async getTotalPages(): Promise<string> {
return BrowserActions.getText(this.totalPages);
}
async getPaginationRange(): Promise<string> {
return BrowserActions.getText(this.paginationRange);
}
async clickOnNextPage(): Promise<void> {
Logger.log('Next page');
return BrowserActions.click(this.nextPageButton);
}
async clickOnPageDropdown(): Promise<void> {
await BrowserActions.click(this.pageDropDown);
Logger.log('Click page dropdown');
}
async clickOnPageDropdownOption(numberOfItemPerPage: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.pageDropDownOptions.first());
const option = element(by.cssContainingText(`div[class*="${materialLocators.Menu.content.root}"] button`, numberOfItemPerPage));
await BrowserActions.click(option);
}
async getPageDropdownOptions() {
await BrowserVisibility.waitUntilElementIsVisible(this.pageDropDownOptions.first());
const initialList = [];
await this.pageDropDownOptions.each(async (currentOption) => {
const text = await BrowserActions.getText(currentOption);
if (text !== '') {
initialList.push(text);
}
});
return initialList;
}
async getItemsPerPageDropdownOptions() {
await BrowserVisibility.waitUntilElementIsVisible(this.itemsPerPageOptions.first());
const initialList = [];
await this.itemsPerPageOptions.each(async (currentOption) => {
const text = await BrowserActions.getText(currentOption);
if (text !== '') {
initialList.push(text);
}
});
return initialList;
}
async checkNextPageButtonIsDisabled(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.nextButtonDisabled);
}
async checkPreviousPageButtonIsDisabled(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.previousButtonDisabled);
}
async checkNextPageButtonIsEnabled(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.nextButtonDisabled);
}
async checkPreviousPageButtonIsEnabled(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.previousButtonDisabled);
}
async getTotalNumberOfFiles() {
await BrowserVisibility.waitUntilElementIsVisible(this.totalFiles);
const totalNumberOfFiles = await BrowserActions.getText(this.totalFiles);
return totalNumberOfFiles.split('of ')[1];
}
}

View File

@ -1,33 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export * from './bread-crumb.page';
export * from './header.page';
export * from './user-info.page';
export * from './login.page';
export { LoginPage as LoginSSOPage } from './login.page';
export * from './data-table-component.page';
export * from './pagination.page';
export * from './form/public-api';
export * from './material/public-api';
export * from './card-view/public-api';
export * from './viewer.page';
export * from './snackbar.page';
export * from './data-table/public-api';
export * from './context-menu.page';

View File

@ -1,70 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { $, $$ } from 'protractor';
import { BrowserVisibility } from '../utils/browser-visibility';
import { BrowserActions } from '../utils/browser-actions';
/** @deprecated Use Playwright API instead */
export class SnackbarPage {
notificationSnackBar = $$(`[data-automation-id='adf-snackbar-message-content']`).first();
snackBarAction = $(`[data-automation-id='adf-snackbar-message-content-action-button']`);
snackBarContainerCss = $$('adf-snackbar-content');
decorativeIconSnackBar = $(`[data-automation-id='adf-snackbar-decorative-icon']`);
async waitForSnackBarToAppear(timeout = 5000) {
return BrowserVisibility.waitUntilElementIsVisible(this.snackBarContainerCss.first(), timeout,
'snackbar did not appear'
);
}
async waitForSnackBarToClose(timeout = 15000) {
return BrowserVisibility.waitUntilElementIsNotVisible(this.snackBarContainerCss.first(), timeout);
}
async getSnackBarMessage(): Promise<string> {
await this.waitForSnackBarToAppear();
return this.notificationSnackBar.getText();
}
/** @deprecated Use Playwright API instead */
async getSnackBarActionMessage(): Promise<string> {
await this.waitForSnackBarToAppear();
return this.snackBarAction.getText();
}
async getSnackBarDecorativeIcon(): Promise<string> {
await this.waitForSnackBarToAppear();
return this.decorativeIconSnackBar.getText();
}
/** @deprecated Use Playwright API instead */
async clickSnackBarAction(): Promise<void> {
await this.waitForSnackBarToAppear();
await BrowserActions.click(this.snackBarAction);
}
async isNotificationSnackBarDisplayed(): Promise<boolean> {
try {
await BrowserVisibility.waitUntilElementIsVisible(this.notificationSnackBar, 2000);
return true;
} catch {
return false;
}
}
}

View File

@ -1,54 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { $, $$ } from 'protractor';
import { BrowserVisibility } from '../utils/browser-visibility';
import { BrowserActions } from '../utils/browser-actions';
import { materialLocators } from './public-api';
export class UserInfoPage {
dialog = $$(`${materialLocators.Card.root}[class*="adf-userinfo-card"]`).first();
userInfoSsoHeaderTitle = this.dialog.$('div[id="identity-username"]');
userInfoSsoTitle = $('.adf-userinfo__detail-title');
ssoEmail = $('#identity-email');
userProfileButton = $('button[data-automation-id="adf-user-profile"]');
async dialogIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.dialog);
}
async clickUserProfile(): Promise<void> {
await BrowserActions.click(this.userProfileButton);
}
async getSsoHeaderTitle(): Promise<string> {
return BrowserActions.getText(this.userInfoSsoHeaderTitle);
}
async getSsoTitle(): Promise<string> {
return BrowserActions.getText(this.userInfoSsoTitle);
}
async getSsoEmail(): Promise<string> {
return BrowserActions.getText(this.ssoEmail);
}
async closeUserProfile(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.dialog);
await BrowserActions.closeMenuAndDialogs();
}
}

View File

@ -1,347 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { BrowserActions } from '../utils/browser-actions';
import { TabsPage } from './material/tabs.page';
import { BrowserVisibility } from '../utils/browser-visibility';
import { element, by, browser, protractor, $, $$ } from 'protractor';
import { Logger } from '../utils/logger';
import { materialLocators } from './public-api';
const MAX_LOADING_TIME = 120000;
export class ViewerPage {
tabsPage = new TabsPage();
closeButton = $('button.adf-viewer-close-button');
fileName = $('#adf-viewer-display-name');
infoButton = $('button[data-automation-id="adf-toolbar-sidebar"]');
previousPageButton = $('#viewer-previous-page-button');
nextPageButton = $('#viewer-next-page-button');
zoomInButton = $('#viewer-zoom-in-button');
zoomOutButton = $('#viewer-zoom-out-button');
scalePageButton = $('#viewer-scale-page-button');
fullScreenButton = $('button[data-automation-id="adf-toolbar-fullscreen"]');
scaleImg = $('button[id="viewer-reset-button"]');
fileThumbnail = $('img[data-automation-id="adf-file-thumbnail"]');
pageSelectorInput = $('input[data-automation-id="adf-page-selector"]');
imgContainer = $('div[data-automation-id="adf-image-container"]');
mediaContainer = $('.adf-media-player');
percentage = $('div[data-automation-id="adf-page-scale"]');
thumbnailsBtn = $('button[data-automation-id="adf-thumbnails-button"]');
thumbnailsContent = $('div[data-automation-id="adf-thumbnails-content"]');
thumbnailsClose = $('button[data-automation-id="adf-thumbnails-close"]');
secondThumbnail = $('adf-pdf-thumb > img[title="Page 2"]');
lastThumbnailDisplayed = $$('adf-pdf-thumb').last();
infoSideBar = $('#adf-right-sidebar');
viewer = $('adf-viewer');
imgViewer = $('adf-img-viewer');
activeTab = $(`div${materialLocators.Tab.label.active.class}`);
toolbar = $('#adf-viewer-toolbar');
canvasLayer = $$('.canvasWrapper > canvas').first();
pdfPageLoaded = $('[data-page-number="1"][data-loaded="true"], adf-img-viewer, adf-txt-viewer');
downloadButton = $('#adf-alfresco-viewer-download');
unknownFormat = $(`adf-viewer-unknown-format .adf-viewer__unknown-format-view`);
async viewFile(fileName: string): Promise<void> {
const fileView = $$(`#document-list-container div[data-automation-id="${fileName}"]`).first();
await BrowserActions.click(fileView);
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
await this.waitTillContentLoaded();
}
async waitTillContentLoaded(): Promise<void> {
await browser.sleep(500);
if (await this.isSpinnerPresent()) {
Logger.log('wait spinner disappear');
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.tagName(materialLocators.Progress.spinner.root)), MAX_LOADING_TIME);
} else {
try {
Logger.log('wait spinner is present');
await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName(materialLocators.Progress.spinner.root)));
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.tagName(materialLocators.Progress.spinner.root)), MAX_LOADING_TIME);
} catch (error) {
Logger.error('Spinner is not present');
}
}
}
async clearPageNumber(): Promise<void> {
await BrowserActions.clearSendKeys(this.pageSelectorInput);
}
async getZoom(): Promise<string> {
return BrowserActions.getText(this.percentage);
}
async getCanvasWidth(): Promise<string> {
return BrowserActions.getAttribute(this.canvasLayer, `width`);
}
async getCanvasHeight(): Promise<string> {
return BrowserActions.getAttribute(this.canvasLayer, `height`);
}
async getDisplayedFileName(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.fileName);
return BrowserActions.getText(this.fileName);
}
async exitFullScreen(): Promise<void> {
const jsCode = 'document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();';
await browser.executeScript(jsCode);
}
async checkFileIsLoaded(fileName?: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.pdfPageLoaded, 60000, `${fileName} not loaded`);
}
async checkImgViewerIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.imgViewer);
}
async checkAllThumbnailsDisplayed(nbPages): Promise<void> {
const defaultThumbnailHeight = 143;
expect(await BrowserActions.getAttribute(this.thumbnailsContent, 'style')).toEqual(
'height: ' + nbPages * defaultThumbnailHeight + 'px; transform: translate(-50%, 0px);'
);
}
async checkCurrentThumbnailIsSelected(): Promise<void> {
const selectedThumbnail = $('adf-pdf-thumb.adf-pdf-thumbnails__thumb.adf-pdf-thumbnails__thumb--selected > img');
const pageNumber = await BrowserActions.getInputValue(this.pageSelectorInput);
expect('Page ' + pageNumber).toEqual(await BrowserActions.getAttribute(selectedThumbnail, 'title'));
}
async checkThumbnailsCloseIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.thumbnailsClose);
}
async checkThumbnailsBtnIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.thumbnailsBtn);
}
async checkThumbnailsBtnIsDisabled(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible($('button[data-automation-id="adf-thumbnails-button"]:disabled'));
}
async checkThumbnailsContentIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.thumbnailsContent);
}
async checkThumbnailsContentIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.thumbnailsContent);
}
async checkCloseButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.closeButton);
}
async checkDownloadButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.downloadButton);
}
async checkInfoButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.infoButton);
}
async checkFileThumbnailIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.fileThumbnail);
}
async checkFileNameIsDisplayed(filename: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.fileName);
await BrowserVisibility.waitUntilElementHasText(this.fileName, filename);
}
async checkPreviousPageButtonIsDisplayed() {
await BrowserVisibility.waitUntilElementIsVisible(this.previousPageButton);
}
async checkNextPageButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.nextPageButton);
}
async checkZoomInButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.zoomInButton);
}
async checkZoomInButtonIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.zoomInButton);
}
async checkZoomOutButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.zoomOutButton);
}
async checkScalePageButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.scalePageButton);
}
async checkPageSelectorInputIsDisplayed(checkNumber: string): Promise<void> {
expect(await BrowserActions.getInputValue(this.pageSelectorInput)).toEqual(checkNumber);
}
async checkImgContainerIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.imgContainer);
}
async checkMediaPlayerContainerIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.mediaContainer);
}
async checkFileContent(pageNumber: string, text: string): Promise<void> {
const allPages = this.canvasLayer;
const pageLoaded = $$('div[data-page-number="' + pageNumber + '"][data-loaded="true"]').first();
const textLayerLoaded = $$('div[data-page-number="' + pageNumber + '"] .textLayer').first();
const specificText = element.all(by.cssContainingText('div[data-page-number="' + pageNumber + '"] .textLayer', text)).first();
await BrowserVisibility.waitUntilElementIsVisible(allPages);
await BrowserVisibility.waitUntilElementIsVisible(pageLoaded);
await BrowserVisibility.waitUntilElementIsVisible(textLayerLoaded);
await BrowserVisibility.waitUntilElementIsVisible(specificText);
}
async checkFullScreenButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.fullScreenButton);
}
async checkPercentageIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.percentage);
}
async checkZoomedIn(zoom): Promise<void> {
expect(await BrowserActions.getText(this.percentage)).toBeGreaterThan(zoom);
}
async checkZoomedOut(zoom): Promise<void> {
expect(await BrowserActions.getText(this.percentage)).toBeLessThan(zoom);
}
async checkScaleImgButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.scaleImg);
}
async checkInfoSideBarIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.infoSideBar);
}
async checkInfoSideBarIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.infoSideBar);
}
async clickInfoButton(): Promise<void> {
await BrowserActions.click($('button[data-automation-id="adf-toolbar-sidebar"]'));
}
async clickOnTab(tabName: string): Promise<void> {
await this.tabsPage.clickTabByTitle(tabName);
}
async checkTabIsActive(tabName: string): Promise<void> {
const materialLocatorPart = `div${materialLocators.Tab.label.active.class} ${materialLocators.Tab.label.content.class}`;
const tab = element(by.cssContainingText(`.adf-info-drawer-layout-content ${materialLocatorPart}`, tabName));
await BrowserVisibility.waitUntilElementIsVisible(tab);
}
async clickSecondThumbnail(): Promise<void> {
await BrowserActions.click(this.secondThumbnail);
}
async clickLastThumbnailDisplayed(): Promise<void> {
await BrowserActions.click(this.lastThumbnailDisplayed);
}
async clickThumbnailsClose(): Promise<void> {
await BrowserActions.click(this.thumbnailsClose);
}
async clickThumbnailsBtn(): Promise<void> {
await BrowserActions.click(this.thumbnailsBtn);
}
async clickDownloadButton(): Promise<void> {
await BrowserActions.click(this.downloadButton);
}
async clickCloseButton(): Promise<void> {
await BrowserActions.click(this.closeButton);
}
async clickPreviousPageButton(): Promise<void> {
await BrowserActions.click(this.previousPageButton);
}
async clickNextPageButton(): Promise<void> {
await BrowserActions.click(this.nextPageButton);
}
async clickZoomInButton(): Promise<void> {
await BrowserActions.click(this.zoomInButton);
}
async clickZoomOutButton(): Promise<void> {
await BrowserActions.click(this.zoomOutButton);
}
async clickActualSize(): Promise<void> {
await BrowserActions.click(this.scalePageButton);
}
async clickFullScreenButton(): Promise<void> {
await BrowserActions.click(this.fullScreenButton);
}
async getActiveTab(): Promise<string> {
return BrowserActions.getText(this.activeTab);
}
async clickOnCommentsTab(): Promise<void> {
await this.tabsPage.clickTabByTitle('Comments');
}
async checkToolbarIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.toolbar);
}
async checkUnknownFormatIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.unknownFormat);
}
async getUnknownFormatMessage(): Promise<string> {
const unknownFormatLabel = this.unknownFormat.$(`.adf-viewer__unknown-label`);
return BrowserActions.getText(unknownFormatLabel);
}
async expectUrlToContain(text: string): Promise<void> {
expect(browser.getCurrentUrl()).toContain(text);
}
private async isSpinnerPresent(): Promise<boolean> {
let isSpinnerPresent;
try {
isSpinnerPresent = await element(by.tagName(materialLocators.Progress.spinner.root)).isDisplayed();
} catch (error) {
isSpinnerPresent = false;
}
return isSpinnerPresent;
}
}

View File

@ -1,23 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/
export * from './actions/public-api';
export * from './pages/public-api';
export * from './models/public-api';
export * from './dialog/public-api';
export * from './utils/public-api';
export * from './test-element';

Some files were not shown because too many files have changed in this diff Show More