mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-1152] added e2e tests for People and Group of people - CloudWidgets (#5372)
* [AAE-1152] added e2e tests for People and Group of people - CloudWidgets * [AAE-1152] made code more readable * [AAE-1152] added public-api file * Fixing import in index.ts * refactoring and creating public-api file
This commit is contained in:
committed by
Eugenio Romano
parent
3c3aa7599a
commit
f20e158eaf
@@ -46,4 +46,34 @@ export class FormPage {
|
||||
await BrowserActions.click(this.saveButton);
|
||||
}
|
||||
|
||||
async isSaveButtonDisabled(): Promise<boolean> {
|
||||
const saveButtonDisabled = element(by.css('.adf-form-mat-card-actions [disabled]'));
|
||||
try {
|
||||
await saveButtonDisabled.isDisplayed();
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async isValidationIconBlue(): Promise<boolean> {
|
||||
const validationIcon = element(by.css('#adf-valid-form-icon'));
|
||||
try {
|
||||
await validationIcon.isDisplayed();
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async isValidationIconRed(): Promise<boolean> {
|
||||
const validationIcon = element(by.css('#adf-invalid-form-icon'));
|
||||
try {
|
||||
await validationIcon.isDisplayed();
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,18 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './widget/public-api';
|
@@ -0,0 +1,32 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Widget } from '../../../../core/pages/form/widgets/widget';
|
||||
import { PeopleCloudComponentPage } from '../../people-cloud-component.page';
|
||||
import { GroupCloudComponentPage } from '../../group-cloud-component.page';
|
||||
|
||||
export class ProcessCloudWidgetPage extends Widget {
|
||||
|
||||
peopleCloudWidget(): PeopleCloudComponentPage {
|
||||
return new PeopleCloudComponentPage();
|
||||
}
|
||||
|
||||
groupCloudWidget(): GroupCloudComponentPage {
|
||||
return new GroupCloudComponentPage();
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './process-cloud-widget.page';
|
@@ -18,10 +18,12 @@
|
||||
import { browser, by, element, ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
import { FormFields } from '../../core/pages/form/formFields';
|
||||
|
||||
export class GroupCloudComponentPage {
|
||||
|
||||
groupCloudSearch: ElementFinder = element(by.css('input[data-automation-id="adf-cloud-group-search-input"]'));
|
||||
formFields: FormFields = new FormFields();
|
||||
|
||||
async searchGroups(name: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.groupCloudSearch);
|
||||
@@ -36,7 +38,6 @@ export class GroupCloudComponentPage {
|
||||
async getGroupsFieldContent(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.groupCloudSearch);
|
||||
return this.groupCloudSearch.getAttribute('value');
|
||||
|
||||
}
|
||||
|
||||
async selectGroupFromList(name: string): Promise<void> {
|
||||
@@ -69,4 +70,13 @@ export class GroupCloudComponentPage {
|
||||
await BrowserActions.click(locator);
|
||||
}
|
||||
|
||||
async isGroupWidgetVisible(fieldId: string): Promise<boolean> {
|
||||
try {
|
||||
await this.formFields.checkWidgetIsVisible(fieldId);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -15,14 +15,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
import { browser, by, element, ElementFinder, Locator, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
import { FormFields } from '../../core/pages/form/formFields';
|
||||
|
||||
export class PeopleCloudComponentPage {
|
||||
|
||||
peopleCloudSearch: ElementFinder = element(by.css('input[data-automation-id="adf-people-cloud-search-input"]'));
|
||||
assigneeField: ElementFinder = element(by.css('input[data-automation-id="adf-people-cloud-search-input"]'));
|
||||
formFields: FormFields = new FormFields();
|
||||
labelLocator: Locator = by.css("label[class*='adf-label']");
|
||||
inputLocator: Locator = by.css('input');
|
||||
|
||||
async clearAssignee(): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.peopleCloudSearch, ' ');
|
||||
@@ -80,7 +84,38 @@ export class PeopleCloudComponentPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.assigneeField);
|
||||
await browser.sleep(1000);
|
||||
return this.assigneeField.getAttribute('value');
|
||||
}
|
||||
|
||||
getFieldLabel(fieldId): Promise<string> {
|
||||
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
|
||||
}
|
||||
|
||||
getFieldValue(fieldId): Promise<string> {
|
||||
return this.formFields.getFieldValue(fieldId, this.inputLocator);
|
||||
}
|
||||
|
||||
async isPeopleWidgetVisible(fieldId: string): Promise<boolean> {
|
||||
try {
|
||||
await this.formFields.checkWidgetIsVisible(fieldId);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async checkPeopleWidgetIsHidden(fieldId: string): Promise<boolean> {
|
||||
const hiddenElement = element(by.css(`adf-form-field div[id='field-${fieldId}-container'][hidden]`));
|
||||
try {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(hiddenElement);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async clickPeopleInput(fieldId): Promise<void> {
|
||||
const peopleInput = element.all(by.css(`div[id="field-${fieldId}-container"] `)).first();
|
||||
await BrowserActions.click(peopleInput);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -28,5 +28,5 @@ export * from './task-filters-cloud-component.page';
|
||||
export * from './task-list-cloud-component.page';
|
||||
export * from './start-process-cloud-component.page';
|
||||
export * from './task-form-cloud-component.page';
|
||||
|
||||
export * from './dialog/public-api';
|
||||
export * from './form/public-api';
|
||||
|
Reference in New Issue
Block a user