Skip to content

Instantly share code, notes, and snippets.

@andypalmer
Last active August 29, 2015 14:24
Show Gist options
  • Save andypalmer/6ff83c48e9e5e7eb5547 to your computer and use it in GitHub Desktop.
Save andypalmer/6ff83c48e9e5e7eb5547 to your computer and use it in GitHub Desktop.
Serenity Journey example
public class AnEbayUserCan {
@Test
public void searchForAnItem() {
EbayUser andy = new EbayUser().with(WebBrowsing.capability());
andy.doesTheFollowing(
Go.to(EBay.homepage),
Search.for("fire poi"),
Count.the(Results)
);
assertThat(andy.sees(Results.titles()), hasItems(containing("fire poi"));
}
@Test
public void bidAgainstAnotherUser() {
EbayUser andy = new EbayUser().with(WebBrowsing.capability());
EbayUser john = new EbayUser().with(WebBrowsing.capability());
andy.doesTheFollowing(
Login.to(EBay),
Bid.onItem("12345").withMaximumBid(50)
);
john.doesTheFollowing(
Login.to(EBay),
Bid.onItem("12345").withMaximumBid(40)
);
assertThat(john.sees(Item.highestBid(), is(40));
assertThat(john.sees(Item.currentWinner(), is(not(john));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment