Skip to content

Commit

Permalink
add waits for reports test case
Browse files Browse the repository at this point in the history
  • Loading branch information
pripley123 committed Jan 16, 2020
1 parent ba44ce5 commit 61554a4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class Constant {
static final def FILE_UPLOAD_TIMEOUT = 5
static final def DOWNLOAD_INTERFACE_TIMEOUT = 2
static final def ASSIGN_TO_ME_TIMEOUT = 2
static final def STATUS_CHECK_WAIT = 2

final class Alerts {
static final def SUCCESS_UPDATED_TEXT = 'Successfully updated'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public class CheckerStep extends Step {
def checker_should_see_request_is_in_given_status(String statusTxt) {
TestObject statusObj = Utils.getTestObjectByIdPart(Constant.Status.CHECKER_UI_REQUEST_STATUS_ID_PART, 'div')
WebUI.waitForElementPresent(statusObj, Constant.DEFAULT_TIMEOUT)
WebUI.delay(Constant.STATUS_CHECK_WAIT)
String actualStatusTxt = WebUI.getText(statusObj)
if (!actualStatusTxt.equals(statusTxt)) {
WebUI.takeScreenshot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import test.ocwa.common.Step
import test.ocwa.common.Utils

class ReportStep extends Step {

@When("operational manager views the request in the reporting interface")
def view_request_milestones() {
//find the request in the reporting interface UI
Expand All @@ -67,7 +67,7 @@ class ReportStep extends Step {
@Then("the approved request should have a milestones for each status change")
def check_milestones_present() {
WebUI.waitForPageLoad(Constant.DEFAULT_TIMEOUT)

//check that all status changes are present (assume it's an approved request)
TestObject statusObj = Utils.getTestObjectByIdPart(Constant.Status.REPORTS_UI_REQUEST_STATUS_ID_PART, 'div')
String statusTxt = Constant.Status.APPROVED
Expand All @@ -79,7 +79,9 @@ class ReportStep extends Step {
KeywordUtil.markFailed('Failing scenario because request is unexpected state.')
}
//check that the variable description field is populated
String varDesc = WebUI.getText(Utils.getTestObjectById(Constant.Reports.REPORTS_VARIABLE_TXT_ID))
TestObject varTextObj = Utils.getTestObjectById(Constant.Reports.REPORTS_VARIABLE_TXT_ID)
WebUI.waitForElementPresent(varTextObj, Constant.DEFAULT_TIMEOUT)
String varDesc = WebUI.getText(varTextObj)
String expectedVariableDesc = Constant.Requester.REQUEST_VARIABLE_TEXT
if (!varDesc.equals(expectedVariableDesc )) {
WebUI.takeScreenshot()
Expand Down

0 comments on commit 61554a4

Please sign in to comment.