* fix protractor conf

* remove update env

* fix cli error script cs

* change screenshot plugin

* remove unused param

* fix

* fix

* fix

* moment comment nvm

* fix

* fix

* fix

* fix

* remove adf redirect

* fix

* fix

* save remote report

* report fix

* improve save result

* fix folder save

* fix folder save

* fix placeholder pointer , they needs refactor later

* fix

* fix lint

* fix

* remove test already covered by unit
fix the test in core needed
exclude the one impossible to make it works without APS basic support

* lint

* fix some logout missing

* fix

* Fix the custom-tasks-filters.e2e

* fix lint

* fix

* fix

* fix

* Fix wait on start process  and on process definition options

* Fix logout before login again

* fix uplaod test

* fix

* Fix infodrawer with check detail and sleep

* lint

* increase list of excluded test

* fix

* fix lint

* change wait method datatable

* fix

* fix

* revert check value

* fix

* fix

* change tag test

Co-authored-by: maurizio vitale <maurizio.vitale@alfresco.com>
This commit is contained in:
Eugenio Romano
2020-09-04 13:27:55 +01:00
committed by GitHub
parent f17270621b
commit a630cfb390
132 changed files with 1109 additions and 1850 deletions

View File

@@ -31,14 +31,14 @@ async function checkEnv() {
});
await alfrescoJsApi.login(program.username, program.password);
} catch (e) {
} catch (error) {
console.log('Login error environment down or inaccessible');
counter++;
if (MAX_RETRY === counter) {
console.log('Give up');
process.exit(1);
} else {
console.log(`Retry in 1 minute attempt N ${counter}`);
console.log(`Retry in 1 minute attempt N ${counter}`, error);
sleep(TIMEOUT);
checkEnv();
}
@@ -74,8 +74,8 @@ async function checkDiskSpaceFullEnv() {
'overwrite': true
});
}
let pathFile = path.join(__dirname, '../', 'README.md');
let pathFile = path.join(__dirname, '../../', 'README.md');
let file = fs.createReadStream(pathFile);
let uploadedFile = await alfrescoJsApi.upload.uploadFile(
@@ -94,6 +94,8 @@ async function checkDiskSpaceFullEnv() {
} catch (error) {
counter++;
console.log('error', error);
if (MAX_RETRY === counter) {
console.log('=============================================================');
console.log('================ Not able to upload a file ==================');
@@ -101,7 +103,7 @@ async function checkDiskSpaceFullEnv() {
console.log('=============================================================');
process.exit(1);
} else {
console.log(`Retry in 1 minute attempt N ${counter}`);
console.log(`Retry in 1 minute attempt N ${counter}`, error);
sleep(TIMEOUT);
checkDiskSpaceFullEnv();
}

View File

@@ -65,20 +65,24 @@ async function healthCheck(nameService: string) {
logger.info(`${nameService} is UP!`);
}
} catch (error) {
logger.error(`${nameService} is not reachable ${error.status} `);
logger.error(`${nameService} is not reachable error: `, error);
isValid = false;
}
}
function getApplicationByStatus(status: string) {
async function getApplicationByStatus(status: string) {
const url = `${args.host}/deployment-service/v1/applications/`;
const pathParams = {}, queryParams = { status: status },
headerParams = {}, formParams = {}, bodyParam = {},
contentTypes = ['application/json'], accepts = ['application/json'];
try {
await alfrescoJsApiDevops.login(args.devopsUsername, args.devopsPassword);
return alfrescoJsApiDevops.oauth2Auth.callCustomApi(url, 'GET', pathParams, queryParams, headerParams, formParams, bodyParam,
contentTypes, accepts);
contentTypes, accepts).on('error',(error)=>{
logger.error(`Get application by status ${error} `);
});
} catch (error) {
logger.error(`Get application by status ${error.status} `);
@@ -203,6 +207,7 @@ function deploy(model: any) {
function getAlfrescoJsApiInstance(configArgs: ConfigArgs) {
const config = {
provider: 'BPM',
hostEcm: `${configArgs.host}`,
hostBpm: `${configArgs.host}`,
authType: 'OAUTH',
oauth2: {
@@ -395,6 +400,11 @@ async function main(configArgs: ConfigArgs) {
}
alfrescoJsApiModeler = getAlfrescoJsApiInstance(args);
AAE_MICROSERVICES.map(async (serviceName) => {
await healthCheck(serviceName);
});
await alfrescoJsApiModeler.login(args.modelerUsername, args.modelerPassword).then(() => {
logger.info('login SSO ok');
}, (error) => {
@@ -402,10 +412,6 @@ async function main(configArgs: ConfigArgs) {
process.exit(1);
});
AAE_MICROSERVICES.map(async (serviceName) => {
await healthCheck(serviceName);
});
if (isValid) {
logger.error('The environment is up and running');
alfrescoJsApiDevops = getAlfrescoJsApiInstance(args);

View File

@@ -24,7 +24,7 @@
</data-column>
<data-column key="email" class="adf-full-width">
<ng-template let-entry="$implicit">
<div class="adf-people-full-name">{{ getDisplayUser(entry.row.obj.firstName, entry.row.obj.lastName, ' ') }}</div>
<div data-automation-id="adf-people-full-name" class="adf-people-full-name">{{ getDisplayUser(entry.row.obj.firstName, entry.row.obj.lastName, ' ') }}</div>
</ng-template>
</data-column>
</data-columns>

View File

@@ -41,8 +41,8 @@
<data-column key="email" class="adf-full-width">
<ng-template let-entry="$implicit">
<div class="adf-people-user-info">
<div class="adf-people-full-name">{{ getDisplayUser(entry.row.obj.firstName, entry.row.obj.lastName, ' ') }}</div>
<div class="adf-people-email">{{ entry.row.obj.email }}</div>
<div data-automation-id="adf-people-full-name" class="adf-people-full-name">{{ getDisplayUser(entry.row.obj.firstName, entry.row.obj.lastName, ' ') }}</div>
<div data-automation-id="adf-people-email" class="adf-people-email">{{ entry.row.obj.email }}</div>
</div>
</ng-template>
</data-column>

View File

@@ -8,7 +8,6 @@
"@alfresco/js-api": "@alfresco/js-api",
"moment-es6": "moment-es6",
"protractor": "protractor",
"selenium-webdriver/remote": "selenium-webdriver/remote",
"selenium-webdriver": "selenium-webdriver",
"fs": "fs",
"path": "path"

View File

@@ -15,8 +15,7 @@
* limitations under the License.
*/
import { by, element, browser } from 'protractor';
import * as remote from 'selenium-webdriver/remote';
import { by, element } from 'protractor';
import { DocumentListPage } from '../pages/document-list.page';
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { BrowserActions } from '../../core/utils/browser-actions';
@@ -137,7 +136,6 @@ export class ContentNodeSelectorDialogPage {
await this.dataTable.waitForTableBody();
await this.breadcrumbDropdownPage.checkCurrentFolderIsDisplayed();
await browser.setFileDetector(new remote.FileDetector());
const uploadButton = element(by.css('adf-upload-button input'));
await BrowserVisibility.waitUntilElementIsPresent(uploadButton);
await uploadButton.sendKeys(fileLocation);

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { by, element, ElementFinder, browser } from 'protractor';
import { Locator, by, element, ElementFinder, browser } from 'protractor';
import { DataTableComponentPage } from '../../core/pages/data-table-component.page';
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { BrowserActions } from '../../core/utils/browser-actions';
@@ -23,7 +23,7 @@ import { BrowserActions } from '../../core/utils/browser-actions';
export class DocumentListPage {
rootElement: ElementFinder;
optionButton = by.css('button[data-automation-id*="action_menu_"]');
optionButton: Locator = by.css('button[data-automation-id*="action_menu_"]');
tableBody: ElementFinder;
dataTable: DataTableComponentPage;

View File

@@ -15,17 +15,17 @@
* limitations under the License.
*/
import { element, by, ElementFinder, browser } from 'protractor';
import { Locator, element, by, ElementFinder, browser } from 'protractor';
import { BrowserActions } from '../../../core/utils/browser-actions';
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
export class SearchCheckListPage {
filter: ElementFinder;
inputBy = by.css('div[class*="mat-expansion-panel-content"] input');
showMoreBy = by.css('button[title="Show more"]');
showLessBy = by.css('button[title="Show less"]');
clearAllButton = by.css('button');
inputBy: Locator = by.css('div[class*="mat-expansion-panel-content"] input');
showMoreBy: Locator = by.css('button[title="Show more"]');
showLessBy: Locator = by.css('button[title="Show less"]');
clearAllButton: Locator = by.css('button');
constructor(filter: ElementFinder) {
this.filter = filter;

View File

@@ -15,16 +15,16 @@
* limitations under the License.
*/
import { browser, by, ElementFinder } from 'protractor';
import { Locator, browser, by, ElementFinder } from 'protractor';
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
import { BrowserActions } from '../../../core/utils/browser-actions';
export class SearchSliderPage {
filter: ElementFinder;
slider = by.css('mat-slider[data-automation-id="slider-range"]');
clearButton = by.css('button[data-automation-id="slider-btn-clear"]');
sliderWithThumbLabel = by.css('mat-slider[data-automation-id="slider-range"][class*="mat-slider-thumb-label-showing"]');
slider: Locator = by.css('mat-slider[data-automation-id="slider-range"]');
clearButton: Locator = by.css('button[data-automation-id="slider-btn-clear"]');
sliderWithThumbLabel: Locator = by.css('mat-slider[data-automation-id="slider-range"][class*="mat-slider-thumb-label-showing"]');
constructor(filter: ElementFinder) {
this.filter = filter;

View File

@@ -39,12 +39,16 @@ export class ApiService {
constructor(clientIdOrAppConfig?: AlfrescoApiConfig | string, host?: string, hostSso?: string, provider?: string) {
if (browser.params.testConfig && browser.params.testConfig.appConfig) {
Logger.log('Get Config ApiService from browser params');
this.config = { ...browser.params.testConfig.appConfig };
this.config.hostEcm = browser.params.testConfig.appConfig.ecmHost;
this.config.hostBpm = browser.params.testConfig.appConfig.bpmHost;
}
if (clientIdOrAppConfig && typeof clientIdOrAppConfig !== 'string') {
Logger.log('overwrite ApiService config param');
this.config = { ...this.config, ...clientIdOrAppConfig };
this.config.hostEcm = clientIdOrAppConfig.hostEcm ? clientIdOrAppConfig.hostEcm : this.config.hostEcm;
@@ -54,6 +58,8 @@ export class ApiService {
}
if (hostSso) {
Logger.log('overwrite ApiService hostSso param');
this.config.oauth2.host = hostSso;
}

View File

@@ -18,7 +18,6 @@ import { browser, ElementFinder } from 'protractor';
import * as path from 'path';
import * as fs from 'fs';
import * as remote from 'selenium-webdriver/remote';
import { BrowserActions } from '../utils/browser-actions';
const JS_BIND_INPUT = function(target) {
@@ -78,8 +77,6 @@ const JS_BIND_INPUT_FOLDER = function(target) {
export class DropActions {
static async dropFile(dropArea, filePath) {
browser.setFileDetector(new remote.FileDetector());
const absolutePath = path.resolve(path.join(browser.params.testConfig.main.rootPath, filePath));
fs.accessSync(absolutePath, fs.constants.F_OK);
@@ -89,8 +86,6 @@ export class DropActions {
}
static async dropFolder(dropArea, folderPath) {
browser.setFileDetector(new remote.FileDetector());
const absolutePath = path.resolve(path.join(browser.params.testConfig.main.rootPath, folderPath));
fs.accessSync(absolutePath, fs.constants.F_OK);

View File

@@ -17,7 +17,6 @@
import * as path from 'path';
import * as fs from 'fs';
import * as remote from 'selenium-webdriver/remote';
import { browser } from 'protractor';
import { ImageUploadRepresentation, UserRepresentation } from '@alfresco/js-api';
@@ -99,6 +98,11 @@ export class UsersActions {
return user;
}
async createUserWithName(firstName: string, lastName: string): Promise<UserModel> {
const user = new UserModel({ firstName: firstName, lastName: lastName});
return this.createUser(user);
}
async createTenantAndUser(email?: string, firstName?: string, lastName?: string, password?: string): Promise<UserRepresentation> {
const newTenant = await this.api.apiService.activiti.adminTenantsApi.createTenant(new Tenant());
@@ -127,8 +131,6 @@ export class UsersActions {
}
async changeProfilePictureAps(fileLocation: string): Promise<ImageUploadRepresentation> {
browser.setFileDetector(new remote.FileDetector());
const pathFile = path.join(browser.params.testConfig.main.rootPath + fileLocation);
const file = fs.createReadStream(pathFile);

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { element, by, ElementFinder } from 'protractor';
import { Locator, element, by, ElementFinder } from 'protractor';
import { DateTimePickerPage } from '../material/date-time-picker.page';
import { DatePickerPage } from '../material/date-picker.page';
import { BrowserVisibility } from '../../utils/browser-visibility';
@@ -26,10 +26,10 @@ export class CardDateItemPage {
dateTimePickerPage: DateTimePickerPage;
datePickerPage = new DatePickerPage();
labelLocator = by.css('div[data-automation-id*="card-dateitem-label"]');
valueLocator = by.css('span[data-automation-id*="card-date"]');
labelLocator: Locator = by.css('div[data-automation-id*="card-dateitem-label"]');
valueLocator: Locator = by.css('span[data-automation-id*="card-date"]');
dateTimePicker = element.all(by.css('.mat-datetimepicker-toggle')).first();
saveButton = by.css('button[data-automation-id*="card-dateitem-update"]');
saveButton: Locator = by.css('button[data-automation-id*="card-dateitem-update"]');
constructor(label: string = 'minDate') {
this.rootElement = element(by.xpath(`//div[contains(@data-automation-id, "label-${label}")]/ancestor::adf-card-view-dateitem`));

View File

@@ -15,19 +15,19 @@
* limitations under the License.
*/
import { element, by, ElementFinder, Key } from 'protractor';
import { Locator, element, by, ElementFinder, Key } from 'protractor';
import { BrowserActions, BrowserVisibility } from '../../utils/public-api';
export class CardTextItemPage {
rootElement: ElementFinder;
textField = by.css('[data-automation-id*="card-textitem-value"]');
saveButton = by.css('button[data-automation-id*="card-textitem-update"]');
clearButton = by.css('button[data-automation-id*="card-textitem-reset"]');
field = by.css('[data-automation-id*="card-textitem-value"]');
labelLocator = by.css('div[data-automation-id*="card-textitem-label"]');
errorMessage = by.css('.adf-textitem-editable-error');
clickableElement = by.css('.adf-textitem-clickable');
readOnlyField = by.css('.adf-property-read-only');
textField: Locator = by.css('[data-automation-id*="card-textitem-value"]');
saveButton: Locator = by.css('button[data-automation-id*="card-textitem-update"]');
clearButton: Locator = by.css('button[data-automation-id*="card-textitem-reset"]');
field: Locator = by.css('[data-automation-id*="card-textitem-value"]');
labelLocator: Locator = by.css('div[data-automation-id*="card-textitem-label"]');
errorMessage: Locator = by.css('.adf-textitem-editable-error');
clickableElement: Locator = by.css('.adf-textitem-clickable');
readOnlyField: Locator = by.css('.adf-property-read-only');
constructor(label: string = 'assignee') {
this.rootElement = element(by.xpath(`//div[contains(@data-automation-id, "label-${label}")]/ancestor::adf-card-view-textitem`));

View File

@@ -15,9 +15,10 @@
* limitations under the License.
*/
import { browser, by, element, protractor, ElementFinder, ElementArrayFinder } from 'protractor';
import { Locator, browser, by, element, protractor, ElementFinder, ElementArrayFinder } from 'protractor';
import { BrowserVisibility } from '../utils/browser-visibility';
import { BrowserActions } from '../utils/browser-actions';
import { Logger } from '../utils/logger';
export class DataTableComponentPage {
@@ -25,7 +26,7 @@ export class DataTableComponentPage {
list: ElementArrayFinder;
contents: ElementArrayFinder;
tableBody: ElementFinder;
rows = by.css(`adf-datatable div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row']`);
rows: Locator = by.css(`adf-datatable div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row']`);
allColumns: ElementArrayFinder;
selectedRowNumber: ElementFinder;
allSelectedRows: ElementArrayFinder;
@@ -177,7 +178,12 @@ export class DataTableComponentPage {
}
async numberOfRows(): Promise<number> {
return this.rootElement.all(this.rows).count();
try {
await this.waitForFirstRow();
return this.rootElement.all(this.rows).count();
} catch (e) {
return 0;
}
}
async waitForFirstRow(): Promise<void> {
@@ -186,7 +192,7 @@ export class DataTableComponentPage {
async getAllRowsColumnValues(column: string): Promise<string[]> {
let columnValues: string[] = [];
const columnLocator = by.css("adf-datatable div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row'] div[title='" + column + "'] span");
const columnLocator: Locator = by.css("adf-datatable div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row'] div[title='" + column + "'] span");
try {
await BrowserVisibility.waitUntilElementIsPresent(element.all(columnLocator).first(), 1000);
@@ -200,7 +206,7 @@ export class DataTableComponentPage {
}
async getRowsWithSameColumnValues(columnName: string, columnValue: string) {
const columnLocator = by.css(`div[title='${columnName}'] div[data-automation-id="text_${columnValue}"] span`);
const columnLocator: Locator = by.css(`div[title='${columnName}'] div[data-automation-id="text_${columnValue}"] span`);
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.all(columnLocator).first());
return this.rootElement.all(columnLocator).getText();
}
@@ -230,7 +236,7 @@ export class DataTableComponentPage {
* @param sortOrder : 'ASC' to sort the list ascendant and 'DESC' for descendant
*/
async sortByColumn(sortOrder: string, titleColumn: string): Promise<void> {
const locator = by.css(`div[data-automation-id="auto_id_${titleColumn}"]`);
const locator: Locator = by.css(`div[data-automation-id="auto_id_${titleColumn}"]`);
await BrowserVisibility.waitUntilElementIsVisible(element(locator));
const result = await element(locator).getAttribute('class');
if (sortOrder.toLocaleLowerCase() === 'asc') {
@@ -281,7 +287,18 @@ export class DataTableComponentPage {
}
async waitTillContentLoaded(): Promise<void> {
await browser.driver.sleep(500);
await browser.sleep(500);
Logger.log('wait datatable loading');
if (element(by.tagName('mat-spinner')).isPresent()) {
await BrowserVisibility.waitUntilElementIsNotPresent(element(by.tagName('mat-spinner')));
} else {
try {
await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-spinner')), 500);
} catch (error) {
}
}
await BrowserVisibility.waitUntilElementIsVisible(this.contents.first());
}

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { by, element, ElementFinder } from 'protractor';
import { Locator, by, element, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '../../utils/public-api';
import { DropdownPage } from '../material/dropdown.page';
@@ -24,8 +24,8 @@ export class FormFields {
formContent = element(by.css('adf-form-renderer'));
refreshButton = element(by.css('div[class*="form-reload-button"] mat-icon'));
saveButton = element(by.cssContainingText('mat-card-actions[class*="adf-for"] span', 'SAVE'));
valueLocator = by.css('input');
labelLocator = by.css('label');
valueLocator: Locator = by.css('input');
labelLocator: Locator = by.css('label');
noFormMessage = element(by.css('.adf-empty-content__title'));
noFormMessageStandaloneTask = element(by.css('adf-task-standalone #adf-no-form-message'));
noFormTemplate = element(by.css('adf-empty-content'));
@@ -35,7 +35,7 @@ export class FormFields {
completeButton = element(by.id('adf-form-complete'));
completeNoFormButton = element(by.id('adf-no-form-complete-button'));
cancelButton = element(by.css('#adf-no-form-cancel-button'));
errorMessage = by.css('.adf-error-text-container .adf-error-text');
errorMessage: Locator = by.css('.adf-error-text-container .adf-error-text');
selectFormDropdown = new DropdownPage(element.all(by.css('.adf-attach-form .mat-select-arrow')).first());
@@ -89,7 +89,7 @@ export class FormFields {
async getFieldPlaceHolder(fieldId: string, locator = 'input'): Promise<string> {
const placeHolderLocator = element(by.css(`${locator}#${fieldId}`));
await BrowserVisibility.waitUntilElementIsVisible(placeHolderLocator);
return placeHolderLocator.getAttribute('placeholder');
return placeHolderLocator.getAttribute('data-placeholder');
}
async checkFieldValue(locator, field, val): Promise<void> {

View File

@@ -17,15 +17,14 @@
import { FormFields } from '../form-fields';
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
import * as remote from 'selenium-webdriver/remote';
import { element, by, browser } from 'protractor';
import { Locator, element, by, browser } from 'protractor';
export class AttachFileWidgetPage {
formFields = new FormFields();
uploadLocator = by.css('button[id="attachfile"]');
uploadLocator: Locator = by.css('button[id="attachfile"]');
localStorageButton = element(by.css('input[id="attachfile"]'));
filesListLocator = by.css('div[id="adf-attach-widget-readonly-list"]');
filesListLocator: Locator = by.css('div[id="adf-attach-widget-readonly-list"]');
attachFileWidget = element(by.css('#attachfile'));
attachedFileMenu = element(by.css('mat-list-item button'));
attachedFileOptions = element(by.css('.mat-menu-panel .mat-menu-content'));
@@ -34,7 +33,6 @@ export class AttachFileWidgetPage {
removeFileOptionButton = element(by.css(`.mat-menu-panel .mat-menu-content button[id$="remove"]`));
async attachFile(fieldId, fileLocation): Promise<void> {
browser.setFileDetector(new remote.FileDetector());
const widget = await this.formFields.getWidget(fieldId);
const uploadButton = await widget.element(this.uploadLocator);
await BrowserActions.click(uploadButton);
@@ -107,7 +105,6 @@ export class AttachFileWidgetPage {
}
async checkUploadIsNotVisible(fieldId): Promise<void> {
browser.setFileDetector(new remote.FileDetector());
const widget = await this.formFields.getWidget(fieldId);
const uploadButton = await widget.element(this.uploadLocator);
await BrowserVisibility.waitUntilElementIsNotPresent(uploadButton);
@@ -119,7 +116,6 @@ export class AttachFileWidgetPage {
}
async clickUploadButton(fieldId): Promise<void> {
browser.setFileDetector(new remote.FileDetector());
await BrowserActions.closeMenuAndDialogs();
const widget = await this.formFields.getWidget(fieldId);
const uploadButton = await widget.element(this.uploadLocator);

View File

@@ -15,18 +15,16 @@
* limitations under the License.
*/
import * as remote from 'selenium-webdriver/remote';
import { browser, by, element } from 'protractor';
import { Locator, by, element } from 'protractor';
import { FormFields } from '../form-fields';
import { BrowserActions, BrowserVisibility } from '../../../utils/public-api';
export class AttachFolderWidgetPage {
formFields: FormFields = new FormFields();
foldersListLocator = by.css('.adf-attach-folder-result');
foldersListLocator: Locator = by.css('.adf-attach-folder-result');
async clickWidget(fieldId: string): Promise<void> {
browser.setFileDetector(new remote.FileDetector());
const widget = await this.formFields.getWidget(fieldId).element(by.css(`button[id="folder-${fieldId}-button"]`));
await BrowserActions.click(widget);
}

View File

@@ -17,13 +17,13 @@
import { FormFields } from '../form-fields';
import { BrowserActions, BrowserVisibility } from '../../../utils/public-api';
import { by, element } from 'protractor';
import { Locator, by, element } from 'protractor';
export class CheckboxWidgetPage {
formFields = new FormFields();
checkboxLabel = element(by.css('span[class*="mat-checkbox-label"]'));
checkboxLocator = by.css('mat-checkbox');
checkboxLocator: Locator = by.css('mat-checkbox');
getCheckboxLabel(): Promise<string> {
return BrowserActions.getText(this.checkboxLabel);

View File

@@ -16,15 +16,15 @@
*/
import { FormFields } from '../form-fields';
import { by, element, protractor } from 'protractor';
import { Locator, by, element, protractor } from 'protractor';
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
export class DynamicTableWidgetPage {
formFields = new FormFields();
labelLocator = by.css('dynamic-table-widget div div');
columnNameLocator = by.css('table[id*="dynamic-table"] th');
labelLocator: Locator = by.css('dynamic-table-widget div div');
columnNameLocator: Locator = by.css('table[id*="dynamic-table"] th');
cancelButton = element(by.cssContainingText('button span', 'Cancel'));
editButton = element(by.cssContainingText('button span', 'edit'));
columnDateTime = element(by.id('columnDateTime'));

View File

@@ -16,7 +16,7 @@
*/
import { FormFields } from '../form-fields';
import { by, element } from 'protractor';
import { Locator, by, element } from 'protractor';
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
export class GroupWidgetPage {
@@ -24,7 +24,7 @@ export class GroupWidgetPage {
groupField = element(by.css('input[data-automation-id="adf-group-search-input"]'));
firstResult = element(by.id('adf-group-widget-user-0'));
formFields = new FormFields();
groupDropDownList = by.css('.mat-autocomplete-panel');
groupDropDownList: Locator = by.css('.mat-autocomplete-panel');
getFieldLabel(fieldId: string): Promise<string> {
return this.formFields.getFieldLabel(fieldId);
@@ -52,7 +52,7 @@ export class GroupWidgetPage {
}
async getDropDownList(): Promise<any[]> {
const user = by.css('[id="adf-group-label-name"]');
const user: Locator = by.css('[id="adf-group-label-name"]');
await BrowserVisibility.waitUntilElementIsVisible(element(user));
return element.all(user).map((elementFinder) => elementFinder.getText());
}

View File

@@ -16,13 +16,13 @@
*/
import { FormFields } from '../form-fields';
import { by, element } from 'protractor';
import { Locator, by, element } from 'protractor';
import { BrowserActions } from '../../../utils/public-api';
export class HyperlinkWidgetPage {
formFields = new FormFields();
fieldLocator = by.css('.adf-hyperlink-widget a');
fieldLocator: Locator = by.css('.adf-hyperlink-widget a');
async getFieldText(fieldId: string): Promise<string> {
return this.formFields.getFieldText(fieldId, this.fieldLocator);

View File

@@ -16,7 +16,7 @@
*/
import { FormFields } from '../form-fields';
import { by, Locator } from 'protractor';
import { Locator, by } from 'protractor';
export class MultilineTextWidgetPage {

View File

@@ -16,7 +16,7 @@
*/
import { FormFields } from '../form-fields';
import { by, element } from 'protractor';
import { by, element, Locator } from 'protractor';
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
export class PeopleWidgetPage {
@@ -24,9 +24,9 @@ export class PeopleWidgetPage {
peopleField = element(by.css('input[data-automation-id="adf-people-search-input"]'));
firstResult = element(by.id('adf-people-widget-user-0'));
formFields = new FormFields();
labelLocator = by.css('div[class*="display-text-widget"]');
inputLocator = by.id('involvepeople');
peopleDropDownList = by.css('div[class*="adf-people-widget-list"]');
labelLocator: Locator = by.css('div[class*="display-text-widget"]');
inputLocator: Locator = by.id('involvepeople');
peopleDropDownList: Locator = by.css('div[class*="adf-people-widget-list"]');
getFieldLabel(fieldId: string): Promise<string> {
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
@@ -60,7 +60,7 @@ export class PeopleWidgetPage {
async getDropDownList(): Promise<any[]> {
await this.checkDropDownListIsDisplayed();
const users = by.css('.adf-people-label-name');
const users: Locator = by.css('.adf-people-label-name');
await BrowserVisibility.waitUntilElementIsVisible(element(users));
return element.all(users).map((elementFinder) => elementFinder.getText());
}

View File

@@ -26,14 +26,14 @@ export class RadioButtonsWidgetPage {
formFields: FormFields = new FormFields();
async getSpecificOptionLabel(fieldId, optionNumber): Promise<string> {
const optionLocator = by.css('label[for*="radiobuttons-option_' + optionNumber + '"]');
const optionLocator: Locator = by.css('label[for*="radiobuttons-option_' + optionNumber + '"]');
const widget = await this.formFields.getWidget(fieldId);
const option = widget.element(optionLocator);
return BrowserActions.getText(option);
}
async selectOption(fieldId, optionNumber): Promise<void> {
const optionLocator = by.css(`label[for*="${fieldId}-option_${optionNumber}"]`);
const optionLocator: Locator = by.css(`label[for*="${fieldId}-option_${optionNumber}"]`);
const widget = await this.formFields.getWidget(fieldId);
const option = widget.element(optionLocator);
await BrowserActions.click(option);

View File

@@ -16,7 +16,7 @@
*/
import { FormFields } from '../form-fields';
import { by, element } from 'protractor';
import { Locator, by, element } from 'protractor';
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
export class TypeaheadWidgetPage {
@@ -24,7 +24,7 @@ export class TypeaheadWidgetPage {
field = element(by.css('input[data-automation-id="adf-typeahed-search-input"]'));
firstResult = element(by.id('adf-typeahed-widget-user-0'));
formFields = new FormFields();
groupDropDownList = by.css('.mat-autocomplete-panel');
groupDropDownList: Locator = by.css('.mat-autocomplete-panel');
getFieldLabel(fieldId: string): Promise<string> {
return this.formFields.getFieldLabel(fieldId);
@@ -52,7 +52,7 @@ export class TypeaheadWidgetPage {
}
async getDropDownList(): Promise<any[]> {
const option = by.css('[id="adf-typeahed-label-name"]');
const option: Locator = by.css('[id="adf-typeahed-label-name"]');
await BrowserVisibility.waitUntilElementIsVisible(element(option));
return element.all(option).map((elementFinder) => elementFinder.getText());
}
@@ -68,7 +68,7 @@ export class TypeaheadWidgetPage {
async fillTypeaheadField(value: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsClickable(this.field);
await BrowserActions.clearSendKeys(this.field, value);
await BrowserActions.clearSendKeys(this.field, value, 10);
}
async selectOptionFromDropdown(): Promise<void> {

View File

@@ -15,14 +15,14 @@
* limitations under the License.
*/
import { element, by, ElementFinder } from 'protractor';
import { Locator, element, by, ElementFinder } from 'protractor';
import { BrowserVisibility } from './../utils/browser-visibility';
import { TabsPage } from './material/tabs.page';
export class InfoDrawerPage {
rootElement: ElementFinder;
infoDrawerHeader = by.css('adf-info-drawer-layout-header');
infoDrawerHeader: Locator = by.css('adf-info-drawer-layout-header');
tabsPage: TabsPage = new TabsPage();
constructor(classLocator: string = 'adf-info-drawer') {

View File

@@ -70,8 +70,8 @@ export class LoginPage {
const loginURL: string = browser.baseUrl + (browser.params.loginRoute ? browser.params.loginRoute : '');
await BrowserActions.getUrl(loginURL);
const oauth2 = await LocalStorageUtil.getConfigField('oauth2');
await BrowserActions.getUrl(loginURL);
if (oauth2 && oauth2.silentLogin === false) {
await this.clickOnSSOButton();

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { element, by } from 'protractor';
import { Locator, element, by } from 'protractor';
import { BrowserVisibility } from '../../utils/browser-visibility';
import { BrowserActions } from '../../utils/browser-actions';
@@ -26,8 +26,8 @@ export class DateTimePickerCalendarPage {
timePicker = element(by.css('.mat-datetimepicker-clock'));
hourTime = element.all(by.css('.mat-datetimepicker-clock-hours .mat-datetimepicker-clock-cell')).first();
minutesTime = element.all(by.css('.mat-datetimepicker-clock-minutes .mat-datetimepicker-clock-cell')).first();
firstEnabledHourSelector = by.css('.mat-datetimepicker-clock-cell:not(.mat-datetimepicker-clock-cell-disabled)');
firstEnabledMinutesSelector = by.css('.mat-datetimepicker-clock-cell:not(.mat-datetimepicker-clock-cell-disabled)');
firstEnabledHourSelector: Locator = by.css('.mat-datetimepicker-clock-cell:not(.mat-datetimepicker-clock-cell-disabled)');
firstEnabledMinutesSelector: Locator = by.css('.mat-datetimepicker-clock-cell:not(.mat-datetimepicker-clock-cell-disabled)');
hoursPicker = element(by.css('.mat-datetimepicker-clock-hours'));
minutePicker = element(by.css('.mat-datetimepicker-clock-minutes'));

View File

@@ -28,10 +28,12 @@ export class DropdownPage {
}
async clickDropdown(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.dropDownElement);
await BrowserActions.click(this.dropDownElement);
}
async selectOption(option: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(element.all(by.cssContainingText('mat-option span.mat-option-text', option)).first());
const optionElement = element.all(by.cssContainingText('mat-option span.mat-option-text', option)).first();
await BrowserActions.click(optionElement);
}

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { browser, by, element } from 'protractor';
import { Locator, by, element } from 'protractor';
import { BrowserVisibility } from '../utils/browser-visibility';
import { BrowserActions } from '../utils/browser-actions';
@@ -25,7 +25,7 @@ export class PaginationPage {
pageSelectorArrow = element(by.css('button[data-automation-id="page-selector"]'));
itemsPerPage = element(by.css('.adf-pagination__max-items'));
itemsPerPageOpenDropdown = element(by.css('.adf-pagination__perpage-block button'));
itemsPerPageOptions = by.css('.adf-pagination__page-selector .mat-menu-item');
itemsPerPageOptions: Locator = by.css('.adf-pagination__page-selector .mat-menu-item');
currentPage = element(by.css('.adf-pagination__current-page'));
totalPages = element(by.css('.adf-pagination__total-pages'));
paginationRange = element(by.css('.adf-pagination__range'));
@@ -33,13 +33,13 @@ export class PaginationPage {
nextButtonDisabled = element(by.css('button[class*="adf-pagination__next-button"][disabled]'));
previousButtonDisabled = element(by.css('button[class*="adf-pagination__previous-button"][disabled]'));
pageDropDown = element(by.css('div[class*="adf-pagination__actualinfo-block"] button'));
pageDropDownOptions = by.css('div[class*="mat-menu-content"] button');
pageDropDownOptions: Locator = by.css('div[class*="mat-menu-content"] button');
paginationSection = element(by.css('adf-pagination'));
paginationSectionEmpty = element(by.css('adf-pagination[class*="adf-pagination__empty"]'));
totalFiles = element(by.css('.adf-pagination__range'));
async selectItemsPerPage(numberOfItem: string): Promise<void> {
await browser.executeScript(`document.querySelector('div[class*="adf-pagination__perpage-block"] button').click();`);
await BrowserActions.clickExecuteScript(`div[class*="adf-pagination__perpage-block"] button`);
await BrowserVisibility.waitUntilElementIsVisible(this.pageSelectorDropDown);
const itemsPerPage = element.all(by.cssContainingText('.mat-menu-item', numberOfItem)).first();
await BrowserVisibility.waitUntilElementIsPresent(itemsPerPage);
@@ -80,7 +80,7 @@ export class PaginationPage {
}
async clickOnNextPage(): Promise<void> {
await browser.executeScript(`document.querySelector('button[class*="adf-pagination__next-button"]').click();`);
return BrowserActions.click(this.nextPageButton);
}
async clickOnPageDropdown(): Promise<void> {
@@ -138,13 +138,4 @@ export class PaginationPage {
const totalNumberOfFiles = await BrowserActions.getText(this.totalFiles);
return totalNumberOfFiles.split('of ')[1];
}
/*
* Wait until the total number of items is less then specified value
*/
async waitUntilNoOfItemsIsLessThenValue(expectedValue: number): Promise<any> {
await BrowserVisibility.waitUntilElementIsVisible(this.totalFiles);
const condition = () => this.totalFiles.getText().then(value => value && +value.split('of ')[1] < expectedValue);
return browser.wait(condition, 10000);
}
}

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { element, by } from 'protractor';
import { Locator, element, by } from 'protractor';
import { BrowserVisibility } from '../utils/browser-visibility';
import { BrowserActions } from '../utils/browser-actions';
@@ -23,7 +23,7 @@ export class SnackbarPage {
notificationSnackBar = element.all(by.css('simple-snack-bar span')).first();
snackBarAction = element(by.css('simple-snack-bar button span'));
snackBarContainerCss = by.css('.mat-snack-bar-container');
snackBarContainerCss: Locator = by.css('.mat-snack-bar-container');
async waitForSnackBarToAppear() {
return BrowserVisibility.waitUntilElementIsVisible(element.all(this.snackBarContainerCss).first(), 5000,

View File

@@ -37,11 +37,15 @@ export class BrowserActions {
}
static async clickScript(elementFinder: ElementFinder): Promise<void> {
Logger.info(`Click script ${elementFinder.locator().toString()}`);
await browser.executeScript(`arguments[0].scrollIntoView();`, elementFinder);
await browser.executeScript(`arguments[0].click();`, elementFinder);
}
static async clickExecuteScript(elementCssSelector: string): Promise<void> {
Logger.info(`Click execute script ${elementCssSelector}`);
await BrowserVisibility.waitUntilElementIsPresent(element(by.css(elementCssSelector)));
await browser.executeScript(`document.querySelector('${elementCssSelector}').click();`);
}
@@ -69,13 +73,26 @@ export class BrowserActions {
Logger.info(`Get Text ${elementFinder.locator().toString()}`);
const present = await BrowserVisibility.waitUntilElementIsPresent(elementFinder);
if (present) {
return elementFinder.getText();
let text = await elementFinder.getText();
if (text === '') { // DO NOT REMOVE BUG sometime wrongly return empty text for cdk elements
text = await this.getTextScript(elementFinder);
return text?.trim();
}
return text;
} else {
Logger.error(`Get Text ${elementFinder.locator().toString()} not present`);
return '';
}
}
static async getTextScript(elementFinder: ElementFinder): Promise<string> {
return browser.executeScript(`return arguments[0].textContent`, elementFinder);
}
static async getInputValue(elementFinder: ElementFinder): Promise<string> {
Logger.info(`Get Input value ${elementFinder.locator().toString()}`);
@@ -83,6 +100,7 @@ export class BrowserActions {
if (present) {
return elementFinder.getAttribute('value');
} else {
Logger.error(`Get Input value ${elementFinder.locator().toString()} not present`);
return '';
}
}
@@ -109,13 +127,22 @@ export class BrowserActions {
}
}
static async clearSendKeys(elementFinder: ElementFinder, text: string): Promise<void> {
static async clearSendKeys(elementFinder: ElementFinder, text: string, sleepTime: number = 0): Promise<void> {
Logger.info(`Clear and sendKeys text:${text} locator:${elementFinder.locator().toString()}`);
await this.click(elementFinder);
await elementFinder.sendKeys('');
await elementFinder.clear();
await elementFinder.sendKeys(text);
if (sleepTime === 0) {
await elementFinder.sendKeys(text);
} else {
for (let i = 0; i < text.length; i++) {
await elementFinder.sendKeys(text[i]);
await browser.sleep(sleepTime);
}
}
}
static async checkIsDisabled(elementFinder: ElementFinder): Promise<void> {
@@ -138,7 +165,7 @@ export class BrowserActions {
const container = element(by.css('div.cdk-overlay-backdrop.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing'));
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
await BrowserVisibility.waitUntilElementIsNotVisible(container);
await BrowserVisibility.waitUntilElementIsNotVisible(container, 1000);
}
static async closeDisabledMenu(): Promise<void> {

View File

@@ -83,7 +83,16 @@ export class BrowserVisibility {
static async waitUntilElementHasValue(elementToCheck: ElementFinder, elementValue, waitTimeout: number = BrowserVisibility.DEFAULT_TIMEOUT): Promise<any> {
Logger.info(`Wait Until Element has value ${elementToCheck.locator().toString()} for ${waitTimeout}`);
return browser.wait(protractor.ExpectedConditions.textToBePresentInElementValue(elementToCheck, elementValue), waitTimeout, 'Element doesn\'t have a value ' + elementToCheck.locator());
return browser.wait(protractor.ExpectedConditions.textToBePresentInElementValue(elementToCheck, elementValue), waitTimeout, `Element doesn\'t have a value ${elementValue} ${elementToCheck.locator()}`);
}
/*
* Wait for element to have text
*/
static async waitUntilElementHasText(elementToCheck: ElementFinder, text, waitTimeout: number = BrowserVisibility.DEFAULT_TIMEOUT): Promise<any> {
Logger.info(`Wait Until Element has value ${elementToCheck.locator().toString()} for ${waitTimeout}`);
return browser.wait(protractor.ExpectedConditions.textToBePresentInElement(elementToCheck, text), waitTimeout, `Element doesn\'t have the text ${text} ${elementToCheck.locator()}`);
}
static async waitUntilElementIsNotPresent(elementToCheck: ElementFinder, waitTimeout: number = BrowserVisibility.NOT_VISIBLE_DEFAULT_TIMEOUT): Promise<any> {

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { browser, by, element } from 'protractor';
import { Locator, browser, by, element } from 'protractor';
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
import { BrowserActions } from '../../../core/utils/browser-actions';
@@ -24,8 +24,8 @@ export class EditProcessFilterDialogPage {
componentElement = element(by.css('adf-cloud-process-filter-dialog-cloud'));
title = element(by.id('adf-process-filter-dialog-title'));
filterNameInput = element(by.id('adf-filter-name-id'));
saveButtonLocator = by.id('adf-save-button-id');
cancelButtonLocator = by.id('adf-cancel-button-id');
saveButtonLocator: Locator = by.id('adf-save-button-id');
cancelButtonLocator: Locator = by.id('adf-cancel-button-id');
async clickOnSaveButton(): Promise<void> {
const saveButton = this.componentElement.element(this.saveButtonLocator);

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { browser, by, element } from 'protractor';
import { browser, by, element, Locator } from 'protractor';
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
import { BrowserActions } from '../../../core/utils/browser-actions';
@@ -24,8 +24,8 @@ export class EditTaskFilterDialogPage {
componentElement = element(by.css('adf-cloud-task-filter-dialog'));
title = element(by.id('adf-task-filter-dialog-title'));
filterNameInput = element(by.id('adf-filter-name-id'));
saveButtonLocator = by.id('adf-save-button-id');
cancelButtonLocator = by.id('adf-cancel-button-id');
saveButtonLocator: Locator = by.id('adf-save-button-id');
cancelButtonLocator: Locator = by.id('adf-cancel-button-id');
async clickOnSaveButton(): Promise<void> {
const saveButton = this.componentElement.element(this.saveButtonLocator);

View File

@@ -30,8 +30,8 @@ export class EditTaskFilterCloudComponentPage {
id = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-taskId"]'));
processDefinitionId = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-processDefinitionId"]'));
processInstanceId = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-processInstanceId"]'));
lastModifiedFrom = element(by.css('input[placeholder="LastModifiedFrom"]'));
lastModifiedTo = element(by.css('input[placeholder="LastModifiedTo"]'));
lastModifiedFrom = element(by.css('input[data-placeholder="LastModifiedFrom"]'));
lastModifiedTo = element(by.css('input[data-placeholder="LastModifiedTo"]'));
parentTaskId = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-parentTaskId"]'));
owner = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-owner"]'));
saveButton = element(by.css('[data-automation-id="adf-filter-action-save"]'));

View File

@@ -15,15 +15,14 @@
* limitations under the License.
*/
import * as remote from 'selenium-webdriver/remote';
import { element, by, browser, ElementFinder } from 'protractor';
import { Locator, element, by, ElementFinder } from 'protractor';
import { BrowserActions } from '../../../../core/utils/browser-actions';
import { BrowserVisibility } from '../../../../core/utils/browser-visibility';
export class AttachFileWidgetCloudPage {
widget: ElementFinder;
filesListLocator = by.css('div[id="adf-attach-widget-readonly-list"]');
filesListLocator: Locator = by.css('div[id="adf-attach-widget-readonly-list"]');
constructor(fieldId: string) {
this.assignWidget(fieldId);
@@ -34,7 +33,6 @@ export class AttachFileWidgetCloudPage {
}
async attachLocalFile(fileLocation: string): Promise<void> {
await browser.setFileDetector(new remote.FileDetector());
const uploadButton = element(by.css('adf-upload-button input'));
await BrowserVisibility.waitUntilElementIsPresent(uploadButton);
await uploadButton.sendKeys(fileLocation);

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { by, element, protractor } from 'protractor';
import { Locator, by, element, protractor } from 'protractor';
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { BrowserActions } from '../../core/utils/browser-actions';
import { FormFields } from '../../core/pages/form/form-fields';
@@ -26,8 +26,8 @@ export class PeopleCloudComponentPage {
assigneeField = element(by.css('input[data-automation-id="adf-people-cloud-search-input"]'));
selectionReady = element(by.css('div[data-automation-id="adf-people-cloud-row"]'));
formFields = new FormFields();
labelLocator = by.css("label[class*='adf-label']");
inputLocator = by.css('input');
labelLocator: Locator = by.css("label[class*='adf-label']");
inputLocator: Locator = by.css('input');
assigneeChipList = element(by.css('mat-chip-list[data-automation-id="adf-cloud-people-chip-list"]'));
async clearAssignee(): Promise<void> {

View File

@@ -15,14 +15,14 @@
* limitations under the License.
*/
import { by, element, ElementFinder } from 'protractor';
import { Locator, by, element, ElementFinder } from 'protractor';
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { BrowserActions } from '../../core/utils/browser-actions';
export class ProcessFiltersCloudComponentPage {
filter: ElementFinder;
filterIcon = by.css('adf-icon[data-automation-id="adf-filter-icon"]');
filterIcon: Locator = by.css('adf-icon[data-automation-id="adf-filter-icon"]');
processFilters = element(by.css("mat-expansion-panel[data-automation-id='Process Filters']"));

View File

@@ -17,7 +17,7 @@
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { DataTableComponentPage } from '../../core/pages/data-table-component.page';
import { element, by, browser } from 'protractor';
import { Locator, element, by, browser } from 'protractor';
import { BrowserActions } from '../../core/utils/browser-actions';
export class ProcessListCloudComponentPage {
@@ -30,7 +30,7 @@ export class ProcessListCloudComponentPage {
processList = element(by.css('adf-cloud-process-list'));
noProcessFound = element.all(by.css('.adf-empty-content__title')).first();
actionMenu = element(by.css('*[role="menu"]'));
optionButton = by.css('button[data-automation-id*="action_menu_"]');
optionButton: Locator = by.css('button[data-automation-id*="action_menu_"]');
dataTable = new DataTableComponentPage(this.processList);

View File

@@ -17,7 +17,7 @@
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { DataTableComponentPage } from '../../core/pages/data-table-component.page';
import { element, by, ElementFinder } from 'protractor';
import { element, by, ElementFinder, Locator } from 'protractor';
import { BrowserActions } from '../../core/utils/browser-actions';
const column = {
@@ -37,7 +37,7 @@ export class TaskListCloudComponentPage {
taskList = element(by.css('adf-cloud-task-list'));
noTasksFound = element.all(by.css('.adf-empty-content__title')).first();
actionMenu = element(by.css('*[role="menu"]'));
optionButton = by.css('button[data-automation-id*="action_menu_"]');
optionButton: Locator = by.css('button[data-automation-id*="action_menu_"]');
dataTable = new DataTableComponentPage(this.taskList);

View File

@@ -16,7 +16,6 @@
*/
import { Logger } from '../../core/utils/logger';
import * as remote from 'selenium-webdriver/remote';
import { browser } from 'protractor';
import { ApiService } from '../../core/actions/api.service';
import { AppDefinitionUpdateResultRepresentation } from '@alfresco/js-api';
@@ -50,8 +49,6 @@ export class ApplicationsUtil {
}
async publishDeployApp(appId: number): Promise<AppDefinitionUpdateResultRepresentation> {
browser.setFileDetector(new remote.FileDetector());
const publishApp = await this.api.getInstance().activiti.appsApi.publishAppDefinition(appId, new AppPublish());
await this.api.getInstance().activiti.appsApi.deployAppDefinitions({ appDefinitions: [{ id: publishApp.appDefinition.id }] });
@@ -71,8 +68,6 @@ export class ApplicationsUtil {
}
async importNewVersionAppDefinitionPublishDeployApp(appFileLocation: string, modelId: number) {
browser.setFileDetector(new remote.FileDetector());
const pathFile = path.join(browser.params.testConfig.main.rootPath + appFileLocation);
const file = fs.createReadStream(pathFile);
@@ -87,7 +82,6 @@ export class ApplicationsUtil {
async importApplication(appFileLocation: string, options = {}): Promise<any> {
try {
browser.setFileDetector(new remote.FileDetector());
const file = fs.createReadStream(appFileLocation);
return await this.api.getInstance().activiti.appsDefinitionApi.importAppDefinition(file, options);
} catch (error) {

View File

@@ -17,13 +17,13 @@
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { BrowserActions } from '../../core/utils/browser-actions';
import { by, element, ElementFinder } from 'protractor';
import { Locator, by, element, ElementFinder } from 'protractor';
export class FiltersPage {
accordionMenu = element(by.css('.app-processes-menu mat-accordion'));
buttonWindow = element(by.css('div > button[data-automation-id="btn-start-process"] > div'));
processIcon = by.css('adf-icon[data-automation-id="adf-filter-icon"]');
processIcon: Locator = by.css('adf-icon[data-automation-id="adf-filter-icon"]');
async clickFilterButton(filterElement: ElementFinder): Promise<void> {
await BrowserActions.click(filterElement);

View File

@@ -26,13 +26,13 @@ export class FormFieldsPage {
formContent = element(by.css('adf-form'));
refreshButton = element(by.css('div[class*="form-reload-button"] mat-icon'));
saveButton = element(by.cssContainingText('mat-card-actions[class*="adf-for"] span', 'SAVE'));
valueLocator = by.css('input');
labelLocator = by.css('label');
valueLocator: Locator = by.css('input');
labelLocator: Locator = by.css('label');
noFormMessage = element(by.css('.adf-empty-content__title'));
completedTaskNoFormMessage = element(by.css('div[id*="completed-form-message"] p'));
attachFormButton = element(by.id('adf-attach-form-attach-button'));
completeButton = element(by.id('adf-form-complete'));
errorMessage = by.css('.adf-error-text-container .adf-error-text');
errorMessage: Locator = by.css('.adf-error-text-container .adf-error-text');
selectFormDropdown = new DropdownPage(element.all(by.css('.adf-attach-form .mat-select-arrow')).first());
@@ -86,7 +86,7 @@ export class FormFieldsPage {
async getFieldPlaceHolder(fieldId: string, locator = 'input'): Promise<string> {
const placeHolderLocator = element(by.css(`${locator}#${fieldId}`));
await BrowserVisibility.waitUntilElementIsVisible(placeHolderLocator);
return placeHolderLocator.getAttribute('placeholder');
return placeHolderLocator.getAttribute('data-placeholder');
}
async checkFieldValue(locator, field, val): Promise<void> {

View File

@@ -75,6 +75,7 @@ export class StartProcessPage {
}
async clickProcessDropdownArrow(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.selectProcessDropdownArrow);
await BrowserActions.click(this.selectProcessDropdownArrow);
}