Merge pull request #1 from BookOfGreg/h-master

Replace webdriver with firefox-headless
This commit is contained in:
Hayley Prior 2019-10-08 15:59:33 +01:00 committed by GitHub
commit ca8a2b6da2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 11 deletions

View File

@ -28,7 +28,8 @@ group :test do
gem 'rspec-rails' gem 'rspec-rails'
gem 'generator_spec' gem 'generator_spec'
gem 'capybara' gem 'capybara'
gem 'capybara-webkit' gem 'geckodriver-helper'
gem 'selenium-webdriver'
gem 'rswag-specs', path: './rswag-specs' gem 'rswag-specs', path: './rswag-specs'
end end

View File

@ -2,15 +2,15 @@
# of editing this file, please use the migrations feature of Active Record to # of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition. # incrementally modify your database, and then regenerate this schema definition.
# #
# Note that this schema.rb definition is the authoritative source for your # This file is the source Rails uses to define your schema when running `rails
# database schema. If you need to create the application database on another # db:schema:load`. When creating a new database, `rails db:schema:load` tends to
# system, you should be using db:schema:load, not running all the migrations # be faster and is potentially less error prone than running all of your
# from scratch. The latter is a flawed and unsustainable approach (the more migrations # migrations from scratch. Old migrations may fail to apply correctly if those
# you'll amass, the slower it'll run and the greater likelihood for issues). # migrations use external dependencies or application code.
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160218212104) do ActiveRecord::Schema.define(version: 2016_02_18_212104) do
create_table "blogs", force: :cascade do |t| create_table "blogs", force: :cascade do |t|
t.string "title" t.string "title"

View File

@ -51,9 +51,12 @@ RSpec.configure do |config|
# arbitrary gems may also be filtered via: # arbitrary gems may also be filtered via:
# config.filter_gems_from_backtrace("gem name") # config.filter_gems_from_backtrace("gem name")
Capybara.javascript_driver = :webkit Capybara.register_driver :firefox_headless do |app|
end options = ::Selenium::WebDriver::Firefox::Options.new
options.args << '--headless'
Capybara::Webkit.configure do |config| Capybara::Selenium::Driver.new(app, browser: :firefox, options: options)
config.block_unknown_urls end
Capybara.javascript_driver = :firefox_headless
end end