mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3873] Implement automated tests for edit process filter cloud (#4118)
* Implement edit process filter tests * Added tests to edit-process-filters-component.e2e.ts * Fix lint error * Rebase * Fixing a part of the existent tests for edit-process * no message * Fixing the tests. * Fixing edit process filter tests * Fixing lint errors. * Remove some waits * Removed some more waits * Delete a file that is not used. * Fix edit process filter tests * Update editProcessFilterCloudComponent.ts * Remove checkSpinnerIsDisplayed() check from tests * Moved clickCustomiseFilterHeader() to beforeEach()
This commit is contained in:
committed by
Eugenio Romano
parent
b5631b9a7f
commit
64cd91d66d
@@ -301,6 +301,10 @@ export class DataTablePage {
|
||||
return this;
|
||||
}
|
||||
|
||||
checkSpinnerIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotOnPage(this.spinner);
|
||||
}
|
||||
|
||||
checkRowIsDisplayedByName(filename) {
|
||||
Util.waitUntilElementIsVisible(element.all(by.css(`div[filename="${filename}"]`)).first());
|
||||
}
|
||||
|
@@ -15,14 +15,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Util } from '../../../util/util';
|
||||
import { by, element } from 'protractor';
|
||||
import { by, element, protractor } from 'protractor';
|
||||
import { EditProcessFilterDialog } from '../dialog/editProcessFilterDialog';
|
||||
|
||||
export class EditProcessFilterCloudComponent {
|
||||
|
||||
customiseFilter = element(by.id('adf-edit-process-filter-title-id'));
|
||||
selectedOption = element(by.css('mat-option[class*="mat-selected"]'));
|
||||
|
||||
saveButton = element(by.css('button[id="adf-save-id"]'));
|
||||
saveAsButton = element(by.css('button[id="adf-save-as-id"]'));
|
||||
deleteButton = element(by.css('button[id="adf-delete-id"]'));
|
||||
|
||||
editProcessFilter = new EditProcessFilterDialog();
|
||||
|
||||
@@ -36,6 +39,14 @@ export class EditProcessFilterCloudComponent {
|
||||
return this;
|
||||
}
|
||||
|
||||
checkCustomiseFilterHeaderIsExpanded() {
|
||||
let expansionPanelExtended = element.all(by.css('mat-expansion-panel-header[class*="mat-expanded"]')).first();
|
||||
Util.waitUntilElementIsVisible(expansionPanelExtended);
|
||||
let content = element(by.css('div[class*="mat-expansion-panel-content "][style*="visible"]'));
|
||||
Util.waitUntilElementIsVisible(content);
|
||||
return this;
|
||||
}
|
||||
|
||||
setStateFilterDropDown(option) {
|
||||
this.clickOnDropDownArrow('state');
|
||||
|
||||
@@ -46,6 +57,10 @@ export class EditProcessFilterCloudComponent {
|
||||
return this;
|
||||
}
|
||||
|
||||
getStateFilterDropDownValue() {
|
||||
return element(by.css("mat-form-field[data-automation-id='status'] span")).getText();
|
||||
}
|
||||
|
||||
setSortFilterDropDown(option) {
|
||||
this.clickOnDropDownArrow('sort');
|
||||
|
||||
@@ -56,6 +71,12 @@ export class EditProcessFilterCloudComponent {
|
||||
return this;
|
||||
}
|
||||
|
||||
getSortFilterDropDownValue() {
|
||||
let sortLocator = element.all(by.css("mat-form-field[data-automation-id='sort'] span")).first();
|
||||
Util.waitUntilElementIsVisible(sortLocator);
|
||||
return sortLocator.getText();
|
||||
}
|
||||
|
||||
setOrderFilterDropDown(option) {
|
||||
this.clickOnDropDownArrow('order');
|
||||
|
||||
@@ -66,9 +87,14 @@ export class EditProcessFilterCloudComponent {
|
||||
return this;
|
||||
}
|
||||
|
||||
getOrderFilterDropDownValue() {
|
||||
return element(by.css("mat-form-field[data-automation-id='order'] span")).getText();
|
||||
}
|
||||
|
||||
clickOnDropDownArrow(option) {
|
||||
let dropDownArrow = element.all(by.css("mat-form-field[data-automation-id='" + option + "'] div[class*='arrow']")).first();
|
||||
let dropDownArrow = element.all(by.css("mat-form-field[data-automation-id='" + option + "'] div[class='mat-select-arrow-wrapper']")).first();
|
||||
Util.waitUntilElementIsVisible(dropDownArrow);
|
||||
Util.waitUntilElementIsClickable(dropDownArrow);
|
||||
dropDownArrow.click();
|
||||
Util.waitUntilElementIsVisible(this.selectedOption);
|
||||
}
|
||||
@@ -96,10 +122,57 @@ export class EditProcessFilterCloudComponent {
|
||||
return this;
|
||||
}
|
||||
|
||||
checkSaveButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.saveButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkSaveAsButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.saveAsButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkDeleteButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.deleteButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkSaveButtonIsEnabled() {
|
||||
Util.waitUntilElementIsVisible(this.saveButton);
|
||||
return this.saveButton.isEnabled();
|
||||
}
|
||||
|
||||
checkSaveAsButtonIsEnabled() {
|
||||
Util.waitUntilElementIsVisible(this.saveAsButton);
|
||||
return this.saveAsButton.isEnabled();
|
||||
}
|
||||
|
||||
checkDeleteButtonIsEnabled() {
|
||||
Util.waitUntilElementIsVisible(this.deleteButton);
|
||||
return this.deleteButton.isEnabled();
|
||||
}
|
||||
|
||||
clickSaveAsButton() {
|
||||
let disabledButton = element(by.css(("button[id='adf-save-as-id'][disabled]")));
|
||||
Util.waitUntilElementIsClickable(this.saveAsButton);
|
||||
Util.waitUntilElementIsVisible(this.saveAsButton);
|
||||
Util.waitUntilElementIsNotVisible(disabledButton);
|
||||
this.saveAsButton.click();
|
||||
return this.editProcessFilter;
|
||||
}
|
||||
|
||||
clickDeleteButton() {
|
||||
Util.waitUntilElementIsVisible(this.deleteButton);
|
||||
this.deleteButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
clickSaveButton() {
|
||||
let disabledButton = element(by.css(("button[id='adf-save-as-id'][disabled]")));
|
||||
Util.waitUntilElementIsClickable(this.saveButton);
|
||||
Util.waitUntilElementIsVisible(this.saveButton);
|
||||
Util.waitUntilElementIsNotVisible(disabledButton);
|
||||
this.saveButton.click();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user