Comments (1)
docker-compose.yml
...
browserless:
image: browserless/chrome:latest
container_name: ${COMPOSE_PROJECT_NAME}_browserless
restart: always
environment:
- PORT=4000
ports:
- '4000:4000'
.env
BROWSERLESS_URL=http://localhost:4000/
test/helpers/cuprite_helper.rb
# frozen_string_literal: true
require 'capybara/cuprite'
Capybara.register_driver(:browserless) do |app|
Capybara::Cuprite::Driver.new(app, browser_options:
{
window_size: [1920, 1080],
url: ENV.fetch('BROWSERLESS_URL', nil),
headless: true,
'no-sandbox': true,
'disable-gpu': true
})
end
Capybara.default_driver = :browserless
Capybara.javascript_driver = :browserless
# This is because the BrowserLessTest is failing.
# The problem was that, without this line, visits to a page
# always appended the capybara port to the url.
Capybara.run_server = false
test/application_system_test_case.rb
# frozen_string_literal: true
require 'test_helper'
require_relative '../test/helpers/cuprite_helper'
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :browserless
end
test/system/browser_less_test.rb
# frozen_string_literal: true
require 'application_system_test_case'
class BrowserLessTest < ApplicationSystemTestCase
test 'Remote browser connection established' do
visit 'https://google.com'
assert_equal 'Google', page.title
end
end
execution
bin/rails test:system
from cuprite.
Related Issues (20)
- ReferenceError: _cuprite is not defined HOT 7
- Cuprite.scrollIntoViewport does not properly handle elements hidden by overlays HOT 1
- BUG: select actions does not trigger "input" events (only "change" event) on select inputs/dropdowns
- Proxy does not get set
- How do I debug the behavior of this gem?
- Cuprite does not appear to support `evaluate_script` HOT 1
- Setting a color input doesn't fire the change or input events
- Process forking causing cuprite/ferrum to never exit HOT 1
- 500 error, possibly related to web sockets with Ferrum
- Race condition leading to `Argument should belong to the same JavaScript world as target object` HOT 2
- What the best way to play with multiple/new windows or tabs? HOT 1
- fill_in with empty string does not call addEventListener('input') HOT 1
- Visibility issue upon replacing hidden nodes (Race condition)
- keydown event sent without key property HOT 5
- Obsolete nodes are not refreshed when using Capybara's #within and/or #synchronize HOT 2
- Release that references ferrum 0.14.0
- Scraping Blocked on Indeed Site HOT 1
- Capybara::Cuprite::InvalidSelector
- Loading all JS files from asset pipeline and packs folder for testing with capybara/rspec
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cuprite.