sapphire 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sapphire/DSL/Browser/Not.rb +4 -5
- data/lib/sapphire/DSL/TestPlans/Run.rb +6 -4
- data/lib/sapphire/JobAbstractions/Job.rb +4 -0
- data/lib/sapphire/Strategies/NullModifier.rb +4 -5
- data/lib/sapphire/TeamCity/TeamCityReporter.rb +24 -21
- data/lib/sapphire/WebAbstractions/Controls/Base/WebBrowser.rb +9 -11
- data/lib/sapphire/WebAbstractions/Controls/CheckBox.rb +1 -1
- data/lib/sapphire/version.rb +1 -1
- data/lib/sapphire.rb +1 -1
- metadata +8 -8
@@ -21,14 +21,13 @@ module Sapphire
|
|
21
21
|
if(evaluation.left == evaluation.right)
|
22
22
|
messages = []
|
23
23
|
|
24
|
-
messages << "expected NOT: (nil)" if evaluation.
|
25
|
-
messages << "expected NOT: " + evaluation.
|
26
|
-
messages << "got: (nil)" if evaluation.
|
27
|
-
messages << "got: " + evaluation.
|
24
|
+
messages << "expected NOT: (nil)" if evaluation.right == nil
|
25
|
+
messages << "expected NOT: " + evaluation.right.to_s if evaluation.right != nil
|
26
|
+
messages << "got: (nil)" if evaluation.left == nil
|
27
|
+
messages << "got: " + evaluation.left.to_s if evaluation.left != nil
|
28
28
|
|
29
29
|
raise ExpectationException.new(messages)
|
30
30
|
end
|
31
|
-
#evaluation.left.should_not == evaluation.right
|
32
31
|
end
|
33
32
|
|
34
33
|
def execute
|
@@ -2,9 +2,11 @@ module Sapphire
|
|
2
2
|
module DSL
|
3
3
|
module TestPlans
|
4
4
|
def Run(item)
|
5
|
-
if(item.is_a?
|
6
|
-
|
7
|
-
|
5
|
+
if(item.is_a? Job)
|
6
|
+
job = item
|
7
|
+
if(job.Arg)
|
8
|
+
system(job.PsExecPath + " " + job.Server + " -u " + job.User + " -p " + job.Password + " " + job.Path + " " + job.Arg.to_s)
|
9
|
+
else
|
8
10
|
system(job.PsExecPath + " " + job.Server + " -u " + job.User + " -p " + job.Password + " " + job.Path)
|
9
11
|
end
|
10
12
|
else
|
@@ -13,4 +15,4 @@ module Sapphire
|
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
16
|
-
end
|
18
|
+
end
|
@@ -19,14 +19,13 @@ class NullModifier
|
|
19
19
|
if(evaluation.left != evaluation.right)
|
20
20
|
messages = []
|
21
21
|
|
22
|
-
messages << "expected: (nil)" if evaluation.
|
23
|
-
messages << "expected: " + evaluation.
|
24
|
-
messages << "got: (nil)" if evaluation.
|
25
|
-
messages << "got: " + evaluation.
|
22
|
+
messages << "expected: (nil)" if evaluation.right == nil
|
23
|
+
messages << "expected: " + evaluation.right.to_s if evaluation.right != nil
|
24
|
+
messages << "got: (nil)" if evaluation.left == nil
|
25
|
+
messages << "got: " + evaluation.left.to_s if evaluation.left != nil
|
26
26
|
|
27
27
|
raise ExpectationException.new(messages)
|
28
28
|
end
|
29
|
-
#evaluation.left.should == evaluation.right if @modifier == nil
|
30
29
|
end
|
31
30
|
|
32
31
|
def execute
|
@@ -124,30 +124,33 @@ module Sapphire
|
|
124
124
|
log(@message_factory.create_test_started(test.text))
|
125
125
|
end
|
126
126
|
|
127
|
-
def
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
messages = test.messages
|
138
|
-
end
|
139
|
-
stack = ""
|
140
|
-
test.stack.each do |line|
|
141
|
-
if (!line.include? "sapphire")
|
142
|
-
stack += line + "\n"
|
143
|
-
end
|
127
|
+
def TestPassed(test)
|
128
|
+
log(@message_factory.create_test_finished(test.text, test.time))
|
129
|
+
log(@message_factory.create_suite_finished("Finally")) if test.item.is_a? Finally
|
130
|
+
end
|
131
|
+
|
132
|
+
def TestFailed(test)
|
133
|
+
if test.messages.is_a? Array
|
134
|
+
messages = test.messages.join("\n")
|
135
|
+
else
|
136
|
+
messages = test.messages
|
144
137
|
end
|
145
|
-
|
138
|
+
stack = ""
|
139
|
+
test.stack.each do |line|
|
140
|
+
#if (!line.include? "sapphire")
|
141
|
+
stack += line + "\n"
|
142
|
+
#end
|
146
143
|
end
|
144
|
+
log(@message_factory.create_test_failed(test.text, messages, stack))
|
145
|
+
log(@message_factory.create_suite_finished("Finally")) if test.item.is_a? Finally
|
146
|
+
end
|
147
147
|
|
148
|
-
|
149
|
-
|
150
|
-
|
148
|
+
def TestPending(test)
|
149
|
+
log(@message_factory.create_test_ignored(test.text, "Pending: Not Yet Implemented"))
|
150
|
+
log(@message_factory.create_suite_finished("Finally")) if test.item.is_a? Finally
|
151
|
+
end
|
152
|
+
|
153
|
+
def TestingComplete()
|
151
154
|
|
152
155
|
end
|
153
156
|
|
@@ -49,19 +49,17 @@ module Sapphire
|
|
49
49
|
nav = page
|
50
50
|
end
|
51
51
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
if(temp)
|
59
|
-
temp = Evaluation.new(self.CurrentUrl.upcase.start_with?("HTTP://" + url.upcase) || self.CurrentUrl.upcase.start_with?("HTTPS://" + url.upcase), true)
|
60
|
-
return temp, nav
|
52
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 10)
|
53
|
+
found = wait.until {
|
54
|
+
x = self.CurrentUrl.upcase.start_with?("HTTP://" + nav.Url.upcase) || self.CurrentUrl.upcase.start_with?("HTTPS://" + nav.Url.upcase)
|
55
|
+
if(x == false)
|
56
|
+
nav.AlternateUrls.each do |url|
|
57
|
+
x = self.CurrentUrl.upcase.start_with?("HTTP://" + url.upcase) || self.CurrentUrl.upcase.start_with?("HTTPS://" + url.upcase)
|
61
58
|
end
|
62
59
|
end
|
63
|
-
|
64
|
-
|
60
|
+
x
|
61
|
+
}
|
62
|
+
temp = Evaluation.new(found, true)
|
65
63
|
return temp, nav
|
66
64
|
end
|
67
65
|
|
data/lib/sapphire/version.rb
CHANGED
data/lib/sapphire.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sapphire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-10-
|
12
|
+
date: 2011-10-08 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: selenium-webdriver
|
16
|
-
requirement: &
|
16
|
+
requirement: &9953184 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *9953184
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: colorize
|
27
|
-
requirement: &
|
27
|
+
requirement: &9952932 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *9952932
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: win32console
|
38
|
-
requirement: &
|
38
|
+
requirement: &9952680 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *9952680
|
47
47
|
description: An automated web acceptance test framework for non-technical resources
|
48
48
|
using selenium-wedriver.
|
49
49
|
email:
|