Test xpath expressions in your browser
Safari & Chrome
Use $x()
in your console:
$x('//span') # selects all span elements
Firefox
There's an add-on Show archive.org snapshot .
Related cards:
Capybara: Preventing server errors from failing your test
When your Rails application server raises error, Capybara will fail your test when it clears the session after the last step. The effect is a test that passes all steps, but fails anyway.
Capybara's behavior will help you to detect and fix errors...
Capybara: Preventing headless Chrome from freezing your test suite
We prefer to run our end-to-end tests with headless Chrome. While it's a very stable solution overall, we sometimes see the headless Chrome process freeze ...
How to hide your selenium browser window with "headless"
Note: While the solution in this card should still work, we prefer another solution now: Hide your Selenium browser window with a VNC server.
---------...
Heads up: You should always use "current_window.resize_to" to resize the browser window in tests
I recently noticed a new kind of flaky tests on the slow free tier GitHub Action runners: Integration tests were running on smaller screen sizes than [specified in the device metrics](https://makandracards.com/makandra/492109-capybara-running-test...
How to employ and run your tests with parallel_tests to speed up test execution
When your cucumber features grow massively over time, the test execution can take a lot of time.
One easy way to speed up your test execution is to use the parallel_tests gem.
It comes along with some ...
Hide your Selenium browser window with a VNC server
This is now part of geordi. Please don't follow the instructions below, if you use geordi.
Inspired by the recent [headless Selenium note](https://makandracards.com/makandra/1391-how-to-hide-your-...
Your browser might silently change setTimeout(f, 0) to setTimeout(f, 4)
When you're nesting setTimeout(f, 0)
calls, your browser will silently increase the delay to 5 milliseconds after the fourth level of nesting.
This is called "timeout clamping" and [defined in the HTML spec](https://html.spec.whatwg.org/multipa...
JustinFrench.com: Learn how to test your code
Eventually you’ll forget that you used to spend hours testing your code in a browser, and start complaining that your automated tests are taking minutes to run! You’ll have intense debates with co-workers about what to test and how to test it prop...
Test your application's e-mail spam scoring with mail-tester.com
You can use mail-tester.com to check your application's e-mails for issues that might cause e-mails to be classified as spam.
They provide a one-time e-mail addresses that you can use to sign up etc. You can then c...