{"id":20447578,"url":"https://github.com/doamaral/ruby-rspec-selenium","last_synced_at":"2026-04-11T00:52:40.893Z","repository":{"id":87569601,"uuid":"221753534","full_name":"doamaral/ruby-rspec-selenium","owner":"doamaral","description":"Using the minimal number of libs to do UI Testing","archived":false,"fork":false,"pushed_at":"2019-11-21T19:56:46.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-15T21:56:15.806Z","etag":null,"topics":["rspec","ruby","selenium-webdriver","testing","ui"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doamaral.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-14T17:38:06.000Z","updated_at":"2022-12-22T04:40:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"b854dcea-64c5-4ed0-a424-368c2a0f9348","html_url":"https://github.com/doamaral/ruby-rspec-selenium","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doamaral%2Fruby-rspec-selenium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doamaral%2Fruby-rspec-selenium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doamaral%2Fruby-rspec-selenium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doamaral%2Fruby-rspec-selenium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doamaral","download_url":"https://codeload.github.com/doamaral/ruby-rspec-selenium/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241997290,"owners_count":20055113,"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":["rspec","ruby","selenium-webdriver","testing","ui"],"created_at":"2024-11-15T10:27:54.938Z","updated_at":"2025-12-31T00:56:52.307Z","avatar_url":"https://github.com/doamaral.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ruby-rspec-selenium\n\nUsing the minimal number of libs to do UI Testing\n\n## Initial project structure\n\n- `bundle init` to Generate Gemfile\n- Go to [Rubygems](https://rubygems.org) and look for the right way to pu rspec and selenium-webdriver at the Gemfile\n\n```ruby\ngem 'rspec', '~\u003e 3.9'\ngem 'selenium-webdriver', '~\u003e 3.142', '\u003e= 3.142.6'\n```\n\n- `bundle install` to install all gems at Gemfile\n- `rspec --init` to create rspec structure:\n  - `spec` folder\n    - `spec_helper.rb` file\n  - `.rspec` file\n\n## Writing first test script\n\n- Create the first test file at `spec` folder `test_specfile.rb`\n- Describe: our first scenario\n  - All starts with a `describe` plus `it` (or `example`) commands\n- To run tests, just type `rspec \u003cspecfile\u003e.rb`\n- It is not a actual test script without an assertion: using `expect` [[More info about Expectations]](https://www.rubydoc.info/gems/rspec-expectations/RSpec/Expectations)\n- Creating class file to play around doing tests with an objects\n\n## Using Selenium WebDriver\n- First of all, you must Download [Firefox](https://github.com/mozilla/geckodriver/releases/tag/v0.26.0), [Chrome](https://chromedriver.chromium.org/downloads) Driver compatible with your Browser\n- Put its path into the Path environment variable\n- create file `test_with_selenium.rb`\n- add require 'selenium-webdriver'\n- Start to use [Selenium API](https://github.com/SeleniumHQ/selenium/wiki/Ruby-Bindings)\n  - Start with `driver = Selenium::WebDriver.for :firefox or :chrome`\n  - `driver.get \"\u003cURL\u003e\"` open and load a Web Page\n    - You can use `driver.navigate.to \"\u003cURL\u003e\"`, to navigate to a webpage also\n- Exercise element locators with: find_element (HOW, WHAT)\n  - [HOW](https://selenium.dev/selenium/docs/api/rb/Selenium/WebDriver/SearchContext.html#FINDERS-constant): Strategy used to locate elements\n    - :id\n    - :name\n    - :class\n    - :tag_name\n    - :css\n  - WHAT: text to find element\n- RSpec Hooks:\n  - before, after:\n    - :each\n    - :all\n\n## Optional Moves\n\n- One can find interesting moving standard configurations, including stardard Hooks to `spec_helper.rb` file\n  - Do it within `RSpec.configure do |config|` session\n- Using tags to filter examples: `it 'example name', :tag do ...` or `it 'example name', :tag =\u003e 'tag value' do ...`\n- Running options\n  - Test Progress style: `rspec spec/test_*.rb --format documentation`\n  - Running filtering by tags: `rspec spec/test_*.rb --tag tag` or `rspec spec/test_*.rb --tag tag:'tag value'`\n  - Running filtering by example name: `rspec spec/test_*.rb --example 'example name'` or `rspec spec/test_*.rb -e 'example name'`\n\n## What is next\n\n- Implement POM\n- Explore more types of Elements: Combo box, Radiobutton, check box and Ajax calls","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoamaral%2Fruby-rspec-selenium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoamaral%2Fruby-rspec-selenium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoamaral%2Fruby-rspec-selenium/lists"}