Skip to content

Commit 1108072

Browse files
committed
Fix build
1 parent 1cf3856 commit 1108072

File tree

11 files changed

+96
-63
lines changed

11 files changed

+96
-63
lines changed

.circleci/config.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

gemfiles/capybara-2.x.gemfile renamed to .github/gemfiles/capybara-2.x.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ source "https://rubygems.org"
44

55
gem "capybara", "~> 2.0"
66

7-
gemspec path: "../"
7+
gemspec path: "../../"

gemfiles/capybara-3.x.gemfile renamed to .github/gemfiles/capybara-3.x.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ source "https://rubygems.org"
44

55
gem "capybara", "~> 3.0"
66

7-
gemspec path: "../"
7+
gemspec path: "../../"

gemfiles/ferrum-master.gemfile renamed to .github/gemfiles/ferrum-master.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ source "https://rubygems.org"
44

55
gem "ferrum", github: "route/ferrum"
66

7-
gemspec path: "../"
7+
gemspec path: "../../"

gemfiles/websocket-driver-6.x.gemfile renamed to .github/gemfiles/websocket-driver-6.x.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ source "https://rubygems.org"
44

55
gem "websocket-driver", ">= 0.6", "< 0.7"
66

7-
gemspec path: "../"
7+
gemspec path: "../../"

.github/workflows/linter.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Linter
2+
on: [push]
3+
4+
# jobs:
5+
# linters:
6+
# name: Linters
7+
# runs-on: ubuntu-latest
8+
# steps:
9+
# - name: Checkout code
10+
# uses: actions/checkout@v2
11+
12+
# - name: Setup Ruby
13+
# uses: ruby/setup-ruby@v1
14+
# - name: Ruby gem cache
15+
# uses: actions/cache@v1
16+
# with:
17+
# path: vendor/bundle
18+
# key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
19+
# restore-keys: |
20+
# ${{ runner.os }}-gems-
21+
# - name: Install gems
22+
# run: |
23+
# bundle config path vendor/bundle
24+
# bundle install --jobs 4 --retry 3
25+
26+
# - name: Run linters
27+
# run: |
28+
# bin/rubocop --parallel

.github/workflows/tests.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Tests
2+
on: [push]
3+
4+
jobs:
5+
tests:
6+
name: Tests
7+
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
gemfile: [capybara-2.x, capybara-3.x, ferrum-master, websocket-driver-6.x]
12+
ruby: [2.5, 2.6, 2.7]
13+
14+
runs-on: ubuntu-latest
15+
env:
16+
FERRUM_PROCESS_TIMEOUT: 10
17+
BUNDLE_GEMFILE: .github/gemfiles/${{ matrix.gemfile }}.gemfile
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v2
21+
22+
- name: Setup Ruby
23+
uses: ruby/setup-ruby@v1
24+
with:
25+
ruby-version: ${{ matrix.ruby }}
26+
bundler-cache: true
27+
28+
- run: mkdir -p /tmp/cuprite
29+
30+
- name: Run tests
31+
run: bundle exec rake
32+
33+
- name: Archive artifacts
34+
uses: actions/upload-artifact@v2
35+
if: ${{ failure() }}
36+
with:
37+
name: footprints
38+
path: /tmp/cuprite/

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Cuprite - Headless Chrome driver for Capybara
22

3-
[![CircleCI](https://circleci.com/gh/rubycdp/cuprite.svg?style=shield)](https://circleci.com/gh/rubycdp/cuprite)
4-
53
Cuprite is a pure Ruby driver (read as _no_ Selenium/WebDriver/ChromeDriver
64
dependency) for [Capybara](https://github.com/teamcapybara/capybara). It allows
75
you to run Capybara tests on a headless Chrome or Chromium. Under the hood it

spec/integration/driver_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ def create_screenshot(file, *args)
783783
%r{/cuprite/jquery.min.js$} => File.size(CUPRITE_ROOT + "/spec/support/public/jquery-1.11.3.min.js"),
784784
%r{/cuprite/jquery-ui.min.js$} => File.size(CUPRITE_ROOT + "/spec/support/public/jquery-ui-1.11.4.min.js"),
785785
%r{/cuprite/test.js$} => File.size(CUPRITE_ROOT + "/spec/support/public/test.js"),
786-
%r{/cuprite/with_js$} => 2329
786+
%r{/cuprite/with_js$} => 2405
787787
}
788788

789789
resources_size.each do |resource, size|

spec/integration/session_spec.rb

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,11 +1016,28 @@
10161016
context "in threadsafe mode" do
10171017
before do
10181018
skip "No threadsafe mode in this version" unless Capybara.respond_to?(:threadsafe)
1019-
Capybara::SpecHelper.reset_threadsafe(true, @session) if Capybara.respond_to?(:threadsafe)
1019+
1020+
if Capybara.respond_to?(:threadsafe)
1021+
parameters = Capybara::SpecHelper.method(:reset_threadsafe).parameters
1022+
1023+
if parameters[0][0] == :opt
1024+
Capybara::SpecHelper.reset_threadsafe(true, @session)
1025+
else
1026+
Capybara::SpecHelper.reset_threadsafe(bool: true, session: @session)
1027+
end
1028+
end
10201029
end
10211030

10221031
after do
1023-
Capybara::SpecHelper.reset_threadsafe(false, @session) if Capybara.respond_to?(:threadsafe)
1032+
if Capybara.respond_to?(:threadsafe)
1033+
parameters = Capybara::SpecHelper.method(:reset_threadsafe).parameters
1034+
1035+
if parameters[0][0] == :opt
1036+
Capybara::SpecHelper.reset_threadsafe(false, @session)
1037+
else
1038+
Capybara::SpecHelper.reset_threadsafe(bool: false, session: @session)
1039+
end
1040+
end
10241041
end
10251042

10261043
it "uses per session wait setting" do

0 commit comments

Comments
 (0)