diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a3ced88 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +chromedriver.log +selenium.log \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index d65f62d..adafafc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,55 +1,55 @@ GEM remote: http://rubygems.org/ specs: - addressable (2.4.0) - capybara (2.8.1) + addressable (2.5.1) + public_suffix (~> 2.0, >= 2.0.2) + capybara (2.14.0) addressable mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) - childprocess (0.5.9) + childprocess (0.7.0) ffi (~> 1.0, >= 1.0.11) coderay (1.1.1) - diff-lcs (1.2.5) - ffi (1.9.14) + diff-lcs (1.3) + ffi (1.9.18) method_source (0.8.2) mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) mini_portile2 (2.1.0) - nokogiri (1.6.8) + nokogiri (1.7.1) mini_portile2 (~> 2.1.0) - pkg-config (~> 1.1.7) - pkg-config (1.1.7) pry (0.10.4) coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - rack (2.0.1) + public_suffix (2.0.5) + rack (2.0.2) rack-test (0.6.3) rack (>= 1.0) - rspec (3.5.0) - rspec-core (~> 3.5.0) - rspec-expectations (~> 3.5.0) - rspec-mocks (~> 3.5.0) - rspec-core (3.5.3) - rspec-support (~> 3.5.0) - rspec-expectations (3.5.0) + rspec (3.6.0) + rspec-core (~> 3.6.0) + rspec-expectations (~> 3.6.0) + rspec-mocks (~> 3.6.0) + rspec-core (3.6.0) + rspec-support (~> 3.6.0) + rspec-expectations (3.6.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-mocks (3.5.0) + rspec-support (~> 3.6.0) + rspec-mocks (3.6.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-support (3.5.0) - rubyzip (1.2.0) - selenium-webdriver (2.53.4) + rspec-support (~> 3.6.0) + rspec-support (3.6.0) + rubyzip (1.2.1) + selenium-webdriver (3.4.0) childprocess (~> 0.5) rubyzip (~> 1.0) websocket (~> 1.0) slop (3.6.0) - websocket (1.2.3) + websocket (1.2.4) xpath (2.0.0) nokogiri (~> 1.3) @@ -63,4 +63,4 @@ DEPENDENCIES selenium-webdriver BUNDLED WITH - 1.13.2 + 1.13.7 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 017ea8b..c75175d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,13 +2,14 @@ require 'selenium-webdriver' require 'pry' +Selenium::WebDriver.logger.level = :debug +Selenium::WebDriver.logger.output = 'selenium.log' + #Latests versions of firefox don't work with selenium 2.54 Capybara.register_driver :selenium do |app| - caps = {"chromeOptions" => { - "args": [ "start-maximized"] - }} - SARASA - Capybara::Selenium::Driver.new(app, browser: :chrome, desired_capabilities: caps) + args = [ "--start-maximized", "--enable-logging", "--v=1", "--no-sandbox", "--headless", "--remote-debugging-port=9222"] + Selenium::WebDriver::Chrome.path = "/usr/bin/google-chrome-beta" + Capybara::Selenium::Driver.new(app, browser: :chrome, "args": args, driver_opts: {log_path: "chromedriver.log", verbose: true}) end Capybara.default_driver = :selenium diff --git a/spec/the_internet_spec.rb b/spec/the_internet_spec.rb index cf1aafa..02f04ae 100644 --- a/spec/the_internet_spec.rb +++ b/spec/the_internet_spec.rb @@ -1,6 +1,6 @@ RSpec.describe "The internet", type: :feature do - it "should login to the secure area", type: :feature do + it "should login to the secure area", type: :feature, sarasa: true do visit("http://the-internet.herokuapp.com/login") fill_in("username", with: "tomsmith") fill_in("password", with: "SuperSecretPassword!")