Save 37% off PRO during our Black Friday Sale! »

SelenideとGeb

 SelenideとGeb

JJUG CCC Spring 2016 の懇親会LTの発表スライドを日本語にしたものです。
English version is here: https://speakerdeck.com/poohsunny/selenium-vs-geb

B765faf519f19520e1495bd870f4d7f0?s=128

PoohSunny

May 21, 2016
Tweet

Transcript

  1. Selenide ͱ Geb

  2. @PoohSunny { work: "σΟϕϩούʔ" geb: "very minor contributor" community: [

    "TDDBC", "Agile Samurai Base Camp", "೔ຊSeleniumϢʔβʔίϛϡχςΟ" ] }
  3. ͞·͟·ͳϒϥ΢βΦʔτ ϝʔγϣϯπʔϧ

  4. ͲΕ͔ͭ͏͔ ໎ͬͪΌ͏ʂ

  5. Selenide ͱ Geb ͷίϛολ ͕ձ࿩ͯͨ͠1 1 https://github.com/codeborne/selenide/issues/65

  6. ಡΜͰΈΔͱ ྆ऀͷҧ͍͕ Α͘Θ͔Δ͔΋ʂʁ

  7. ※͓͜ͱΘΓ 2೥൒લͷ࿩Ͱ͢

  8. લఏ஌ࣝ ྆ํͰςετΛॻ͍ͯΈΔ • googleͷαʔνϖʔδભҠ • ݕࡧཝʹʮSelenide/GebʯΛೖྗ • ݁Ռ͕10ݸฦͬͯ͘Δ͜ͱΛνΣοΫ • ࠷ॳͷݕࡧ݁Ռʹݕࡧͨ͠จࣈ͕ೖ͍ͬͯΔͷ

    ΛνΣοΫ
  9. Selenide2 public class GoogleTest { @Test public void userCanSearch() {

    GooglePage page = open("http://google.com/", GooglePage.class); SearchResultsPage results = page.searchFor("selenide"); results.getResults().shouldHave(size(10)); results.getResult(0).shouldHave(text("Selenide")); } } 2 https://github.com/selenide-examples/google/blob/master/test/org/selenide/examples/ google/selenidepageobject/GoogleTest.javaΛϕʔεʹҰ෦มߋ
  10. Geb @RunWith(JUnit4) public class GoogleTest extend GebTest { @Test def

    userCanSearch() { to GooglePage searchFor("Geb") at SearchResultsPage assert results.size() == 10 assert results[0].text().contains("Geb") } }
  11. waitͷѻ͍ Selenide $("#resultDiv").shouldBe(visible); Geb waitFor { theResultDiv.present } Selenide͸waitΛҙࣝ͠ͳ͍

  12. pure Java ? Selenide: Yes! Geb: No!

  13. Gebίϛολͷίϝϯτ Implicit wait͔ͭ͑Δ͚Ͳɺ ެʹ͸͠ͳ͍Α • ։ൃͱσόοΫΛͭΒ͘͢Δ • ඇಉظॲཧͷӅṭ͸ܦݧ্͏·͍͔͘ͳ͍ Geb͔Βಈతͳ෦෼Λ೷͍ͪΌ͏ͱɺ ΋͏GebͰ͸ͳ͍ͩΖ͏Ͷ

  14. Selenideίϛολίϝϯτ Implicit wait • ͏·͘ಈ͔ͳ͍Α͏ʹࢥ͏ • ΤϨϝϯτͷද͔ࣔ͠଴ͯͳ͍͠ Selenide͸wait͸ࣗલ࣮૷ $("#resultDiv").shouldHave(text("Hello")); $(".error").should(disappear);

  15. ·ͱΊ Selenide • Java • waitΛҙࣝ͠ͳ͍ Geb • Groovy •

    waitॻ͘
  16. ͲͪΒ΋ implicit waitݏ͍

  17. ͓͠·͍