Skip to content

Commit

Permalink
Added debugging example
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Jan 14, 2010
1 parent 7df189c commit d6a98e7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
@@ -0,0 +1,19 @@
package cuke4duke.webdriver;

import org.junit.Test;

import java.lang.reflect.InvocationTargetException;

// See http://wiki.github.com/aslakhellesoy/cuke4duke/debug-cuke4duke-steps
public class Debugging {
@Test
public void letsDebug() throws InvocationTargetException, InstantiationException, IllegalAccessException {
WebDriverFacade wdf = new WebDriverFacade();
ResultsPage rp = new ResultsPage(wdf);
SearchPage sp = new SearchPage(wdf);

sp.visit();
sp.search("cucumber github");
rp.shouldSee("<em>Cucumber</em> itself is written in Ruby");
}
}
Expand Up @@ -13,7 +13,7 @@ public ResultsPage(WebDriverFacade facade) {
}

@Then("^I should see$")
public void seeSearchResults(String results) {
public void shouldSee(String results) {
assertThat(d.getPageSource(), containsString(results));
}
}

0 comments on commit d6a98e7

Please sign in to comment.