Here is a short summary of Cucumber hooks in Ruby taken from https://github.com/cucumber/cucumber-ruby. Note that the BeforeStep is...

While you can use Capybara matchers like have_css and have_content for expectations, they are not too helpful for...

browserstack.com

Local testing allows you to test your private and internal servers using the BrowserStack cloud, which has support for firewalls, proxies and Active Directory...

github.com

When running tests via parallel_tests, you may encounter an error: cannot load such file -- parallel_tests/gherkin/runtime_logger Error creating formatter: ParallelTests::Gherkin::RuntimeLogger (LoadError) This will happen when you upgrade...

...only runs when it is called directly, but not as part of the whole test suite, make sure the filename is foo_spec.rb instead of just foo.rb...

github.com

When handling nested hashes the RSpec output is often hard to read. Here the gem super_diff could help.

Our projects with parallel_tests and cucumber used to have a patched failure logger as the one from parallel_tests was missing spaces which resulted in the output not being...

If you need to test some HTML, e.g. an embed code, you can use RubyMine's "scratch files": File > New Scratch File (or Ctrl + Shift + Alt + Ins) Select "HTML" as...

Cucumber allows for prose in features and scenarios. Example: Feature: Cancel account There are several ways to cancel a user...

.../home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/capistrano-3.14.1/lib/capistrano/tasks/deploy.rake:90:in `block (5 levels) in <top (required)>' 11: from /home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:50:in `test' 10: from /home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:137:in `create_command_and_execute' 9: from /home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:137:in `tap...

...s only minor changes but when installing major upgrades it's a good idea. Test your system after the upgrade! If you want back for some reason, you'll have...

In order to reach the baseline for good code, make your code: deterministic tested (automated) scaling with data Other people will be able to rely on your code, and...

Code coverage is the ratio of code lines kissed by a test vs. the total number of lines in your source files. This sounds meaningful, but isn't. Total coverage...

...REVISION', 'utf-8').trim() } catch(_error) { // okay, probably in dev mode } environment.loaders.prepend('fa-font', { test: /fa-.*\.(woff2|woff|eot|svg|ttf)$/, use: [{ loader: 'file-loader', options: { name: '[path][name]-[hash...

So your Cucumber feature sometimes dies with this exception: Modal Dialog Present (Selenium::WebDriver::Error::UnhandledAlertError) As a seasoned Selenium...

makandra dev
ruby-doc.org

TLDR if you define a equality method for a class you must also implement def hash. Ruby has a lot...

...data to a new schema. If you have different versions, you always need to test all different version if required. With FactoryBot this should be traits. The JSON Schema files...

RSpec provides a nice diff when certain matchers fail. Here is an example where this diff is helpful while comparing...

...MySQL console and execute SHOW TABLE STATUS FROM database; mysql> SHOW TABLE STATUS FROM test; +-------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+ | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index...

...free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment | +-------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+ | test1 | MyISAM | 10 | Dynamic...

Nowadays it is fairly easy to intercept and modify mails globally before they are sent. All you have to do...

rhnh.net

...the min and max values, the range is iterated over from min until the test value is found (or max) [...] Ruby 1.9 introduces a new method Range#cover? that implements...

...on your production site only. Otherwise it will spoil your statistics. To prevent this, test for the right environment and place the JS-code afterwards: - if Rails.env.production? :javascript

...handler. The attached initializer makes I18n just raise any exception (in a development or test environment...

...While the FULLTEXT approach was many times faster than the LIKE approach in my tests, both approaches seem to scale linearly with the number of records. For a typical web...