Skip to content

Commit

Permalink
Add chrome based Edge to travis run
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed Jun 4, 2019
1 parent 5409abf commit 580324a
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 13 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Expand Up @@ -105,6 +105,18 @@ matrix:
- "sudo /usr/bin/safaridriver --enable"
- "sudo '/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver' --enable"
script: "bundle exec rake spec_safari"
- gemfile: gemfiles/Gemfile.chrome_edge
os: osx
osx_image: xcode10.2
rvm: 2.6
addons:
homebrew:
taps: homebrew/cask-versions
casks: microsoft-edge-canary
before_install:
- wget https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/76.0.168.0/edgedriver_mac64.zip
- unzip edgedriver_mac64.zip -d /usr/local/bin
script: "bundle exec rake spec_edge"
allow_failures:
- os: osx
- gemfile: gemfiles/Gemfile.beta-versions
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/Gemfile.chrome_edge
Expand Up @@ -5,7 +5,7 @@ gemspec path: '..'

gem 'xpath', github: 'teamcapybara/xpath'

gem 'selenium-webdriver', github: 'seleniumhq/selenium', glob: 'rb/*.gemspec'
gem 'selenium-webdriver', github: 'seleniumhq/selenium', branch: 'edge_chrome_rb', glob: 'rb/*.gemspec'
gem 'webdrivers', github: 'twalpole/webdrivers', branch: 'selenium_4'
gem 'rack', github: 'rack/rack'
gem 'sinatra', github: 'sinatra/sinatra', branch: 'master'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/Gemfile.edge-firefox
Expand Up @@ -6,7 +6,7 @@ gemspec path: '..'
gem 'xpath', github: 'teamcapybara/xpath'

gem 'selenium-webdriver', :path => '../../selenium/build/rb'
gem 'webdrivers', 'twalpole/webdrivers', branch: 'selenium_4' if ENV['CI']
gem 'webdrivers', github: 'twalpole/webdrivers', branch: 'selenium_4' if ENV['CI']
gem 'rack', github: 'rack/rack'
gem 'sinatra', github: 'sinatra/sinatra', branch: 'master'

Expand Down
Expand Up @@ -119,3 +119,4 @@ def edgedriver_version
end

Capybara::Selenium::Driver.register_specialization :edge, Capybara::Selenium::Driver::EdgeDriver
Capybara::Selenium::Driver.register_specialization :edge_chrome, Capybara::Selenium::Driver::EdgeDriver
21 changes: 10 additions & 11 deletions spec/selenium_spec_edge.rb
Expand Up @@ -7,12 +7,11 @@
require 'rspec/shared_spec_matchers'

Selenium::WebDriver::Edge::Service.driver_path = '/usr/local/bin/msedgedriver'
# Not yet implemented in the selenium-webdriver edge driver
# Selenium::WebDriver::Edge.path = '/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary'
Selenium::WebDriver::EdgeChrome.path = '/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary'

Capybara.register_driver :selenium_edge do |app|
# ::Selenium::WebDriver.logger.level = "debug"
Capybara::Selenium::Driver.new(app, browser: :edge).tap do |driver|
Capybara::Selenium::Driver.new(app, browser: :edge_chrome).tap do |driver|
driver.browser
driver.download_path = Capybara.save_path
end
Expand All @@ -27,14 +26,14 @@ module TestSessions
Capybara::SpecHelper.log_selenium_driver_version(Selenium::WebDriver::Edge) if ENV['CI']

Capybara::SpecHelper.run_specs TestSessions::SeleniumEdge, 'selenium', capybara_skip: skipped_tests do |example|
case example.metadata[:description]
when /#refresh it reposts$/
skip 'Edge insists on prompting without providing a way to suppress'
when /should be able to open non-http url/
skip 'Crashes'
when /when Capybara.always_include_port is true/
skip 'Crashes'
end
# case example.metadata[:description]
# when /#refresh it reposts$/
# skip 'Edge insists on prompting without providing a way to suppress'
# when /should be able to open non-http url/
# skip 'Crashes'
# when /when Capybara.always_include_port is true/
# skip 'Crashes'
# end
end

RSpec.describe 'Capybara::Session with Edge', capybara_skip: skipped_tests do
Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Expand Up @@ -46,6 +46,10 @@ def chrome_gte?(version, session)
end

def edge?(session)
browser_name(session).match?(/^edge/)
end

def legacy_edge?(session)
browser_name(session) == :edge
end

Expand Down

0 comments on commit 580324a

Please sign in to comment.