effective_test_bot 1.5.4 → 1.5.6

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: 00e994d7cc48e7ad3f6594daf5f8e13678fcc85be4b178d8565f3d4666f5724e
4
- data.tar.gz: 3b2ec36407c22b8b8639e6a585e2fea987033affdacb0ab61e551f183965b55b
3
+ metadata.gz: 973740fc8ffcd01506d1f25adfd33ea5b6243bf0cf10ac92c2e113e99545db75
4
+ data.tar.gz: f0432c566e900a84b03363a9f71c23e6da82a80ab096ba85b1959cc589c0c1fd
5
5
  SHA512:
6
- metadata.gz: 32c6e8f8e86c813d29dcc283a449eda202b61791ad4ae4cdb599a7db95ab4678f9d93f9d248507ec07265f6c1a45a42b62355d42a4549d765b1684f4ad2c52b5
7
- data.tar.gz: 6d9ad23ef9fe2bf9dd41b7ef7ec1d9664735a38f0ff8187d65bb09a85aa66c455ac4f9e26c276b0fcbe00697ea04ae796c483628d96189614d1a0f5a16ebde53
6
+ metadata.gz: 22dcfa39126fb8e039ae905eb274f89181fea57adc283774366dfc8cc53a7cd93e24289fb4f0709045b1f79408652463cd68da1a3b8ec2b44be28353e3499c36
7
+ data.tar.gz: 6eb4f7a4c8b0199e4821a3279b30fdcfc723cc0c3d58b9fc48e1ecbafdee9b6a62bfa0a9f68d98d6d2835df898793bc20402c44e45d40c71ef06bf62e08d5288
@@ -1,3 +1,3 @@
1
1
  module EffectiveTestBot
2
- VERSION = '1.5.4'.freeze
2
+ VERSION = '1.5.6'.freeze
3
3
  end
@@ -34,12 +34,12 @@ module TestSeedable
34
34
 
35
35
  case seed
36
36
  when :all
37
- load(db_seeds) if File.exists?(db_seeds)
38
- load(test_seeds) if File.exists?(test_seeds)
37
+ load(db_seeds) if File.exist?(db_seeds)
38
+ load(test_seeds) if File.exist?(test_seeds)
39
39
  when :db
40
- load(db_seeds) if File.exists?(db_seeds)
40
+ load(db_seeds) if File.exist?(db_seeds)
41
41
  when :test
42
- load(test_seeds) if File.exists?(test_seeds)
42
+ load(test_seeds) if File.exist?(test_seeds)
43
43
  else
44
44
  raise('unexpected seed argument. use :all, :db or :test')
45
45
  end
@@ -166,7 +166,7 @@ module EffectiveTestBotFormFaker
166
166
  # If this is a file field, make sure the file is present at Rails.root/test/fixtures/
167
167
  if fill.present? && fill != :unselect && field_name == 'input_file'
168
168
  filename = (fill.to_s.include?('/') ? fill : "#{Rails.root}/test/fixtures/#{fill}")
169
- raise("Warning: Unable to load fill file #{fill}. Expected file #{filename}") unless File.exists?(filename)
169
+ raise("Warning: Unable to load fill file #{fill}. Expected file #{filename}") unless File.exist?(filename)
170
170
  return filename
171
171
  end
172
172
 
@@ -149,13 +149,16 @@ module EffectiveTestBotFormFiller
149
149
  end
150
150
 
151
151
  def fill_input_checkbox(field, value)
152
- return if [nil, false].include?(value)
153
-
154
152
  if field['class'].to_s.include?('custom-control-input')
155
153
  label = all("label[for='#{field['id']}']", wait: false).first
156
- return label.click() if label
154
+ if label
155
+ label.click if field.checked? ^ value # click if check status is different from value
156
+ return
157
+ end
157
158
  end
158
159
 
160
+ return if [nil, false].include?(value)
161
+
159
162
  begin
160
163
  field.set(value)
161
164
  rescue Exception => e
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.5.4
4
+ version: 1.5.6
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: 2023-12-13 00:00:00.000000000 Z
11
+ date: 2024-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  - !ruby/object:Gem::Version
193
193
  version: '0'
194
194
  requirements: []
195
- rubygems_version: 3.4.10
195
+ rubygems_version: 3.5.6
196
196
  signing_key:
197
197
  specification_version: 4
198
198
  summary: A shared library of rails model & system tests that should pass in every