Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Fix builds #3006

Merged
merged 3 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/assets/builds/alchemy/admin.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/assets/builds/alchemy/admin.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions spec/libraries/page_layout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ module Alchemy
context "with a YAML file including a symbol" do
let(:yaml) { "name: :symbol" }
before do
expect(File).to receive(:exist?).and_return(true)
expect(File).to receive(:read).and_return(yaml)
allow(File).to receive(:exist?).and_return(true)
allow(File).to receive(:read).and_return(yaml)
end

it "returns the definition without error" do
Expand Down
12 changes: 6 additions & 6 deletions spec/models/alchemy/element_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ module Alchemy
let(:yaml) { "- name: :symbol" }

before do
expect(File).to receive(:exist?).and_return(true)
expect(File).to receive(:read).and_return(yaml)
allow(File).to receive(:exist?).and_return(true)
allow(File).to receive(:read).and_return(yaml)
end

it "returns the definition without error" do
Expand All @@ -246,8 +246,8 @@ module Alchemy
let(:yaml) { "- default: 2017-12-24" }

before do
expect(File).to receive(:exist?).and_return(true)
expect(File).to receive(:read).and_return(yaml)
allow(File).to receive(:exist?).and_return(true)
allow(File).to receive(:read).and_return(yaml)
end

it "returns the definition without error" do
Expand All @@ -259,8 +259,8 @@ module Alchemy
let(:yaml) { "- format: !ruby/regexp '/\A[^@\s]+@([^@\s]+.)+[^@\s]+\z/'" }

before do
expect(File).to receive(:exist?).and_return(true)
expect(File).to receive(:read).and_return(yaml)
allow(File).to receive(:exist?).and_return(true)
allow(File).to receive(:read).and_return(yaml)
end

it "returns the definition without error" do
Expand Down
19 changes: 5 additions & 14 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,6 @@
FactoryBot.definition_file_paths.append(Alchemy::TestSupport.factories_path)
FactoryBot.find_definitions

Capybara.register_driver :selenium_chrome_headless do |app|
Capybara::Selenium::Driver.load_selenium
browser_options = ::Selenium::WebDriver::Chrome::Options.new.tap do |opts|
opts.args << "--headless"
opts.args << "--disable-gpu" if Gem.win_platform?
# Workaround https://bugs.chromium.org/p/chromedriver/issues/detail?id=2650&q=load&sort=-id&colspec=ID%20Status%20Pri%20Owner%20Summary
opts.args << "--disable-site-isolation-trials"
opts.args << "--window-size=1280,800"
end
Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options)
end

Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec
Expand Down Expand Up @@ -108,7 +96,10 @@
end
end

config.before(:each, type: :system, js: true) do
driven_by :selenium_chrome_headless
config.before(:each, type: :system, js: true) do |example|
screen_size = example.metadata[:screen_size] || [1280, 800]
driven_by(:selenium, using: :headless_chrome, screen_size: screen_size) do |capabilities|
capabilities.add_argument("--disable-search-engine-choice-screen")
end
end
end