abak-selenium-integration 1.0.5 → 1.0.6

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: bb96bbafc6c6219b38837b3002a6f3d15c2587ff
4
- data.tar.gz: 080e3797b14994bf5e45075ae6ab6ffd90917f81
3
+ metadata.gz: 951a68fbb765edaf5efe0d966c727e1b81d2a845
4
+ data.tar.gz: 660eb47c982dbe9f3a3d8b11265eb59e5d1fe81e
5
5
  SHA512:
6
- metadata.gz: 49219d095995cc5f4caa9e0f58441c5072863eb968c2f460418eb0f241839218de1d7ecfc1809bfe271fd8ddede2d835b68928e370b7d67946b88c76bc93c299
7
- data.tar.gz: b9bf604af409944b356890b28d6a13f080811af3e76350ace32d01e1d04d2891f409a7c249a79fe27a1efe330bd1e1a714c000a1b2e3bfecdfbc8ab396f1a598
6
+ metadata.gz: 2d01caa2c2bdff95e3b09f8629ccb6ca9ceecd0c9e108f5a38d4497922f918129b98e9a119df59d0fb864968bfe783d85fa88d44255b79be0282da15803c7179
7
+ data.tar.gz: e040305cbad1328102fd98ac12b9096e8dfc783e80a7ba23feeb320dba6a90eb40048243d614765c8275f26276d792e62a9d6dffda26ed74af1decdf8bd95a07
data/.gitignore CHANGED
@@ -2,4 +2,3 @@
2
2
  *.log
3
3
  *.gem
4
4
  *test.rb
5
- .gitignore.txt
@@ -0,0 +1 @@
1
+ # abak-selenium-integration
@@ -3,17 +3,17 @@ lib = File.expand_path('lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'abak-selenium-integration'
6
- spec.version = '1.0.5'
7
- spec.authors = ["Sergey Avdonin"]
8
- spec.email = ["sunlf@yandex.ru"]
9
- spec.summary = %q{Selenium integration gem}
6
+ spec.version = '1.0.6'
7
+ spec.authors = ['Sergey Avdonin']
8
+ spec.email = ['sunlf@yandex.ru']
9
+ spec.summary = 'Selenium integration gem'
10
10
  spec.files = `git ls-files -z`.split("\x0")
11
- spec.require_paths = ["lib"]
11
+ spec.require_paths = ['lib']
12
12
  spec.add_runtime_dependency('page-object')
13
13
  spec.add_runtime_dependency('activesupport')
14
14
  spec.add_runtime_dependency('rspec')
15
15
  spec.add_runtime_dependency('selenium-webdriver')
16
- spec.description = %q{Integration gem for test automatisation based on page-object}
16
+ spec.description = 'Integration gem for test automatisation based on page-object'
17
17
  spec.homepage = 'http://rubygems.org/gems/abak-selenium-integration'
18
- spec.license = "MIT"
19
- end
18
+ spec.license = 'MIT'
19
+ end
@@ -2,7 +2,6 @@
2
2
  module GemsOverriding
3
3
  # Override selenium gem to make find element more exact. Selenium will try to find
4
4
  # element for some time. Override click to ignore wrappers around element.
5
-
6
5
  Selenium::WebDriver::Element.class_eval do
7
6
  attr_reader :bridge, :id
8
7
 
@@ -13,7 +12,7 @@ module GemsOverriding
13
12
 
14
13
  def send_keys(*args)
15
14
  bridge.send_keys_to_element id, Selenium::WebDriver::Keys.encode(args)
16
- # rescue if cant focus
15
+ # rescue if cant focus
17
16
  rescue Selenium::WebDriver::Error::UnknownError
18
17
  bridge.execute_script('arguments[0].value = arguments[1];', self, Selenium::WebDriver::Keys.encode(args))
19
18
  end
@@ -21,7 +20,7 @@ module GemsOverriding
21
20
 
22
21
  PageObject::Platforms::SeleniumWebDriver::PageObject.class_eval do
23
22
  def select_list_value_set(identifier, value)
24
- process_selenium_call(identifier, Elements::SelectList, 'select') do |how, what|
23
+ process_selenium_call(identifier, PageObject::Elements::SelectList, 'select') do |how, what|
25
24
  select_list = @browser.find_element(how, what)
26
25
  select_list.find_elements(tag_name: 'option').find do |option|
27
26
  option.text == value
@@ -34,27 +33,27 @@ module GemsOverriding
34
33
  # need for find_element reconstruction
35
34
  def extract_args(args)
36
35
  case args.size
37
- when 3
38
- args
39
- when 2
40
- # base timeout for find_element
41
- args.push(10)
42
- args
43
- when 1
44
- arg = args.first
45
- unless arg.respond_to?(:shift)
46
- raise ArgumentError, "expected #{arg.inspect}:#{arg.class} to respond to #shift"
47
- end
36
+ when 3
37
+ args
38
+ when 2
39
+ # base timeout for find_element
40
+ args.push(10)
41
+ args
42
+ when 1
43
+ arg = args.first
44
+ unless arg.respond_to?(:shift)
45
+ raise ArgumentError, "expected #{arg.inspect}:#{arg.class} to respond to #shift"
46
+ end
48
47
 
49
- # this will be a single-entry hash, so use #shift over #first or #[]
50
- arr = arg.dup.shift
51
- unless arr.size == 2
52
- raise ArgumentError, "expected #{arr.inspect} to have 2 elements"
53
- end
54
- arr.push(10)
55
- arr
56
- else
57
- raise ArgumentError, "wrong number of arguments (#{args.size} for 2)"
48
+ # this will be a single-entry hash, so use #shift over #first or #[]
49
+ arr = arg.dup.shift
50
+ unless arr.size == 2
51
+ raise ArgumentError, "expected #{arr.inspect} to have 2 elements"
52
+ end
53
+ arr.push(10)
54
+ arr
55
+ else
56
+ raise ArgumentError, "wrong number of arguments (#{args.size} for 2)"
58
57
  end
59
58
  end
60
59
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abak-selenium-integration
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Avdonin
@@ -76,6 +76,7 @@ files:
76
76
  - ".gitignore"
77
77
  - Gemfile
78
78
  - Gemfile.lock
79
+ - README.md
79
80
  - abak-selenium-integration.gemspec
80
81
  - lib/page.rb
81
82
  - lib/page/driver.rb