Repository: teamcapybara/capybara Branch: master Commit: b3325b198464 Files: 342 Total size: 1.7 MB Directory structure: gitextract_qjm4xzrk/ ├── .codeclimate.yml ├── .gitattributes ├── .github/ │ ├── ISSUE_TEMPLATE.md │ ├── dependabot.yml │ ├── lock.yml │ └── workflows/ │ └── build.yml ├── .gitignore ├── .rspec ├── .rubocop.yml ├── .yardopts ├── CONTRIBUTING.md ├── Gemfile ├── History.md ├── License.txt ├── README.md ├── Rakefile ├── UPGRADING.md ├── appveyor.yml.outdated ├── capybara.gemspec ├── docker-compose.yml ├── features/ │ ├── capybara.feature │ ├── named_driver_feature.feature │ ├── step_definitions/ │ │ └── capybara_steps.rb │ └── support/ │ └── env.rb ├── gem-public_cert.pem ├── gemfiles/ │ ├── Gemfile.base-versions │ ├── Gemfile.beta-versions │ ├── Gemfile.chrome_edge │ ├── Gemfile.edge-firefox │ ├── Gemfile.ie │ ├── Gemfile.rack2 │ └── Gemfile.rack3 ├── lib/ │ ├── capybara/ │ │ ├── config.rb │ │ ├── cucumber.rb │ │ ├── driver/ │ │ │ ├── base.rb │ │ │ └── node.rb │ │ ├── dsl.rb │ │ ├── helpers.rb │ │ ├── minitest/ │ │ │ └── spec.rb │ │ ├── minitest.rb │ │ ├── node/ │ │ │ ├── actions.rb │ │ │ ├── base.rb │ │ │ ├── document.rb │ │ │ ├── document_matchers.rb │ │ │ ├── element.rb │ │ │ ├── finders.rb │ │ │ ├── matchers.rb │ │ │ ├── simple.rb │ │ │ └── whitespace_normalizer.rb │ │ ├── queries/ │ │ │ ├── active_element_query.rb │ │ │ ├── ancestor_query.rb │ │ │ ├── base_query.rb │ │ │ ├── current_path_query.rb │ │ │ ├── match_query.rb │ │ │ ├── selector_query.rb │ │ │ ├── sibling_query.rb │ │ │ ├── style_query.rb │ │ │ ├── text_query.rb │ │ │ └── title_query.rb │ │ ├── rack_test/ │ │ │ ├── browser.rb │ │ │ ├── css_handlers.rb │ │ │ ├── driver.rb │ │ │ ├── errors.rb │ │ │ ├── form.rb │ │ │ └── node.rb │ │ ├── rails.rb │ │ ├── registration_container.rb │ │ ├── registrations/ │ │ │ ├── drivers.rb │ │ │ ├── patches/ │ │ │ │ └── puma_ssl.rb │ │ │ └── servers.rb │ │ ├── result.rb │ │ ├── rspec/ │ │ │ ├── features.rb │ │ │ ├── matcher_proxies.rb │ │ │ ├── matchers/ │ │ │ │ ├── base.rb │ │ │ │ ├── become_closed.rb │ │ │ │ ├── compound.rb │ │ │ │ ├── count_sugar.rb │ │ │ │ ├── have_ancestor.rb │ │ │ │ ├── have_current_path.rb │ │ │ │ ├── have_selector.rb │ │ │ │ ├── have_sibling.rb │ │ │ │ ├── have_text.rb │ │ │ │ ├── have_title.rb │ │ │ │ ├── match_selector.rb │ │ │ │ ├── match_style.rb │ │ │ │ └── spatial_sugar.rb │ │ │ └── matchers.rb │ │ ├── rspec.rb │ │ ├── selector/ │ │ │ ├── builders/ │ │ │ │ ├── css_builder.rb │ │ │ │ └── xpath_builder.rb │ │ │ ├── css.rb │ │ │ ├── definition/ │ │ │ │ ├── button.rb │ │ │ │ ├── checkbox.rb │ │ │ │ ├── css.rb │ │ │ │ ├── datalist_input.rb │ │ │ │ ├── datalist_option.rb │ │ │ │ ├── element.rb │ │ │ │ ├── field.rb │ │ │ │ ├── fieldset.rb │ │ │ │ ├── file_field.rb │ │ │ │ ├── fillable_field.rb │ │ │ │ ├── frame.rb │ │ │ │ ├── id.rb │ │ │ │ ├── label.rb │ │ │ │ ├── link.rb │ │ │ │ ├── link_or_button.rb │ │ │ │ ├── option.rb │ │ │ │ ├── radio_button.rb │ │ │ │ ├── select.rb │ │ │ │ ├── table.rb │ │ │ │ ├── table_row.rb │ │ │ │ └── xpath.rb │ │ │ ├── definition.rb │ │ │ ├── filter.rb │ │ │ ├── filter_set.rb │ │ │ ├── filters/ │ │ │ │ ├── base.rb │ │ │ │ ├── expression_filter.rb │ │ │ │ ├── locator_filter.rb │ │ │ │ └── node_filter.rb │ │ │ ├── regexp_disassembler.rb │ │ │ ├── selector.rb │ │ │ └── xpath_extensions.rb │ │ ├── selector.rb │ │ ├── selenium/ │ │ │ ├── atoms/ │ │ │ │ └── src/ │ │ │ │ ├── getAttribute.js │ │ │ │ └── isDisplayed.js │ │ │ ├── driver.rb │ │ │ ├── driver_specializations/ │ │ │ │ ├── chrome_driver.rb │ │ │ │ ├── edge_driver.rb │ │ │ │ ├── firefox_driver.rb │ │ │ │ ├── internet_explorer_driver.rb │ │ │ │ └── safari_driver.rb │ │ │ ├── extensions/ │ │ │ │ ├── file_input_click_emulation.rb │ │ │ │ ├── find.rb │ │ │ │ ├── html5_drag.rb │ │ │ │ ├── modifier_keys_stack.rb │ │ │ │ └── scroll.rb │ │ │ ├── node.rb │ │ │ ├── nodes/ │ │ │ │ ├── chrome_node.rb │ │ │ │ ├── edge_node.rb │ │ │ │ ├── firefox_node.rb │ │ │ │ ├── ie_node.rb │ │ │ │ └── safari_node.rb │ │ │ └── patches/ │ │ │ ├── atoms.rb │ │ │ ├── is_displayed.rb │ │ │ ├── logs.rb │ │ │ ├── pause_duration_fix.rb │ │ │ └── persistent_client.rb │ │ ├── server/ │ │ │ ├── animation_disabler.rb │ │ │ ├── checker.rb │ │ │ └── middleware.rb │ │ ├── server.rb │ │ ├── session/ │ │ │ ├── config.rb │ │ │ └── matchers.rb │ │ ├── session.rb │ │ ├── spec/ │ │ │ ├── fixtures/ │ │ │ │ ├── another_test_file.txt │ │ │ │ ├── no_extension │ │ │ │ └── test_file.txt │ │ │ ├── public/ │ │ │ │ ├── jquery-ui.js │ │ │ │ ├── jquery.js │ │ │ │ ├── offset.js │ │ │ │ └── test.js │ │ │ ├── session/ │ │ │ │ ├── accept_alert_spec.rb │ │ │ │ ├── accept_confirm_spec.rb │ │ │ │ ├── accept_prompt_spec.rb │ │ │ │ ├── active_element_spec.rb │ │ │ │ ├── all_spec.rb │ │ │ │ ├── ancestor_spec.rb │ │ │ │ ├── assert_all_of_selectors_spec.rb │ │ │ │ ├── assert_current_path_spec.rb │ │ │ │ ├── assert_selector_spec.rb │ │ │ │ ├── assert_style_spec.rb │ │ │ │ ├── assert_text_spec.rb │ │ │ │ ├── assert_title_spec.rb │ │ │ │ ├── attach_file_spec.rb │ │ │ │ ├── body_spec.rb │ │ │ │ ├── check_spec.rb │ │ │ │ ├── choose_spec.rb │ │ │ │ ├── click_button_spec.rb │ │ │ │ ├── click_link_or_button_spec.rb │ │ │ │ ├── click_link_spec.rb │ │ │ │ ├── current_scope_spec.rb │ │ │ │ ├── current_url_spec.rb │ │ │ │ ├── dismiss_confirm_spec.rb │ │ │ │ ├── dismiss_prompt_spec.rb │ │ │ │ ├── element/ │ │ │ │ │ ├── assert_match_selector_spec.rb │ │ │ │ │ ├── match_css_spec.rb │ │ │ │ │ ├── match_xpath_spec.rb │ │ │ │ │ └── matches_selector_spec.rb │ │ │ │ ├── evaluate_async_script_spec.rb │ │ │ │ ├── evaluate_script_spec.rb │ │ │ │ ├── execute_script_spec.rb │ │ │ │ ├── fill_in_spec.rb │ │ │ │ ├── find_button_spec.rb │ │ │ │ ├── find_by_id_spec.rb │ │ │ │ ├── find_field_spec.rb │ │ │ │ ├── find_link_spec.rb │ │ │ │ ├── find_spec.rb │ │ │ │ ├── first_spec.rb │ │ │ │ ├── frame/ │ │ │ │ │ ├── frame_title_spec.rb │ │ │ │ │ ├── frame_url_spec.rb │ │ │ │ │ ├── switch_to_frame_spec.rb │ │ │ │ │ └── within_frame_spec.rb │ │ │ │ ├── go_back_spec.rb │ │ │ │ ├── go_forward_spec.rb │ │ │ │ ├── has_all_selectors_spec.rb │ │ │ │ ├── has_ancestor_spec.rb │ │ │ │ ├── has_any_selectors_spec.rb │ │ │ │ ├── has_button_spec.rb │ │ │ │ ├── has_css_spec.rb │ │ │ │ ├── has_current_path_spec.rb │ │ │ │ ├── has_element_spec.rb │ │ │ │ ├── has_field_spec.rb │ │ │ │ ├── has_link_spec.rb │ │ │ │ ├── has_none_selectors_spec.rb │ │ │ │ ├── has_select_spec.rb │ │ │ │ ├── has_selector_spec.rb │ │ │ │ ├── has_sibling_spec.rb │ │ │ │ ├── has_table_spec.rb │ │ │ │ ├── has_text_spec.rb │ │ │ │ ├── has_title_spec.rb │ │ │ │ ├── has_xpath_spec.rb │ │ │ │ ├── headers_spec.rb │ │ │ │ ├── html_spec.rb │ │ │ │ ├── matches_style_spec.rb │ │ │ │ ├── node_spec.rb │ │ │ │ ├── node_wrapper_spec.rb │ │ │ │ ├── refresh_spec.rb │ │ │ │ ├── reset_session_spec.rb │ │ │ │ ├── response_code_spec.rb │ │ │ │ ├── save_and_open_page_spec.rb │ │ │ │ ├── save_and_open_screenshot_spec.rb │ │ │ │ ├── save_page_spec.rb │ │ │ │ ├── save_screenshot_spec.rb │ │ │ │ ├── screenshot_spec.rb │ │ │ │ ├── scroll_spec.rb │ │ │ │ ├── select_spec.rb │ │ │ │ ├── selectors_spec.rb │ │ │ │ ├── sibling_spec.rb │ │ │ │ ├── text_spec.rb │ │ │ │ ├── title_spec.rb │ │ │ │ ├── uncheck_spec.rb │ │ │ │ ├── unselect_spec.rb │ │ │ │ ├── visit_spec.rb │ │ │ │ ├── window/ │ │ │ │ │ ├── become_closed_spec.rb │ │ │ │ │ ├── current_window_spec.rb │ │ │ │ │ ├── open_new_window_spec.rb │ │ │ │ │ ├── switch_to_window_spec.rb │ │ │ │ │ ├── window_opened_by_spec.rb │ │ │ │ │ ├── window_spec.rb │ │ │ │ │ ├── windows_spec.rb │ │ │ │ │ └── within_window_spec.rb │ │ │ │ └── within_spec.rb │ │ │ ├── spec_helper.rb │ │ │ ├── test_app.rb │ │ │ └── views/ │ │ │ ├── animated.erb │ │ │ ├── buttons.erb │ │ │ ├── fieldsets.erb │ │ │ ├── form.erb │ │ │ ├── frame_child.erb │ │ │ ├── frame_one.erb │ │ │ ├── frame_parent.erb │ │ │ ├── frame_two.erb │ │ │ ├── header_links.erb │ │ │ ├── host_links.erb │ │ │ ├── initial_alert.erb │ │ │ ├── layout.erb │ │ │ ├── obscured.erb │ │ │ ├── offset.erb │ │ │ ├── path.erb │ │ │ ├── popup_one.erb │ │ │ ├── popup_two.erb │ │ │ ├── postback.erb │ │ │ ├── react.erb │ │ │ ├── scroll.erb │ │ │ ├── spatial.erb │ │ │ ├── tables.erb │ │ │ ├── with_animation.erb │ │ │ ├── with_base_tag.erb │ │ │ ├── with_count.erb │ │ │ ├── with_dragula.erb │ │ │ ├── with_fixed_header_footer.erb │ │ │ ├── with_hover.erb │ │ │ ├── with_hover1.erb │ │ │ ├── with_html.erb │ │ │ ├── with_html5_svg.erb │ │ │ ├── with_html_entities.erb │ │ │ ├── with_jquery_animation.erb │ │ │ ├── with_js.erb │ │ │ ├── with_jstree.erb │ │ │ ├── with_namespace.erb │ │ │ ├── with_scope.erb │ │ │ ├── with_scope_other.erb │ │ │ ├── with_shadow.erb │ │ │ ├── with_simple_html.erb │ │ │ ├── with_slow_unload.erb │ │ │ ├── with_sortable_js.erb │ │ │ ├── with_unload_alert.erb │ │ │ ├── with_windows.erb │ │ │ └── within_frames.erb │ │ ├── version.rb │ │ └── window.rb │ └── capybara.rb └── spec/ ├── basic_node_spec.rb ├── capybara_spec.rb ├── counter_spec.rb ├── css_builder_spec.rb ├── css_splitter_spec.rb ├── dsl_spec.rb ├── filter_set_spec.rb ├── fixtures/ │ ├── capybara.csv │ ├── certificate.pem │ ├── key.pem │ ├── selenium_driver_rspec_failure.rb │ └── selenium_driver_rspec_success.rb ├── minitest_spec.rb ├── minitest_spec_spec.rb ├── per_session_config_spec.rb ├── rack_test_spec.rb ├── regexp_dissassembler_spec.rb ├── result_spec.rb ├── rspec/ │ ├── features_spec.rb │ ├── scenarios_spec.rb │ ├── shared_spec_matchers.rb │ └── views_spec.rb ├── rspec_matchers_spec.rb ├── rspec_spec.rb ├── sauce_spec_chrome.rb ├── selector_spec.rb ├── selenium_spec_chrome.rb ├── selenium_spec_chrome_remote.rb ├── selenium_spec_edge.rb ├── selenium_spec_firefox.rb ├── selenium_spec_firefox_remote.rb ├── selenium_spec_ie.rb ├── selenium_spec_safari.rb ├── server_spec.rb ├── session_spec.rb ├── shared_selenium_node.rb ├── shared_selenium_session.rb ├── spec_helper.rb ├── whitespace_normalizer_spec.rb └── xpath_builder_spec.rb ================================================ FILE CONTENTS ================================================ ================================================ FILE: .codeclimate.yml ================================================ --- version: "2" checks: method-count: enabled: false file-lines: config: threshold: 500 method-complexity: config: threshold: 10 engines: bundler-audit: enabled: false csslint: enabled: false duplication: enabled: true exclude_patterns: - "lib/capybara/selector.rb" - "lib/capybara/minitest.rb" - "lib/capybara/selector/definition/" - "lib/capybara/rspec/matchers/" config: languages: ruby: mass_threshold: 25 eslint: enabled: false fixme: enabled: true rubocop: enabled: true channel: rubocop-0-72 exclude_fingerprints: - affb30770e6ef0780044f5646e28d817 ratings: paths: - Gemfile.lock - "**.css" - "**.inc" - "**.js" - "**.jsx" - "**.module" - "**.php" - "**.py" - "**.rb" exclude_paths: - features/ - spec/ - lib/capybara/spec/ ================================================ FILE: .gitattributes ================================================ lib/capybara/spec/views/*.erb eol=lf ================================================ FILE: .github/ISSUE_TEMPLATE.md ================================================ **Note:** This is for issues with Capybara. If you have a howto type question, please ask on the mailing list as requested in the README: http://groups.google.com/group/ruby-capybara ## Meta Capybara Version: Driver Information (and browser if relevant): ## Expected Behavior ## Actual Behavior ## Steps to reproduce ================================================ FILE: .github/dependabot.yml ================================================ version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" ================================================ FILE: .github/lock.yml ================================================ # Configuration for Lock Threads - https://github.com/dessant/lock-threads # Number of days of inactivity before a closed issue or pull request is locked daysUntilLock: 30 # Skip issues and pull requests created before a given timestamp. Timestamp must # follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable skipCreatedBefore: false # Issues and pull requests with these labels will be ignored. Set to `[]` to disable exemptLabels: [] # Label to add before locking, such as `outdated`. Set to `false` to disable lockLabel: false # Comment to post before locking. Set to `false` to disable lockComment: false # Assign `resolved` as the reason for locking. Set to `false` to disable setLockReason: false # Limit to only `issues` or `pulls` only: issues # Optionally, specify configuration settings just for `issues` or `pulls` # issues: # exemptLabels: # - help-wanted # lockLabel: outdated # pulls: # daysUntilLock: 30 # Repository to extend settings from # _extends: repo ================================================ FILE: .github/workflows/build.yml ================================================ # This workflow will download a prebuilt Ruby version, install dependencies and # run tests with Rake # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby name: Build "on": push env: CUCUMBER_PUBLISH_QUIET: true RUBYOPTS: "--disable-did-you-mean" NOKOGIRI_USE_SYSTEM_LIBRARIES: true JAVA_OPTS: "-Djava.security.egd=file:/dev/urandom" WD_CACHE_TIME: 0 jobs: rack_smoke: runs-on: ubuntu-latest env: HTML5_PARSING: true strategy: fail-fast: false matrix: ruby: ["3.2", "3.3", "3.4"] task: ["rack_smoke", "cucumber"] steps: - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Run smoke tests run: bundle exec rake ${{ matrix.task }} headless: runs-on: ubuntu-latest env: HEADLESS: true strategy: # Ensure all jobs are run to completion fail-fast: false matrix: ruby: ["3.2"] task: ["spec_chrome", "spec_firefox"] steps: - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Run tests run: bundle exec rake ${{ matrix.task }} headless_base_versions: runs-on: ubuntu-latest env: HEADLESS: true BUNDLE_GEMFILE: gemfiles/Gemfile.base-versions strategy: # Ensure all jobs are run to completion fail-fast: false matrix: ruby: ["3.2"] task: ["spec_chrome", "spec_firefox"] steps: - uses: actions/checkout@v4 - name: Install non-ruby dependencies run: | sudo apt-get update sudo apt-get install libxslt-dev - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Run tests run: bundle exec rake ${{ matrix.task }} # remote_chrome: # runs-on: ubuntu-latest # strategy: # matrix: # ruby: ["3.0"] # steps: # - uses: actions/checkout@v4 # - name: Set up Ruby # uses: ruby/setup-ruby@v1 # with: # ruby-version: ${{ matrix.ruby }} # bundler-cache: true # - name: Run remote Chrome # run: docker-compose up -d selenium_chrome # - name: Run specs # run: bundle exec rake spec_chrome_remote # remote_firefox: # runs-on: ubuntu-latest # strategy: # matrix: # ruby: ["3.1"] # steps: # - uses: actions/checkout@v4 # - name: Set up Ruby # uses: ruby/setup-ruby@v1 # with: # ruby-version: ${{ matrix.ruby }} # bundler-cache: true # - name: Run remote Firefox # run: docker-compose up -d selenium_firefox # - name: Run specs # run: bundle exec rake spec_firefox_remote non_headless: runs-on: ubuntu-latest strategy: # Ensure all jobs are run to completion fail-fast: false matrix: ruby: ["3.2"] task: ["spec_chrome", "spec_firefox"] steps: - uses: actions/checkout@v4 - name: Install non-ruby dependencies run: | sudo apt-get update sudo apt-get install xvfb fluxbox - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Run tests inside a window manager run: xvfb-run sh -c "fluxbox & bundle exec rake ${{ matrix.task }}; killall fluxbox" rack_3: runs-on: ubuntu-latest env: HEADLESS: true BUNDLE_GEMFILE: gemfiles/Gemfile.rack3 strategy: fail-fast: false matrix: ruby: ["3.4"] task: ["spec_rack"] steps: - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Run smoke tests run: bundle exec rake ${{ matrix.task }} ================================================ FILE: .gitignore ================================================ .rbx .idea/ .DS_Store pkg tmp *~ *swp *gem spec.opts .rvmrc .ruby-version .java-version .ruby-gemset capybara-*.html .yardoc doc .bundle Gemfile*.lock chromedriver.log bundler_stubs bin gem-private_key.pem save_path_tmp vendor/bundle .byebug_history ================================================ FILE: .rspec ================================================ --color --order random --require rspec/instafail --format RSpec::Instafail --format progress ================================================ FILE: .rubocop.yml ================================================ plugins: - rubocop-minitest - rubocop-performance - rubocop-rake - rubocop-capybara - rubocop-rspec AllCops: NewCops: enable DisabledByDefault: false TargetRubyVersion: 3.2 Exclude: - 'vendor/**/*' - 'gemfiles/vendor/**/*' #################### Capybara ################## Capybara/NegationMatcher: Enabled: false RSpec/SpecFilePathFormat: Enabled: false RSpec/SpecFilePathSuffix: Enabled: false Capybara/FindAllFirst: Enabled: false Capybara/NegationMatcherAfterVisit: Enabled: false Capybara/RSpec/HaveSelector: Enabled: false Capybara/SpecificFinders: Enabled: false Capybara/ClickLinkOrButtonStyle: Enabled: false #################### Gemspec ################### Gemspec/DevelopmentDependencies: Enabled: false #################### Layout #################### Layout/AccessModifierIndentation: EnforcedStyle: outdent Layout/CaseIndentation: EnforcedStyle: end Layout/EmptyLineBetweenDefs: AllowAdjacentOneLineDefs: true Layout/EndAlignment: EnforcedStyleAlignWith: variable Layout/FirstArrayElementIndentation: EnforcedStyle: consistent Layout/IndentationWidth: AllowedPatterns: ['^\s*module'] Layout/LineLength: # Limit lines to 120 characters # https://github.com/rubocop/ruby-style-guide#maximum-line-length Exclude: - 'spec/**/*' - 'lib/capybara/spec/**/*' AllowedPatterns: - '\s+# _?rubocop' - '^\s*#' - '^\s*(raise|warn|Capybara::Helpers.warn) ' Max: 120 #################### Lint #################### Lint/EmptyBlock: Exclude: - 'lib/capybara/spec/**/*' - 'spec/**/*.rb' Lint/UnusedMethodArgument: Exclude: - 'lib/capybara/driver/base.rb' - 'lib/capybara/driver/node.rb' #################### Metrics #################### Metrics/AbcSize: Enabled: false Metrics/BlockLength: Exclude: - 'spec/**/*' - 'lib/capybara/spec/**/*' - 'capybara.gemspec' AllowedMethods: - Capybara.add_selector - Capybara::Selector::FilterSet.add Metrics/ClassLength: CountComments: false Enabled: false Metrics/CyclomaticComplexity: Enabled: false Metrics/MethodLength: CountComments: false Enabled: false Metrics/ModuleLength: Enabled: false CountComments: false Metrics/ParameterLists: CountKeywordArgs: false Metrics/PerceivedComplexity: Enabled: false #################### Naming #################### Naming/MethodParameterName: AllowedNames: - 'el' - 'id' - 'c' - 'x' - 'y' - 'on' Naming/PredicatePrefix: Exclude: - '**/*/*matchers.rb' - '**/*/matchers/base.rb' - '**/*/matchers/match_style.rb' #################### Performance #################### Performance/MethodObjectAsBlock: Enabled: false Performance/StringIdentifierArgument: Enabled: false #################### RSpec #################### # Capybara/FeatureMethods: # Enabled: false RSpec/ContextWording: Enabled: false RSpec/DescribeClass: Enabled: false RSpec/ExampleLength: Enabled: false RSpec/ExampleWording: Enabled: false # RSpec/FilePath: # Enabled: false RSpec/InstanceVariable: AssignmentOnly: true RSpec/MultipleExpectations: Enabled: false RSpec/NestedGroups: Enabled: false RSpec/NoExpectationExample: Enabled: false RSpec/PredicateMatcher: Exclude: - 'spec/basic_node_spec.rb' #################### Security #################### Security/YAMLLoad: Exclude: - 'lib/capybara/spec/**/*' - 'spec/**/*' #################### Style #################### Style/AccessorGrouping: Enabled: false Style/Alias: Enabled: false Style/ArgumentsForwarding: Enabled: false Style/ClassAndModuleChildren: Enabled: false Style/Documentation: Exclude: - 'lib/capybara/spec/**/*' - 'spec/**/*' Enabled: false Style/DocumentDynamicEvalDefinition: Enabled: false Style/EmptyElse: EnforcedStyle: empty Style/IfUnlessModifier: Exclude: - 'spec/**/*' Style/NumericLiterals: Exclude: - 'lib/capybara/spec/**/*' - 'spec/**/*' Style/ParallelAssignment: Enabled: false Style/SingleLineMethods: Enabled: false Style/SpecialGlobalVars: Exclude: - 'capybara.gemspec' ### Enable and fix Style/KeywordArgumentsMerging: Enabled: false Gemspec/AddRuntimeDependency: Enabled: false Lint/UselessConstantScoping: Enabled: false Naming/PredicateMethod: Enabled: false RSpec/IncludeExamples: Enabled: false Style/SuperArguments: Enabled: false Style/FileNull: Enabled: false Naming/BlockForwarding: Enabled: false Style/ArrayIntersect: Enabled: false ================================================ FILE: .yardopts ================================================ --markup markdown ================================================ FILE: CONTRIBUTING.md ================================================ ## Questions about Capybara? To get your questions answered, please ask on the [mailing list]. Do not open an issue. ## Bug Reports If you are at all unsure whether it's a bug in Capybara or a problem with your code, post on the [mailing list] instead. If it turns out that it is a bug, we can always open an issue later. If you are sure that it's a bug in Capybara, open a new [issue] and try to answer the following questions: - What did you do? - What did you expect to happen? - What happened instead? Please also post code to replicate the bug. Ideally a failing test would be perfect, but even a simple script demonstrating the error would suffice. You could use [this template](https://gist.github.com/jnicklas/5137053) as a starting point. Please don't send us an entire application, unless the bug is in the *interaction* between Capybara and a particular framework. Make sure to specify which version of Capybara you are using. Feature requests are great, but they usually end up lying around the issue tracker indefinitely. Sending a pull request is a much better way of getting a particular feature into Capybara. ## Pull Requests - **Add tests!** Your patch won't be accepted if it doesn't have tests. To run a single test or scenario in development use `:focus_` metadata, e.g.: `it 'should simulate multiple held down modifier keys', :focus_ do` - **Document any change in behaviour**. Make sure the README and any other relevant documentation are kept up-to-date. - **Consider our release cycle**. We try to follow semver. Randomly breaking public APIs is not an option. - **Create topic branches**. Don't ask us to pull from your master branch. - **One pull request per feature**. If you want to do more than one thing, send multiple pull requests. - **Send coherent history**. Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before sending them to us. [mailing list]: http://groups.google.com/group/ruby-capybara [issue]: https://github.com/teamcapybara/capybara/issues ================================================ FILE: Gemfile ================================================ # frozen_string_literal: true source 'https://rubygems.org' gem 'bundler', '< 3.0' gemspec gem 'xpath', github: 'teamcapybara/xpath' # gem 'rack-test', github: 'rack/rack-test' group :doc do gem 'redcarpet', platforms: :mri end ================================================ FILE: History.md ================================================ # Version 3.40.0 Release date: 2024-01-26 ### Changned * Dropped support for Ruby 2.7, 3.0+ is now required * Dropped support for Selenium < 4.8 * Use the new headless option on chromedriver with registered selenium driver [Neil Carvalho] ### Added * `Capybara::Result#to_ary` to support multiple assignment [Sean Doyle] * `has_element?` and related matchers [Sean Doyle] * Rack 3 support ### Fixed * Forward save_screenshot options to selenium - Issue 2738 * Rack test - don't auto submit forms with multiple inputs [Mitchell Henke] * Table row selector matches cell values in order - Issue 2686 [Jeff Parr] * Table row selector fixes for first column - Issue 2685 [Jeff Par] # Version 3.39.2 Release date: 2023-06-10 ### Fixed * Fix Selenium version comparison [aki77] # Version 3.39.1 Release date: 2023-05-12 ### Fixed * Fix usage of Selenium logger # Version 3.39.0 Release date: 2023-04-02 ### Added * Support `:target` filter option on `:link` selector [Yudai Takada] * Experimental Rack 3 support * Text normalization performance improvements [Brandon Weaver] ### Fixed * MS Edge button click [Brian J. Bayer] * Options/Capabilities choosing based on Selenium versions * Support for base versions [Matijs van Zuijlen] * ExpectedError not defined in Selenium 4+ * Filter block forwarding to a number of matchers [Christophe Bliard] ### Changed * Dropped support for rack 1.x # Version 3.38.0 Release date: 2022-11-03 ### Changed * Capybara.w3c_click_offset now defaults to true. If you need click offsets to be from the elements top left corner set it to false in your config ### Added * Support Selenium 4.3 changes to click offset calculations * `click`, `double_click`, `right_click` can now be called on the session to click the currently scoped element (or document) * `Session#within` now passes the scoped element to the block * Support rack-test 2+ * Retry interval is now configurable [Masahiro NOMOTO] * Support Puma 6 - Issue #2590 * Selenium: DetachedShadowRootError is treated as an invalid element error [Perryn Fowler] * Selenium: When inspected shadow roots will have a tag name of "ShadowRoot" * `evaluate_async_script` added to Session::DSL_METHODS [Henry Blyth] ### Fixed * Use higher precision clock in Capybara::Helpers::Timer if available * rack-test driver behavior with \r\n - Issue #2547 [Stefan Hoffmann] * Updated for deprecation of positional parameters in Selenium::WebDriver::ActionBuilder#pause * Explicitly set cause on server raised errors * Options no longer duplicated in have_xxx invalid option error message [Yudai Takada] * Animation disabler is now threadsafe [Daniel Sheppard] * Server connection count tracking [Oleksandr K.] * Ensure scopes are reset when session is [Henry Blyth] # Version 3.37.1 Release date: 2022-05-09 ### Fixed * Regression in rack-test visit - Issue #2548 # Version 3.37.0 Release date: 2022-05-07 ### Changed * Ruby 2.7.0+ is now required ### Added * [Beta] CSP nonces inserted into animation disabler additions - Issue #2542 * Support `` element in rack-test driver - ISsue #2544 * [Beta] `Element#shadow_root` support. Requires selenium-webdriver 4.1+. Only currently supported with Chrome when using the selenium driver. Note: only CSS can be used to find elements from the shadow root. Therefore you won't be able to use most Capybara helper methods (`fill_in`, `click_link`, `find_field`, etc) directly from the shadow root since those locators are built using XPath. If you first locate a descendant from the shadow root using CSS then you should be able to use all the Capybara methods from there. * Regexp now supported for `exact_text` finder option ### Fixed * Fragments in referer headers in rack-test driver - Issue #2525 * Selenium v4.1 deprecation notice # Version 3.36.0 Release date: 2021-10-24 ### Changed * Ruby 2.6.0+ is now required * Minimum selenium-webdriver supported is now 3.142.7 ### Added * Support for selenium-webdriver 4.x * `allow_label_click` accepts click options to be used when clicking an associated label * Deprecated `allow_gumbo=` in favor of `use_html5_parsing=` to enable use of Nokogiri::HTML5 when available * `Session#active_element` returns the element with focus - Not supported by the `RackTest` driver [Sean Doyle] * Support `focused:` filter for finding interactive elements - Not supported by the `RackTest` driver [Sean Doyle] ### Fixed * Sibling and ancestor queries now work with Simple::Node - Issue #2452 * rack_test correctly ignores readonly attribute on specific input element types * `Node#all_text` always returns a string - Issue #2477 * `have_any_of_selectors` negated match - Issue #2473 * `Document#scroll_to` fixed for standards behavior - pass quirks: true if you need the older behavior [Eric Anderson] * Use capture on attach file event listener for better React compatibility [Jeff Way] * Animation disabler produces valid HTML [Javi Martin] ### Removed * References to non-w3c mode in drivers/tests. Non-w3c mode is obsolete and no one should be using it anymore. Capybara hasn't been testing/supporting it in a while # Version 3.35.3 Release date: 2021-01-29 ### Fixed * Just a release to have the correct dates in the History.md in released gem # Version 3.35.2 Release date: 2021-01-29 ### Fixed * Selenium deprecation suppressor with Selenium 3.x # Version 3.35.1 Release date: 2021-01-26 ### Fixed * Default chrome driver registrations use chrome - Issue #2442 [Yuriy Alekseyev] * 'Capybara.test_id' usage with the :button selector - Issue #2443 # Version 3.35.0 Release date: 2021-01-25 ### Added * Support Regexp matching for individual class names in :class filter passed an Array * Animation disabler now supports JQuery animation disabling when JQuery loaded from body [Chien-Wei Huang] ### Fixed * :button selector type use with `enable_aria_role` [Sean Doyle] *