Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance the implementation of systemSavesEncounter() method within the patient encounter test #498

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,24 @@
*/
package org.openmrs.contrib.qaframework.automation;

import static org.junit.Assert.assertTrue;

import io.cucumber.java.After;
import io.cucumber.java.Before;
import io.cucumber.java.en.And;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;

import static org.junit.Assert.assertTrue;

import org.junit.Assert;
import org.openmrs.contrib.qaframework.RunTest;
import org.openmrs.contrib.qaframework.helper.TestData;
import org.openmrs.contrib.qaframework.page.AdministrationPage;
import org.openmrs.contrib.qaframework.page.EncounterFormPage;
import org.openmrs.contrib.qaframework.page.ManageEncountersPage;
import org.openmrs.contrib.qaframework.page.SystemAdministrationPage;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

public class PatientEncounterSteps extends Steps {

Expand Down Expand Up @@ -81,11 +84,13 @@ public void fillEncounterForm() {
@And("a user clicks Save Encounter button")
public void clickOnSaveEncounterButton() {
encounterFormPage.clickOnSaveEncounter();
assertTrue(textExists("Encounter saved"));
}

@Then("the system saves encounter in the encounters table")
public void systemSavesEncounter() {
assertTrue(textExists("Encounter saved"));
WebElement element = driver.findElement(By.xpath("//*[@id='openmrs_msg']"));
Assert.assertEquals(element.getText(), "Encounter saved");
}

@When("a user clicks on deleted checkbox")
Expand Down
Loading