1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00
teamcapybara--capybara/spec/selenium_spec_edge.rb

48 lines
1.7 KiB
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'spec_helper'
2018-07-10 17:18:39 -04:00
require 'selenium-webdriver'
require 'shared_selenium_session'
require 'shared_selenium_node'
require 'rspec/shared_spec_matchers'
2019-08-02 12:42:14 -04:00
# unless ENV['CI']
2019-08-02 13:23:58 -04:00
# Selenium::WebDriver::Edge::Service.driver_path = '/usr/local/bin/msedgedriver'
2019-08-02 12:42:14 -04:00
# end
2019-06-16 13:10:37 -04:00
2019-08-02 12:42:14 -04:00
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"
2019-08-02 12:42:14 -04:00
# 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]
2019-08-02 13:23:58 -04:00
Capybara::SpecHelper.log_selenium_driver_version(Selenium::WebDriver::EdgeChrome) if ENV['CI']
2018-07-10 17:18:39 -04:00
Capybara::SpecHelper.run_specs TestSessions::SeleniumEdge, 'selenium', capybara_skip: skipped_tests do |example|
2019-08-02 13:23:58 -04:00
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
2018-07-10 17:18:39 -04:00
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