mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4488] - FormCloud - Should be able to render a dropdown with a RestService bind (#4834)
* new test file * fix failures, passing string instead of boolean flag. * ADF-4488 - FormCloud - Not able to render a dropdown with a RestService bind * ADF-4488 - FormCloud - Not able to render a dropdown with a RestService bind * added await for entry of undefined error * added missing async for the tests. * changed location * changed locatioremoved unnecessary async * moved the locators to task-form-cloud-component page * removed the taskDetailsCloudPage as is unnecessary and getting the assertions from taskHeaderCloudPage. * fiv circular dependency * fix circular dependency
This commit is contained in:
committed by
Eugenio Romano
parent
b04b717296
commit
626bb01bf7
@@ -21,7 +21,7 @@ import { ElementFinder } from 'protractor/built/element';
|
||||
|
||||
export class FormFields {
|
||||
|
||||
formContent = element(by.css('adf-form'));
|
||||
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');
|
||||
|
@@ -23,27 +23,26 @@ export class DropdownWidget {
|
||||
|
||||
formFields = new FormFields();
|
||||
|
||||
selectedOptionLocator = by.css('mat-select[id="dropdown"] span span');
|
||||
dropdown = element(by.id('dropdown'));
|
||||
|
||||
getSelectedOptionText(fieldId) {
|
||||
return this.formFields.getFieldText(fieldId, this.selectedOptionLocator);
|
||||
getSelectedOptionText(fieldId: string = 'dropdown') {
|
||||
return this.formFields.getFieldText(fieldId, by.css(`mat-select[id="${fieldId}"] span span`));
|
||||
}
|
||||
|
||||
selectOption(option) {
|
||||
this.openDropdown();
|
||||
selectOption(option: string, locator: string = '#dropdown') {
|
||||
this.openDropdown(locator);
|
||||
const row = element(by.cssContainingText('mat-option span', option));
|
||||
BrowserActions.click(row);
|
||||
}
|
||||
|
||||
openDropdown() {
|
||||
this.checkDropdownIsDisplayed();
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.dropdown);
|
||||
return this.dropdown.click();
|
||||
openDropdown(locator: string = '#dropdown') {
|
||||
this.checkDropdownIsDisplayed(locator);
|
||||
const dropdown = locator ? element(by.css(`${locator}`)) : element(by.css(`#dropdown`));
|
||||
BrowserVisibility.waitUntilElementIsClickable(dropdown);
|
||||
return BrowserActions.click(dropdown);
|
||||
}
|
||||
|
||||
checkDropdownIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.dropdown);
|
||||
return this.dropdown;
|
||||
checkDropdownIsDisplayed(locator: string = '#dropdown') {
|
||||
const dropdown = element(by.css(`${locator}`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(dropdown);
|
||||
return dropdown;
|
||||
}
|
||||
}
|
||||
|
@@ -18,11 +18,15 @@
|
||||
import { element, by } 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 TaskFormCloudComponent {
|
||||
|
||||
cancelButton = element(by.css("button[id='adf-cloud-cancel-task']"));
|
||||
completeButton = element(by.css('button[adf-cloud-complete-task]'));
|
||||
cancelButton = element(by.css('button[id="adf-cloud-cancel-task"]'));
|
||||
completeButton = element(by.css('button[id="adf-form-complete"]'));
|
||||
releaseButton = element(by.css('button[adf-cloud-unclaim-task]'));
|
||||
saveButton = element(by.css('button[id="adf-form-save"]'));
|
||||
form = element(by.css('adf-cloud-form'));
|
||||
|
||||
checkCompleteButtonIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.completeButton);
|
||||
@@ -30,7 +34,7 @@ export class TaskFormCloudComponent {
|
||||
}
|
||||
|
||||
checkCompleteButtonIsNotDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(this.completeButton);
|
||||
BrowserVisibility.waitUntilElementIsNotOnPage(this.completeButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -44,4 +48,27 @@ export class TaskFormCloudComponent {
|
||||
return this;
|
||||
}
|
||||
|
||||
formFields() {
|
||||
return new FormFields();
|
||||
}
|
||||
|
||||
checkFormIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.form);
|
||||
return this;
|
||||
}
|
||||
|
||||
getReleaseButtonText() {
|
||||
return BrowserActions.getText(this.releaseButton);
|
||||
}
|
||||
|
||||
checkSaveButtonIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.saveButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickSaveButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.saveButton);
|
||||
this.saveButton.click();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
|
||||
export class TaskHeaderCloudPage {
|
||||
|
||||
@@ -77,4 +78,8 @@ export class TaskHeaderCloudPage {
|
||||
return BrowserActions.getText(this.dueDateField);
|
||||
}
|
||||
|
||||
checkTaskPropertyListIsDisplayed() {
|
||||
return BrowserVisibility.waitUntilElementIsVisible(this.taskPropertyList);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user