70 likes | 222 Views
Overview. UI Automation Testing WINUIA Windows client based application Data driven High level Command DSL for UI tree traversal and actions XML representation of UI element tree Capybara + RSPEC + RAKE Framework in a box – minimal setup time required
E N D
Overview • UI Automation Testing • WINUIA • Windows client based application • Data driven • High level Command DSL for UI tree traversal and actions • XML representation of UI element tree • Capybara + RSPEC + RAKE • Framework in a box – minimal setup time required • DSL Browser automation framework using Ruby • CI Server Ready
WINUIA • Used for testing windows client based applications • Data Driven • Test data resides in format of choice (Excel, relational DB, mongo, flat file etc.) • Implemented using repository pattern with dependency injection • Pattern allows easy connection with test beds and other interfaces in future (REST etc.) • Transformers map data and provide POJO/hash table form • High level command DSL • Domain specific language • Goal: Isolate the hard work once and allow others to write tests quickly • XML representation of UI element tree • XML is well suited for tree like traversal • A windows form can be represented as a multi level set of elements • Example: Form A has 2 Panes -> Pane 1 -> n elements + 2 Dialogs • Open ended on how the interface can be represented • Adding a new form to your system doesn’t require writing new code • Lessons learned: Make sure your UI forms are built to be tested from the start
CI Browser Automation in 10 Min • Goal • Using a DSL (Domain Specific Language) create a test to automate user login for your web application • Technologies • Capybara – DSL Browser automation framework using Ruby • RSPEC – DSL to describe the test • RAILS – Provides test container structure • Rake – Simple Ruby build program used to run your tests • CI Reporter – Produce the testing report for Jenkins • Jenkins – The CI server • Site Prism – Page Object Pattern for Capybara
Capybara • Browser integration built into framework no need to download selenium drivers • Feature rich API with simple DSL commands • ASYNC AJAX support for finding elements that aren’t visible yet and nested • Other teams can understand your tests and participate in efforts
RSPEC • I want to describe the functional behavior of my test as I would in a conversation with my product team • Describe the sign in process it signs me in – scenario if I am not a valid user it lets me know
A Simple Login Script • Let’s create a simple login script that allows us login at kareo.com RSPEC Capybara
Let’s Add In Jenkins • RAKE + CI Reporter • Make sure your CI server has Ruby installed • Install the rake plugin for Jenkins - https://wiki.jenkins-ci.org/display/JENKINS/Rake+Plugin • Setup CI reporter with your rails test suite • Point your Jenkins build configuration at the CI reporter output file • You're Done! No really you are.