Commit 34376c50 authored by Stan Hu's avatar Stan Hu

Merge branch 'mo-change-capybara-screenshots-name' into 'master'

Change capybara screenshots files names

See merge request gitlab-org/gitlab!26788
parents 535d5da7 66f66a03
---
title: Change capybara screenshots files names taken on tests failures
merge_request: 26788
author:
type: changed
......@@ -122,8 +122,10 @@ module QA
driver.browser.save_screenshot(path)
end
Capybara::Screenshot.append_timestamp = false
Capybara::Screenshot.register_filename_prefix_formatter(:rspec) do |example|
::File.join(QA::Runtime::Namespace.name, example.file_path.sub('./qa/specs/features/', ''))
::File.join(QA::Runtime::Namespace.name, example.full_description.downcase.parameterize(separator: "_")[0..99])
end
Capybara.configure do |config|
......
......@@ -79,6 +79,11 @@ Capybara.ignore_hidden_elements = true
Capybara.default_normalize_ws = true
Capybara.enable_aria_label = true
Capybara::Screenshot.append_timestamp = false
Capybara::Screenshot.register_filename_prefix_formatter(:rspec) do |example|
::File.join(QA::Runtime::Namespace.name, example.full_description.downcase.parameterize(separator: "_")[0..99])
end
# Keep only the screenshots generated from the last failing test suite
Capybara::Screenshot.prune_strategy = :keep_last_run
# From https://github.com/mattheworiordan/capybara-screenshot/issues/84#issuecomment-41219326
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment