gridium 1.1.7 → 1.1.8

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: acc2dbcae9f68194291b55aae75d9cde151d925c
4
- data.tar.gz: a9d23c17bcf7fe2c7592f64f02dab27e01ca8301
3
+ metadata.gz: 517b56ed62e9a8809095ef2600590faef16108e4
4
+ data.tar.gz: 1481c1312e62987c16c31e115e630b0f14b65a85
5
5
  SHA512:
6
- metadata.gz: '093a2b2415ccc89b489ef79ff792377227a7e5b4f55142256135d3ca69c121e4f6da10b54484b308b887c5259d67b81aeb681dfec6cc0805a86fe1c76edc84e2'
7
- data.tar.gz: 69236c5f6697c35fe5a675e210828738e6a66e9c98b85bf9e252c18dd26d97f5999762b8e14b871fbfa8452435217ee509ccde3421f580137a3ee87836d0cfcd
6
+ metadata.gz: 0aad78a322e0c34fbbac4a6d473fdc7b59103ae42536bbcc8b61c1a422ef7568c28ff211f42df0b32c934b59b10a753ab2ff0fac21200934d7b6d6cb96ab2dfb
7
+ data.tar.gz: 51057c690edc33798940e7df7ebdfe4e4d348790745fe35e251a6ec83935564eaab33e05df74593bfcfbe628a71e21037eb8bfb0537993b54af031dd69381360
data/lib/element.rb CHANGED
@@ -250,6 +250,16 @@ class Element
250
250
  end
251
251
  end
252
252
 
253
+ def jquery_click
254
+ Log.debug("[GRIDIUM::Element] JQuery clickin (#{self.to_s})...")
255
+ if element.enabled?
256
+ $verification_passes += 1
257
+ ElementExtensions.jquery_click(self)
258
+ else
259
+ Log.error('[GRIDIUM::Element] Cannot jquery_click. Element is not present.')
260
+ end
261
+ end
262
+
253
263
  def size
254
264
  element.size
255
265
  end
@@ -35,4 +35,10 @@ class Gridium::ElementExtensions
35
35
  def self.trigger_onblur(element)
36
36
  Driver.execute_script("arguments[0].focus(); arguments[0].blur(); return true", element.element)
37
37
  end
38
+
39
+ # Occasionaly selenium is unable to click on elements in the DOM which have some
40
+ # interesting React goodies around the element.
41
+ def self.jquery_click(element)
42
+ Driver.execute_script("arguments[0].click().change();", element.element)
43
+ end
38
44
  end
data/lib/page.rb CHANGED
@@ -95,6 +95,17 @@ module Gridium
95
95
  self.evaluate_script("jQuery.active").zero?
96
96
  end
97
97
 
98
+ #
99
+ # JQuery click
100
+ # @param [String] CSS selector
101
+ #
102
+ # Occasionaly selenium is unable to click on elements in the DOM which have some
103
+ # interesting React goodies around the element.
104
+ #
105
+ def self.jquery_click(selector)
106
+ Driver.evaluate_script("$(\"#{selector}\").click().change();")
107
+ end
108
+
98
109
  def all(by, locator)
99
110
  root = Element.new("root", :tag_name, "html")
100
111
  root.find_elements(by, locator)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gridium
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Urban
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-28 00:00:00.000000000 Z
11
+ date: 2017-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler