effective_test_bot 1.1.23 → 1.1.24

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c5680e555e47bbf34f48eb0b94cde7030ea3620b89086ce240ef1ca26f2c104
4
- data.tar.gz: 512d0f243668ccca14b34382cdf1f3f678a90a21ef35dfc5469351a7d4c76787
3
+ metadata.gz: eccff959a9793ba3408242d0ce772d74ffec74b5e814052ee6ee27086d934491
4
+ data.tar.gz: 631e4aca51755e878e549edc85547297bd630c199996b0a67ca34f36ed215e75
5
5
  SHA512:
6
- metadata.gz: eb95d66b4f2f04facf6e8c077ee21457dbece6cd811270483e41172af4bab60c7129c17b46a4bea2572dbbdf4b81142d913569d4598044b098aeaad3841d4601
7
- data.tar.gz: 2724eed26fc9907c1153aa3b0f5a74100a63c554275d968d47e7ece8c2b1b5522255a11492aac9b899e5c14232b73eb4d614bdb57a702f1155cad716932bcf4c
6
+ metadata.gz: db5b468dbb02f65c4e2050a77168c1559f30ec12e6d2f046a014e1a815b78450a93d3816956f3500b969fb8ec5cb6e0065f1040eef4649f4a7be780f4e1930cd
7
+ data.tar.gz: 7c997a7afa4c1875a44e32c4f8de06713f589d6b5e3a51ffa3e3a04c8c37b999d3d24feadae466d1d2f170e93be3666c1f4448f1f9d7ab5d6167a3c53c4227d1
@@ -66,7 +66,7 @@ module EffectiveTestBot
66
66
  end
67
67
 
68
68
  def self.gifs?
69
- image_processing_class.present?
69
+ screenshots? && image_processing_class.present?
70
70
  end
71
71
 
72
72
  def self.image_processing_class
@@ -97,7 +97,7 @@ module EffectiveTestBot
97
97
  if ENV['TOUR'].present?
98
98
  ENV['TOUR'].to_s != 'false'
99
99
  else
100
- screenshots? && (tour_mode != false)
100
+ gifs? && (tour_mode != false)
101
101
  end
102
102
  end
103
103
 
@@ -106,7 +106,7 @@ module EffectiveTestBot
106
106
  if ENV['TOUR'].present?
107
107
  ['extreme', 'debug'].include?(ENV['TOUR'].to_s.downcase)
108
108
  else
109
- screenshots? && ['extreme', 'debug'].include?(tour_mode.to_s)
109
+ gifs? && ['extreme', 'debug'].include?(tour_mode.to_s)
110
110
  end
111
111
  end
112
112
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveTestBot
2
- VERSION = '1.1.23'.freeze
2
+ VERSION = '1.1.24'.freeze
3
3
  end
@@ -5,6 +5,8 @@ require 'faker'
5
5
  module EffectiveTestBotFormFaker
6
6
  DIGITS = ('1'..'9').to_a
7
7
  LETTERS = %w(A B C E G H J K L M N P R S T V X Y) # valid letters of a canadian postal code, eh?
8
+ TRUE_VALUES = [true, 1, '1', 't', 'T', 'true', 'TRUE', 'on', 'ON']
9
+ FALSE_VALUES = [false, 0, '0', 'f', 'F', 'false', 'FALSE', 'off', 'OFF']
8
10
 
9
11
  # Generates an appropriately pseudo-random value for the given field
10
12
  # Pass in a Hash of fills to define pre-selected values
@@ -269,19 +271,11 @@ module EffectiveTestBotFormFaker
269
271
  end
270
272
 
271
273
  def truthy?(value)
272
- if defined?(::ActiveRecord::ConnectionAdapters::Column::TRUE_VALUES) # Rails 5
273
- ::ActiveRecord::ConnectionAdapters::Column::TRUE_VALUES.include?(value)
274
- else
275
- ActiveRecord::Type::Boolean.new.cast(value)
276
- end
274
+ TRUE_VALUES.include?(value)
277
275
  end
278
276
 
279
277
  def falsey?(value)
280
- if defined?(::ActiveRecord::ConnectionAdapters::Column::FALSE_VALUES) # Rails 5
281
- ::ActiveRecord::ConnectionAdapters::Column::FALSE_VALUES.include?(value)
282
- else
283
- ::ActiveRecord::Type::Boolean.new.cast(value) == false
284
- end
278
+ FALSE_VALUES.include?(value)
285
279
  end
286
280
 
287
281
  end
@@ -130,6 +130,7 @@ module EffectiveTestBotFormFiller
130
130
  @filled_country_fields = nil
131
131
 
132
132
  save_test_bot_screenshot
133
+ true
133
134
  end
134
135
 
135
136
  def fill_input_text(field, value)
@@ -7,17 +7,15 @@ module EffectiveTestBotScreenshotsHelper
7
7
  end
8
8
 
9
9
  def save_test_bot_screenshot
10
- return unless EffectiveTestBot.screenshots?
10
+ return unless EffectiveTestBot.gifs?
11
11
  return unless page.current_path.present?
12
-
12
+
13
13
  page.save_screenshot("#{current_test_temp_path}/#{current_test_screenshot_id}.png")
14
14
  true
15
15
  end
16
16
 
17
17
  def save_test_bot_failure_gif
18
- return unless EffectiveTestBot.screenshots?
19
18
  return unless EffectiveTestBot.gifs?
20
-
21
19
  return unless save_test_bot_screenshot
22
20
 
23
21
  Dir.mkdir(current_test_failure_path) unless File.exist?(current_test_failure_path)
@@ -28,7 +26,6 @@ module EffectiveTestBotScreenshotsHelper
28
26
  end
29
27
 
30
28
  def save_test_bot_tour_gif
31
- return unless EffectiveTestBot.screenshots?
32
29
  return unless EffectiveTestBot.gifs?
33
30
  return unless (@test_bot_screenshot_id || 0) > 0
34
31
 
@@ -42,9 +39,12 @@ module EffectiveTestBotScreenshotsHelper
42
39
  def without_screenshots(&block)
43
40
  original = EffectiveTestBot.screenshots
44
41
 
45
- EffectiveTestBot.screenshots = false
46
- yield
47
- EffectiveTestBot.screenshots = original
42
+ begin
43
+ EffectiveTestBot.screenshots = false
44
+ yield
45
+ ensure
46
+ EffectiveTestBot.screenshots = original
47
+ end
48
48
  end
49
49
 
50
50
  protected
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_test_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.23
4
+ version: 1.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-21 00:00:00.000000000 Z
11
+ date: 2020-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails