Geordi can also be configured to automatically update chromedriver each time you run tests. For that, edit the global configuration file ~/.config/geordi/global.yml and add the line auto_update_chromedriver...

edgeapi.rubyonrails.org

The linked article suggests an interesting way to speed up tests of Rails + Postgres apps: PostgreSQL allows the creation of “unlogged” tables, which do not record data in the PostgreSQL...

...production environments. If you would like all created tables to be unlogged in the test environment you can add the following to your test.rb file: # config/environments/test.rb ActiveSupport.on_load(:active_record...

...show a "Choose your search engine" popup in Europe. This might make your Cucumber tests fail. Fortunately there is a flag to disable the popup. Add the following option to...

...I use git worktree? You can use more than one working tree to ... ... run tests while working on another branch ... compare multiple versions ... work on a different branch without disturbing...

Imagine you want to write a cucumber test for a user-to-user chat. To do this, you need the test to work with several browser sessions, logged in as...

...cookies. These are normal, signed and encrypted cookies. By following the happy path of testing a web application, that is only the main use-case is tested as a integration...

...test and the rest as isolated (more unit like) tests, one might want to test some cookie dependent behavior as a request, helper or model spec too. Since the rspec...

...of their file paths by default (or when you specify --order defined). You run tests in random order by using --order random on the command line, or by putting it...

...your project's .rspec file. Note that both switches also affect the order the tests inside each file are run: defined runs tests in the order they are defined inside...

...explains which threads and processes interact with each other when you run a Selenium test with Capybara. This will help you understand "impossible" behavior of your tests.

...a Rack::Test (non-Javascript) test with Capybara, there is a single process in play. It runs both your test script and the server responding to the user interactions scripted...

testing-library are widely used testing utilities libraries for javascript dependent frontend testing. The main utilities provided are query methods, user interactions, dom expectations and interacting with components of several...

...less about the details happening in the browser and focus more on user centric tests instead! Some of the time you will find a necessity to use methods like waitFor...

...to remove the same YAMLs file before you can re-run that still-red test. With this little helper, you (or your coding agent) can do the same with RE...

When using Chrome for Selenium tests, the chromedriver binary will be used to control Chrome. To debug problems that stem from Selenium's Chrome and/or Chromedriver, you might want to...

...the chromedriver itself. Here is how. Option 1: Use Selenium::WebDriver::Service In your test setup, you may already have something like Capybara::Selenium::Driver.new(@app, browser: :chrome, options: ...), especially...

Testing file download links in an end-to-end test can be painful, especially with Selenium. The attached download_helpers.rb provides a download_link method for your Capybara tests. It returns...

...other approaches this helper has many useful features: Works with both Selenium and Rack::Test drivers without limitations. Understands the [download] and [download=filename.ext] attributes. Allows filename, disposition, content type...

...assist users with disabilities. It is also very practical to label things for integration tests. With the auto-mapper below you can write this: Then I should see "Bruce" within...

With this command you can run all the spec files which have been edited or added in the current branch...

...options to disable password leak detection and suppress the warning. Problem When running Selenium tests with recent versions of Chrome and Chromedriver (e.g., version 136+), entering “unsafe” (weak or reused...

"This password has appeared in a data breach…" This alert can break automated test runs, especially in CI/CD pipelines. Solution You can disable Chrome’s password leak detection to...

makandra dev

helps you debugging errors like DNS lookup limit reached it also lets you test a new SPF strings before applying it. This can save you time as you don...

...with operations Also the advanced check at vamsoft.com has a very good interface to test new SPF policies...

...is because Redis defaults to at most 16 databases (0 to 15) and running tests in parallel might exceed that (your tests might run on databases 1..n or...

...cleaner gem with strategy :transaction, after_commit callbacks will not be fired in your tests. Rails 5+ Rails 5 has a fix for this issue and no further action is...

Rails 3, Rails 4 Add the gem test_after_commit to your test group in the Gemfile and you are done. You don't need to change the database...

To set a cookie in your test browser for cucumber tests, you need to know which driver you are using. Use the step below according to your driver.

...cookie set to "([^\"]+)"$/ do |key, value| Capybara.current_session.driver.set_cookie(key, value) end Usage in feature tests Given I have a "page_views" cookie set to "42" When I visit the start...

makandra dev

...environment configuration. This is useful for keeping log files manageable, especially in development and test environments. # config/environments/development.rb Rails.application.configure do config.log_file_size = 10.megabytes end When this value is set, Rails...

github.com

Setting array columns When using PostgreSQL array columns, you can set an array attribute to a value with square brackets...

Until Capybara 2, node finders that accept a text option were able to find nodes based on rendered text, even...

content.pivotal.io

A matcher is a function that returns an object with a compare key. Usually it is registered with beforeEach...

...than Dir.tmpdir e.g. Dir.mktmpdir('foo', Rails.root.join('tmp')) => /home/user/rails_example/tmp/foo20220912-14561-pyr8qd. This might be necessary when your tests are running on CI. For this you might also want to commit tmp/.gitkeep to git...

...tmp dir inside your project is present. Example Dir.mktmpdir('exports') => "/tmp/exports20220912-14561-pobh0a" Improving your parallel tests with Dir.mktmpdir When creating directories in parallel tests manually, you normally need to handle these...