Change capybara screenshots files names
Part of #202114 (closed)
What does this MR do?
This MR updates our screenshots files names taken on test failures. It does 2 things:
- Remove timestamps
- Use RSpec full_description method instead of the
file_path
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
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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