...web browser. It's pretty convenient. By installing a Chrome addon you can also test your local code on http://localhost...

makandra dev

...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

github.com

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...

gist.github.com

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...

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...

...it solve the right problem, is the design sound, is it correct, is it tested, is it readable — and treat style last. You can navigate a change: understand the intent...

...Reviewing agent-generated code Code from an agent looks finished: consistent formatting, confident comments, tests that pass. That makes it harder to review, not easier. Treat it like code from...

You can use the code below to check whether the browser can make connections to the current site: await isOnline...

makandracards.com

...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...

Spreewald now comes with a step that tests if a form field is visible: Then the "Due date" field should be visible But the "Author" field should not be visible...

...checks if that field is hidden via CSS (or Javascript). It is not currently tested if the label is visible or hidden. For this see: Check that an element is...

rubydoc.info

CarrierWave comes with some RSpec matchers which will make testing more comfortable. Let's say you have an Uploader like this: class MyUploader < CarrierWave::Uploader::Base include CarrierWave::MiniMagick

...a class Movie with an attribute poster. In your spec file, you can add tests to check the dimensions of the several versions by writing RSpec.describe Movie, type: :model do...

When using state_machine you sometimes need to know whether an object may execute a certain transition. Let's take...

...URL, which can lead to errors when you have absolute URLs in your Cucumber tests. If you really need to use absolute URLs somewhere, say in an email you send...

web.archive.org

Single step and slow motion for Cucumber scenarios can come in handy, especially in @javascript scenarios. # features/support/examiners.rb AfterStep('@slow_motion...

makandra dev

Fix missing require for Fileutils in the dump load command (#145) Document PARALLEL_TEST_PROCESSORS

blog.buildbettersoftware.com

Mornings can be rough. To make them a little easier, leave yourself a failing test if your work isn’t finished. When you come back to the project, it makes...

When you are scrolling up to investigate a test failure it is super annoying when the terminal scrolls back down whenever the running test outputs another line. Luckily you can...

makandra dev
brunildo.org

The pages listed here contain tests and experiments about features, possibilities, browsers’ bugs concerning CSS. That is, over 200 experiments...

This note describes a Cucumber step definition that lets you test whether or not a CSS selector is present on the site: Then I should see an element "#sign_in...

robots.thoughtbot.com

One of many useful techniques when your test suite needs to talk to a remote API...