mini_autobot 0.6.0 → 0.7.0

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: 375e8e003a97b43d1c639877d97766003a767cdc
4
- data.tar.gz: 4dabbc2febe6d98b6599733e201b30d7ee1e1d3c
3
+ metadata.gz: 62aec5cf1e896d6538e1fc95e40c7dd363f6fea5
4
+ data.tar.gz: 921b07fdf3301c8f90a1b459fc07e002b5b27e97
5
5
  SHA512:
6
- metadata.gz: 2af148d816590b65acea3f074cc76cdcfbe080aa00bc42e6f65dac1e318cb8a88e864f2613657cecc66245053e4dd0857f32425072128703ffc7a274595d8497
7
- data.tar.gz: 146fadf5c55476a8955ad5da9f6a93629d2f546b5cfe08032d74a1475755b5748a086023946da94c4d8adf0b703d36bea6d6ea46a13fb9b4b04e31b3c34a56e6
6
+ metadata.gz: 74d3522d79870e1fbaef113596c306552dc4419fb2839f0b0ccc2b5eb5fe19f29072eee254e8c6bfff8ab2118aa649588319b04a910695b597d1c52c9f9b3269
7
+ data.tar.gz: 80b79b22143258853c5b67e1a40eb0ee18b04cdffce1d90f17b0d1691734d9338917c8c82d86e78060328ead5089f69d4da46f1f8e7266e054bc7655c51047fc
data/lib/mini_autobot.rb CHANGED
@@ -33,6 +33,7 @@ require 'active_support/inflector'
33
33
  require 'active_support/logger'
34
34
 
35
35
  require_relative 'minitap/minitest5_rent'
36
+ require_relative 'selenium/webdriver/common/element_mini'
36
37
 
37
38
  ActiveSupport::Inflector.inflections(:en) do |inflector|
38
39
  inflector.acronym 'PDP'
@@ -230,7 +230,7 @@ module MiniAutobot
230
230
  def current_page(calling_page)
231
231
  calling_page.class.to_s.split('::').last.downcase
232
232
  end
233
-
233
+
234
234
  private
235
235
 
236
236
  # @param eg. (:css, 'button.cancel') or (*BUTTON_SUBMIT_SEARCH)
@@ -256,6 +256,18 @@ module MiniAutobot
256
256
  result
257
257
  end
258
258
 
259
+ # Method that overrides click to send the enter key to the element if the current browser
260
+ # is internet explorer. Used when sending the enter key to the element will work
261
+ def browser_safe_click(element)
262
+ driver.browser == :internet_explorer ? element.send_keys(:enter) : element.click
263
+ end
264
+
265
+ # Method that overrides click to send the space key to the checkbox if the current browser
266
+ # is internet explorer. Used when sending the space key to the checkbox will work
267
+ def browser_safe_checkbox_click(element)
268
+ (driver.browser == :internet_explorer || driver.browser == :firefox) ? element.send_keys(:space) : element.click
269
+ end
270
+
259
271
  end
260
272
 
261
273
  end
@@ -1,3 +1,3 @@
1
1
  module MiniAutobot
2
- VERSION = '0.6.0'
2
+ VERSION = '0.7.0'
3
3
  end
@@ -0,0 +1,21 @@
1
+ require 'selenium-webdriver'
2
+
3
+ module Selenium
4
+ module WebDriver
5
+
6
+ class Element
7
+
8
+ # Click in a way that is reliable for IE and works for other browsers as well
9
+ def browser_safe_click
10
+ bridge.browser == :internet_explorer ? send_keys(:enter) : click
11
+ end
12
+
13
+ # Click in a way that is reliable for IE and Firefox and works for other browsers as well
14
+ def browser_safe_checkbox_click
15
+ (bridge.browser == :internet_explorer || bridge.browser == :firefox) ? send_keys(:space) : click
16
+ end
17
+
18
+ end
19
+
20
+ end
21
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_autobot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ripta Pasay
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-01-13 00:00:00.000000000 Z
13
+ date: 2016-01-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -226,6 +226,7 @@ files:
226
226
  - lib/mini_autobot/version.rb
227
227
  - lib/minitap/minitest5_rent.rb
228
228
  - lib/minitest/autobot_settings_plugin.rb
229
+ - lib/selenium/webdriver/common/element_mini.rb
229
230
  - lib/tapout/custom_reporters/fancy_tap_reporter.rb
230
231
  - lib/yard/tagged_test_case_handler.rb
231
232
  - mini_autobot.gemspec