Artefacts in tests and managing them with Atlas

We’ve recently publicly released a Gem called dvla-atlas1 and today we are going to take you through a bit of history surrounding testing at the DVLA that led to use developing Atlas, along with a dive into some of the code that makes it tick. Atlas is designed to make the managing of properties in functional tests easier while also ensuring that each test is run in isolation and without any cross-pollination of test data. But first, lets take a look at what we mean by artefacts and we used them in tests we’d written in Cucumber. ...

November 14, 2023 · 8 min · 1658 words · Nigel Brookes-Thomas & George Bell

FakerMaker Chaos Mode Update

TL:DR Level up your testing by introducing some chaos to your test data. FakerMaker is an incredible factory builder used to generate test data. When introduced to a test-pack (alongside Faker), it elevates tests by introducing dynamic test data to ensure we’re not constantly testing with the same old boring static data. FakerMaker.factory :some_fancy_object, naming: :json do some_required_attribute { Faker::Lorem.sentence } some_optional_attribute_1 { Faker::Lorem.word } some_optional_attribute_2 { Faker::Lorem.word } some_optional_attribute_3 { Faker::Lorem.word } some_optional_attribute_4 { Faker::Lorem.word } end FakerMaker[:some_fancy_object].build.as_json # => {"someRequiredAttribute"=>"Nulla omnis dolore enim.", "someOptionalAttribute1"=>"qui", "someOptionalAttribute2"=>"deserunt", "someOptionalAttribute3"=>"rerum", "someOptionalAttribute4"=>"facilis"} FakerMaker[:some_fancy_object].build.as_json # => {"someRequiredAttribute"=>"Aut repellendus ut quod.", "someOptionalAttribute1"=>"consequatur", "someOptionalAttribute2"=>"quod", "someOptionalAttribute3"=>"pariatur", "someOptionalAttribute4"=>"rerum"} This is a super effective way of ensuring data within an attribute is dynamic, but can we take this further? ...

June 16, 2023 · 4 min · 672 words · Alexander O'Mahoney