Page Object Model RspecCapybara Page Object Model pros
Page Object Model (Rspec/Capybara) Ø Ø Ø Page Object Model pros & cons Site. Prism Rspec Capybara Example & Useful links 1
Page Object Model pros & cons Ø Page Object Model (POM) is a design pattern to create Object Repository for web UI elements. Ø A page object is an object-oriented class that serves as an interface to a page of your AUT Page Base Object UI Page Object Tests 2
Site. Prism Ø A Page Object Model DSL(Domain Specific Language) for Capybara Ø Gives a simple, clean and semantic DSL for describing a site using the Page Object Model pattern üCreating a Page Model üAdding a URL üPage Title 3
Site. Prism üIndividual Elements (css, xpath) üElements üTesting for existence of elements üChecking that all mapped elements are present on the page 4
Rspec Ø Popular Ruby testing framework Ø Behavior-Driven Development tool – natural syntax Ø Well formatted output 5
Rspec – example Functional requirements: For wire transfer, IBAN for reimbursement and periodicity is required 6
Rspec – example Functional requirements: For wire transfer, IBAN for reimbursement and periodicity is required 7
Capybara Ø A library/gem built to be used on top of an underlying webbased driver, in our case Selenium Ø Intuitive API which mimics the language an actual user would use. üclick_button('button_name') üfill_in('First Name', : with => 'John') üchoose('A Radio Button') ücheck('A Checkbox') üattach_file('Image', '/path/to/image. jpg') Ø Powerful synchronization 8
Example & Useful links Omnimut App • https: //omnimut-dev-1 -2. nxt. uat. unifiedpost. com/affiliation/54 b 42 a 19 -3 e 52 -4 bf 8 -b 231 a 92 d 9 b 49380 b/start? lang=fr Site. Prism • • • http: //www. sitepoint. com/testing-page-objects-siteprism/ http: //www. rubydoc. info/gems/site_prism/Site. Prism/Section https: //github. com/natritmeyer/site_prism RSpec • • http: //rspec. info/ https: //relishapp. com/rspec Capybara • • https: //github. com/jnicklas/capybara http: //jnicklas. github. io/capybara/ 9
Thank you! 10
- Slides: 10