[ADF-3596]Create automated tests for start process (#3834)

* Add automated tests for Start a process

* Deleted a shadow variable.

* Fixing a test

* Modified the testrail ID of two tests.

* Resolve lint errors.
This commit is contained in:
cristinaj
2018-09-28 12:29:33 +03:00
committed by Eugenio Romano
parent 711d51dd1d
commit 80e0a966ad
4 changed files with 154 additions and 20 deletions

View File

@@ -26,10 +26,21 @@ var StartProcessPage = function () {
var formStartProcessButton = element(by.css('button[data-automation-id="adf-form-start process"]'));
var startProcessButton = element(by.css("button[data-automation-id='btn-start']"));
var noProcess = element(by.id('no-process-message'));
var processDefinition = element(by.css("input[id='processDefinitionName']"));
var processDefinitionOptionsPanel = element(by.css("div[class*='processDefinitionOptions']"));
this.checkNoProcessMessage = function () {
Util.waitUntilElementIsVisible(noProcess);
}
};
this.pressDownArrowAndEnter = function () {
processDefinition.sendKeys(protractor.Key.ARROW_DOWN);
return browser.actions().sendKeys(protractor.Key.ENTER).perform();
};
this.checkNoProcessDefinitionOptionIsDisplayed = function () {
Util.waitUntilElementIsNotOnPage(processDefinitionOptionsPanel);
};
this.getDefaultName = function () {
Util.waitUntilElementIsVisible(defaultProcessName);
@@ -52,9 +63,30 @@ var StartProcessPage = function () {
};
this.selectFromProcessDropdown = function (name) {
this.clickProcessDropdownArrow();
return this.selectOption(name);
};
this.clickProcessDropdownArrow = function() {
Util.waitUntilElementIsVisible(selectProcessDropdownArrow);
Util.waitUntilElementIsClickable(selectProcessDropdownArrow)
selectProcessDropdownArrow.click();
};
this.checkOptionIsDisplayed = function (name) {
var selectProcessDropdown = element(by.cssContainingText('.mat-option-text', name));
Util.waitUntilElementIsVisible(selectProcessDropdown);
Util.waitUntilElementIsClickable(selectProcessDropdown);
return this;
};
this.checkOptionIsNotDisplayed = function (name) {
var selectProcessDropdown = element(by.cssContainingText('.mat-option-text', name));
Util.waitUntilElementIsNotOnPage(selectProcessDropdown);
return this;
};
this.selectOption = function (name) {
var selectProcessDropdown = element(by.cssContainingText('.mat-option-text', name));
Util.waitUntilElementIsVisible(selectProcessDropdown);
Util.waitUntilElementIsClickable(selectProcessDropdown);
@@ -62,6 +94,18 @@ var StartProcessPage = function () {
return this;
};
this.typeProcessDefinition = function (name) {
Util.waitUntilElementIsVisible(processDefinition);
Util.waitUntilElementIsClickable(processDefinition);
processDefinition.sendKeys(name);
return this;
};
this.getProcessDefinitionValue = function () {
Util.waitUntilElementIsVisible(processDefinition);
return processDefinition.getAttribute('value');
};
this.clickCancelProcessButton = function () {
Util.waitUntilElementIsVisible(cancelProcessButton);
cancelProcessButton.click();
@@ -81,6 +125,10 @@ var StartProcessPage = function () {
expect(startProcessButton.isEnabled()).toBe(false);
};
this.clickStartProcessButton = function () {
return startProcessButton.click();
};
};
module.exports = StartProcessPage;