Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomkp/california
https://github.com/tomkp/california
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/tomkp/california
- Owner: tomkp
- Created: 2010-04-20T08:54:09.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2013-04-02T14:06:05.000Z (over 11 years ago)
- Last Synced: 2024-04-09T11:22:54.259Z (7 months ago)
- Language: Java
- Homepage:
- Size: 24.6 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# California
Run cucumber tests in junit using java annotations
## Examples
```cucumber
Feature: Google TestsScenario: search google
Given I am on 'http://www.google.com'
And I search for 'cucumber'
Then I should see 10 results```
```java
@Fixture
public class GoogleFixture {private WebDriver driver = null;
@BeforeScenarios("open the browser")
public void openBrowser() {
if (driver == null) {
driver = new FirefoxDriver();
}
}@AfterScenarios("quit the browser")
public void closeBrowser() {
driver.close();
}@Step("I am on '(.*)'")
public void onThePage(String page) {
driver.get(page);
}@Step("I search for '(.*)'")
public void searchFor(String text) throws Exception {
driver.findElement(By.id("gbqfq")).sendKeys(text, Keys.RETURN);
Thread.sleep(1000);
}@Step("I should see (.*) results")
public void shouldSeeResults(Integer numberOfResults) {
Integer actual = driver.findElements(By.className("r")).size();
assertEquals(numberOfResults, actual);
}
}
```