sauce 0.18.3 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sauce/job.rb +4 -1
- data/lib/sauce/selenium.rb +8 -0
- data/sauce.gemspec +2 -2
- data/test/test_selenium.rb +39 -0
- metadata +5 -5
data/lib/sauce/job.rb
CHANGED
@@ -13,6 +13,7 @@ module Sauce
|
|
13
13
|
attr_accessor :name, :browser, :browser_version, :os
|
14
14
|
attr_accessor :creation_time, :start_time, :end_time
|
15
15
|
attr_accessor :public, :video_url, :log_url, :tags
|
16
|
+
attr_accessor :passed
|
16
17
|
|
17
18
|
# Get the class @@client.
|
18
19
|
# TODO: Consider metaprogramming this away
|
@@ -114,7 +115,8 @@ module Sauce
|
|
114
115
|
:video_url => @video_url,
|
115
116
|
:log_url => @log_url,
|
116
117
|
:public => @public,
|
117
|
-
:tags => @tags
|
118
|
+
:tags => @tags,
|
119
|
+
:passed => @passed
|
118
120
|
}
|
119
121
|
|
120
122
|
options[:except].each { |key| json.delete(key) } if options[:except]
|
@@ -150,6 +152,7 @@ module Sauce
|
|
150
152
|
@log_url = options["log_url"]
|
151
153
|
@public = options["public"]
|
152
154
|
@tags = options["tags"]
|
155
|
+
@passed = options["passed"]
|
153
156
|
|
154
157
|
raise NoIDError if @id.nil? or @id.empty?
|
155
158
|
end
|
data/lib/sauce/selenium.rb
CHANGED
@@ -8,6 +8,14 @@ module Sauce
|
|
8
8
|
super(opts.merge({:host => @config.host, :port => @config.port,
|
9
9
|
:browser => @config.to_browser_string, :url => @config.browser_url}))
|
10
10
|
end
|
11
|
+
|
12
|
+
def passed!
|
13
|
+
self.set_context "sauce:job-result=passed"
|
14
|
+
end
|
15
|
+
|
16
|
+
def failed!
|
17
|
+
self.set_context "sauce:job-result=failed"
|
18
|
+
end
|
11
19
|
end
|
12
20
|
|
13
21
|
class Selenium2
|
data/sauce.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{sauce}
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.19.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Eric Allen", "Sean Grove", "Steven Hazel"]
|
9
|
-
s.date = %q{2011-03-
|
9
|
+
s.date = %q{2011-03-25}
|
10
10
|
s.default_executable = %q{sauce}
|
11
11
|
s.description = %q{A Ruby interface to Sauce Labs' services. Start/stop tunnels, retrieve Selenium logs, access video replays, etc.}
|
12
12
|
s.email = %q{help@saucelabs.com}
|
data/test/test_selenium.rb
CHANGED
@@ -8,4 +8,43 @@ class TestSelenium < Test::Unit::TestCase
|
|
8
8
|
selenium.open "/"
|
9
9
|
selenium.stop
|
10
10
|
end
|
11
|
+
|
12
|
+
def test_passed
|
13
|
+
selenium = Sauce::Selenium.new(:job_name => "This test should be marked as passed",
|
14
|
+
:browser_url => "http://www.google.com/")
|
15
|
+
selenium.start
|
16
|
+
job_id = selenium.session_id
|
17
|
+
begin
|
18
|
+
selenium.passed!
|
19
|
+
ensure
|
20
|
+
selenium.stop
|
21
|
+
end
|
22
|
+
|
23
|
+
job = Sauce::Job.find(job_id)
|
24
|
+
while job.status == "in progress"
|
25
|
+
sleep 0.5
|
26
|
+
job.refresh!
|
27
|
+
end
|
28
|
+
|
29
|
+
assert job.passed, job
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_failed
|
33
|
+
selenium = Sauce::Selenium.new(:job_name => "This test should be marked as failed",
|
34
|
+
:browser_url => "http://www.google.com/")
|
35
|
+
selenium.start
|
36
|
+
job_id = selenium.session_id
|
37
|
+
begin
|
38
|
+
selenium.failed!
|
39
|
+
ensure
|
40
|
+
selenium.stop
|
41
|
+
end
|
42
|
+
|
43
|
+
job = Sauce::Job.find(job_id)
|
44
|
+
while job.status == "in progress"
|
45
|
+
sleep 0.5
|
46
|
+
job.refresh!
|
47
|
+
end
|
48
|
+
assert !job.passed, job
|
49
|
+
end
|
11
50
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sauce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 83
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 19
|
9
|
+
- 0
|
10
|
+
version: 0.19.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Eric Allen
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-03-
|
20
|
+
date: 2011-03-25 00:00:00 -07:00
|
21
21
|
default_executable: sauce
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|