webdriver 0.12.0 → 0.17.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
  SHA256:
3
- metadata.gz: c0fc8a27cdf88f2be99a6db59d746bf568c6ec2471d7ef3a79e7b1570ec58400
4
- data.tar.gz: f0f526c0ac95921a54aeee8e05bb9bab40b1da3ea743a17aa8d9db59f6d6cb42
3
+ metadata.gz: 181ac9a930932f8f7b77af1099a7d1ba1034ae23bfd3e552c304949364c89e7f
4
+ data.tar.gz: 19a041769fd050cf75b8e0af6490a7eede83d1a40af04c967d46d726770f5cc4
5
5
  SHA512:
6
- metadata.gz: 7a34dfdc81d44c0f376c732a10c4b73b0935d60ee06885ceb87d9ccddbb50e6b9b18238db8ab29cc21c13ac12ca2cc222f84f1914afcf2aad72ccb70cf9b5902
7
- data.tar.gz: 3203013d1dda2c8e7fcdb5a6d1ac604326ba191071ce06210770152550b74482e0dfca8b9e7dc650591d8c9e8feab576bf8f501ae5ce222310a3bed8e8efb6eb
6
+ metadata.gz: 5e31e162502ac3cc3932af43eebb916d9e8dcf1d4050bada49b19e2e2d6123f87b4551765377668a0d03dddaae86cecfa29800f250019064729188b01e4a5f75
7
+ data.tar.gz: 11b68a2fb08efa53dc9d1e8cfa5255e26a51c65f1d751860b757a679fd3e9205501115b8197e62e90cd0f8761be7394f53d837180d4317a1dc34fdcd6fa3e433
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- webdriver (0.12.0)
4
+ webdriver (0.17.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,8 +1,8 @@
1
1
  module Webdriver
2
2
  class Client
3
- def initialize(endpoint, desired_capabilities={})
3
+ def initialize(endpoint, desired_capabilities={}, opts={})
4
4
  uri = URI(endpoint)
5
- @connection = Webdriver::Connection.new endpoint
5
+ @connection = Webdriver::Connection.new endpoint, opts
6
6
  @desired_capabilities = desired_capabilities
7
7
  end
8
8
 
@@ -1,8 +1,12 @@
1
1
  module Webdriver
2
2
  class Connection
3
- def initialize endpoint
3
+ def initialize endpoint, open_timeout: 3, read_timeout: 5, write_timeout: 5
4
4
  uri = URI(endpoint)
5
5
  @http = Net::HTTP.new uri.hostname, uri.port
6
+ @http.open_timeout = open_timeout
7
+ @http.read_timeout = read_timeout
8
+ @http.write_timeout = write_timeout
9
+
6
10
  @mutex = Mutex.new
7
11
  end
8
12
 
@@ -54,12 +58,22 @@ module Webdriver
54
58
  else # everything else works like this
55
59
  value
56
60
  end
61
+ when 7
62
+ raise Webdriver::NoSuchElementError.new value.dig("message")
63
+ when 8
64
+ raise Webdriver::NoSuchFrameError.new body[:id]
57
65
  when 10
58
- raise Webdriver::StaleElementReferenceError
66
+ raise Webdriver::StaleElementReferenceError.new path
59
67
  when 11
60
- raise Webdriver::ElementNotInteractableError
68
+ raise Webdriver::ElementNotInteractableError.new path
61
69
  when 13
62
- raise Webdriver::UnknownErrorUnhandledInspectorError
70
+ raise Webdriver::UnknownErrorUnhandledInspectorError.new value.dig("message")
71
+ when 26
72
+ raise Webdriver::UnexpectedAlertOpen.new value.dig("message")
73
+ when 27
74
+ raise Webdriver::NoSuchAlert.new value.dig("message")
75
+ when 28
76
+ raise Webdriver::ScriptTimeout.new value.dig("message")
63
77
  when 1..nil
64
78
  error_message = value.dig("message")
65
79
  raise "#{status}: #{error_message}"
@@ -1,8 +1,18 @@
1
1
  module Webdriver
2
+ # 7
3
+ class NoSuchElementError < StandardError; end
4
+ # 7
5
+ class NoSuchFrameError < StandardError; end
2
6
  # 10
3
7
  class StaleElementReferenceError < StandardError; end
4
8
  # 11
5
9
  class ElementNotInteractableError < StandardError; end
6
10
  # 13
7
11
  class UnknownErrorUnhandledInspectorError < StandardError; end
12
+ # 26
13
+ class UnexpectedAlertOpen < StandardError; end
14
+ # 27
15
+ class NoSuchAlert < StandardError; end
16
+ # 28
17
+ class ScriptTimeout < StandardError; end
8
18
  end
@@ -1,3 +1,3 @@
1
1
  module Webdriver
2
- VERSION = "0.12.0"
2
+ VERSION = "0.17.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matti Paksula
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-14 00:00:00.000000000 Z
11
+ date: 2020-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler