diff --git a/qaframework-bdd-tests/src/main/java/org/openmrs/contrib/qaframework/page/ManagePatientPage.java b/qaframework-bdd-tests/src/main/java/org/openmrs/contrib/qaframework/page/ManagePatientPage.java index bbe7e7910..78e6482ca 100644 --- a/qaframework-bdd-tests/src/main/java/org/openmrs/contrib/qaframework/page/ManagePatientPage.java +++ b/qaframework-bdd-tests/src/main/java/org/openmrs/contrib/qaframework/page/ManagePatientPage.java @@ -24,4 +24,9 @@ public void searchPatientIdentifierOrPatientName(String text) { waitForTextToBePresentInElement(SEARCH_STATUS,text.substring(0, text.length() - 1)); } + public void clickOnFirstPatient(String text) { + setText(SEARCH_ELEMENT, text); + clickOn(By.cssSelector("#openmrsSearchTable > tbody > tr:nth-child(2)")); + } + } diff --git a/qaframework-bdd-tests/src/test/java/org/openmrs/contrib/qaframework/automation/AddNewIdentifierSteps.java b/qaframework-bdd-tests/src/test/java/org/openmrs/contrib/qaframework/automation/AddNewIdentifierSteps.java index 692201d78..9176864bb 100644 --- a/qaframework-bdd-tests/src/test/java/org/openmrs/contrib/qaframework/automation/AddNewIdentifierSteps.java +++ b/qaframework-bdd-tests/src/test/java/org/openmrs/contrib/qaframework/automation/AddNewIdentifierSteps.java @@ -53,12 +53,12 @@ public void loadManagePatientsPage() { @When("a user searches for the patient") public void searchPatientIdentifierOrPatientName() { - managePatientPage.searchPatientIdentifierOrPatientName(firstPatientIdentifier); + managePatientPage.searchPatientIdentifierOrPatientName("john"); } @And("user selects returned patient") public void userSelectsReturnedPatient() { - dashboardPage = findPatientPage.clickOnFirstPatient(); + managePatientPage.clickOnFirstPatient("john"); } @And("a user clicks on add new identifier")