capybara-webkit | Capybara driver for headless WebKit
kandi X-RAY | capybara-webkit Summary
kandi X-RAY | capybara-webkit Summary
Development has been suspended on this project because QtWebKit was deprecated in favor of QtWebEngine, which is not a suitable replacement for our purposes. We instead recommend using the [Selenium] or [Apparition] drivers. [Selenium]: [Apparition]:
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Converts a named key to a named class .
- Applies the options .
- Send a command to the client
- Accepts a modal or modal it to accept a browser or modal it .
- Retrieve the attribute value for the given attribute .
- Handles a modal dialog .
- Decode the result of an element
- Switch to the current frame .
- Return the text of the given block .
- Internal method to check if client is available
capybara-webkit Key Features
capybara-webkit Examples and Code Snippets
Community Discussions
Trending Discussions on capybara-webkit
QUESTION
I picked up a 4 year old project written in Ruby 2.1.3
and Rails 4.1.8
.
Very few of the gems were versioned but I've managed to get the project running locally by installing mysql2 0.3.20
as suggested in multiple other threads. Doing this required me to (on MacOS) downgrade openssl and mysql with brew install mysql@57
and brew install openssl@10
.
I could then install mysql2
with by passing the correct libraries to it:
gem install mysql2 -v 0.3.20 -- --with-mysql-config=/usr/local/opt/mysql@5.7/bin/mysql_config --with-ldflags=-L/usr/local/opt/openssl@1.0/lib --with-cppflags=-I/usr/local/opt/openssl@1.0/include
Everything works locally, all good.
I'm trying to deploy this project with Dokku on a Debian instance. Here's the readout from the push to dokku master including the error thrown when starting the Rails server:
...ANSWER
Answered 2020-Jun-22 at 18:38I think I see what's going on. In your Dockerfile, change your DB_URL from: mysql:// to mysql2://
You are loading the mysql2 gem, but indicating to ActiveRecord that you want to use a connection via the mysql gem.
QUESTION
I have a Rails import job that run as a cron job setup through the whenever gem. It was running correctly until I recently updated the app. Now we are seeing the following Error in the logs when the cron job tries to run. If I run the task manually it runs the import correctly.
...ANSWER
Answered 2020-Mar-09 at 16:21Change
command 'cd /home/sotldirectory && bin/rails r import/cron_import.rb'
to
command 'cd /home/sotldirectory && bundle exec rails r import/cron_import.rb'
Also, which rake version is listed in your Gemfile.lock?
QUESTION
I'm using Capybara::Selenium from my script (not tests) for getting some image from external site. Page loads fine, all images are loaded also and I see them, but any attempt to execute function page.session.driver.evaluate_script
always throws Net::ReadTimeout: Net::ReadTimeout with #
.
Full code:
...ANSWER
Answered 2019-Aug-16 at 16:21Small thing first - there is no need to load capybara-webkit
if you're using the Selenium driver.
Now onto the main issue. There is no need to call methods directly on driver when executing JS, rather you should just be calling the Capybara methods execute_script
, evaluate_script
, or evaluate_async_script
. The evaluate_xxx
methods are for when you expect a return value, the execute_script
method is for when you don't care about any return value. evaluate_async_script
receives a callback function as the last argument which needs to be called to return a value, but your JS_GET_IMAGE doesn't appear to ever do that (nor really need to since it's not async) so it would be better to just use evaluate_script
. The other requirement for evaluate_script
is that the code evaluated needs to be a single statement. To meet that requirement we can use an IIFE.
QUESTION
Followed this tutorial in installing qt5.5 on a macOS version 10.13.6 High Sierra. Failed when trying to brew install qt@5.5
giving me an error below:
ANSWER
Answered 2019-Mar-31 at 02:13Referring to the tutorial, the following steps are executed to install qt@5.5
QUESTION
My config is MAC Mojave v10.14.
I try to install gem Capybara-webkit -v '1.15.0' which need qt5.5, but qt5.5 has been dropped of the homebrew and it is not compatible with Xcode v10.
I try this :
- Uninstall Xcode v10
- Install Xcode 9.4.1, found in developer.apple.com/
- Install qt5.5, I have found it in the archives on qt.io/
- Run bundle
But it fail, my error is with the gem capybara-webkit -v '1.15.0':
...ANSWER
Answered 2018-Oct-05 at 12:14I think my problem was with xcrun. For fix I did :
sudo chown root:wheel /Applications/Xcode.app
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
cd /Applications/Xcode.app/Contents/Developer/usr/bin/
sudo ln -s xcodebuild xcrun
And it work (y) !
QUESTION
I switched my rails tests from capybara-webkit to headless chrome. When I run a test which visits not the default Capybara host the first case passes but the second one fails because the user are already logged in when they try to login
I use chromedriver v2.45
, selenium-webdriver (3.141.0)
and capybara (2.18.0)
I have the following setup:
...ANSWER
Answered 2019-Jan-10 at 08:50Are you storing session information in the browsers window.localStorage
and/or window.sessionStorage
? If so you can set those to be cleared via options passed to the driver (Note: these settings are the default for the selenium driver in Capybara 3.12+)
QUESTION
Recently I switched my acceptance tests from capybara-webkit to headless chrome. In some cases I need to check alert messages (for example, confirm to discard changes when user leaves the page). With capybara-webkit I did it the following way
...ANSWER
Answered 2018-Nov-27 at 18:30You need to use the text
parameter of Capybaras modal handling methods (accept_confirm
/accept_alert
/etc) -https://www.rubydoc.info/github/jnicklas/capybara/Capybara/Session#accept_confirm-instance_method - which will check the message before it accepts/dismisses the system modal
QUESTION
Recently I switched my cucumber tests from capybara-webkit to headless chrome. Now many features fail with
expected to find text "commented by J. Smitch" in "commented by[two spaces there]J. Smith"
Is there a way to tell Capybara to ignore extra whitespaces? Or I need to add whitespaces in my step definitions to make the failing tests green?
UPDATE 1
I have
spaces in my markup which are not normalized like this
ANSWER
Answered 2018-Nov-20 at 16:49I'm guessing that at the same time you switched from capybara-webkit to selenium with headless chrome you also switched from Capybara 2.x to 3.x. One of the breaking changes in Capybara 3.x is that it attempts to return whitespace more as the user would actually see it. That means that if you have characters in your markup they don't get collapsed with surrounding spaces since the browser doesn't do that. You can use the normalize_ws
option to get back results more like 2.x
QUESTION
I have a floating menu that pops up when a user clicks on a menu button (button is hidden behind the floating menu in the image below).
The functionality works fine in a live browser (tried it on Firefox, Safari, and Chrome).
However it doesn't seem to work when testing with Capybara-Webkit - the menu never becomes visible on click
Here's the basic implementation:
HTMLThe menu is a
- that sits inside a
...ANSWER
Answered 2018-Oct-04 at 20:51capybara-webkit
is basically equivalent to a 7 year old version of Safari (due to QtWebkit, which it is built on, not having been updated in a long time). As such it doesn't support a lot of modern JS/CSS, which happens to include flex box. Because of this display: flex
will be considered invalid and ignored.
You're going to have a much easier time testing your app if you swap from using capybara-webkit
to selenium with headless chrome or firefox for your headless testing.
QUESTION
My tests are failing like so.
...ANSWER
Answered 2018-Jun-21 at 23:39You are using Ruby version 2.2.5
and you are also upgrading capybara
to version 3.2.1
. If you take a look at the line that causes the syntax error, the commit message give you a hint: Require minimum of Ruby 2.3.0
If you look at the history, capybara
version 3.2.0
requires Ruby 2.3.0+
.
You can either upgrade your applications Ruby version to 2.3.0
or greater, or set your capybara
version to a prior version.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install capybara-webkit
On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page