summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2017-03-14 15:43:53 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2017-03-14 15:43:53 +0000
commitb8a54fc002aea16bf5024c8749007a0b6f8f7141 (patch)
treee16502ad6fa2409971315fb6e40bdecdf8961852
parentbdc1a55eded1f60900fe89591a7fb935445eaac6 (diff)
parenta61c19778180a8316321ac9ca6f84de76a6c23b3 (diff)
downloadgitlab-ce-b8a54fc002aea16bf5024c8749007a0b6f8f7141.tar.gz
Merge branch 'rs-capybara-screenshot-artifacts' into 'master'
Store capybara screenshots as build artifacts Closes #13971 See merge request !7985
-rw-r--r--.gitlab-ci.yml8
-rw-r--r--features/support/capybara.rb9
-rw-r--r--spec/support/capybara.rb9
3 files changed, 12 insertions, 14 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index db3d25195dc..492f5ef715d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -67,9 +67,11 @@ stages:
- knapsack rspec "--color --format documentation"
artifacts:
expire_in: 31d
+ when: always
paths:
- - knapsack/
- coverage/
+ - knapsack/
+ - tmp/capybara/
.spinach-knapsack: &spinach-knapsack
stage: test
@@ -85,9 +87,11 @@ stages:
- knapsack spinach "-r rerun" || retry '[[ -e tmp/spinach-rerun.txt ]] && bundle exec spinach -r rerun $(cat tmp/spinach-rerun.txt)'
artifacts:
expire_in: 31d
+ when: always
paths:
- - knapsack/
- coverage/
+ - knapsack/
+ - tmp/capybara/
# Prepare and merge knapsack tests
diff --git a/features/support/capybara.rb b/features/support/capybara.rb
index a5fcbb65131..c0c489d2775 100644
--- a/features/support/capybara.rb
+++ b/features/support/capybara.rb
@@ -1,5 +1,6 @@
require 'spinach/capybara'
require 'capybara/poltergeist'
+require 'capybara-screenshot/spinach'
# Give CI some extra time
timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 30 : 10
@@ -20,12 +21,8 @@ end
Capybara.default_max_wait_time = timeout
Capybara.ignore_hidden_elements = false
-unless ENV['CI'] || ENV['CI_SERVER']
- require 'capybara-screenshot/spinach'
-
- # Keep only the screenshots generated from the last failing test suite
- Capybara::Screenshot.prune_strategy = :keep_last_run
-end
+# Keep only the screenshots generated from the last failing test suite
+Capybara::Screenshot.prune_strategy = :keep_last_run
Spinach.hooks.before_run do
TestEnv.warm_asset_cache unless ENV['CI'] || ENV['CI_SERVER']
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb
index 62740ec29fd..aa14709bc9c 100644
--- a/spec/support/capybara.rb
+++ b/spec/support/capybara.rb
@@ -1,6 +1,7 @@
require 'capybara/rails'
require 'capybara/rspec'
require 'capybara/poltergeist'
+require 'capybara-screenshot/rspec'
# Give CI some extra time
timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 30 : 10
@@ -21,12 +22,8 @@ end
Capybara.default_max_wait_time = timeout
Capybara.ignore_hidden_elements = true
-unless ENV['CI'] || ENV['CI_SERVER']
- require 'capybara-screenshot/rspec'
-
- # Keep only the screenshots generated from the last failing test suite
- Capybara::Screenshot.prune_strategy = :keep_last_run
-end
+# Keep only the screenshots generated from the last failing test suite
+Capybara::Screenshot.prune_strategy = :keep_last_run
RSpec.configure do |config|
config.before(:suite) do