Skip to content

Add a rspec based docs screenshot generator

What does this MR do?

After an endless amount of time spent taking and re-taking screenshots to update the documentation, I've decided to create an RSpec based solution that can leverage our feature tests system to navigate to pages and take the screenshots.

This is a WIP Mr meant to start a discussion.

Why RSpec

Because we can leverage the utilities and structure of our existing feature tests, that have all the necessary tools to:

  • navigate to a page
  • populate it with data
  • find and select dom elements
  • scroll the page if necessary

Additionally, many of our feature test test cases can be 'copied' and simplified to generate appropriate screenshots

What works

  • create screenshots of 2 different pages, in multiple 'scenarios' with 1 command
  • general helper to facilitate new screenshotter

What is missing

  • create a rake task, that executes the screenshotter and pngquaint
  • DRY and clean the code, also move it outside of the feature test folder

How to test it

  • Check out this branch
  • Follow the newly created docs

How to add more screnshotter

  • Check out this branch
  • add a new .rb file in spec/features/docs_screenshots
  • include include DocsScreenshotHelpers module
  • follow the lead of spec/features/docs_screenshots/container_registry.rb

Screenshots

😏

Edited by Nicolò Maria Mezzopera

Merge request reports

Loading