1. package demoproject.demoproject.steps;
  2. import net.thucydides.core.annotations.Step;
  3. import net.thucydides.core.pages.Pages;
  4. import net.thucydides.core.steps.ScenarioSteps;
  5. import static org.fest.assertions.Assertions.assertThat;
  6. import demoproject.demoproject.pages.DictionaryPage;
  7. public class EndUserSteps extends ScenarioSteps {
  8. DictionaryPage dictionaryPage;
  9. public EndUserSteps(Pages pages) {
  10. super(pages);
  11. }
  12. @Step
  13. public void enters(String keyword) {
  14. dictionaryPage.enter_keywords(keyword);
  15. }
  16. @Step
  17. public void starts_search() {
  18. dictionaryPage.lookup_terms();
  19. }
  20. @Step
  21. public void should_see_definition(String definition) {
  22. assertThat(dictionaryPage.getDefinitions()).contains(definition);
  23. }
  24. @Step
  25. public void is_the_home_page() {
  26. dictionaryPage.open();
  27. }
  28. @Step
  29. public void looks_for(String term) {
  30. enters(term);
  31. starts_search();
  32. }
  33. }