Skip to content

Fix capybara screenshot attachment

Max Orefice requested to merge mo-fix-capybara-screenshot-attachment into master

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

Availability and Testing

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
Edited by Max Orefice

Merge request reports