Skip to content

Change capybara screenshots files names

Max Orefice requested to merge mo-change-capybara-screenshots-name into master

Part of #202114 (closed)

What does this MR do?

This MR updates our screenshots files names taken on test failures. It does 2 things:

Before After
../browser_ui/1_manage/group/groups_permission_checks_spec.rb_2020-02-28-17-25-22.691.png ../verify_pipeline_creation_and_processing_users_creates_a_pipeline_which_gets_processed.html

Why are we changing this?

Today's problem

It's not possible to determine what specific test failed for a given screenshot. Taking this example we have no way to know which test failed according to the actual file name:

gitlab-qa-run-2020-02-28-16-58-48-6c9d9c85/gitlab-ee-qa-7c203b59/qa-test-2020-02-28-17-11-23-b03bf4034f8529a5/ee/browser_ui/1_manage/group/groups_permission_checks_spec.rb_2020-02-28-17-25-22.691.png

Solution

In order for GitLab to display failed screenshots on a pipeline we need a 1:1 mapping between JUnit XML and RSpec test failure.

By modifying the way we are persisting screenshots and using the full_description on a test failure we are able to have this 1:1 mapping that does not exists today.

We will only modify the file_name, the prefix will remain the same.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Max Orefice

Merge request reports