Note that if you plan to freeze your Firefox versions because your Selenium tests break whenever Firefox updates, there is a better way that lets you keep an up-to...
betterspecs.org is a documentation on how to write better RSpec tests. Note that there are also other approaches like The Self-Contained Test, which is complementary to the dry-approches...
Preface: Normally, you would not need this in integrations tests (probably that's why it is so hard to achieve), because it is no actual "integration testing". If you use...
...in features/support/paths.rb. Capybara The step definition is part of Spreewald. The step has been tested with multiple versions of Capybara, Rack::Test and Selenium. Webrat (legacy) This is a simpler...
...visit url_for(request.params) end For a step that distinguishes between drivers (Selenium, Rack::Test, Culerity), check n4k3d.com...
...a transformable example of katapult's features Development Add katapult update script Speed up tests (now running in about 9 min) Improve development workflow (see README) No bundler issues in...
...tests any more
Usually our code lives on GitLab, therefore our documentation for CI testing is extensive in this environment. If you are tied to GitHub e.g. because your customer uses it, you...
...template uses two such custom actions: setup-node and setup-ruby .github/workflows/integration-testing.yml name: Integration Testing on: push: branches: [ main, production ] pull_request: branches: [ main, production ] # Display "Run Workflow" button on...
...they are wrapping the same native DOM elements: $('body') == $('body') // false In order to test if two jQuery objects refer to the same native DOM elements, use is:
Jasmine equality matcher for jQuery See here for a custom Jasmine matcher that tests if two jQuery objects are equal...
If you want to have routes that are only available in tests (e.g. for testing obscure redirects), you can use the with_routing helper -- but that one destroys existing routes...
...may break a specs that require them to work. To keep both "regular" and test routes, do this: class MyApplicationController < ActionController::Base def show render text: 'Welcome to my application...
This step tests whether a given select option comes preselected in the HTML. There is another step to test that an option is available at all. Capybara Then /^"([^"]*)" should be...
...web browser. It's pretty convenient. By installing a Chrome addon you can also test your local code on http://localhost...
...to record communication with remote APIs is a great way to stub requests in tests. However, you may still want to look at the request data like the payload your...
...have_requested(:post, 'http://example.com').with(body: 'yolo') Easy peasy. Related cards Faking and testing the network with WebMock
Some helpers for poking around at your Capybara driven browser's cookies in integration tests. Supports Capybara's bundled drivers (rack-test, Selenium Webdriver), and adapters for other drivers may...
Re-creating a complex ActiveRecord scenario quickly without setting up a full-blown Rails app can come in handy e.g...
Geordi 0.16+ supports running selenium tests with project-specific firefox versions. Just update the gem. It will still default to using the old 5.0.1 firefox. If you want another one...
This cucumber step is useful for testing an image (looking at the src of the image). Then(/^I should see the image "([^"]*)"$/) do |filename_with_extension| expect(page).to have...
Then I should see the image "placeholder.png" Outline: Read more about how to test a uploaded file here, e.g. file downloads...
The linked MDN article is quite informative of a neat feature supported by all major browsers: Unicode character class escape...
sudo gem install parallel script/plugin install git://github.com/grosser/parallel_tests.git Adapt config/database.yml test: database: xxx_test<%= ENV['TEST_ENV_NUMBER'] %> Create test databases script/dbconsole -p CREATE DATABASE `xxx...
... Generate RSpec files script/generate rspec (you'll probably only let it overwrite files in script/) Prepare test databases Now and after each migration: rake parallel:prepare Run tests
...en”. They reappear when Chrome gets updated. This may help you running your Selenium tests using the Chrome driver on applications that choose the language from what the browser sends...
I had to deal with JavaScript Undefined Error while accessing a specific CKEditor instance to fill in text. Ensure everything...
...behavior to be impractical, but it is by design. In order to perform a test or action in all matching elements, do not use within but prefer the attached "inside...
...and inconsistencies that had accumulated over Unpoly's 10+ years, and meaningfully improved our test coverage. Changes that may need your attention are marked with 🧩 when unpoly-migrate.js polyfills them and...
...explain how to set up a development environment, where code lives, and how we test, document and release Unpoly. Two deep-dives explain the rendering core and the selector engine...
...work across all revisions that you will be bisecting. If you're referencing a test file that's under version control, make sure you always run the correct test.There are...
...or when you accidentally interact with the browser frame. This will result in flickering tests, which are "randomly" red and green. In fact, this behavior is not random at all...
...better understanding of Selenium focus issues, and what you can do to get your test suite stable again. Preventing accidental interaction with the Selenium window When Selenium windows steal your...