Fix randomly failing PDF cucumber tests
Sometimes PDF cucumber tests fail at the first test run and succeed at the second run. You can fix this with this step:
When PDF generation is ready
And I follow "Save as PDF"
# Checks for PDF contents go here
Here is the step definition:
When /^PDF generation is ready$/ do
Then 'I should see ""'
end
Related cards:
Fixing flaky E2E tests
An end-to-end test (E2E test) is a script that remote-controls a web browser with tools like Selenium WebDriver. This card shows basic techniques for fixing a flaky E2E test suite that sometimes passes and sometimes fails.
Although many examples ...
LibreOffice won't embed most fonts into PDFs (with fix)
- LibreOffice Impress, Writer, etc. doesn't embed most fonts into the PDFs it generates.
- This means if you share a slide show with a font that is not Arial...
Print large PDFs as a poster
Pdfposter is a Python script that allows to convert large PDFs into a PDF with multiple pages that can be printed and turned into one big poster.
In Ubuntu, you can install it with
sudo apt-get install pdfposter
Scaling to the desired size i...
cucumber_factory: How to keep using Cucumber 2 Transforms in Cucumber 3
Cucumber up to version 2 had a neat feature called Step Argument Transforms which was dropped in favor of Cucumber 3 [ParameterTypes](https://cucumber.io/blog/upgrading-to-cucum...
Fix: Cucumber won't start though cucumber.yml is correct
This is for you if you get this error:
cucumber.yml was found, but could not be parsed. Please refer to cucumber's documentation on correct profile usage.
Actually, it's likely that your cucumber.yml
is just fine but not your rerun.txt
....
Fix warning: Cucumber-rails required outside of env.rb
After installing Bundler 1.1 you will get the following warning when running tests:
WARNING: Cucumber-rails required outside of env.rb. The rest of loading is being defered until env.rb is called.\
To avoid this warning, move 'gem cucumber-...
How to set the user agent in tests
The User-Agent
HTTP header identifies the client and is sent by "regular" browsers, search engine crawlers, or other web client software.
Cucumber
In Rack::Test
, you can set your user agent like this on Capybara:
Given /^my user age...
Run Selenium tests in Chrome instead of Firefox
Here is how to switch your Selenium to Chrome:
- Make sure you've got a recent version of chromedriver in your
$PATH
See also [geordi chromedriver_update](https://github.com/ma...
pdfkit/wkhtmltopdf: When a header is invisible
If you're using the :header_html
option in PDFKit (or the corresponding --header-html
option in wkhtmltopdf
), and the header remains invisible, you need to add this to your header HTML:
<!doctype html>
The same applies to footers v...
New Firefox and gem versions for our Selenium testing environment (Ubuntu 14.04+)
Firefox 5.0.1, which we were using for most Rails 2.3 projects, does not run on Ubuntu 14.04 any more. Here is how to update affected projects.
- Update (or create)
.firefox-version
with the content:24.0
If you haven't installed Firefo...