Fix capybara screenshot attachment
Ref: #330634 (closed)
What does this MR do?
This MR fixes the way we generate our attachment tag during a test failure.
It allows us to generate an [[ATTACHMENT]]
tag which is required in order to be displayed on the UI.
It is now using the same configuration than QA.
It also tweaks the path in order to build it properly.
Why are we doing this?
If my memory is correct, we had some issues when we tested this feature for QA
and we had to tweak our capybara configuration.
I've tested this out locally and I was able to generate the following junit report containing our [[ATTACHMENT]]
tag.
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="rspec" tests="1" skipped="0" failures="1" errors="0" time="109.369995" timestamp="2021-05-11T14:08:39-04:00" hostname="Maximes-MacBook-Pro.local">
<properties>
<property name="seed" value="44468"/>
</properties>
<testcase classname="ee.spec.features.admin.cloud_licences.admin_views_cloud_license_spec" name="Admin views Cloud License when there is no license Upload Legacy License shows a link to upload a legacy license" file="./ee/spec/features/admin/cloud_licences/admin_views_cloud_license_spec.rb" time="98.948543"><failure message="RSpec::Core::MultipleExceptionError" type="RSpec::Core::MultipleExceptionError">
</failure><system-out>[[ATTACHMENT|/Users/goldenson/Code/gitlab-development-kit/gitlab/tmp/capybara/admin_views_cloud_license_when_there_is_no_license_upload_legacy_license_shows_a_link_to_upload_a_le.png]]</system-out></testcase>
</testsuite>
Conformity
- [-] I have included a changelog entry, or it's not needed. (Does this MR need a changelog?)
- [-] I have added/updated documentation, or it's not needed. (Is documentation required?)
- [-] I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?)
- [-] I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?)
-
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides.
Availability and Testing
- [-] I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.)
- [-] I have tested this MR in all supported browsers, or it's not needed.
- [-] I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.
Security
Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.
- [-] 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