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

Try using seleniarm-chrome via Docker. #6208

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
7 changes: 3 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
version: 2.1
orbs:
browser-tools: circleci/[email protected]
node: circleci/[email protected]
jobs:
build:
Expand All @@ -21,7 +20,6 @@ jobs:
POSTGRES_HOST_AUTH_METHOD: trust
resource_class: large
steps:
- browser-tools/install-chrome
- checkout
- node/install:
install-yarn: true
Expand Down Expand Up @@ -75,13 +73,13 @@ jobs:
POSTGRES_HOST_AUTH_METHOD: trust
- image: solr:7.7-alpine
command: bin/solr -cloud -noprompt -f -p 8984
- image: seleniarm/standalone-chromium:114.0
resource_class: large
parallelism: 4
environment:
SPEC_OPTS: --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
COVERALLS_PARALLEL: true
steps:
- browser-tools/install-chrome
- attach_workspace:
at: '~/figgy'
- node/install:
Expand All @@ -92,6 +90,8 @@ jobs:
command: node -v
# Wait for DB
- run: dockerize -wait tcp://localhost:5432 -timeout 1m
# Wait for chrome
- run: dockerize -wait tcp://localhost:4444 -timeout 1m
# Install Bundler
- run: gem install bundler -v '2.3.18'
# Bundle install dependencies
Expand Down Expand Up @@ -162,7 +162,6 @@ jobs:
PSQL_PAGER: ''
resource_class: large
steps:
- browser-tools/install-chrome
- attach_workspace:
at: '~/figgy'
- node/install:
Expand Down
2 changes: 1 addition & 1 deletion .lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services:
driver: none
shm_size: 2G
ports:
- "4445:4444"
- "4444:4444"
- "5900:5900"
- "7900:7900"
volumes:
Expand Down
19 changes: 7 additions & 12 deletions spec/support/capybara_selenium.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@
require "capybara/rspec"
require "selenium-webdriver"

# there's a bug in capybara-screenshot that requires us to name
# the driver ":selenium" so we changed it from :headless_chrome"
selenium_url = nil
browser = :chrome
# If we're not in CI then run Selenium from Lando. Makes it much easier to
# upgrade versions of Chrome.
Capybara.server_host = '0.0.0.0'
Capybara.always_include_port = true
if !ENV["CI"]
selenium_url = "http://127.0.0.1:4445/wd/hub"
Capybara.server_host = '0.0.0.0'
Capybara.always_include_port = true
Capybara.app_host = "http://host.docker.internal:#{Capybara.server_port}"
browser = :remote
else
# In CI all the ports from containers are on localhost.
Capybara.app_host = "http://127.0.0.1:#{Capybara.server_port}"
end

Capybara.register_driver(:selenium) do |app|
Expand All @@ -27,10 +22,10 @@
http_client.read_timeout = 120
http_client.open_timeout = 120
Capybara::Selenium::Driver.new(app,
browser: browser,
browser: :remote,
options: browser_options,
http_client: http_client,
url: selenium_url)
url: "http://127.0.0.1:4444/wd/hub")
end

Capybara.javascript_driver = :selenium
Expand Down