webdriver 0.13.0 → 0.18.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: 725390cb120a545ab1ba0a55d5f21430e5d4a90b824883e30aa5223577f61822
4
- data.tar.gz: 06c2a1a75ca97e41b7bad105715eb2084a5d34f4acb96ac291e7ff0032150790
3
+ metadata.gz: d09a93e6f4b50a10d3679803a0a0c28bc60e84bbf96965995c00d301eb25b09e
4
+ data.tar.gz: 74f84de640f7adf6a938e8ce8df20f44e83eb91a0ab59b8bd01e9eb97f20b69c
5
5
  SHA512:
6
- metadata.gz: 4ba9cfa9aaabffe2c339af6a7389c86ef97e190361bd01dbcdf9a6dd480d80437036814e6a203de4ca13b2a81efd466eb1aac9a306e95825cfb8548a0d0a5e09
7
- data.tar.gz: 35f64a452a56318b0be9b2496bcf21670a4d7a977a17dac26f0c021fab1b124e7cec6c93c558a4d873e4553a89a914ffcd582df70a30e929afcb02b0ad78f4ea
6
+ metadata.gz: 60091beb64f53bcd98efa0cab6741c0324c298ffe5f0e08b28efcaef227697f79f441fdd7df825450e7e661b2231bd00eb7efcf34c64b1747b2d429349a0c890
7
+ data.tar.gz: 6d82f6c98eacdb4f255adfb6305d3eeef30fb47382514cbe61e175b117c55a03d3af89c73906812be9d7d5ed75c2ec32880c75d0b328020ecee6f65f3095d629
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- webdriver (0.13.0)
4
+ webdriver (0.18.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,14 +58,26 @@ 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 17
72
+ raise Webdriver::JavascriptError.new value.dig("message")
73
+ when 23
74
+ raise Webdriver::NoSuchWindow.new value.dig("message")
75
+ when 26
76
+ raise Webdriver::UnexpectedAlertOpen.new value.dig("message")
77
+ when 27
78
+ raise Webdriver::NoSuchAlert.new value.dig("message")
63
79
  when 28
64
- raise Webdriver::ScriptTimeout
80
+ raise Webdriver::ScriptTimeout.new value.dig("message")
65
81
  when 1..nil
66
82
  error_message = value.dig("message")
67
83
  raise "#{status}: #{error_message}"
@@ -1,10 +1,22 @@
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
+ # 17
13
+ class JavascriptError < StandardError; end
14
+ # 23
15
+ class NoSuchWindow < StandardError; end
16
+ # 26
17
+ class UnexpectedAlertOpen < StandardError; end
18
+ # 27
19
+ class NoSuchAlert < StandardError; end
8
20
  # 28
9
21
  class ScriptTimeout < StandardError; end
10
22
  end
@@ -1,3 +1,3 @@
1
1
  module Webdriver
2
- VERSION = "0.13.0"
2
+ VERSION = "0.18.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.13.0
4
+ version: 0.18.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-29 00:00:00.000000000 Z
11
+ date: 2021-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler