Sha256: f2ce80a579735a5b08f0a05e973cf650c13cb5f9b9cd49994941f6a2230f47ca

Contents?: true

Size: 1.68 KB

Versions: 46

Compression:

Stored size: 1.68 KB

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'selenium-webdriver'
require 'shared_selenium_session'
require 'shared_selenium_node'
require 'rspec/shared_spec_matchers'

# unless ENV['CI']
#   Selenium::WebDriver::Edge::Service.driver_path = '/usr/local/bin/msedgedriver'
# end

if ::Selenium::WebDriver::Platform.mac?
  Selenium::WebDriver::EdgeChrome.path = '/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev'
end

Capybara.register_driver :selenium_edge do |app|
  # ::Selenium::WebDriver.logger.level = "debug"
  # If we don't create an options object the path set above won't be used
  browser_options = ::Selenium::WebDriver::EdgeChrome::Options.new
  Capybara::Selenium::Driver.new(app, browser: :edge_chrome, options: browser_options).tap do |driver|
    driver.browser
    driver.download_path = Capybara.save_path
  end
end

module TestSessions
  SeleniumEdge = Capybara::Session.new(:selenium_edge, TestApp)
end

skipped_tests = %i[response_headers status_code trigger]

Capybara::SpecHelper.log_selenium_driver_version(Selenium::WebDriver::EdgeChrome) if ENV['CI']

Capybara::SpecHelper.run_specs TestSessions::SeleniumEdge, 'selenium', capybara_skip: skipped_tests do |example|
  case example.metadata[:full_description]
  when 'Capybara::Session selenium #attach_file with a block can upload by clicking the file input'
    pending "EdgeChrome doesn't allow clicking on file inputs"
  end
end

RSpec.describe 'Capybara::Session with Edge', capybara_skip: skipped_tests do
  include Capybara::SpecHelper
  ['Capybara::Session', 'Capybara::Node', Capybara::RSpecMatchers].each do |examples|
    include_examples examples, TestSessions::SeleniumEdge, :selenium_edge
  end
end

Version data entries

46 entries across 33 versions & 4 rubygems

Version Path
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/capybara-3.36.0/spec/selenium_spec_edge.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/capybara-3.37.1/spec/selenium_spec_edge.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/capybara-3.37.1/spec/selenium_spec_edge.rb
capybara-3.37.1 spec/selenium_spec_edge.rb
capybara-3.37.0 spec/selenium_spec_edge.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/capybara-3.36.0/spec/selenium_spec_edge.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/capybara-3.35.3/spec/selenium_spec_edge.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/capybara-3.36.0/spec/selenium_spec_edge.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/capybara-3.36.0/spec/selenium_spec_edge.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/capybara-3.36.0/spec/selenium_spec_edge.rb
capybara-3.36.0 spec/selenium_spec_edge.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/capybara-3.35.3/spec/selenium_spec_edge.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/capybara-3.35.3/spec/selenium_spec_edge.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/capybara-3.35.3/spec/selenium_spec_edge.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/capybara-3.35.3/spec/selenium_spec_edge.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/capybara-3.35.3/spec/selenium_spec_edge.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/capybara-3.35.3/spec/selenium_spec_edge.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/capybara-3.34.0/spec/selenium_spec_edge.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/capybara-3.34.0/spec/selenium_spec_edge.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/capybara-3.34.0/spec/selenium_spec_edge.rb