effective_test_bot 1.3.3 → 1.3.5
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 +4 -4
- data/README.md +10 -0
- data/lib/effective_test_bot/version.rb +1 -1
- data/test/support/effective_test_bot_form_filler.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4a17fe103ca39026ff28a4b3b438fe12859f73b7783133777a2a551c88d7890f
|
|
4
|
+
data.tar.gz: c075fa86e25c11cedbf3a5f99195d5ee7bc0472adc476e7ea65e4b92294b0c4c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b423d7b189ed090317e48de57fe50d79a87789dc59106f38447f6864be57b65af5c321cfe6ba7a58f5f4cc07b7a642e2445de9cad5de40ef37bbfc5432c6da19
|
|
7
|
+
data.tar.gz: 10804ee52c3840b8ad28b876e47f8a67fccaa03358b3719c700e97b324cfe673050323e826aa9c0f581065ed0a55b087ab6cdc94578e751c5284b35633b1be90
|
data/README.md
CHANGED
|
@@ -145,6 +145,16 @@ As well,
|
|
|
145
145
|
|
|
146
146
|
- `assert_page_normal` checks for general errors on the current page. Checks include `assert_page_status`, `assert_no_js_errors`, and `assert_page_title`.
|
|
147
147
|
|
|
148
|
+
## Object Extras
|
|
149
|
+
|
|
150
|
+
Includes a `stub_any_instance` helper:
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
String.stub_any_instance(:length, 42) do
|
|
154
|
+
assert_equal "hello".length, 42
|
|
155
|
+
end
|
|
156
|
+
```
|
|
157
|
+
|
|
148
158
|
## Capybara Extras
|
|
149
159
|
|
|
150
160
|
The following quality of life helpers are added by this gem:
|
|
@@ -174,6 +174,11 @@ module EffectiveTestBotFormFiller
|
|
|
174
174
|
if ckeditor_text_area?(field)
|
|
175
175
|
value = "<p>#{value.gsub("'", '')}</p>"
|
|
176
176
|
try_script "CKEDITOR.instances['#{field['id']}'].setData('#{value}')"
|
|
177
|
+
elsif article_editor_text_area?(field)
|
|
178
|
+
value = "<p>#{value.gsub("'", '')}</p>"
|
|
179
|
+
try_script "ArticleEditor('##{field['id']}').editor.setFocus('start')"
|
|
180
|
+
try_script "ArticleEditor('##{field['id']}').editor.insertContent({html: '#{value}'})"
|
|
181
|
+
try_script "ArticleEditor('##{field['id']}').editor.setFocus('end')"
|
|
177
182
|
else
|
|
178
183
|
field.set(value)
|
|
179
184
|
end
|
|
@@ -300,6 +305,10 @@ module EffectiveTestBotFormFiller
|
|
|
300
305
|
@test_bot_excluded_fields_xpath = nil
|
|
301
306
|
end
|
|
302
307
|
|
|
308
|
+
def article_editor_text_area?(field)
|
|
309
|
+
field.tag_name == 'textarea' && field['class'].to_s.include?('effective_article_editor')
|
|
310
|
+
end
|
|
311
|
+
|
|
303
312
|
def ckeditor_text_area?(field)
|
|
304
313
|
return false unless field.tag_name == 'textarea'
|
|
305
314
|
(field['class'].to_s.include?('ckeditor') || all("span[id='cke_#{field['id']}']", wait: false).present?)
|
|
@@ -338,6 +347,7 @@ module EffectiveTestBotFormFiller
|
|
|
338
347
|
return true if @test_bot_excluded_fields_xpath.present? && field.path.include?(@test_bot_excluded_fields_xpath)
|
|
339
348
|
|
|
340
349
|
if !field.visible?
|
|
350
|
+
return false if article_editor_text_area?(field)
|
|
341
351
|
return false if ckeditor_text_area?(field)
|
|
342
352
|
return false if custom_control_input?(field)
|
|
343
353
|
return false if file_input?(field)
|
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.3.
|
|
4
|
+
version: 1.3.5
|
|
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: 2022-
|
|
11
|
+
date: 2022-09-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|