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
import static pages.Pages.* | |
scenario("search by specific query") { | |
search.submit("search this") | |
search.numberOfResults.waitToBe > 1 | |
} |
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
import static pages.Pages.* | |
scenario("search by specific query") { | |
search.submit("search this") | |
search.numberOfResults.shouldBe > 1 | |
} |
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
package pages | |
class Pages { | |
static final def search = new SearchPage() | |
static final def calculation = new CalculationPage() | |
static final def form = new FormPage() | |
} |
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
package pages | |
import static org.testingisdocumenting.webtau.WebTauDsl.* | |
class SearchPage { | |
def searchBox = $('#search-box') | |
def numberOfResults = $('#results .result').count | |
def submit(query) { | |
browser.open("/search") |
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
def searchBox = $('#search-box') | |
def numberOfResults = searchBox.count | |
scenario('search by specific query') { | |
submit('search this') | |
numberOfResults.shouldBe > 1 | |
} | |
def submit(query) { | |
browser.open("/search") |
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
def searchBox = $('#search-box') | |
def numberOfResults = searchBox.count | |
scenario('search by specific query') { | |
browser.open('/search') | |
searchBox.setValue('search this') | |
searchBox.sendKeys("\n") | |
numberOfResults.shouldBe > 1 |
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
scenario('search by specific query') { | |
browser.open('/search') | |
$('#search-box').setValue('search this') | |
$('#search-box').sendKeys("\n") | |
$('#results .result').count.shouldBe > 1 | |
} |
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
class Customer { | |
Number id | |
String url // store url of the created entity | |
} |
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
def customerPayload = [firstName: "FN", lastName: "LN"] | |
def customer = createLazyResource("customer") { // lazy resource to be created on the first access | |
def id = http.post("/customers", customerPayload) { | |
return id | |
} | |
return new Customer(id: id, url: "/customers/${id}") // definition is below | |
} |
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
scenario("CRUD operations for customer") { | |
def customerPayload = [firstName: "FN", lastName: "LN"] | |
def id = http.post("/customers", customerPayload) { | |
return id // return id value from response body | |
} | |
http.get("/customers/${id}") { | |
body.should == customerPayload // only specified properties will be asserted against | |
} |
NewerOlder