sapphire 0.4.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,6 @@
1
1
  $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
2
2
 
3
+ require 'rubygems'
3
4
  require 'sapphire'
4
5
  include Sapphire::Sapphire
5
6
 
@@ -1,29 +1,22 @@
1
- require "rubygems"
1
+ $:.unshift File.expand_path("..", __FILE__)
2
+
3
+ require 'rubygems'
4
+ require 'Platform'
2
5
  require 'yaml'
3
6
  require 'selenium-webdriver'
4
7
  require 'delegate'
5
8
  require 'Forwardable'
6
- require 'win32ole'
7
- require 'win32console'
8
- require 'json'
9
9
  require 'colorize'
10
10
 
11
- require File.expand_path(File.dirname(__FILE__) +'/sapphire/Strategies/Strategy.rb', __FILE__)
12
- require File.expand_path(File.dirname(__FILE__) +'/sapphire/Testing/Reporter.rb', __FILE__)
13
- Dir[File.dirname(__FILE__) + '/sapphire/Testing/*.rb'].each {|file| require file }
14
- #Dir[File.dirname(__FILE__) + '/sapphire/TeamCity/*.rb'].each {|file| require file }
15
- Dir[File.dirname(__FILE__) + '/sapphire/Configuration/*.rb'].each {|file| require file }
16
- Dir[File.dirname(__FILE__) + '/sapphire/WebAbstractions/Controls/Base/*.rb'].each {|file| require file }
17
- Dir[File.dirname(__FILE__) + '/sapphire/WebAbstractions/Controls/*.rb'].each {|file| require file }
18
- Dir[File.dirname(__FILE__) + '/sapphire/DataAbstractions/*.rb'].each {|file| require file }
19
- Dir[File.dirname(__FILE__) + '/sapphire/JobAbstractions/*.rb'].each {|file| require file }
20
- Dir[File.dirname(__FILE__) + '/sapphire/Strategies/*.rb'].each {|file| require file }
21
- Dir[File.dirname(__FILE__) + '/sapphire/DSL/Browser/*.rb'].each {|file| require file }
22
- Dir[File.dirname(__FILE__) + '/sapphire/DSL/Configuration/*.rb'].each {|file| require file }
23
- Dir[File.dirname(__FILE__) + '/sapphire/DSL/Data/*.rb'].each {|file| require file }
24
- Dir[File.dirname(__FILE__) + '/sapphire/DSL/Scenarios/*.rb'].each {|file| require file }
25
- Dir[File.dirname(__FILE__) + '/sapphire/DSL/TestPlans/*.rb'].each {|file| require file }
26
- Dir[File.dirname(__FILE__) + '/sapphire/UI/*.rb'].each {|file| require file }
11
+ require 'sapphire/Strategies'
12
+ require 'sapphire/Testing'
13
+ require 'sapphire/Web'
14
+ require 'sapphire/DSL'
15
+ require 'sapphire/CommandLine'
16
+ require 'sapphire/Configuration'
17
+ require 'sapphire/Data'
18
+ require 'sapphire/Virtualization'
19
+ require 'sapphire/TeamCity'
27
20
 
28
21
  module Sapphire
29
22
  module Sapphire
@@ -39,7 +32,7 @@ module Sapphire
39
32
  include JobAbstractions
40
33
  include WebAbstractions
41
34
  include Testing
42
- # include Testing::TeamCity
35
+ include Testing::TeamCity
43
36
  include UI
44
37
  end
45
38
  end
@@ -0,0 +1 @@
1
+ Dir[File.dirname(__FILE__) + '/JobAbstractions/*.rb'].each {|file| require file }
@@ -0,0 +1 @@
1
+ Dir[File.dirname(__FILE__) + '/Configuration/*.rb'].each {|file| require file }
@@ -3,10 +3,10 @@ require 'ostruct'
3
3
 
4
4
  module Sapphire
5
5
  module Configuration
6
- class Config < OpenStruct
6
+ class AppConfig < OpenStruct
7
7
 
8
8
  def self.create(hash)
9
- @@instance ||= AppConfig.new hash
9
+ @@instance ||= Config.new hash
10
10
  @@instance
11
11
  end
12
12
 
@@ -0,0 +1,6 @@
1
+ Dir[File.dirname(__FILE__) + '/DSL/Browser/*.rb'].each {|file| require file }
2
+ Dir[File.dirname(__FILE__) + '/DSL/Browser/Keys/*.rb'].each {|file| require file }
3
+ Dir[File.dirname(__FILE__) + '/DSL/Configuration/*.rb'].each {|file| require file }
4
+ Dir[File.dirname(__FILE__) + '/DSL/Data/*.rb'].each {|file| require file }
5
+ Dir[File.dirname(__FILE__) + '/DSL/Scenarios/*.rb'].each {|file| require file }
6
+ Dir[File.dirname(__FILE__) + '/DSL/TestPlans/*.rb'].each {|file| require file }
@@ -0,0 +1,11 @@
1
+ module Sapphire
2
+ module DSL
3
+ module Browser
4
+ class Enter
5
+ def Press
6
+ $browser.action.send_keys("\n").perform()
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module Sapphire
2
+ module DSL
3
+ module Browser
4
+
5
+ def Press(item)
6
+ item.new().Press
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,2 @@
1
+ require 'win32ole' if Platform::OS == :win32
2
+ Dir[File.dirname(__FILE__) + '/DataAbstractions/*.rb'].each {|file| require file }
@@ -0,0 +1,2 @@
1
+ require File.expand_path(File.dirname(__FILE__) +'/Strategies/Strategy.rb', __FILE__)
2
+ Dir[File.dirname(__FILE__) + '/Strategies/*.rb'].each {|file| require file }
@@ -0,0 +1,9 @@
1
+ Dir[File.dirname(__FILE__) + '/TeamCity/*.rb'].each {|file| require file } if ENV["TeamCity"] == 1
2
+
3
+ module Sapphire
4
+ module Testing
5
+ module TeamCity
6
+
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,2 @@
1
+ require File.expand_path(File.dirname(__FILE__) +'/Testing/Reporter.rb', __FILE__)
2
+ Dir[File.dirname(__FILE__) + '/Testing/*.rb'].each {|file| require file }
@@ -28,13 +28,13 @@ module Sapphire
28
28
  Indent(depth)
29
29
 
30
30
  if result.type == 'pass'
31
- $stdout.puts result.text.green
31
+ $stdout.puts result.text.colorize :green
32
32
  elsif result.type == 'pending'
33
- $stdout.puts result.text.yellow
33
+ $stdout.puts result.text.colorize :yellow
34
34
  Indent(depth+1)
35
35
  $stdout.puts " ## Not Yet Implemented ##"
36
36
  else
37
- $stdout.puts result.text.red
37
+ $stdout.puts result.text.colorize :red
38
38
  if result.messages.is_a? Array
39
39
  result.messages.each do |message|
40
40
  Indent(depth+1)
@@ -66,19 +66,19 @@ module Sapphire
66
66
 
67
67
  def TestPassed(test)
68
68
  @passing_count = @passing_count + 1
69
- $stdout.print ".".green
69
+ $stdout.print ".".colorize :green
70
70
  end
71
71
 
72
72
  def TestFailed(test)
73
73
  @failing_count = @failing_count + 1
74
74
  Add test
75
- $stdout.print "F".red
75
+ $stdout.print "F".colorize :red
76
76
  end
77
77
 
78
78
  def TestPending(test)
79
79
  @pending_count = @pending_count + 1
80
80
  Add test
81
- $stdout.print "*".yellow
81
+ $stdout.print "*".colorize :yellow
82
82
  end
83
83
 
84
84
  def Add(r)
@@ -106,11 +106,11 @@ module Sapphire
106
106
  end
107
107
 
108
108
  $stdout.puts ""
109
- $stdout.puts "Finished in " + (@end - @start).round(2).to_s + " seconds."
109
+ $stdout.puts "Finished in " + (@end - @start).round().to_s + " seconds."
110
110
  $stdout.puts "Test Count: " + @test_count.to_s
111
- $stdout.puts "Passing: " + @passing_count.to_s.green
112
- $stdout.puts "Failing: " + @failing_count.to_s.red
113
- $stdout.puts "Pending: " + @pending_count.to_s.yellow
111
+ $stdout.puts "Passing: " + @passing_count.to_s.colorize(:green)
112
+ $stdout.puts "Failing: " + @failing_count.to_s.colorize(:red)
113
+ $stdout.puts "Pending: " + @pending_count.to_s.colorize(:yellow)
114
114
  end
115
115
 
116
116
  def Output(result, depth)
@@ -0,0 +1,8 @@
1
+ require File.expand_path(File.dirname(__FILE__) +'/UI/Functions.rb', File.dirname(__FILE__)) if Platform::OS == :win32
2
+ require File.expand_path(File.dirname(__FILE__) +'/UI/VirtualUI.rb', File.dirname(__FILE__)) if Platform::OS == :win32
3
+
4
+ module Sapphire
5
+ module UI
6
+
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ Dir[File.dirname(__FILE__) + '/WebAbstractions/Controls/Base/*.rb'].each {|file| require file }
2
+ Dir[File.dirname(__FILE__) + '/WebAbstractions/Controls/*.rb'].each {|file| require file }
3
+
4
+ require File.expand_path(File.dirname(__FILE__) +'/WebAbstractions/Controls/Browsers/Chrome.rb', File.dirname(__FILE__))
5
+ require File.expand_path(File.dirname(__FILE__) +'/WebAbstractions/Controls/Browsers/FireFox.rb', File.dirname(__FILE__))
6
+ require File.expand_path(File.dirname(__FILE__) +'/WebAbstractions/Controls/Browsers/InternetExplorer.rb', File.dirname(__FILE__)) if Platform::OS == :win32
@@ -10,7 +10,7 @@ module Sapphire
10
10
  attr_reader :browser
11
11
 
12
12
  def initialize()
13
- @browser = Selenium::WebDriver.for(:chrome, :desired_capabilities => browser)
13
+ @browser = Selenium::WebDriver.for(:chrome)
14
14
  super @browser
15
15
  $browser = @browser
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module Sapphire
2
- VERSION = "0.4.3"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,61 +1,74 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: sapphire
3
- version: !ruby/object:Gem::Version
4
- version: 0.4.3
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 5
8
+ - 0
9
+ version: 0.5.0
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - Marcus Bratton
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2011-10-08 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
16
+
17
+ date: 2011-10-08 00:00:00 -05:00
18
+ default_executable: sapphire
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: selenium-webdriver
16
- requirement: &9953184 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
22
  prerelease: false
24
- version_requirements: *9953184
25
- - !ruby/object:Gem::Dependency
26
- name: colorize
27
- requirement: &9952932 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ version: "0"
33
30
  type: :runtime
31
+ version_requirements: *id001
32
+ - !ruby/object:Gem::Dependency
33
+ name: colorize
34
34
  prerelease: false
35
- version_requirements: *9952932
36
- - !ruby/object:Gem::Dependency
37
- name: win32console
38
- requirement: &9952680 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
43
- version: '0'
35
+ requirement: &id002 !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ segments:
40
+ - 0
41
+ version: "0"
44
42
  type: :runtime
43
+ version_requirements: *id002
44
+ - !ruby/object:Gem::Dependency
45
+ name: Platform
45
46
  prerelease: false
46
- version_requirements: *9952680
47
- description: An automated web acceptance test framework for non-technical resources
48
- using selenium-wedriver.
49
- email:
47
+ requirement: &id003 !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ segments:
52
+ - 0
53
+ version: "0"
54
+ type: :runtime
55
+ version_requirements: *id003
56
+ description: An automated web acceptance test framework for non-technical resources using selenium-wedriver.
57
+ email:
50
58
  - marcus.bratton@gmail.com
51
- executables:
59
+ executables:
52
60
  - sapphire
53
61
  extensions: []
62
+
54
63
  extra_rdoc_files: []
55
- files:
64
+
65
+ files:
66
+ - lib/sapphire/CommandLine.rb
67
+ - lib/sapphire/Configuration/AppConfig.rb
56
68
  - lib/sapphire/Configuration/AttrMethods.rb
57
- - lib/sapphire/Configuration/Config.rb
58
69
  - lib/sapphire/Configuration/SapphireConfig.rb
70
+ - lib/sapphire/Configuration.rb
71
+ - lib/sapphire/Data.rb
59
72
  - lib/sapphire/DataAbstractions/Database.rb
60
73
  - lib/sapphire/DataAbstractions/NonQuery.rb
61
74
  - lib/sapphire/DataAbstractions/Query.rb
@@ -76,11 +89,13 @@ files:
76
89
  - lib/sapphire/DSL/Browser/Hide.rb
77
90
  - lib/sapphire/DSL/Browser/IsHidden.rb
78
91
  - lib/sapphire/DSL/Browser/IsVisible.rb
92
+ - lib/sapphire/DSL/Browser/Keys/Enter.rb
79
93
  - lib/sapphire/DSL/Browser/List.rb
80
94
  - lib/sapphire/DSL/Browser/MouseOver.rb
81
95
  - lib/sapphire/DSL/Browser/Navigate.rb
82
96
  - lib/sapphire/DSL/Browser/Not.rb
83
97
  - lib/sapphire/DSL/Browser/Popup.rb
98
+ - lib/sapphire/DSL/Browser/Press.rb
84
99
  - lib/sapphire/DSL/Browser/Reload.rb
85
100
  - lib/sapphire/DSL/Browser/Set.rb
86
101
  - lib/sapphire/DSL/Browser/Should.rb
@@ -119,6 +134,7 @@ files:
119
134
  - lib/sapphire/DSL/TestPlans/PathHandler.rb
120
135
  - lib/sapphire/DSL/TestPlans/Run.rb
121
136
  - lib/sapphire/DSL/TestPlans/TestPlan.rb
137
+ - lib/sapphire/DSL.rb
122
138
  - lib/sapphire/JobAbstractions/Job.rb
123
139
  - lib/sapphire/Strategies/ClassStrategy.rb
124
140
  - lib/sapphire/Strategies/DefaultStrategy.rb
@@ -127,7 +143,9 @@ files:
127
143
  - lib/sapphire/Strategies/NullModifier.rb
128
144
  - lib/sapphire/Strategies/Strategy.rb
129
145
  - lib/sapphire/Strategies/SymbolStrategy.rb
146
+ - lib/sapphire/Strategies.rb
130
147
  - lib/sapphire/TeamCity/TeamCityReporter.rb
148
+ - lib/sapphire/TeamCity.rb
131
149
  - lib/sapphire/Testing/ConsoleReporter.rb
132
150
  - lib/sapphire/Testing/Executable.rb
133
151
  - lib/sapphire/Testing/ExpectationException.rb
@@ -139,49 +157,58 @@ files:
139
157
  - lib/sapphire/Testing/ScenarioResult.rb
140
158
  - lib/sapphire/Testing/TestResult.rb
141
159
  - lib/sapphire/Testing/TestRunnerAdapter.rb
160
+ - lib/sapphire/Testing.rb
142
161
  - lib/sapphire/UI/Functions.rb
143
162
  - lib/sapphire/UI/VirtualUI.rb
144
163
  - lib/sapphire/version.rb
164
+ - lib/sapphire/Virtualization.rb
165
+ - lib/sapphire/Web.rb
145
166
  - lib/sapphire/WebAbstractions/Controls/Base/Control.rb
146
167
  - lib/sapphire/WebAbstractions/Controls/Base/Page.rb
147
168
  - lib/sapphire/WebAbstractions/Controls/Base/WebBrowser.rb
169
+ - lib/sapphire/WebAbstractions/Controls/Browsers/Chrome.rb
170
+ - lib/sapphire/WebAbstractions/Controls/Browsers/FireFox.rb
171
+ - lib/sapphire/WebAbstractions/Controls/Browsers/InternetExplorer.rb
148
172
  - lib/sapphire/WebAbstractions/Controls/Button.rb
149
173
  - lib/sapphire/WebAbstractions/Controls/CheckBox.rb
150
- - lib/sapphire/WebAbstractions/Controls/Chrome.rb
151
174
  - lib/sapphire/WebAbstractions/Controls/DropDown.rb
152
- - lib/sapphire/WebAbstractions/Controls/FireFox.rb
153
175
  - lib/sapphire/WebAbstractions/Controls/Hyperlink.rb
154
176
  - lib/sapphire/WebAbstractions/Controls/Image.rb
155
- - lib/sapphire/WebAbstractions/Controls/InternetExplorer.rb
156
177
  - lib/sapphire/WebAbstractions/Controls/Label.rb
157
178
  - lib/sapphire/WebAbstractions/Controls/RadioButton.rb
158
179
  - lib/sapphire/WebAbstractions/Controls/TableCell.rb
159
180
  - lib/sapphire/WebAbstractions/Controls/TextBox.rb
160
181
  - lib/sapphire/WebAbstractions/Controls/Title.rb
161
182
  - lib/sapphire.rb
162
- - bin/sapphire
183
+ has_rdoc: true
163
184
  homepage: http://github.com/MarcusTheBold/Sapphire/
164
185
  licenses: []
186
+
165
187
  post_install_message:
166
188
  rdoc_options: []
167
- require_paths:
189
+
190
+ require_paths:
168
191
  - lib
169
- required_ruby_version: !ruby/object:Gem::Requirement
170
- none: false
171
- requirements:
172
- - - ! '>='
173
- - !ruby/object:Gem::Version
174
- version: '0'
175
- required_rubygems_version: !ruby/object:Gem::Requirement
176
- none: false
177
- requirements:
178
- - - ! '>='
179
- - !ruby/object:Gem::Version
180
- version: '0'
192
+ required_ruby_version: !ruby/object:Gem::Requirement
193
+ requirements:
194
+ - - ">="
195
+ - !ruby/object:Gem::Version
196
+ segments:
197
+ - 0
198
+ version: "0"
199
+ required_rubygems_version: !ruby/object:Gem::Requirement
200
+ requirements:
201
+ - - ">="
202
+ - !ruby/object:Gem::Version
203
+ segments:
204
+ - 0
205
+ version: "0"
181
206
  requirements: []
207
+
182
208
  rubyforge_project:
183
- rubygems_version: 1.8.5
209
+ rubygems_version: 1.3.6
184
210
  signing_key:
185
211
  specification_version: 3
186
212
  summary: An automated web acceptance test framework for non-technical resources
187
213
  test_files: []
214
+