{"id":15580992,"url":"https://github.com/nbulaj/ruby-chromedriver","last_synced_at":"2025-04-24T02:49:34.927Z","repository":{"id":27254664,"uuid":"97582742","full_name":"nbulaj/ruby-chromedriver","owner":"nbulaj","description":"Ruby, Chrome / Chrome driver, NodeJS on Docker for Cucumber specs","archived":false,"fork":false,"pushed_at":"2023-04-17T06:39:21.000Z","size":36,"stargazers_count":32,"open_issues_count":1,"forks_count":20,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T02:49:29.360Z","etag":null,"topics":["capybara","chrome","chromedriver","cucumber","docker","ruby","tests"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nbulaj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-07-18T09:56:41.000Z","updated_at":"2023-09-27T19:05:40.000Z","dependencies_parsed_at":"2024-10-22T20:04:43.488Z","dependency_job_id":null,"html_url":"https://github.com/nbulaj/ruby-chromedriver","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/nbulaj%2Fruby-chromedriver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbulaj%2Fruby-chromedriver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbulaj%2Fruby-chromedriver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbulaj%2Fruby-chromedriver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nbulaj","download_url":"https://codeload.github.com/nbulaj/ruby-chromedriver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250552035,"owners_count":21449161,"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":["capybara","chrome","chromedriver","cucumber","docker","ruby","tests"],"created_at":"2024-10-02T19:40:57.008Z","updated_at":"2025-04-24T02:49:34.878Z","avatar_url":"https://github.com/nbulaj.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ruby-chromedriver\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/nbulai/ruby-chromedriver.svg)](https://hub.docker.com/r/nbulai/ruby-chromedriver/)\n[![Docker Stars](https://img.shields.io/docker/stars/nbulai/ruby-chromedriver.svg)](https://hub.docker.com/r/nbulai/ruby-chromedriver/)\n\nRuby 3.1.x, Chrome / [Chrome driver](https://sites.google.com/chromium.org/driver/), NodeJS on \nDocker for [Capybara](https://github.com/teamcapybara/capybara)/[Cucumber](https://github.com/cucumber/cucumber) specs.\n\nBased on official Ruby image and uses official stable Chrome repository. Uses X virtual framebuffer (Xvfb)\nfor keycode conversions.\n\nCan be used for Continuous Integration or Delivery (CI/CD) pipelines (like GitLab) instead of Qt and PhantomJS:\n\n# CI/CD Configuration\n\nExample of GitLab CI configuration for Ruby on Rails project with Cucumber using the image\n(read https://about.gitlab.com/2017/12/19/moving-to-headless-chrome/):\n\n```yaml\ncucumber:\n  stage: test\n  image: 'nbulai/ruby-chromedriver:latest'\n  variables:\n    RAILS_ENV: test\n  script:\n    - chromedriver -v # to check version\n    - ...\n    - bin/cucumber\n  artifacts:\n    paths:\n      - coverage/\n  only:\n    - main\n```\n\nIf you need some specific screen size for testing, then you can pass it as an `SCREEN` environment variable:\n\n`docker run -e SCREEN=\"1280x1024x16\" -t -i --rm nbulai/ruby-chromedriver:latest bash`\n\nDon't forget to configure your Cucumber/Capybara to use Chrome as a driver (see instruction below).\n\nFirst install it locally to run your test-suite (if you will run tests on the dev machine):\n\n```bash\n# add Google public key\nwget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -\n# add Google Chrome stable repository to sources\necho \"deb http://dl.google.com/linux/chrome/deb/ stable main\" \u003e\u003e /etc/apt/sources.list.d/google.list\nsudo apt-get update \n# install Chrome and it's driver\nsudo apt-get install google-chrome-stable chromium-chromedriver\nsudo ln -s /usr/lib/chromium-browser/chromedriver /usr/bin/chromedriver\n# check if all is OK\nchromedriver -v\n```\n\nAdd gem `selenium-webdriver` to your `Gemfile`:\n\n```ruby\ngroup :test do\n  # ...\n  gem 'selenium-webdriver'\nend\n```\n\nAnd then edit `features/support/env.rb` (or other config file):\n\n```ruby\n# ...\n\nCapybara.register_driver(:headless_chrome) do |app|\n  capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(\n    # Add 'no-sandbox' arg if you have an \"unknown error: Chrome failed to start: exited abnormally\"\n    # @see https://github.com/SeleniumHQ/selenium/issues/4961\n    chromeOptions: { args: %w[headless disable-gpu no-sandbox] } \n  )\n\n  Capybara::Selenium::Driver.new(app, browser: :chrome, desired_capabilities: capabilities)\nend\n\nCapybara.javascript_driver = :headless_chrome\n\n# ...\n```\n\nThat's all. Run `bin/cucumber` to check your tests.\n\n## License\n\nThis repo content is released under the [MIT License](http://www.opensource.org/licenses/MIT).\n\nCopyright (c) 2017- Nikita Bulai (bulajnikita@gmail.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbulaj%2Fruby-chromedriver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnbulaj%2Fruby-chromedriver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbulaj%2Fruby-chromedriver/lists"}