pickles 0.2.3 → 0.2.4

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
  SHA1:
3
- metadata.gz: 133b4adeb408fceb495f86eaa9331e277bb4c684
4
- data.tar.gz: 11b8af9c0ff9438bcd04f96960beafee5d9b3f37
3
+ metadata.gz: 2d2a4e0ea1dad01c9b57c03c78da7d871daaa46a
4
+ data.tar.gz: c13a7b51a04b2ec2efe6c860c7522a85c44e9fb6
5
5
  SHA512:
6
- metadata.gz: f4254e7ac1c0c28bfc235d30791db7016d2087e2440fed0dbc849705577cc932844e71b4a51b10b20b1f73a156d2f62d12c82672dc2e695613ba133a72607f79
7
- data.tar.gz: 7bb8bf6bb981989c6e56f4ea42d2feb4f88c744db9ea096a67d76b7e261cc5f05541ea7945b25509bedebc6e6dc117383b2e8b59860147ae69e1efae6e3e7d74
6
+ metadata.gz: f04a85be92608cc9761390eb1b85f6e052162ebfc00e90482262c9a17571c2f6b04c98b33981b82404c21d95841f096c50afbb84902053a7ab9b56cc29f4082d
7
+ data.tar.gz: 917952706245cd2623a51c9b7f8e44ed2cfbcbc73231c310d0e2133c18c553d4eddd8f5837c13fc4c02ae8ab1a89985c1cca958f1b1ea0247bfff322904963f7
@@ -139,7 +139,7 @@ module NodeFinders
139
139
  _rescued_find([:xpath, xpath, options], locator, within: within, message: "find_node(#{locator}) => look for closest fillable field, index by label") do
140
140
 
141
141
  # case 2
142
- _rescued_find([:fillable_field, locator, options], locator, within: within, message: 'Capybara#fillable_input') do
142
+ _rescued_find([:fillable_field, locator, options], locator, index: index, within: within, message: 'Capybara#fillable_input') do
143
143
 
144
144
  # all cases failed => raise
145
145
  raise Capybara::ElementNotFound,
@@ -154,8 +154,12 @@ module NodeFinders
154
154
  end
155
155
  end
156
156
 
157
- def _rescued_find(params, locator, within:, message:)
158
- within.find(*params)
157
+ def _rescued_find(params, locator, within:, message:, index: nil)
158
+ if index
159
+ within.all(*params)[index - 1]
160
+ else
161
+ within.find(*params)
162
+ end
159
163
  rescue Capybara::Ambiguous => err # Capybara::Ambiguous < Capybara::ElementNotFound == true
160
164
  raise Pickles::Ambiguous.new(locator, within, params, message), nil, caller
161
165
  rescue Capybara::ElementNotFound
@@ -1,3 +1,3 @@
1
1
  module Pickles
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pickles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - vs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-20 00:00:00.000000000 Z
11
+ date: 2017-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara