Skip to content

Commit

Permalink
fix: options of Capybara driver
Browse files Browse the repository at this point in the history
  • Loading branch information
takahashim committed Dec 18, 2023
1 parent c8eb120 commit e17316d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
18 changes: 18 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,24 @@
puts e.to_s.strip
exit 1
end

Capybara.register_driver :headless_chrome do |app|
options = ::Selenium::WebDriver::Chrome::Options.new
options.args << "--headless=new"
options.args << "--no-sandbox"
options.args << if ENV["BIG_SCREEN_SIZE"].present?
"--window-size=1920,3000"
else
"--window-size=1920,1080"
end
options.args << "--ignore-certificate-errors" if ENV["TEST_SSL"]
Capybara::Selenium::Driver.new(
app,
browser: :chrome,
capabilities: [options]
)
end

RSpec.configure do |config|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
# config.fixture_path = "#{::Rails.root}/spec/fixtures"
Expand Down
2 changes: 1 addition & 1 deletion spec/system/admin_officializations_user_extension_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require "rails_helper"

xdescribe "Admin manages officializations", type: :system do
describe "Admin manages officializations", type: :system do
let(:model_name) { Decidim::User.model_name }
let(:filterable_concern) { Decidim::Admin::Officializations::Filterable }

Expand Down
2 changes: 1 addition & 1 deletion spec/system/comment_sort_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require "rails_helper"

xdescribe "Comments", type: :system, perform_enqueued: true do
describe "Comments", type: :system, perform_enqueued: true do
let!(:component) { create(:debates_component, organization: organization) }
let!(:commentable) { create(:debate, :open_ama, component: component) }

Expand Down
2 changes: 1 addition & 1 deletion spec/system/needs_user_extension_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require "rails_helper"

xdescribe "Need user extension", type: :system do
describe "Need user extension", type: :system do
let(:organization) { create(:organization) }
let(:user) { create(:user, :confirmed, organization: organization) }

Expand Down
4 changes: 2 additions & 2 deletions spec/system/user_profile_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

require "spec_helper"
require "rails_helper"

xdescribe "Profile", type: :system do
describe "Profile", type: :system do
let(:user) { create(:user, :confirmed) }

before do
Expand Down

0 comments on commit e17316d

Please sign in to comment.