booth 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d547a4c717dfffb45aefa8f29c31635c2f626b5387d722f79d0cf1a91941edff
4
- data.tar.gz: a75ac248690b901a84a14ae6d7a7ad6109aae727d6df12bfadcd151c6e37f076
3
+ metadata.gz: c779268526f086dc6da451ea8cd36969525d8db694fa94a4d6e9c81a1b7b7e0b
4
+ data.tar.gz: 1382ff82844424fe05b32d57faea6a76975eb986cfb4eb35dad81ef8e50a2068
5
5
  SHA512:
6
- metadata.gz: 735a909c2ff361d73d9325c5ee3db38e47085db47c510ab56658f92cc93ab9d74b812de893b714e0829340f1ae2364211eb409f109ae282007c39196f2e40f64
7
- data.tar.gz: 9479f3920d36131ddfeda314ad3f90a2099f91975a350792cd99483f0608d8b913a82cde64e670c87e79fc69b6155452eca05aad226e9f1edc0bf9d7b920e470
6
+ metadata.gz: 744a4c6084155c5e6d36c1aaf0a389d373511988d31312befb5418f309bbc1a3a142efff2d6beedd90307a1ffa1b9ad6c59abb174b7c6ef5630f35fd6a79b606
7
+ data.tar.gz: f2fb21ae84bd0c98c4293a22dda5d7f4a5dd0484745b4e750be1fbeda029308791b0413ae2f16de506ce7986d757935d626da2be426038919a2502d30dcdb99e
@@ -33,6 +33,7 @@ module Booth
33
33
 
34
34
  log { "The expected view `#{partial}` was rendered." }
35
35
  self.class.asserted_partials << partial
36
+ take_screenshot
36
37
  return
37
38
  end
38
39
  end
@@ -46,6 +47,21 @@ module Booth
46
47
  def partial
47
48
  "#{namespace}/#{controller}/#{step}"
48
49
  end
50
+
51
+ private
52
+
53
+ # For manual visual inspection of all partial (e.g. CSS glitches).
54
+ # Because doing this manually is very hard (would have to play through every scenario).
55
+ def take_screenshot
56
+ screenshot_dir.mkpath
57
+ path = screenshot_dir.join(::ActiveStorage::Filename.new(partial).sanitized)
58
+ page.save_screenshot(path.to_s) # rubocop:disable Lint/Debugger
59
+ log { "Screenshot saved to `#{path}`" }
60
+ end
61
+
62
+ def screenshot_dir
63
+ ::Rails.root.join('tmp/booth')
64
+ end
49
65
  end
50
66
  end
51
67
  end
data/lib/booth/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Booth
4
- VERSION = '0.0.7'
4
+ VERSION = '0.0.8'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: booth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - halo