effective_test_bot 0.4.15 → 0.4.16

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
  SHA1:
3
- metadata.gz: 3a778c05ffd7dc030ac1a5ba973d18c6a246e544
4
- data.tar.gz: 21883e88e7e4dce236b0da20e3defd3179100d00
3
+ metadata.gz: 124e24f5a23f78013a2895ed9b1cb6c84553f50c
4
+ data.tar.gz: bf2e35d6c19792b9fd322c870d6dd65260a86f48
5
5
  SHA512:
6
- metadata.gz: 42890c86671d96d6cf02c86da2a86c2d470cfac7bc7bf54f805334855c824c7a0170320b64f55fb55b03ff3f2f169b7eb9bc6ebb7afca6f7ef56dc9a63234af4
7
- data.tar.gz: d98cdbb9dd5d68309fce7157ac15bc0b154fffaf82c02ff72610b3aa3caf8a8d306e2a4a4e7321eeb35ae99198973424b99e317cce3d693d3b26027dd160db9d
6
+ metadata.gz: fe29d076bafcb5ab447e37f7a4f69e5417e3169eec65a6c446019e5cb92428e385ac7fb4cb1ad530eaba669bb52d06fdef167ab44bada016fae093c0d57bf02e
7
+ data.tar.gz: 5a703c21aa3183e2c3fdc1c4429810ea052947696ab0078b591181392c526e2f5e88389db9c532dbab20a88f9f9c0b3eaf3c9573c6b65eace9c2e6938219294b
@@ -1,3 +1,3 @@
1
1
  module EffectiveTestBot
2
- VERSION = '0.4.15'.freeze
2
+ VERSION = '0.4.16'.freeze
3
3
  end
@@ -291,32 +291,13 @@ module EffectiveTestBotFormFiller
291
291
 
292
292
  # The field here is going to be the %input{:type => file}. Files can be one or more pathnames
293
293
  # http://stackoverflow.com/questions/5188240/using-selenium-to-imitate-dragging-a-file-onto-an-upload-element/11203629#11203629
294
- def upload_effective_asset(field, files)
295
- files = Array(files)
294
+ def upload_effective_asset(field, file)
296
295
  uid = field['id']
297
-
298
- js = "fileList = Array();"
299
-
300
- files.each_with_index do |file, i|
301
- # Generate a fake input selector
302
- page.execute_script("if($('#effectiveAssetsPlaceholder#{i}').length == 0) {effectiveAssetsPlaceholder#{i} = window.$('<input/>').attr({id: 'effectiveAssetsPlaceholder#{i}', type: 'file'}).appendTo('body'); }")
303
-
304
- # Attach file to the fake input selector through Capybara
305
- page.document.attach_file("effectiveAssetsPlaceholder#{i}", files[i])
306
-
307
- # Build up the fake js event
308
- js = "#{js} fileList.push(effectiveAssetsPlaceholder#{i}.get(0).files[0]);"
309
- end
310
-
311
- # Trigger the fake drop event
312
- page.execute_script("#{js} e = $.Event('drop'); e.originalEvent = {dataTransfer : { files : fileList } }; $('#s3_#{uid}').trigger(e);")
313
-
314
- # Remove the file inputs we created
315
- page.execute_script("$('input[id^=effectiveAssetsPlaceholder]').remove();")
296
+ field.set(file)
316
297
 
317
298
  # Wait till the Uploader bar goes away
318
299
  begin
319
- Timeout.timeout(files.length * 5) do
300
+ Timeout.timeout(5) do
320
301
  within("#asset-box-input-#{uid}") do
321
302
  within('.uploads') do
322
303
  while (first('.upload').present? rescue false) do
@@ -327,7 +308,7 @@ module EffectiveTestBotFormFiller
327
308
  end
328
309
  end
329
310
  rescue Timeout::Error
330
- puts "file upload timed out after #{files.length * 5}s"
311
+ puts "file upload timed out after 5s"
331
312
  end
332
313
  end
333
314
 
@@ -19,6 +19,8 @@ module WizardTest
19
19
  submit_form
20
20
  end
21
21
 
22
+ assert_no_assigns_errors
23
+
22
24
  if to_path.present?
23
25
  # Keep going till we hit a certain to_path
24
26
  break if page.current_path == to_path
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: 0.4.15
4
+ version: 0.4.16
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: 2016-03-22 00:00:00.000000000 Z
11
+ date: 2016-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails