Last active
August 29, 2015 14:24
-
-
Save andypalmer/6ff83c48e9e5e7eb5547 to your computer and use it in GitHub Desktop.
Serenity Journey example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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