sapphire 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. data/lib/sapphire.rb +38 -37
  2. data/lib/sapphire/Adapters.rb +1 -0
  3. data/lib/sapphire/Adapters/Selenium/RubySeleniumWebDriver.rb +190 -0
  4. data/lib/sapphire/DSL.rb +6 -6
  5. data/lib/sapphire/DSL/Browser/Accept.rb +9 -9
  6. data/lib/sapphire/DSL/Browser/AlertBox.rb +14 -19
  7. data/lib/sapphire/DSL/Browser/Browser.rb +17 -17
  8. data/lib/sapphire/DSL/Browser/By.rb +10 -10
  9. data/lib/sapphire/DSL/Browser/Check.rb +12 -12
  10. data/lib/sapphire/DSL/Browser/Clear.rb +12 -12
  11. data/lib/sapphire/DSL/Browser/Click.rb +12 -12
  12. data/lib/sapphire/DSL/Browser/Close.rb +12 -12
  13. data/lib/sapphire/DSL/Browser/Compare.rb +18 -18
  14. data/lib/sapphire/DSL/Browser/Complete.rb +15 -15
  15. data/lib/sapphire/DSL/Browser/CurrentUrl.rb +11 -11
  16. data/lib/sapphire/DSL/Browser/Day.rb +24 -24
  17. data/lib/sapphire/DSL/Browser/Differ.rb +18 -18
  18. data/lib/sapphire/DSL/Browser/Error.rb +26 -26
  19. data/lib/sapphire/DSL/Browser/ExecuteAgainstControl.rb +45 -45
  20. data/lib/sapphire/DSL/Browser/Exists.rb +22 -22
  21. data/lib/sapphire/DSL/Browser/For.rb +10 -10
  22. data/lib/sapphire/DSL/Browser/Hide.rb +26 -26
  23. data/lib/sapphire/DSL/Browser/IsHidden.rb +10 -10
  24. data/lib/sapphire/DSL/Browser/IsVisible.rb +33 -33
  25. data/lib/sapphire/DSL/Browser/Keys/Enter.rb +10 -10
  26. data/lib/sapphire/DSL/Browser/Month.rb +24 -24
  27. data/lib/sapphire/DSL/Browser/MouseOver.rb +12 -12
  28. data/lib/sapphire/DSL/Browser/Navigate.rb +11 -11
  29. data/lib/sapphire/DSL/Browser/Popup.rb +2 -4
  30. data/lib/sapphire/DSL/Browser/Press.rb +10 -10
  31. data/lib/sapphire/DSL/Browser/Reload.rb +11 -11
  32. data/lib/sapphire/DSL/Browser/Set.rb +18 -18
  33. data/lib/sapphire/DSL/Browser/Should.rb +42 -42
  34. data/lib/sapphire/DSL/Browser/Show.rb +26 -26
  35. data/lib/sapphire/DSL/Browser/Start.rb +16 -16
  36. data/lib/sapphire/DSL/Browser/To.rb +10 -10
  37. data/lib/sapphire/DSL/Browser/Tracker.rb +15 -15
  38. data/lib/sapphire/DSL/Browser/Transition.rb +26 -26
  39. data/lib/sapphire/DSL/Browser/Uncheck.rb +12 -12
  40. data/lib/sapphire/DSL/Browser/With.rb +10 -10
  41. data/lib/sapphire/DSL/Configuration/ConfiguredBrowser.rb +12 -12
  42. data/lib/sapphire/DSL/Configuration/ConfiguredUser.rb +10 -10
  43. data/lib/sapphire/DSL/Configuration/Use.rb +15 -15
  44. data/lib/sapphire/DSL/Data/Exist.rb +27 -27
  45. data/lib/sapphire/DSL/Data/Find.rb +10 -10
  46. data/lib/sapphire/DSL/Data/GetPageField.rb +17 -17
  47. data/lib/sapphire/DSL/Data/Underscore.rb +8 -8
  48. data/lib/sapphire/DSL/Data/Validate.rb +26 -26
  49. data/lib/sapphire/DSL/Data/Verify.rb +10 -10
  50. data/lib/sapphire/DSL/Scenarios/Is.rb +9 -9
  51. data/lib/sapphire/DSL/Scenarios/Pending.rb +28 -28
  52. data/lib/sapphire/DSL/Scenarios/and.rb +25 -25
  53. data/lib/sapphire/DSL/Scenarios/background.rb +33 -33
  54. data/lib/sapphire/DSL/Scenarios/dsl.rb +59 -59
  55. data/lib/sapphire/DSL/Scenarios/finally.rb +33 -33
  56. data/lib/sapphire/DSL/Scenarios/given.rb +57 -57
  57. data/lib/sapphire/DSL/Scenarios/runner.rb +40 -40
  58. data/lib/sapphire/DSL/Scenarios/scenario.rb +53 -53
  59. data/lib/sapphire/DSL/Scenarios/then.rb +34 -34
  60. data/lib/sapphire/DSL/Scenarios/when.rb +47 -47
  61. data/lib/sapphire/Data.rb +1 -1
  62. data/lib/sapphire/DataAbstractions/Database.rb +57 -57
  63. data/lib/sapphire/DataAbstractions/Query.rb +19 -19
  64. data/lib/sapphire/JobAbstractions/Job.rb +32 -32
  65. data/lib/sapphire/Strategies.rb +1 -1
  66. data/lib/sapphire/TeamCity.rb +8 -8
  67. data/lib/sapphire/Testing.rb +2 -2
  68. data/lib/sapphire/Testing/Executable.rb +30 -30
  69. data/lib/sapphire/Testing/RakeTask.rb +108 -108
  70. data/lib/sapphire/Testing/ResultList.rb +18 -18
  71. data/lib/sapphire/Testing/ResultTree.rb +44 -44
  72. data/lib/sapphire/Testing/ScenarioResult.rb +36 -36
  73. data/lib/sapphire/Testing/TestResult.rb +21 -21
  74. data/lib/sapphire/Testing/TestRunnerAdapter.rb +69 -69
  75. data/lib/sapphire/Virtualization.rb +7 -7
  76. data/lib/sapphire/Web.rb +3 -6
  77. data/lib/sapphire/WebAbstractions/{Controls/Browsers → Browsers}/Chrome.rb +21 -21
  78. data/lib/sapphire/WebAbstractions/{Controls/Browsers → Browsers}/FireFox.rb +22 -22
  79. data/lib/sapphire/WebAbstractions/{Controls/Browsers → Browsers}/InternetExplorer.rb +21 -21
  80. data/lib/sapphire/WebAbstractions/Controls/Base/Control.rb +59 -99
  81. data/lib/sapphire/WebAbstractions/Controls/Base/Page.rb +62 -62
  82. data/lib/sapphire/WebAbstractions/Controls/Button.rb +9 -9
  83. data/lib/sapphire/WebAbstractions/Controls/CheckBox.rb +28 -28
  84. data/lib/sapphire/WebAbstractions/Controls/Date.rb +11 -11
  85. data/lib/sapphire/WebAbstractions/Controls/DropDown.rb +26 -26
  86. data/lib/sapphire/WebAbstractions/Controls/Hyperlink.rb +8 -8
  87. data/lib/sapphire/WebAbstractions/Controls/Image.rb +9 -9
  88. data/lib/sapphire/WebAbstractions/Controls/Label.rb +8 -8
  89. data/lib/sapphire/WebAbstractions/Controls/RadioButton.rb +18 -18
  90. data/lib/sapphire/WebAbstractions/Controls/TextBox.rb +31 -31
  91. data/lib/sapphire/WebAbstractions/Controls/Title.rb +12 -12
  92. data/lib/sapphire/version.rb +3 -3
  93. metadata +14 -13
  94. data/lib/sapphire/WebAbstractions/Controls/Base/WebBrowser.rb +0 -91
@@ -1,8 +1,8 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class Hyperlink < Control
4
-
5
- end
6
- end
7
- end
8
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class Hyperlink < Control
4
+
5
+ end
6
+ end
7
+ end
8
+
@@ -1,9 +1,9 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class Image < Control
4
-
5
- end
6
- end
7
- end
8
-
9
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class Image < Control
4
+
5
+ end
6
+ end
7
+ end
8
+
9
+
@@ -1,8 +1,8 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class Label < Control
4
-
5
- end
6
- end
7
- end
8
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class Label < Control
4
+
5
+ end
6
+ end
7
+ end
8
+
@@ -1,18 +1,18 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class RadioButton < Control
4
-
5
- def Text
6
- self.Find().text
7
- end
8
-
9
- def Check (value)
10
-
11
- radio = self.Find
12
- radio.click
13
-
14
- end
15
- end
16
- end
17
- end
18
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class RadioButton < Control
4
+
5
+ def Text
6
+ self.Find().text
7
+ end
8
+
9
+ def Check (value)
10
+
11
+ radio = self.Find
12
+ radio.click
13
+
14
+ end
15
+ end
16
+ end
17
+ end
18
+
@@ -1,31 +1,31 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class TextBox < Control
4
-
5
- def Text= (value)
6
- text = self.Find
7
- text.send_keys value
8
- end
9
-
10
- def Text
11
- text = self.Find
12
- text.attribute("value")
13
- end
14
-
15
- def Set(value)
16
- if(value == "")
17
- self.Clear
18
- else
19
- text = self.Find
20
- text.send_keys value
21
- end
22
- end
23
-
24
- def Clear
25
- text = self.Find
26
- text.clear
27
- end
28
- end
29
- end
30
- end
31
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class TextBox < Control
4
+
5
+ def Text= (value)
6
+ text = self.Find
7
+ text.send_keys value
8
+ end
9
+
10
+ def Text
11
+ text = self.Find
12
+ text.attribute("value")
13
+ end
14
+
15
+ def Set(value)
16
+ if(value == "")
17
+ self.Clear
18
+ else
19
+ text = self.Find
20
+ text.send_keys value
21
+ end
22
+ end
23
+
24
+ def Clear
25
+ text = self.Find
26
+ text.clear
27
+ end
28
+ end
29
+ end
30
+ end
31
+
@@ -1,12 +1,12 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class Title < Control
4
-
5
- def Text
6
- @browser.title
7
- end
8
-
9
- end
10
- end
11
- end
12
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class Title < Control
4
+
5
+ def Text
6
+ @browser.title
7
+ end
8
+
9
+ end
10
+ end
11
+ end
12
+
@@ -1,3 +1,3 @@
1
- module Sapphire
2
- VERSION = "0.5.2"
3
- end
1
+ module Sapphire
2
+ VERSION = "0.5.3"
3
+ end
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.5.2
4
+ version: 0.5.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-24 00:00:00.000000000Z
12
+ date: 2011-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver
16
- requirement: &10052256 !ruby/object:Gem::Requirement
16
+ requirement: &20481660 !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: *10052256
24
+ version_requirements: *20481660
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: colorize
27
- requirement: &10052004 !ruby/object:Gem::Requirement
27
+ requirement: &20481384 !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: *10052004
35
+ version_requirements: *20481384
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: Platform
38
- requirement: &10051752 !ruby/object:Gem::Requirement
38
+ requirement: &20481120 !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: *10051752
46
+ version_requirements: *20481120
47
47
  description: An automated web acceptance test framework for non-technical resources
48
48
  using selenium-wedriver.
49
49
  email:
@@ -53,6 +53,8 @@ executables:
53
53
  extensions: []
54
54
  extra_rdoc_files: []
55
55
  files:
56
+ - lib/sapphire/Adapters/Selenium/RubySeleniumWebDriver.rb
57
+ - lib/sapphire/Adapters.rb
56
58
  - lib/sapphire/CommandLine.rb
57
59
  - lib/sapphire/Configuration/AppConfig.rb
58
60
  - lib/sapphire/Configuration/AttrMethods.rb
@@ -158,12 +160,11 @@ files:
158
160
  - lib/sapphire/version.rb
159
161
  - lib/sapphire/Virtualization.rb
160
162
  - lib/sapphire/Web.rb
163
+ - lib/sapphire/WebAbstractions/Browsers/Chrome.rb
164
+ - lib/sapphire/WebAbstractions/Browsers/FireFox.rb
165
+ - lib/sapphire/WebAbstractions/Browsers/InternetExplorer.rb
161
166
  - lib/sapphire/WebAbstractions/Controls/Base/Control.rb
162
167
  - lib/sapphire/WebAbstractions/Controls/Base/Page.rb
163
- - lib/sapphire/WebAbstractions/Controls/Base/WebBrowser.rb
164
- - lib/sapphire/WebAbstractions/Controls/Browsers/Chrome.rb
165
- - lib/sapphire/WebAbstractions/Controls/Browsers/FireFox.rb
166
- - lib/sapphire/WebAbstractions/Controls/Browsers/InternetExplorer.rb
167
168
  - lib/sapphire/WebAbstractions/Controls/Button.rb
168
169
  - lib/sapphire/WebAbstractions/Controls/CheckBox.rb
169
170
  - lib/sapphire/WebAbstractions/Controls/Date.rb
@@ -198,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
199
  version: '0'
199
200
  requirements: []
200
201
  rubyforge_project:
201
- rubygems_version: 1.8.5
202
+ rubygems_version: 1.8.11
202
203
  signing_key:
203
204
  specification_version: 3
204
205
  summary: An automated web acceptance test framework for non-technical resources
@@ -1,91 +0,0 @@
1
- module Sapphire
2
- module WebAbstractions
3
- module WebBrowser
4
-
5
- attr_reader :rootUrl
6
-
7
- def Init(url)
8
- @rootUrl = url
9
- end
10
-
11
- def SetRootUrl(url)
12
- if(url.instance_of?(String))
13
- self.Init(url)
14
- else
15
- x = url.new().Url
16
- self.Init(x)
17
- end
18
- end
19
-
20
- def NavigateTo(page)
21
- if(page.is_a? Class)
22
- nav = page.new self
23
- else
24
- nav = page
25
- end
26
-
27
- self.browser.get "https://" + nav.Url
28
- nav.Init
29
- nav
30
- end
31
-
32
- def CurrentUrl
33
- wait = Selenium::WebDriver::Wait.new(:timeout => 30)
34
- url = wait.until { x = self.current_url
35
- x unless x == nil
36
- }
37
-
38
- url
39
- end
40
-
41
- def Reload
42
- self.browser.get self.CurrentUrl
43
- end
44
-
45
- def ShouldNavigateTo(page)
46
- if(page.is_a? Class)
47
- nav = page.new self
48
- else
49
- nav = page
50
- end
51
-
52
- wait = Selenium::WebDriver::Wait.new(:timeout => 30)
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)
58
- end
59
- end
60
- x
61
- }
62
- temp = Evaluation.new(found, true)
63
- return temp, nav
64
- end
65
-
66
- def Run(background)
67
- scenario = background.new self
68
- scenario.Run
69
- end
70
-
71
- def ShouldShow(page)
72
- self.ShouldNavigateTo page
73
- end
74
-
75
- def ShouldTransitionTo(url)
76
- if(url.instance_of?(String))
77
- temp = Evaluation.new(self.CurrentUrl.upcase.start_with?("HTTP://" + url.upcase) || self.CurrentUrl.upcase.start_with?("HTTPS://" + url.upcase), true)
78
- @rootUrl = url
79
- else
80
- x = url.new().Url
81
- temp = Evaluation.new(self.CurrentUrl.upcase.start_with?("HTTP://" + x.upcase) || self.CurrentUrl.upcase.start_with?("HTTPS://" + x.upcase), true)
82
- @rootUrl = x
83
- end
84
-
85
- return temp
86
- end
87
- end
88
- end
89
- end
90
-
91
-