{"id":18537282,"url":"https://github.com/nareshnavinash/teber-ruby","last_synced_at":"2025-07-16T21:15:33.032Z","repository":{"id":40194954,"uuid":"224660641","full_name":"nareshnavinash/Teber-Ruby","owner":"nareshnavinash","description":"Selenium, Ruby, Cucumber framework in Page Object model with Allure as reporting","archived":false,"fork":false,"pushed_at":"2023-01-09T22:31:18.000Z","size":237,"stargazers_count":4,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T10:16:42.633Z","etag":null,"topics":["cucumber","framework","parallel-tests","ruby","selenium","web-automation"],"latest_commit_sha":null,"homepage":"https://nareshnavinash.github.io/Teber-Ruby/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nareshnavinash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-28T13:35:08.000Z","updated_at":"2024-08-05T12:29:12.000Z","dependencies_parsed_at":"2023-02-08T15:00:41.894Z","dependency_job_id":null,"html_url":"https://github.com/nareshnavinash/Teber-Ruby","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nareshnavinash/Teber-Ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nareshnavinash%2FTeber-Ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nareshnavinash%2FTeber-Ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nareshnavinash%2FTeber-Ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nareshnavinash%2FTeber-Ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nareshnavinash","download_url":"https://codeload.github.com/nareshnavinash/Teber-Ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nareshnavinash%2FTeber-Ruby/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263932017,"owners_count":23531707,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cucumber","framework","parallel-tests","ruby","selenium","web-automation"],"created_at":"2024-11-06T19:37:42.743Z","updated_at":"2025-07-06T16:05:17.455Z","avatar_url":"https://github.com/nareshnavinash.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Teber-Ruby\n\nTeber-Ruby is a Page Object Model (POM) framework for selenium automation with ruby `Cucumber`. In order to make the testing faster used 'parallel_tests' gem to run multiple threads to run the tests at the same time. For reporting 'allure' is being adapted.\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE)\n[![Made with Ruby](https://img.shields.io/badge/Made%20with-Ruby-red.svg)](https://www.ruby-lang.org/en/)\n[![StackOverflow](http://img.shields.io/badge/Stack%20Overflow-Ask-blue.svg)]( https://stackoverflow.com/users/10505289/naresh-sekar )\n[![Contributions Welcome](https://img.shields.io/badge/Contributions-Welcome-brightgreen.svg)](CONTRIBUTING.md)\n[![email me](https://img.shields.io/badge/Contact-Email-green.svg)](mailto:nareshnavinash@gmail.com)\n\n\n![alt text](features/libraries/Teber_Ruby_Black.png)\n\n\n## Supports\n* Multiple browser automation\n* Multi browser automation\n* Allure reports\n* Jenkins Integration\n* Modes of run via CLI command\n* Headless run\n* Docker Execution\n* Failed Screenshots\n* Testdata driven tests\n* Multi Thread run\n\n## Setup\n* Clone this repository\n* Navigate to the cloned folder\n* Install bundler using `gem install bundler`\n* Install the dependencies by `bundle install`\n\n## To Run the tests\nFor a simple run of all the feature files in normal mode, try\n```\ncucumber\n```\nTo Run the tests in parallel mode for the available feature files, try\n\n```\nparallel_cucumber features/ \n```\nTo Run the tests in parallel mode for the available feature files along with tags, try\n```\nparallel_cucumber features/ -o \"-t \"@scenario_001\"\"\n```\nTo Run the tests in parallel mode for the available feature files along with tags and environment variables, try\n```\nparallel_cucumber features/ -o \"-t \"@scenario_001\" MODE=headless\"\n```\nThis will run the tests in headless mode\n\n## To open allure results\n```\nallure serve reports/allure\n```\n\n## Multiple Browser\nCurrently supports for Chrome browser, but handled in such a way that framework can be easily configured to support multiple browsers. I used webdriver manager to resolve the driver-browser compatibility issues, use the same to add your designated browser (firefox, edge, ie, safari etc.,).\n\n## Multi Browser\nInitiate the driver class inside support package mutiple times with different WebDriver objects. You can execute the actions in multiple browsers at the same time by executing actions against each driver object.\n\n## Reports\nFor better illustration on the testcases, allure reports has been integrated. Allure reports can also be integrated with jenkins to get a dashboard view. Apart from allure, cucumber's default reporting such as html, pretty, progress, rerun files has been added to the `reports/` folder.\n\n## Jenkins Integration with Docker images\nGet any of the linux with ruby docker image as the slaves in jenkins and use the same for executing the UI automation with this framework (Sample docker image - `https://hub.docker.com/_/ruby`). From the jenkins bash Execute the following to get the testcases to run,\n```\n#!/bin/bash -l\nrvm list\nls\ncd \u003cpath_to_the_project\u003e\nbundle install\ncucumber #or custom commands\n```\nfor complete guide to setup in linux check [Cloud Setup for Ruby](https://github.com/nareshnavinash/Cloud-Setup-Ruby)\n\nIn Jenkins pipeline, try to add the following snippet to execute the tests,\n```\npipeline {\n    agent { docker { image 'ruby' } }\n    stages {\n        stage('build') {\n            steps {\n                sh 'cd project/'\n                sh 'gem install bundler'\n                sh 'bundle install'\n                sh 'cucumber' # or custom methods\n            }\n        }\n    }\n}\n```\n\n## Headless Run\nIn `global-data/global.yml` file, if the mode is `headless`, the chrome will be initialized in headless mode which can be used to run in server. Screenshots will be added even if the browser runs in headless mode.\n\n## Break down into end to end tests\n\n### Adding Locators to the project\n\n1. Add Locators to the that are going to be used inside the project inside the `Locators` module\n```\nmodule Locators\n\t# Add a class for each page and add the locators\nend\n```\n2. For each page add a new class inside the `Locators` module.\n\n```\nmodule Locators\n  class TestPage\n\n    # All the Locators in the initialize block need to be declared here for read write permission.\n    attr_accessor :TEST_LOCATOR\n\n    def initialize\n      # Locators can be declared here by mentioning {how?(xpath,css,id) and what?(identifier)}\n      @TEST_LOCATOR = Locator.new(:id, \"\")\n    end\n\n    # Dynamic locators can be declared here as a seperate method (This method doesnot need to be declared with attr_accessor)\n    def TEST_DYNAMIC_LOCATOR(variable)\n      @TEST_DYNAMIC_LOCATOR = Locator.new(:xpath,\"//*[text()=#{variable}]\")\n    end\n\n  end\nend\n```\n\n3. Ideally each web page should have a new file inside locators folder (with the same name as the web page) and all the locators inside a web page has to be declared inside a page class(Class name also should be same as the web page name).\n* If the web page name is `home page` then the locator file name should be `home_page.rb` inside `locators` folder and the class name should be `HomePage` inside `Locators` module.\n\n### Adding page methods to the project\n\n1. Add page specific methods inside the `Pages` module.\n\n```\nmodule Pages\n  # add the page class here\nend\n```\n\n2. For each page add a new class inside `Pages` module and each page class should inherit the locators class of the same page\n\n```\nmodule Pages\n  class TestPage \u003c Locators::TestPage\n\n    def initialize()\n      super()\n    end\n\n    def test_method(attribute_text)\n    \tputs \"#{attribute_text}\"\n    end\n\n  end\nend\n```\n\n3. Ideally each web page should have a new page file inside `pages` folder with the class name same as the web page name.\n* If the web page name is `home page` then the pages file name should be `home_page.rb` inside `pages` folder and the class name should be `HomePage` inside `Pages` module.\n\n### Creating a new feature file in the project\n\n1. Define the tests in the feature file in gherkin language.\n\n```\nFeature: Sample project setup\n  To get to know the sample cucumber project\n\n  Scenario: This test will pass\n    Given true eql true\n    When false eql false\n    Then string eql string\n```\n\n2. Ideally tags has to be used for each feature and each scenario to identify the test cases in the unique way.\n\n```\n@before_feature @test_feature\nFeature: Sample project setup\n  To get to know about the basic flows in this framework\n\n  @before_scenario @test_id=001\n  Scenario: This test will pass\n    Given true eql true\n    When false eql false\n    Then string eql string\n```\n\n3. Now declare the feature steps inside the step definitions file, the name of the step definition file should be same as the feature file.\n\n4. In the step definitions file, initially declare the before and after action block.\n\n```\nBefore do\n  puts \"before each \"\nend\n\nAfter do |s|\n   puts \"after each \"\nend\n```\n\n5. Cucumber allows us to use in an extensive way. So we can define `Before` and `After` for each specific tags that we defined in the feature file.\n\n```\nBefore('@test_tag') do\n  puts \"before each \"\nend\n\nAfter('@test_tag') do |s|\n   puts \"after each \"\nend\n```\n\n6. Define the steps after the before/after block.\n\n```\nGiven(\"true eql true\") do\n  expect(true).to eql true\nend\n\nWhen(\"false eql false\") do\n  expect(false).to eql false\nend\n\nThen(\"string eql string\") do\n  expect(\"test\").to eql \"test\"\nend\n```\n\n## Built With\n\n* [Cucumber](https://rubygems.org/gems/cucumber/versions/3.1.2) - Automation core framework\n* [Parallel_tests](https://rubygems.org/gems/parallel_tests) - To run automation parallely at the same time.\n* [Allure Cucumber](https://rubygems.org/gems/allure-cucumber/versions/0.6.1) - For Detailed reporting.\n* [Selenium](https://www.seleniumhq.org/) - For web browser automation.\n\n## Contributing\n\n1. Clone the repo!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Create a pull request.\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) for details on code of conduct, and the process for submitting pull requests.\n\n## Authors\n\n* **[Naresh Sekar](https://github.com/nareshnavinash)**\n\n## License\n\nThis project is licensed under the GNU GPL-3.0 License - see the [LICENSE](LICENSE) file for details\n\n## Acknowledgments\n\n* To all the open source contributors whose code has been referred in this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnareshnavinash%2Fteber-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnareshnavinash%2Fteber-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnareshnavinash%2Fteber-ruby/lists"}