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 full-size slide

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

    View full-size slide

  3. End-to-End ?

    View full-size slide

  4. User experience

    View full-size slide

  5. Adopt legacy

    View full-size slide

  6. maintain variants

    View full-size slide

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

    View full-size 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 full-size slide

  9. Structure,
    Technical Details
    PageObject
    PageObject
    Spec
    Service
    Method

    View full-size slide

  10. 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 full-size slide

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

    View full-size slide

  12. Non-blocking tests?

    View full-size slide

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

    View full-size slide

  14. encapsulate 

    End-to-End tests
    Demo

    View full-size slide

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

    View full-size slide

  16. Automation!
    Docker&Geb + CI
    Demo

    View full-size slide

  17. Unit
    Integration
    End to End

    View full-size slide


  18. • 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 full-size slide

  19. The horizon
    • Living Documentation:

    Geb/Spock Specs + AsciiDoctor

    View full-size slide

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

    View full-size slide