This file contains hidden or 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
{ | |
"temperature": 88 | |
} |
This file contains hidden or 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 com.example.tests.junit4 | |
import org.testingisdocumenting.webtau.junit4.WebTauRunner | |
import org.junit.Test | |
import org.junit.runner.RunWith | |
import static org.testingisdocumenting.webtau.WebTauGroovyDsl.* | |
@RunWith(WebTauRunner.class) // required for html report generation only | |
class WeatherGroovyTest { |
This file contains hidden or 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 com.example.tests.junit4; | |
import org.testingisdocumenting.webtau.junit4.WebTauRunner; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import static org.testingisdocumenting.webtau.WebTauGroovyDsl.*; | |
@RunWith(WebTauRunner.class) | |
public class WeatherJavaTest { |
This file contains hidden or 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 | |
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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") |