Upgrade to Pro — share decks privately, control downloads, hide ads and more …

さいきんのGebしってますか? #jggug

さいきんのGebしってますか? #jggug

PoohSunny

May 13, 2016
Tweet

More Decks by PoohSunny

Other Decks in Technology

Transcript

  1. ؆ܿͳهड़ import geb.Browser Browser.drive { go "http://myapp.com/login" assert $("h1").text() ==

    "Please Login" $("form.login").with { username = "admin" password = "password" login().click() } assert $("h1").text() == "Admin Section" }
  2. ͓ྡ͞Μͷऔಘ͕Մೳʹ1 <div class="a"> <div class="b"> <p class="c"></p> <p class="d"></p> <p

    class="e"></p> </div> <div class="f"></div> </div> assert $("p.d").previous() == $("p.c") assert $("p.d").next() == $("p.e") assert $("p.d").parent() == $("div.b") assert $("div.a").children() == $("div.b").add("div.f") 1 http://www.gebish.org/manual/current/#focus
  3. toWait1 ϖʔδભҠ࣌ͷatνΣοΫʹwait͕͔͔Δ class PageWithTemplateUsingToWaitOption extends Page { static content =

    { asyncPageButton(to: AsyncPage, toWait: true) { $("button") } } } class AsyncPage extends Page { static at = { $("#async-content") } } 1 http://www.gebish.org/manual/current/#focus