Here's a pretty useful steps that hasn't made it into Spreewald yet. It is best used with the...

github.com

...implement sending an error notification if the data (in the db) is too old. Testing: If you use sidekiq_retries_exhausted (unit test): https://stackoverflow.com/questions/33930199/rspec-sidekiq-how-to-test-within-sidekiq-retries-exhausted-block-with-another If you use the...

...global option (manual test): # Use this worker to test if the exception notifier for sidekiq works as expected and the retries total duration fits. # Example: TestWorker.perform_async('foo', 'bar')

Copy the attached file to features/support. This gets you a convenience method: Capybara.javascript_test? Is true for Selenium, capybara-webkit, Poltergeist and a custom driver called :chrome (which we sometimes...

makandracards.com

Our rcov:all task for aggregated RSpec/Cucumber coverage was overhauled extensively. Among other things it now works for Rails 2...

makandra dev

.../public/assets-test/', '/tmp/', ] } 2. Report all existing offenses and exclude them initially Add an RSpec test, which runs ESLint (also during a full RSpec test run), e.g. in spec/eslint_spec.rb: require 'open3...

expect(status.success?).to eq(true), failure_message end end Run the test or simply run yarn run eslint . from your console to check all files. Now you...

makandra dev

Have you ever mistaken one Rails environment for another? The attached helper will help you to never do it again...

justinfrench.com

If you’re testing the behavior of deprecated code in your Ruby project, the warning messages littered throughout your spec output is incredibly noisy. You could silence all warnings with...

...an important warning in one of your dependencies. It’s tempting to remove the tests altogether (the code will be burned soon too, right?), but I figured out something a...

Just install the texlive-xetex package: sudo apt-get install texlive-xetex Running integration tests without texlive-xetex will produce an error during xelatex execution: RTeX::Document::ExecutableNotFoundError

Cucumber scenarios that are tagged with @javascript so they run with Selenium are very slow. You might not want to...

To test whether a hash includes an expected sub-hash: expect(user.attributes).to match(hash_including('name' => 'Bruce Wayne')) expect(User).to receive(:create!).with(hash_including('name' => 'Bruce Wayne...

Haml HTML generated by Haml 5 HTML generated by Haml 6 %button(up-test) %button(up-test=true) %button(up-test=false) %button(up-test=nil) %button(up-test...

same %button(up-test='false') same %button(up-test='') same Extending the list of attributes considered "boolean" You can add to the list of "boolean attributes", but please do...

Selenium does not speak SSL because it uses WEBrick that doesn't. When you use Selenium for Cucumber scenarios that...

We are consistently having trouble with selenium-webdriver > 2.5.0 where whenever we try to select an option from a Capybara...

When testing JavaScript functionality in Selenium (E2E), you may need to access a class or function inside of a evaluate_script block in one of your steps. Capybara may only...

...are exporting your definition(s) in Webpacker, these won't be available in your tests (and neither in the dev console). The following principles/concepts also apply to Sprockets.

Here is an example with the --tags option. You need to wrap them inside --cucumber-options option of parallel_cucumber...

Code splitting is a feature of esbuild that can keep huge libraries out of the main bundle. How code splitting...

...vcr, a cassette with an automatically determined name will be generated on the first test run and replayed on subsequent runs: Here is an example for a spec using the...

If you get the above error when running tests in bulk (but not individually), it's actually the fault of Webmock. Updating Webmock to version 1.7+ fixes this...

You can use the step definition below to say this: Then the "Last name" field should have an error

...seems to forget cookies / sessions when you run it with Selenium check if the test travels in time like here: Given the date is 2017-10-20

...does not have any log or debugging statements like console.log(...), byebug etc. has green tests has tests for new features has been manually tested in the browser has no missing...

If you're supposed to merge yourself, you need to Run all tests again by using geordi t Get the latest master Squash your commits using git rebase...

programmingtour.blogspot.com

We had a conversation about the fact that the 'TDD is about testing vs TDD is about design" debate that keeps popping up, especially now in the Ruby community...

Spreewald gives you steps like these: When I enter "text" into the browser dialog Also see Accept or deny JavaScript...

...write the password hash to a file: echo firstname.lastname:$2y$05$4JXxd2GM/J2...9c3KJmFS > htpass_test Check, if it is correct: htpasswd -v htpass_test firstname.lastname You probably should not use...