masilotti.com

Slow test suites are a major pain point in projects, often due to RSpec and FactoryBot. Although minitest and fixtures...

Starting with ChromeDriver 127, if your application displays a beforeunload confirmation dialog, ChromeDriver will immediately close it. In consequence, any...

testing-library are widely used testing utilities libraries for javascript dependent frontend testing. The main utilities provided are query methods...

Whenever you have to deal with randomness in a jasmine test there are some spy strategies to help you out...

stevenhicks.me

Sometimes you want to write a test for a business rule that's based on multiple variables. In your goal...

makandra dev

There are two ways a logout in SAML can happen: Service Provider (SP) initiated and Identity Provider (IDP) initiated logout...

tl;dr Prefer request specs over end-to-end tests (Capybara) to joyfully test file downloads! Why? Testing file downloads

A Rails script lives in lib/scripts and is run with bin/rails runner lib/scripts/.... They are a simple tool to perform...

github.com

There are a few tools to combat the dreaded n+1 queries. The bullet gem notifies you of missing eager...

Here are some hints on best practices to maintain your tasks in larger projects. Rake Tasks vs. Scripts

selenium.dev

I recently stumbled over a problem that my feature tests broke in CI because of a mismatching chromedriver version.

github.com

For my computer science bachelor's thesis I programmed and evaluated a CLI Test Case Prioritization (TCP) tool for makandra...

You can tell npm to install a package globally with npm -g install @puppeteer/browsers. However, it seems that its not...

Rails offers several methods to manage three types of different cookies along with a session storage for cookies. These...

Debugging your integration tests, that run a headless Chrome inside a docker image, is tricky. In many cases you can...

Testing your responses in Rails allows to parse the body depending on the response MIME type with parsed_body.

Jasmine specs for the frontend often need some DOM elements to work with. Because creating them is such a common...

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

Testing file download links in an end-to-end test can be painful, especially with Selenium. The attached download_helpers.rb provides...

While verifying doubles in RSpec is a good default, it is limited in the amount of methods it actually is...

When the order matters: expect(array1).toEqual(array2) Regardless of order: expect(array1).toEqual(jasmine.arrayWithExactContents(array2)) Ignoring extra elements:

RSpec's let allows you to super into "outside" definitions, in parent contexts. Example: describe '#save' do subject { described_class.new(attributes...

A flaky test is a test that is often green, but sometimes red. It may only fail on some PCs...

When testing JavaScript functionality in Selenium (E2E), you may need to access a class or function inside of a evaluate...