bucky-core 0.9.11 → 0.9.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bucky/test_equipment/pageobject/base_pageobject.rb +16 -1
- data/lib/bucky/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13cebeab73b7e81980d36a07515ac17fb040eea9
|
4
|
+
data.tar.gz: 407b0fc24a25d52ce5977fa2a63e2c7b5a5b1021
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c49d372f9e4a36a81daaf07fe7309caf7286e5dbbfd6ad4094bc29eaded54f4bf51c1ed84ad3813858b974c5cbcd63729d87438ebe3b881a76c779ee69ba1b1
|
7
|
+
data.tar.gz: 65ba083425e8b97bc0e59486c3663e8e293c1add4cb1e4cd89749dea1333e078e79bd40bb73235122ae020631e90784ad35eb07207b7e315b65690e731ee8811
|
@@ -54,7 +54,22 @@ module Bucky
|
|
54
54
|
|
55
55
|
elements = @driver.find_elements(method_name, value)
|
56
56
|
raise_if_elements_empty(elements, method_name, value)
|
57
|
-
|
57
|
+
|
58
|
+
get_element_or_attribute = lambda do |elems, arg|
|
59
|
+
# return WebElement
|
60
|
+
return elems[arg] if arg.is_a? Integer
|
61
|
+
# return String(Value of WebElement`s attribute)
|
62
|
+
return elems.first.attribute(arg) if [String, Symbol].include? arg.class
|
63
|
+
|
64
|
+
raise StandardError, "Invalid argument type. Expected type is Integer/String/Symbol.\n\
|
65
|
+
| Got argument:#{arg}, type:#{arg.class}."
|
66
|
+
end
|
67
|
+
|
68
|
+
elements.first.instance_eval do
|
69
|
+
define_singleton_method('[]') { |arg| get_element_or_attribute.call(elements, arg) }
|
70
|
+
%w[each length].each { |m| define_singleton_method(m) { elements.send(m) } }
|
71
|
+
end
|
72
|
+
|
58
73
|
elements.first
|
59
74
|
rescue StandardError => e
|
60
75
|
Bucky::Core::Exception::WebdriverException.handle(e)
|
data/lib/bucky/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bucky-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NaotoKishino
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: exe
|
15
15
|
cert_chain: []
|
16
|
-
date: 2019-07-
|
16
|
+
date: 2019-07-09 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: awesome_print
|