Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titlecreate_encounter_type.story

GivenStories: org/openmrs/stories/go_to_admin_page.story

Given I am on Admin page
When I choose to manage encounter types
And I choose to add a new encounter type
And I mention name YOUTHINITIAL and description Outpatient Youth initial visit
When I save the encounter type
Then the new encounter type should be saved

...

JBehave looks for a java class with the same name as the .story class. So from our example above we would need a class named CreateEncounterType.java in the org.openmrs.stories package.

Code Block

public class CreateEncounterType extends Story {
	@Override
    public List<Steps> includeSteps() {
        return asList(new LoginSteps(driver), new AdminSteps(), new CreateEncounterTypeSteps(driver));
    }
}

...

Code Block
titleAnnotations in our steps class

@Given("I am on Admin page")
@When("I choose to manage encounter types")
@When("I choose to add a new encounter type")
@When("I mention name $name and description $description")
@When("I save the encounter type")
@Then("the new encounter type should be saved")

...

Since openmrs is running in memory, you need to increase the amount of memory given to maven:

Code Block

export MAVEN_OPTS="-Xmx512m -Xms256m -XX:MaxPermSize=256m"

...

Execute this script at a command line with:

Code Block

sh .release_test/release-test.sh -b -v -wMyOpenmrsPassword -tGoToAdminPage

...

Running directly using maven

Code Block

mvn clean integration-test -DskipTests -P integration-test

or

Code Block

mvn clean integration-test -DskipTests -P smoke

...