sapphire 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sapphire/DSL/Browser/Browser.rb +13 -13
- data/lib/sapphire/DSL/Browser/Check.rb +12 -12
- data/lib/sapphire/DSL/Browser/Clear.rb +15 -15
- data/lib/sapphire/DSL/Browser/Click.rb +12 -12
- data/lib/sapphire/DSL/Browser/Close.rb +12 -12
- data/lib/sapphire/DSL/Browser/Complete.rb +15 -15
- data/lib/sapphire/DSL/Browser/CurrentUrl.rb +11 -11
- data/lib/sapphire/DSL/Browser/Error.rb +12 -12
- data/lib/sapphire/DSL/Browser/ExecuteAgainstControl.rb +45 -45
- data/lib/sapphire/DSL/Browser/Exists.rb +22 -22
- data/lib/sapphire/DSL/Browser/For.rb +10 -10
- data/lib/sapphire/DSL/Browser/Hide.rb +10 -10
- data/lib/sapphire/DSL/Browser/IsHidden.rb +28 -28
- data/lib/sapphire/DSL/Browser/IsVisible.rb +25 -25
- data/lib/sapphire/DSL/Browser/MouseOver.rb +12 -12
- data/lib/sapphire/DSL/Browser/Navigate.rb +11 -11
- data/lib/sapphire/DSL/Browser/Not.rb +9 -0
- data/lib/sapphire/DSL/Browser/Reload.rb +11 -11
- data/lib/sapphire/DSL/Browser/Set.rb +12 -12
- data/lib/sapphire/DSL/Browser/Should.rb +10 -10
- data/lib/sapphire/DSL/Browser/Show.rb +27 -26
- data/lib/sapphire/DSL/Browser/Start.rb +16 -16
- data/lib/sapphire/DSL/Browser/To.rb +10 -10
- data/lib/sapphire/DSL/Browser/Tracker.rb +15 -15
- data/lib/sapphire/DSL/Browser/Transition.rb +10 -10
- data/lib/sapphire/DSL/Browser/Uncheck.rb +12 -12
- data/lib/sapphire/DSL/Browser/With.rb +10 -10
- data/lib/sapphire/DSL/Configuration/ConfiguredBrowser.rb +12 -12
- data/lib/sapphire/DSL/Configuration/ConfiguredUser.rb +10 -10
- data/lib/sapphire/DSL/Configuration/Use.rb +15 -15
- data/lib/sapphire/DSL/Data/Exist.rb +11 -11
- data/lib/sapphire/DSL/Data/Find.rb +10 -10
- data/lib/sapphire/DSL/Data/GetPageField.rb +17 -17
- data/lib/sapphire/DSL/Data/Underscore.rb +8 -8
- data/lib/sapphire/DSL/Data/Validate.rb +16 -16
- data/lib/sapphire/DSL/Data/Verify.rb +10 -10
- data/lib/sapphire/DSL/Scenarios/Is.rb +9 -9
- data/lib/sapphire/DSL/Scenarios/Pending.rb +28 -28
- data/lib/sapphire/DSL/Scenarios/and.rb +24 -24
- data/lib/sapphire/DSL/Scenarios/background.rb +22 -22
- data/lib/sapphire/DSL/Scenarios/dsl.rb +60 -60
- data/lib/sapphire/DSL/Scenarios/finally.rb +31 -31
- data/lib/sapphire/DSL/Scenarios/given.rb +56 -56
- data/lib/sapphire/DSL/Scenarios/runner.rb +30 -30
- data/lib/sapphire/DSL/Scenarios/scenario.rb +51 -51
- data/lib/sapphire/DSL/Scenarios/then.rb +33 -33
- data/lib/sapphire/DSL/Scenarios/when.rb +46 -46
- data/lib/sapphire/DataAbstractions/Database.rb +57 -57
- data/lib/sapphire/DataAbstractions/Query.rb +19 -19
- data/lib/sapphire/Testing/ResultList.rb +18 -18
- data/lib/sapphire/Testing/ResultTree.rb +37 -37
- data/lib/sapphire/WebAbstractions/Controls/Base/Control.rb +74 -74
- data/lib/sapphire/WebAbstractions/Controls/Base/Page.rb +47 -47
- data/lib/sapphire/WebAbstractions/Controls/Base/WebBrowser.rb +74 -74
- data/lib/sapphire/WebAbstractions/Controls/Button.rb +9 -9
- data/lib/sapphire/WebAbstractions/Controls/CheckBox.rb +28 -28
- data/lib/sapphire/WebAbstractions/Controls/Chrome.rb +21 -21
- data/lib/sapphire/WebAbstractions/Controls/DropDown.rb +25 -25
- data/lib/sapphire/WebAbstractions/Controls/FireFox.rb +22 -22
- data/lib/sapphire/WebAbstractions/Controls/Hyperlink.rb +8 -8
- data/lib/sapphire/WebAbstractions/Controls/Image.rb +9 -9
- data/lib/sapphire/WebAbstractions/Controls/InternetExplorer.rb +21 -21
- data/lib/sapphire/WebAbstractions/Controls/Label.rb +8 -8
- data/lib/sapphire/WebAbstractions/Controls/RadioButton.rb +18 -18
- data/lib/sapphire/WebAbstractions/Controls/TableCell.rb +10 -0
- data/lib/sapphire/WebAbstractions/Controls/TextBox.rb +31 -31
- data/lib/sapphire/WebAbstractions/Controls/Title.rb +12 -12
- data/lib/sapphire/version.rb +1 -1
- metadata +13 -9
@@ -1,32 +1,32 @@
|
|
1
|
-
class Finally
|
2
|
-
include Sapphire::Testing::Executable
|
3
|
-
|
4
|
-
attr_reader :value
|
5
|
-
attr_reader :block
|
6
|
-
attr_reader :text
|
7
|
-
attr_reader :and
|
8
|
-
attr_reader :parent
|
9
|
-
attr_reader :results
|
10
|
-
|
11
|
-
def initialize(parent, text, &block)
|
12
|
-
@value = text
|
13
|
-
@text = text.to_s
|
14
|
-
@block = block
|
15
|
-
@and = []
|
16
|
-
@parent = parent
|
17
|
-
@results = []
|
18
|
-
end
|
19
|
-
|
20
|
-
def add_and(pre, text, &block)
|
21
|
-
if(self.value.is_a? Pending)
|
22
|
-
self.and << And.new(self, Pending.new(pre + text), &block)
|
23
|
-
else
|
24
|
-
self.and << And.new(self, pre + text, &block)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def AddResult(result)
|
29
|
-
@results << result
|
30
|
-
end
|
31
|
-
|
1
|
+
class Finally
|
2
|
+
include Sapphire::Testing::Executable
|
3
|
+
|
4
|
+
attr_reader :value
|
5
|
+
attr_reader :block
|
6
|
+
attr_reader :text
|
7
|
+
attr_reader :and
|
8
|
+
attr_reader :parent
|
9
|
+
attr_reader :results
|
10
|
+
|
11
|
+
def initialize(parent, text, &block)
|
12
|
+
@value = text
|
13
|
+
@text = text.to_s
|
14
|
+
@block = block
|
15
|
+
@and = []
|
16
|
+
@parent = parent
|
17
|
+
@results = []
|
18
|
+
end
|
19
|
+
|
20
|
+
def add_and(pre, text, &block)
|
21
|
+
if(self.value.is_a? Pending)
|
22
|
+
self.and << And.new(self, Pending.new(pre + text), &block)
|
23
|
+
else
|
24
|
+
self.and << And.new(self, pre + text, &block)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def AddResult(result)
|
29
|
+
@results << result
|
30
|
+
end
|
31
|
+
|
32
32
|
end
|
@@ -1,57 +1,57 @@
|
|
1
|
-
class Given
|
2
|
-
include Sapphire::Testing::Executable
|
3
|
-
|
4
|
-
attr_reader :value
|
5
|
-
attr_reader :text
|
6
|
-
attr_reader :block
|
7
|
-
attr_reader :finally
|
8
|
-
attr_reader :when
|
9
|
-
attr_reader :and
|
10
|
-
attr_reader :parent
|
11
|
-
attr_reader :results
|
12
|
-
|
13
|
-
def initialize(parent, pre, text, &block)
|
14
|
-
@value = text
|
15
|
-
@text = pre + text.to_s
|
16
|
-
@block = block
|
17
|
-
@when = []
|
18
|
-
@and = []
|
19
|
-
@parent = parent
|
20
|
-
@results = []
|
21
|
-
end
|
22
|
-
|
23
|
-
def add_when(pre, text, &block)
|
24
|
-
if(self.value.is_a? Pending)
|
25
|
-
@when << When.new(self, pre, Pending.new(text), &block)
|
26
|
-
else
|
27
|
-
x = When.new(self, pre, text, &block)
|
28
|
-
@when << x
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def last_when()
|
33
|
-
@when.last
|
34
|
-
end
|
35
|
-
|
36
|
-
def add_finally(finally)
|
37
|
-
if(self.value.is_a? Pending)
|
38
|
-
@finally = Finally.new(self, Pending.new(finally.text), &block)
|
39
|
-
else
|
40
|
-
@finally = finally
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def add_and(pre, text, &block)
|
45
|
-
if(self.value.is_a? Pending)
|
46
|
-
self.and << And.new(self, Pending.new(pre + text), &block)
|
47
|
-
else
|
48
|
-
self.and << And.new(self, text, &block)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def AddResult(result)
|
53
|
-
@results << result
|
54
|
-
self.parent.result.AddChild(result)
|
55
|
-
end
|
56
|
-
|
1
|
+
class Given
|
2
|
+
include Sapphire::Testing::Executable
|
3
|
+
|
4
|
+
attr_reader :value
|
5
|
+
attr_reader :text
|
6
|
+
attr_reader :block
|
7
|
+
attr_reader :finally
|
8
|
+
attr_reader :when
|
9
|
+
attr_reader :and
|
10
|
+
attr_reader :parent
|
11
|
+
attr_reader :results
|
12
|
+
|
13
|
+
def initialize(parent, pre, text, &block)
|
14
|
+
@value = text
|
15
|
+
@text = pre + text.to_s
|
16
|
+
@block = block
|
17
|
+
@when = []
|
18
|
+
@and = []
|
19
|
+
@parent = parent
|
20
|
+
@results = []
|
21
|
+
end
|
22
|
+
|
23
|
+
def add_when(pre, text, &block)
|
24
|
+
if(self.value.is_a? Pending)
|
25
|
+
@when << When.new(self, pre, Pending.new(text), &block)
|
26
|
+
else
|
27
|
+
x = When.new(self, pre, text, &block)
|
28
|
+
@when << x
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def last_when()
|
33
|
+
@when.last
|
34
|
+
end
|
35
|
+
|
36
|
+
def add_finally(finally)
|
37
|
+
if(self.value.is_a? Pending)
|
38
|
+
@finally = Finally.new(self, Pending.new(finally.text), &block)
|
39
|
+
else
|
40
|
+
@finally = finally
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def add_and(pre, text, &block)
|
45
|
+
if(self.value.is_a? Pending)
|
46
|
+
self.and << And.new(self, Pending.new(pre + text), &block)
|
47
|
+
else
|
48
|
+
self.and << And.new(self, text, &block)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def AddResult(result)
|
53
|
+
@results << result
|
54
|
+
self.parent.result.AddChild(result)
|
55
|
+
end
|
56
|
+
|
57
57
|
end
|
@@ -1,30 +1,30 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Scenarios
|
4
|
-
class Runner
|
5
|
-
attr_accessor :scenarios
|
6
|
-
|
7
|
-
def self.create
|
8
|
-
@@instance ||= Runner.new
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.instance
|
12
|
-
@@instance ||= self.create
|
13
|
-
end
|
14
|
-
|
15
|
-
def initialize
|
16
|
-
@scenarios = []
|
17
|
-
end
|
18
|
-
|
19
|
-
def add_scenario(scenario)
|
20
|
-
@scenarios << scenario
|
21
|
-
end
|
22
|
-
|
23
|
-
def last_scenario
|
24
|
-
@scenarios.last
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Scenarios
|
4
|
+
class Runner
|
5
|
+
attr_accessor :scenarios
|
6
|
+
|
7
|
+
def self.create
|
8
|
+
@@instance ||= Runner.new
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.instance
|
12
|
+
@@instance ||= self.create
|
13
|
+
end
|
14
|
+
|
15
|
+
def initialize
|
16
|
+
@scenarios = []
|
17
|
+
end
|
18
|
+
|
19
|
+
def add_scenario(scenario)
|
20
|
+
@scenarios << scenario
|
21
|
+
end
|
22
|
+
|
23
|
+
def last_scenario
|
24
|
+
@scenarios.last
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
@@ -1,51 +1,51 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Scenarios
|
4
|
-
class Scenario
|
5
|
-
include Sapphire::Testing::RSpecRunner
|
6
|
-
|
7
|
-
attr_reader :block
|
8
|
-
attr_reader :value
|
9
|
-
attr_reader :text
|
10
|
-
attr_reader :givens
|
11
|
-
attr_reader :backgrounds
|
12
|
-
attr_reader :result
|
13
|
-
|
14
|
-
def initialize(text, &block)
|
15
|
-
@value = text
|
16
|
-
@text = text.to_s
|
17
|
-
@block = block
|
18
|
-
@givens = []
|
19
|
-
@backgrounds = []
|
20
|
-
@result = Testing::ScenarioResult.new(text)
|
21
|
-
end
|
22
|
-
|
23
|
-
def add_given(given)
|
24
|
-
if(self.value.is_a? Pending)
|
25
|
-
@givens << Given.new(self, "", Pending.new(given.text), &block)
|
26
|
-
else
|
27
|
-
@givens << given
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def last_given
|
32
|
-
@givens.last
|
33
|
-
end
|
34
|
-
|
35
|
-
def add_background(background)
|
36
|
-
if(self.value.is_a? Pending)
|
37
|
-
@backgrounds << Background.new(self, "", Pending.new(background.text), &block)
|
38
|
-
else
|
39
|
-
@backgrounds << background
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def last_background
|
44
|
-
@backgrounds.last
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Scenarios
|
4
|
+
class Scenario
|
5
|
+
include Sapphire::Testing::RSpecRunner
|
6
|
+
|
7
|
+
attr_reader :block
|
8
|
+
attr_reader :value
|
9
|
+
attr_reader :text
|
10
|
+
attr_reader :givens
|
11
|
+
attr_reader :backgrounds
|
12
|
+
attr_reader :result
|
13
|
+
|
14
|
+
def initialize(text, &block)
|
15
|
+
@value = text
|
16
|
+
@text = text.to_s
|
17
|
+
@block = block
|
18
|
+
@givens = []
|
19
|
+
@backgrounds = []
|
20
|
+
@result = Testing::ScenarioResult.new(text)
|
21
|
+
end
|
22
|
+
|
23
|
+
def add_given(given)
|
24
|
+
if(self.value.is_a? Pending)
|
25
|
+
@givens << Given.new(self, "", Pending.new(given.text), &block)
|
26
|
+
else
|
27
|
+
@givens << given
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def last_given
|
32
|
+
@givens.last
|
33
|
+
end
|
34
|
+
|
35
|
+
def add_background(background)
|
36
|
+
if(self.value.is_a? Pending)
|
37
|
+
@backgrounds << Background.new(self, "", Pending.new(background.text), &block)
|
38
|
+
else
|
39
|
+
@backgrounds << background
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def last_background
|
44
|
+
@backgrounds.last
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
@@ -1,34 +1,34 @@
|
|
1
|
-
class Then
|
2
|
-
include Sapphire::Testing::Executable
|
3
|
-
|
4
|
-
attr_reader :value
|
5
|
-
attr_accessor :text
|
6
|
-
attr_reader :block
|
7
|
-
attr_reader :and
|
8
|
-
attr_reader :parent
|
9
|
-
attr_reader :results
|
10
|
-
|
11
|
-
def initialize(parent, pre, text, &block)
|
12
|
-
@block = block
|
13
|
-
@value = text
|
14
|
-
@text = pre + text.to_s
|
15
|
-
@and = []
|
16
|
-
@parent = parent
|
17
|
-
@results = []
|
18
|
-
end
|
19
|
-
|
20
|
-
def add_and(pre, text, &block)
|
21
|
-
if(!self.value.instance_of? Pending)
|
22
|
-
x = Then.new(self, pre, text, &block)
|
23
|
-
self.and << x
|
24
|
-
else
|
25
|
-
self.and << Then.new(self, pre, Pending.new(pre + text), &block)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def AddResult(result)
|
30
|
-
@results << result
|
31
|
-
self.parent.results.last.AddChild(result)
|
32
|
-
end
|
33
|
-
|
1
|
+
class Then
|
2
|
+
include Sapphire::Testing::Executable
|
3
|
+
|
4
|
+
attr_reader :value
|
5
|
+
attr_accessor :text
|
6
|
+
attr_reader :block
|
7
|
+
attr_reader :and
|
8
|
+
attr_reader :parent
|
9
|
+
attr_reader :results
|
10
|
+
|
11
|
+
def initialize(parent, pre, text, &block)
|
12
|
+
@block = block
|
13
|
+
@value = text
|
14
|
+
@text = pre + text.to_s
|
15
|
+
@and = []
|
16
|
+
@parent = parent
|
17
|
+
@results = []
|
18
|
+
end
|
19
|
+
|
20
|
+
def add_and(pre, text, &block)
|
21
|
+
if(!self.value.instance_of? Pending)
|
22
|
+
x = Then.new(self, pre, text, &block)
|
23
|
+
self.and << x
|
24
|
+
else
|
25
|
+
self.and << Then.new(self, pre, Pending.new(pre + text), &block)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def AddResult(result)
|
30
|
+
@results << result
|
31
|
+
self.parent.results.last.AddChild(result)
|
32
|
+
end
|
33
|
+
|
34
34
|
end
|
@@ -1,47 +1,47 @@
|
|
1
|
-
class When
|
2
|
-
include Sapphire::Testing::Executable
|
3
|
-
|
4
|
-
attr_reader :value
|
5
|
-
attr_accessor :text
|
6
|
-
attr_reader :block
|
7
|
-
attr_reader :then
|
8
|
-
attr_reader :and
|
9
|
-
attr_reader :parent
|
10
|
-
attr_reader :results
|
11
|
-
|
12
|
-
def initialize(parent, pre, text, &block)
|
13
|
-
@block = block
|
14
|
-
@value = text
|
15
|
-
@text = pre + text.to_s
|
16
|
-
@then = []
|
17
|
-
@and = []
|
18
|
-
@parent = parent
|
19
|
-
@results = []
|
20
|
-
end
|
21
|
-
|
22
|
-
def add_then(pre, text, &block)
|
23
|
-
if(self.value.is_a? Pending)
|
24
|
-
@then << Then.new(self, pre, Pending.new(text), &block)
|
25
|
-
else
|
26
|
-
@then << Then.new(self, pre, text, &block)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def add_and(pre, text, &block)
|
31
|
-
if(self.value.is_a? Pending)
|
32
|
-
self.and << And.new(self, Pending.new(pre + text), &block)
|
33
|
-
else
|
34
|
-
self.and << And.new(self, pre + text, &block)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def last_then
|
39
|
-
@then.last
|
40
|
-
end
|
41
|
-
|
42
|
-
def AddResult(result)
|
43
|
-
@results << result
|
44
|
-
self.parent.results.last.AddChild(result)
|
45
|
-
end
|
46
|
-
|
1
|
+
class When
|
2
|
+
include Sapphire::Testing::Executable
|
3
|
+
|
4
|
+
attr_reader :value
|
5
|
+
attr_accessor :text
|
6
|
+
attr_reader :block
|
7
|
+
attr_reader :then
|
8
|
+
attr_reader :and
|
9
|
+
attr_reader :parent
|
10
|
+
attr_reader :results
|
11
|
+
|
12
|
+
def initialize(parent, pre, text, &block)
|
13
|
+
@block = block
|
14
|
+
@value = text
|
15
|
+
@text = pre + text.to_s
|
16
|
+
@then = []
|
17
|
+
@and = []
|
18
|
+
@parent = parent
|
19
|
+
@results = []
|
20
|
+
end
|
21
|
+
|
22
|
+
def add_then(pre, text, &block)
|
23
|
+
if(self.value.is_a? Pending)
|
24
|
+
@then << Then.new(self, pre, Pending.new(text), &block)
|
25
|
+
else
|
26
|
+
@then << Then.new(self, pre, text, &block)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def add_and(pre, text, &block)
|
31
|
+
if(self.value.is_a? Pending)
|
32
|
+
self.and << And.new(self, Pending.new(pre + text), &block)
|
33
|
+
else
|
34
|
+
self.and << And.new(self, pre + text, &block)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def last_then
|
39
|
+
@then.last
|
40
|
+
end
|
41
|
+
|
42
|
+
def AddResult(result)
|
43
|
+
@results << result
|
44
|
+
self.parent.results.last.AddChild(result)
|
45
|
+
end
|
46
|
+
|
47
47
|
end
|