eyes_selenium 1.35.0 → 1.36.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/eyes_selenium/eyes/agent_connector.rb +26 -1
- data/lib/eyes_selenium/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTVkZmRmNjA5MWI2NWVjNzliNTI1NDY5NDJmMmQxYmMyOGNjZWIxNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTdlMmEyNDFjYTllNzk3YjVkMGM2YjE0OGQ3YzliODU4MDk2N2UyNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTM0MzYyZmMzYzk0MzU1MzBmYTMyZjVhMmIzNmQyMzc0YmY4NDVkZGEyZGFm
|
10
|
+
ZjUwNjhjYzUwMTFlM2ViYzY3YjM3N2M5MjQ0NWIxMGY5ZjBiODZiYjc2NDNl
|
11
|
+
YTcwZDJhNzdlYmJjZGZkMWRmZmEzNjVhZWI4YWRmYTEzMTRkMTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWU2Yjk4YzNlOTZlZDVjNWNjNzA0Njc1ZGI1MjBhODU1MzhmMzI5ODNiNzhj
|
14
|
+
NTUyYWRlNWRiMzQyMmE0MWEzZjRlZWU5NGZiM2NkZTgwYWQxMGE1MzAwZTUx
|
15
|
+
ZjBjN2MzZWIwZWEzMWQ5NGNjODg5ZmFkMzllMDQ0ZDY4NTE1Y2I=
|
@@ -33,9 +33,34 @@ class Applitools::AgentConnector
|
|
33
33
|
|
34
34
|
def stop_session(session, aborted=nil, save=false)
|
35
35
|
self.class.headers 'Content-Type' => 'application/json'
|
36
|
-
res = self.class.
|
36
|
+
res = self.class.send_long_request('stop_session') do
|
37
|
+
self.class.delete(uri + "/#{session.id}", basic_auth: auth, query: { aborted: aborted.to_s, updateBaseline: save.to_s })
|
38
|
+
end
|
37
39
|
parsed_res = res.parsed_response
|
38
40
|
parsed_res.delete("$id")
|
39
41
|
Applitools::TestResults.new(*parsed_res.values)
|
40
42
|
end
|
43
|
+
|
44
|
+
private
|
45
|
+
##
|
46
|
+
# Static method for sending long running requests
|
47
|
+
# Args:
|
48
|
+
# name: (String) name of the method being executed
|
49
|
+
# request_block: (block) The actual block to be executed. Will be called using "yield"
|
50
|
+
def self.send_long_request(name, &request_block)
|
51
|
+
delay = 2 # seconds
|
52
|
+
|
53
|
+
headers 'Eyes-Expect' => '202-accepted'
|
54
|
+
while true
|
55
|
+
# Date should be in RFC 1123 format
|
56
|
+
headers 'Eyes-Date' => Time.now.utc.strftime('%a, %d %b %Y %H:%M:%S GMT')
|
57
|
+
res = yield
|
58
|
+
if res.code != 202
|
59
|
+
return res
|
60
|
+
end
|
61
|
+
EyesLogger.debug "#{name}: Still running... Retrying in #{delay}s"
|
62
|
+
sleep delay
|
63
|
+
delay = [10, (delay*1.5).round].min
|
64
|
+
end
|
65
|
+
end
|
41
66
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eyes_selenium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.36.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Applitools team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: selenium-webdriver
|