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

Boost your testing: End-to-End with Docker and Geb

Boost your testing: End-to-End with Docker and Geb

End to end testing is a crucial part of a tool chain to deliver high-quality releases of many software systems.

With Geb, we have a very handy wrapper to WebDriver/Selenium at our fingertips that enables us to create actually maintainable E2E test suites even for large web applications.
Combining it with Docker and a CI system enables us to be very flexible about the context we use this tests in and allow us to provoke feedback for many interesting aspects we need to know about in our system.

This talk outlines findings and experiences from projects that utilized the mentioned technologies to succeed in constantly delivering high quality releases not only in slides but also with some live-coding and demos.

Markus Schlichting

March 17, 2018
Tweet

More Decks by Markus Schlichting

Other Decks in Programming

Transcript

  1. Boost your testing:
    End to End with

    Docker & Geb

    17.03.2018
    Markus Schlichting

    View Slide

  2. Markus Schlichting
    Senior Software Engineer
    Basel, Switzerland
    Hackergarten Basel
    [email protected]
    @madmas

    View Slide

  3. End-to-End ?

    View Slide

  4. User experience

    View Slide

  5. Adopt legacy

    View Slide

  6. maintain variants

    View Slide

  7. Say hello to
    • Groovy DSL on top of Selenium/WebDriver
    • IDE support: syntax & debugging
    • PageObject, Modules

    View Slide

  8. 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"
    }

    View Slide

  9. Structure,
    Technical Details
    PageObject
    PageObject
    Spec
    Service
    Method

    View Slide

  10. waitFor { }

    View Slide

  11. waitFor { }
    package demo
    import geb.Browser
    Browser.drive {
    go "https://mynethome.de/animation.html"
    assert title == "Animation For Waitfor Example"
    $("div#app button").click()
    waitFor { !$("div.modal").hasClass("fade-enter-active") }
    $("div.modal button").click()
    waitFor { !$("div.modal").hasClass("fade-leave-active") }
    }

    View Slide

  12. + Spock

    View Slide

  13. + Spock

    View Slide

  14. + Spock
    1
    2

    View Slide

  15. + Spock

    View Slide

  16. Write End-to-End tests with Geb
    Demo

    View Slide

  17. Non-blocking tests?

    View Slide

  18. Docker

    View Slide

  19. View Slide

  20. • Docker WebDriver Selenium Container
    • Xvfb: X virtual frame-buffer
    • Chrome, Firefox
    • Video recording
    Docker

    View Slide

  21. encapsulate 

    End-to-End tests
    Demo

    View Slide

  22. http://nvie.com/posts/a-successful-git-branching-model/

    View Slide

  23. Automation!
    Docker&Geb + CI
    Demo

    View Slide

  24. View Slide

  25. Unit
    Integration
    End to End

    View Slide


  26. • E2E do not replace other tests - they rather
    complete them
    • E2E should merely be seen as the final

    „does everything fit together“
    • „Acceptance Tests“

    View Slide

  27. The horizon
    • Living Documentation:

    Geb/Spock Specs + AsciiDoctor

    View Slide

  28. Markus Schlichting
    [email protected]
    @madmas
    Happy with End-to-End testing
    =

    View Slide