{"id":17038636,"url":"https://github.com/wbotelhos/capybara-box","last_synced_at":"2025-04-12T13:52:44.971Z","repository":{"id":54934701,"uuid":"105067804","full_name":"wbotelhos/capybara-box","owner":"wbotelhos","description":":package: Capybara Box - A Tool Box for Capybara","archived":false,"fork":false,"pushed_at":"2023-03-03T11:39:17.000Z","size":174,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T08:37:11.116Z","etag":null,"topics":["capybara","chrome","firefox","headless-chrome","screenshot","selenium","session"],"latest_commit_sha":null,"homepage":"https://www.danca.com","language":"Ruby","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/wbotelhos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"wbotelhos"}},"created_at":"2017-09-27T20:47:45.000Z","updated_at":"2023-09-08T17:30:29.000Z","dependencies_parsed_at":"2022-08-14T07:00:39.272Z","dependency_job_id":null,"html_url":"https://github.com/wbotelhos/capybara-box","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbotelhos%2Fcapybara-box","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbotelhos%2Fcapybara-box/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbotelhos%2Fcapybara-box/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbotelhos%2Fcapybara-box/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wbotelhos","download_url":"https://codeload.github.com/wbotelhos/capybara-box/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248112432,"owners_count":21049656,"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","firefox","headless-chrome","screenshot","selenium","session"],"created_at":"2024-10-14T08:57:20.054Z","updated_at":"2025-04-12T13:52:44.952Z","avatar_url":"https://github.com/wbotelhos.png","language":"Ruby","funding_links":["https://patreon.com/wbotelhos","https://github.com/sponsors/wbotelhos"],"categories":[],"sub_categories":[],"readme":"# Capybara Box\n\n[![CI](https://github.com/wbotelhos/capybara-box/workflows/CI/badge.svg)](https://github.com/wbotelhos/capybara-box/actions)\n[![Gem Version](https://badge.fury.io/rb/capybara-box.svg)](https://badge.fury.io/rb/capybara-box)\n[![Maintainability](https://api.codeclimate.com/v1/badges/f312587b4f126bb13e85/maintainability)](https://codeclimate.com/github/wbotelhos/capybara-box/maintainability)\n[![Coverage](https://codecov.io/gh/wbotelhos/capybara-box/branch/main/graph/badge.svg)](https://codecov.io/gh/wbotelhos/capybara-box)\n[![Sponsor](https://img.shields.io/badge/sponsor-%3C3-green)](https://github.com/sponsors/wbotelhos)\n\nConfigure Capybara with **Chrome**, **Chrome Headless**, **Firefox** and **Firefox Headless** with *Screenshot* feature without losing your mind.\n\n## install\n\nAdd the following code on your Gemfile and run bundle install:\n\n```ruby\ngroup :test do\n  gem 'capybara-box', require: false\nend\n```\n\n## Usage\n\nJust require the lib **after** Capybara require and you done:\n\n```ruby\nrequire 'capybara/rails'\nrequire 'capybara-box'\n\nCapybaraBox::Base.configure\n```\n\nBy default, `selenium_chrome` is the driver, but you can use `selenium_chrome_headless` and `selenium_firefox` or `selenium_firefox_headless` too.\n\n```ruby\nCapybaraBox::Base.configure(browser: :selenium_firefox)\n```\n\n## Version\n\nThe version is setted via `webdrivers`. You can specify the version:\n\n```ruby\nCapybaraBox::Base.configure(version: '83.0.4103.39')\n```\n\n## Screenshot\n\nYou can enable screenshot on failure:\n\n```ruby\nCapybaraBox.configure(screenshot: { enabled: true })\n```\n\nIf you want to send the screenshot and html page to S3 setup your credentials via ENV:\n\n```sh\nENV['CAPYBARA_BOX__S3_BUCKET_NAME']\nENV['CAPYBARA_BOX__S3_REGION']\nENV['CAPYBARA_BOX__S3_ACCESS_KEY_ID']\nENV['CAPYBARA_BOX__S3_SECRET_ACCESS_KEY']\n```\n\nAnd then enable S3 feature:\n\n```ruby\nCapybaraBox.configure(screenshot: { enabled: true, s3: true })\n```\n\n## Add Argument\n\nBy default some Switches are enabled for a better performance, you can add yours too:\n\n```ruby\ncapybara_box = CapybaraBox.configure\n\ncapybara_box.add_argument('--incognito')\n```\n\n## Arguments\n\nIf you prefere, is possible override all of them:\n\n```ruby\nCapybaraBox.configure(arguments: ['--incognito'])\n```\n\nClick [here](https://peter.sh/experiments/chromium-command-line-switches) to see the avaiables.\n\n## Add Preference\n\nBy default some Preferences are enabled for a better performance, you can add yours too:\n\n```ruby\ncapybara_box = CapybaraBox.configure\n\ncapybara_box.add_preference(:credentials_enable_service, false)\n```\n\n## Preferences\n\nIf you prefere, is possible override all of them:\n\n```ruby\nCapybaraBox.configure(preferences: { credentials_enable_service: false })\n```\n\nYou can check [Chrome](https://sites.google.com/a/chromium.org/chromedriver/home) and [Firefox](http://preferential.mozdev.org/preferences.html).\n\n## HTTP Client Options\n\nBy default some timeout configs are enabled only on CI env for a better performance.\nIt has this restrition because with timeout enabled, debugger cannot evaluate the variables values.\nYou can override all of them too:\n\n```ruby\nCapybaraBox.configure(http_client_options: { read_timeout: 60 })\n```\n\n## Driver Options\n\nYou can override all driver options:\n\n```ruby\nCapybaraBox.configure(driver_options: { clear_local_storage: true })\n```\n\n## Logger\n\nLogs are writen as WARN on the `STDOUT` by default. You can change it:\n\n```ruby\nCapybaraBox.configure(logger: { level: :debug, output: 'log/selenium.log' })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwbotelhos%2Fcapybara-box","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwbotelhos%2Fcapybara-box","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwbotelhos%2Fcapybara-box/lists"}