Skip to content

KarimAhmedElKhashab/selenium-webdriver-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

selenium-webdriver-ruby

A demo e2e test framework using selenium webdriver under ruby

Dependencies

Running tests

You can run any test via browser={browser} rspec /path_to_file/test_name.rb

Test Reporting via Allure

https://github.com/allure-framework/allure-ruby/blob/master/allure-rspec/README.md

To run specs with Allure formatter from command line

rspec /path/to/example_spec.rb --format AllureRspecFormatter

To generate and view Allure report in HTML format from command line

allure generate report/allure-results

Then

allure serve report/allure-results

Page Object Model and OOP Implementations

Inspired from https://slack.engineering/scaling-end-to-end-user-interface-tests/

  • To abstract UI for better maintainability and scalability you can rely on Class Inheritance OOP concept by having Base parent classes and children classes extending them.
  • Centralized driver class to managae driver main actions and configs
  • Base element class with common Web Element actions
  • Common page helper class that contains common methods that's used across other pages
  • Separate pages to encapsulate each page logic into it's own class/methods

What is next?

  • Separate locators from page objects for better structure, readability and maintainability
  • Break down base web element class into sub types like button, link, input...etc. instead of general WebElement. It isn't so comfortable to work with so general web element API. You have a possibility to type text (send keys) to button or to link.
  • Leverage driver class to use desired capabilities and red config externally

About

A demo e2e test framework using selenium webdriver under ruby

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages