SeleniumSteps { @Before public void before() { if (browser == null && citrus.getCitrusContext().getReferenceResolver().resolveAll(SeleniumBrowser.class).size() == 1L) { browser = citrus.getCitrusContext().getReferenceResolver().resolve(SeleniumBrowser.class); } pages = new HashMap<>(); validators = new HashMap<>(); }  @Before void before(); @Given("^(?:selenium )?browser \"([^\"]+)\"$") void setBrowser(String id); @Given("^pages$") void pages(DataTable dataTable); @Given("^page \"([^\"]+)\" ([^\\s]+)$") void page(String id, String type); @Given("^page validators") void page_validators(DataTable dataTable); @Given("^page validator ([^\\s]+) ([^\\s]+)$") void page_validator(String id, String type); @When("^(?:user )?starts? browser$") void start(); @When("^(?:user )?stops? browser$") void stop(); @When("^(?:user )?navigates? to \"([^\"]+)\"$") void navigate(String url); @When("^(?:user )?clicks? (?:element|button|link) with ([^\"]+)=\"([^\"]+)\"$") void click(String property, String value); @When("^(?:user )?(?:sets?|puts?) text \"([^\"]+)\" to (?:element|input|textfield) with ([^\"]+)=\"([^\"]+)\"$") void setInput(String text, String property, String value); @When("^(?:user )?(checks?|unchecks?) checkbox with ([^\"]+)=\"([^\"]+)\"$") void checkInput(String type, String property, String value); @Then("^(?:page )?should (?:display|have) (?:element|button|link|input|textfield|form|heading) with (id|name|class-name|link-text|css-selector|tag-name|xpath)=\"([^\"]+)\"$") void should_display(String property, String value); @Then("^(?:page )?should (?:display|have) (?:element|button|link|input|textfield|form|heading) with (id|name|class-name|link-text|css-selector|tag-name|xpath)=\"([^\"]+)\" having$") void should_display(String property, String value, DataTable dataTable); @When("^(?:page )?([^\\s]+) performs ([^\\s]+)$") void page_action(String pageId, String method); @When("^(?:page )?([^\\s]+) performs ([^\\s]+) with arguments$") void page_action_with_arguments(String pageId, String method, DataTable dataTable); @Then("^(?:page )?([^\\s]+) should validate$") void page_should_validate(String pageId); @Then("^(?:page )?([^\\s]+) should validate with ([^\\s]+)$") void page_should_validate_with_validator(String pageId, String validatorId);  }
@Test public void testDefaultBrowserInitialization() { Assert.assertNull(steps.browser); steps.before(); Assert.assertNotNull(steps.browser); }