mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +00:00
add slower type method for user picker (#5632)
* add slower type method for user picker * add slower type method for user picker * slower * other fixes * remove slow digit * fix some more test * slow down * fix some more test * exclude test * exclude C315268
This commit is contained in:
@@ -19,6 +19,8 @@ import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { NodeEntry } from '@alfresco/js-api/src/api/content-rest-api/model/nodeEntry';
|
||||
import { ApiUtil } from '../../core/structure/api.util';
|
||||
import { Logger } from '../../core/utils/logger';
|
||||
|
||||
export class UploadActions {
|
||||
alfrescoJsApi: AlfrescoApi = null;
|
||||
@@ -64,7 +66,15 @@ export class UploadActions {
|
||||
}
|
||||
|
||||
async deleteFileOrFolder(nodeId) {
|
||||
return this.alfrescoJsApi.node.deleteNode(nodeId, { permanent: true });
|
||||
const apiCall = async () => {
|
||||
try {
|
||||
return this.alfrescoJsApi.node.deleteNode(nodeId, { permanent: true });
|
||||
} catch (error) {
|
||||
Logger.error('Error delete file or folder');
|
||||
}
|
||||
};
|
||||
|
||||
return ApiUtil.waitForApi(apiCall, () => true);
|
||||
}
|
||||
|
||||
async uploadFolder(sourcePath, folder) {
|
||||
|
@@ -275,6 +275,7 @@ export class DataTableComponentPage {
|
||||
}
|
||||
|
||||
async waitTillContentLoaded(): Promise<void> {
|
||||
await browser.driver.sleep(500);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.contents.first());
|
||||
}
|
||||
|
||||
|
@@ -61,7 +61,7 @@ export class DateTimeWidgetPage {
|
||||
}
|
||||
|
||||
async selectTime(time): Promise<void> {
|
||||
const selectedTime = element(by.cssContainingText('div[class*="mat-datetimepicker-clock-cell"]', time));
|
||||
const selectedTime = element.all(by.cssContainingText('div[class*="mat-datetimepicker-clock-cell"]', time)).first();
|
||||
await BrowserActions.click(selectedTime);
|
||||
}
|
||||
|
||||
|
@@ -27,13 +27,13 @@ export class BrowserActions {
|
||||
await BrowserVisibility.waitUntilElementIsClickable(elementFinder);
|
||||
await elementFinder.click();
|
||||
} catch (clickErr) {
|
||||
try {
|
||||
await browser.executeScript(`arguments[0].scrollIntoView();`, elementFinder);
|
||||
await browser.executeScript(`arguments[0].click();`, elementFinder);
|
||||
} catch (jsErr) {
|
||||
Logger.error(`click error element ${elementFinder.locator()}`);
|
||||
throw jsErr;
|
||||
}
|
||||
try {
|
||||
await browser.executeScript(`arguments[0].scrollIntoView();`, elementFinder);
|
||||
await browser.executeScript(`arguments[0].click();`, elementFinder);
|
||||
} catch (jsErr) {
|
||||
Logger.error(`click error element ${elementFinder.locator()}`);
|
||||
throw jsErr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -68,9 +68,14 @@ export class PeopleCloudComponentPage {
|
||||
return this.assigneeChipList.all(by.css('mat-chip')).first().getText();
|
||||
}
|
||||
|
||||
async checkUserIsDisplayed(name: string): Promise<void> {
|
||||
const assigneeRow = element(by.cssContainingText('mat-option span.adf-people-label-name', name));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(assigneeRow);
|
||||
async checkUserIsDisplayed(name: string): Promise<boolean> {
|
||||
try {
|
||||
const assigneeRow = element(by.cssContainingText('mat-option span.adf-people-label-name', name));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(assigneeRow);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async checkUserIsNotDisplayed(name: string): Promise<void> {
|
||||
@@ -78,12 +83,12 @@ export class PeopleCloudComponentPage {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(assigneeRow);
|
||||
}
|
||||
|
||||
async checkOptionIsDisplayed(): Promise <void> {
|
||||
async checkOptionIsDisplayed(): Promise<void> {
|
||||
const optionList = element(by.css('.adf-people-cloud-list'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(optionList);
|
||||
}
|
||||
|
||||
async checkOptionIsNotDisplayed(): Promise <void> {
|
||||
async checkOptionIsNotDisplayed(): Promise<void> {
|
||||
const optionList = element(by.css('.adf-people-cloud-list'));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(optionList);
|
||||
}
|
||||
@@ -129,7 +134,7 @@ export class PeopleCloudComponentPage {
|
||||
await BrowserActions.click(peopleInput);
|
||||
}
|
||||
|
||||
async checkPeopleWidgetIsReadOnly (): Promise <boolean> {
|
||||
async checkPeopleWidgetIsReadOnly(): Promise<boolean> {
|
||||
const readOnlyAttribute = element(by.css('people-cloud-widget .adf-readonly'));
|
||||
try {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(readOnlyAttribute);
|
||||
@@ -139,7 +144,7 @@ export class PeopleCloudComponentPage {
|
||||
}
|
||||
}
|
||||
|
||||
async checkPeopleActiveField(name): Promise <boolean> {
|
||||
async checkPeopleActiveField(name): Promise<boolean> {
|
||||
const activePeopleField = element(by.css('people-cloud-widget .adf-readonly'));
|
||||
try {
|
||||
await BrowserActions.clearSendKeys(activePeopleField, name);
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { DataTableComponentPage } from '../../core/pages/data-table-component.page';
|
||||
import { element, by, ElementFinder, Locator } from 'protractor';
|
||||
import { element, by, ElementFinder, Locator, browser } from 'protractor';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class ProcessListCloudComponentPage {
|
||||
@@ -105,6 +105,7 @@ export class ProcessListCloudComponentPage {
|
||||
async clickOptionsButton(content: string): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
const row: ElementFinder = this.dataTable.getRow('Id', content);
|
||||
await browser.sleep(1000);
|
||||
await BrowserActions.click(row.element(this.optionButton));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.actionMenu);
|
||||
}
|
||||
|
@@ -84,6 +84,6 @@ export class TaskHeaderCloudPage {
|
||||
}
|
||||
|
||||
async checkTaskPropertyListIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.taskPropertyList);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.taskPropertyList, 90000);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user