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

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

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

B765faf519f19520e1495bd870f4d7f0?s=128

PoohSunny

May 13, 2016
Tweet

Transcript

  1. ͍͖͞ΜͷGeb ͬͯ͠·͔͢ʁ @PoohSunny 2016/05/13 #jggug

  2. ͝ແࠫଡͯ͠·͢

  3. @PoohSunny work: [ "WebΤϯδχΞ", "Gebͷਖ਼͍͠ಡΈํΛ఻͑Δ" ] community: [ "TDDBC", "Agile

    Samurai Base Camp", "೔ຊSeleniumϢʔβʔίϛϡχςΟ" ]
  4. ΑΖ͘͠ ͓Ͷ͕͍͠·͢

  5. None
  6. ϒϥ΢βΦʔτϝʔγϣϯπʔϧ ݱࡏͷ࠷৽όʔδϣϯ͸0.13.1

  7. ؆ܿͳهड़ 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" }
  8. Gebͱ͍͑͹

  9. 2011 -> 2016 0.9.0 -> 0.13.1

  10. ࠷ۙͷGebͷ Ξοϓσʔτ

  11. None
  12. ϩΰ͕Ͱ͖ͨʂ

  13. 0.10.0

  14. NavigatorʹcssϝιουΛ௥Ճ1 <div style="float: left">text</div> assert $("div").css("float") == "left" 1 http://www.gebish.org/manual/current/#focus

  15. ͓ྡ͞Μͷऔಘ͕Մೳʹ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
  16. 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
  17. 0.12.0

  18. WebDriverͷByΛαϙʔτ ݁Ռతʹxpathه๏Λαϙʔτ $(By.xpath('//p[@class="xpath"]'))

  19. ϖʔδϨϕϧatCheckWaiting GebConfig্ͰͷઃఆΛϖʔδຖʹ্ֻ͚Δ class PageWithAtCheckWaiting extends Page { static atCheckWaiting =

    true }
  20. ϚχϡΞϧ͕Ascii Docʹ αϯϓϧ΋ಈ࡞͢ΔΑ͏ʹ

  21. 0.13.0

  22. reportOnTestFailureOnly1 ςετ͕མͪͨ࣌ʮ͚ͩʯϨϙʔτΛऔಘ Spock, JUnit4Ͱαϙʔτ reportOnTestFailureOnly = true 1 http://www.gebish.org/manual/current/#focus

  23. isFocused1 ΤϨϝϯτʹϑΥʔΧε͕౰͍ͨͬͯΔ͔ waitFor { nameInput.isFocused() } 1 http://www.gebish.org/manual/current/#focus

  24. Geb͕·͢·͢ศརʹʂ

  25. ࿕ใ

  26. JJUG CCC (5/21)

  27. None
  28. ඞࢮͰ͢ʂʂ

  29. ͝ڵຯͷ͋Δํͥͻʂʂ

  30. ͓͠·͍