spec_ui 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +2 -2
- data/examples/selenium/README.txt +4 -1
- data/examples/selenium/Rakefile +11 -6
- data/examples/selenium/spec/google/find_rspecs_homepage_spec.rb +2 -12
- data/examples/selenium/spec/spec_helper.rb +18 -0
- data/examples/watir/README.txt +1 -1
- data/examples/watir/Rakefile +11 -6
- data/examples/watir/spec/spec_helper.rb +11 -3
- data/examples/watir/spec/{google → watir}/find_rspecs_homepage_spec.rb +1 -12
- data/lib/spec/ui/formatter.rb +1 -1
- data/lib/spec/ui/selenium.rb +1 -0
- data/lib/spec/ui/version.rb +1 -1
- data/lib/spec/ui/watir.rb +1 -0
- metadata +4 -4
data/Manifest.txt
CHANGED
@@ -8,7 +8,7 @@ lib/spec/ui/images/rmagick_not_installed.png
|
|
8
8
|
lib/spec/ui/images/win32screenshot_not_installed.png
|
9
9
|
lib/spec/ui/images/wrong_win32screenshot.png
|
10
10
|
lib/spec/ui/screenshot_saver.rb
|
11
|
-
lib/spec/ui/selenium
|
11
|
+
lib/spec/ui/selenium.rb
|
12
12
|
lib/spec/ui/selenium/driver_ext.rb
|
13
13
|
lib/spec/ui/version.rb
|
14
14
|
lib/spec/ui/watir.rb
|
@@ -20,7 +20,7 @@ examples/selenium/spec/google/find_rspecs_homepage_spec.rb
|
|
20
20
|
examples/selenium/spec/spec_helper.rb
|
21
21
|
examples/watir/Rakefile
|
22
22
|
examples/watir/README.txt
|
23
|
-
examples/watir/spec/
|
23
|
+
examples/watir/spec/watir/find_rspecs_homepage_spec.rb
|
24
24
|
examples/watir/spec/spec_helper.rb
|
25
25
|
spec/spec_helper.rb
|
26
26
|
spec/spec/ui/watir/matchers_spec.rb
|
@@ -16,7 +16,7 @@ In the first one, run:
|
|
16
16
|
|
17
17
|
In the second one, run:
|
18
18
|
|
19
|
-
rake spec:
|
19
|
+
rake spec:selenium
|
20
20
|
|
21
21
|
= Note for OS X users =
|
22
22
|
|
@@ -24,6 +24,9 @@ In the second one, run:
|
|
24
24
|
If you experience that the selenium server is just hanging, read this:
|
25
25
|
http://forums.openqa.org/message.jspa?messageID=16541
|
26
26
|
|
27
|
+
You may have better luck with one of the snapshot jars found under
|
28
|
+
http://maven.openqa.org/org/openqa/selenium/server/selenium-server
|
29
|
+
|
27
30
|
== Safari ==
|
28
31
|
You may have to set up Safari's proxy settings manually:
|
29
32
|
http://forums.openqa.org/thread.jspa?messageID=20570做
|
data/examples/selenium/Rakefile
CHANGED
@@ -1,12 +1,17 @@
|
|
1
|
-
|
1
|
+
# You don't need to tweak the $LOAD_PATH if you have RSpec and Spec::Ui installed as gems
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../../rspec/lib')
|
3
|
+
|
4
|
+
require 'rubygems'
|
2
5
|
require 'spec/rake/spectask'
|
3
6
|
|
4
|
-
desc "Run
|
5
|
-
Spec::Rake::SpecTask.new('spec:
|
6
|
-
t.spec_files = FileList['spec/**/*.rb']
|
7
|
+
desc "Run Selenium Specs"
|
8
|
+
Spec::Rake::SpecTask.new('spec:selenium') do |t|
|
9
|
+
t.spec_files = FileList['spec/google/**/*.rb']
|
10
|
+
# This line is not necessary if you have RSpec and Spec::Ui installed as gems
|
11
|
+
t.ruby_opts = ["-I#{File.dirname(__FILE__) + '/../../lib'}"]
|
7
12
|
t.spec_opts = [
|
8
|
-
'--require', 'spec/
|
13
|
+
'--require', 'rubygems,spec/ui',
|
9
14
|
'--format', 'Spec::Ui::ScreenshotFormatter:spec_report.html',
|
10
|
-
'--format', 'progress'
|
15
|
+
'--format', 'progress'
|
11
16
|
]
|
12
17
|
end
|
@@ -1,12 +1,9 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../spec_helper'
|
2
2
|
|
3
3
|
describe "Google's search page" do
|
4
|
-
|
5
|
-
@browser = Selenium::SeleniumDriver.new("localhost", 4444, "*safari", "http://www.google.no", 10000)
|
6
|
-
@browser.start
|
7
|
-
end
|
8
|
-
|
4
|
+
|
9
5
|
before(:each) do
|
6
|
+
# The @browser is initialised in spec_helper.rb
|
10
7
|
@browser.open('http://www.google.no')
|
11
8
|
end
|
12
9
|
|
@@ -28,11 +25,4 @@ describe "Google's search page" do
|
|
28
25
|
@browser.is_text_present("Ali G").should be_false
|
29
26
|
end
|
30
27
|
|
31
|
-
after(:each) do
|
32
|
-
Spec::Ui::WebappFormatter.browser = @browser
|
33
|
-
end
|
34
|
-
|
35
|
-
after(:all) do
|
36
|
-
@browser.kill! rescue nil
|
37
|
-
end
|
38
28
|
end
|
@@ -5,4 +5,22 @@ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../../lib')
|
|
5
5
|
require 'rubygems'
|
6
6
|
require 'spec'
|
7
7
|
require 'spec/ui'
|
8
|
+
require File.dirname(__FILE__) + '/selenium'
|
8
9
|
require 'spec/ui/selenium'
|
10
|
+
|
11
|
+
Spec::Runner.configure do |config|
|
12
|
+
|
13
|
+
config.before(:all) do
|
14
|
+
@browser = Selenium::SeleniumDriver.new("localhost", 4444, "*firefox", "http://www.google.no", 10000)
|
15
|
+
@browser.start
|
16
|
+
end
|
17
|
+
|
18
|
+
config.after(:each) do
|
19
|
+
Spec::Ui::ScreenshotFormatter.browser = @browser
|
20
|
+
end
|
21
|
+
|
22
|
+
config.after(:all) do
|
23
|
+
@browser.kill! rescue nil
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
data/examples/watir/README.txt
CHANGED
data/examples/watir/Rakefile
CHANGED
@@ -1,12 +1,17 @@
|
|
1
|
-
|
1
|
+
# You don't need to tweak the $LOAD_PATH if you have RSpec and Spec::Ui installed as gems
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../../rspec/lib')
|
3
|
+
|
4
|
+
require 'rubygems'
|
2
5
|
require 'spec/rake/spectask'
|
3
6
|
|
4
|
-
desc "Run
|
5
|
-
Spec::Rake::SpecTask.new('spec:
|
6
|
-
t.spec_files = FileList['spec/**/*.rb']
|
7
|
+
desc "Run Watir Specs"
|
8
|
+
Spec::Rake::SpecTask.new('spec:watir') do |t|
|
9
|
+
t.spec_files = FileList['spec/watir/**/*.rb']
|
10
|
+
# This line is not necessary if you have RSpec and Spec::Ui installed as gems
|
11
|
+
t.ruby_opts = ["-I#{File.dirname(__FILE__) + '/../../lib'}"]
|
7
12
|
t.spec_opts = [
|
8
|
-
'--require', 'spec/
|
13
|
+
'--require', 'rubygems,spec/ui',
|
9
14
|
'--format', 'Spec::Ui::ScreenshotFormatter:spec_report.html',
|
10
|
-
'--format', 'progress'
|
15
|
+
'--format', 'progress'
|
11
16
|
]
|
12
17
|
end
|
@@ -7,8 +7,16 @@ require 'spec'
|
|
7
7
|
require 'spec/ui'
|
8
8
|
require 'spec/ui/watir'
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
Spec::Runner.configure do |config|
|
11
|
+
config.before(:all) do
|
12
|
+
@browser = Watir::Browser.new
|
13
|
+
end
|
14
|
+
|
15
|
+
config.after(:each) do
|
16
|
+
Spec::Ui::ScreenshotFormatter.browser = @browser
|
17
|
+
end
|
18
|
+
|
19
|
+
config.after(:all) do
|
20
|
+
@browser.kill! rescue nil
|
13
21
|
end
|
14
22
|
end
|
@@ -1,11 +1,8 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../spec_helper'
|
2
2
|
|
3
3
|
describe "Google's search page" do
|
4
|
-
before(:all) do
|
5
|
-
@browser = Watir::Browser.new
|
6
|
-
end
|
7
|
-
|
8
4
|
before(:each) do
|
5
|
+
# The @browser is initialised in spec_helper.rb
|
9
6
|
@browser.goto('http://www.google.com')
|
10
7
|
end
|
11
8
|
|
@@ -26,12 +23,4 @@ describe "Google's search page" do
|
|
26
23
|
@browser.button(:name, "btnG").click
|
27
24
|
@browser.should_not have_text("Ali G")
|
28
25
|
end
|
29
|
-
|
30
|
-
after(:each) do
|
31
|
-
Spec::Ui::ScreenshotFormatter.browser = @browser
|
32
|
-
end
|
33
|
-
|
34
|
-
after(:all) do
|
35
|
-
@browser.kill! rescue nil
|
36
|
-
end
|
37
26
|
end
|
data/lib/spec/ui/formatter.rb
CHANGED
@@ -27,7 +27,7 @@ module Spec
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def png_path
|
30
|
-
raise "Screenshot not taken. You must call #{self.
|
30
|
+
raise "Screenshot not taken. You must call #{self.name}.screenshot! or #{self.name}.browser = @browser from after(:each)" if @png_path.nil?
|
31
31
|
@png_path
|
32
32
|
end
|
33
33
|
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'spec/ui/selenium/driver_ext'
|
data/lib/spec/ui/version.rb
CHANGED
data/lib/spec/ui/watir.rb
CHANGED
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
|
|
3
3
|
specification_version: 1
|
4
4
|
name: spec_ui
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.2.
|
7
|
-
date: 2007-05-
|
6
|
+
version: 0.2.2
|
7
|
+
date: 2007-05-18 00:00:00 -07:00
|
8
8
|
summary: Run UI RSpec examples with screenshot reports
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -39,7 +39,7 @@ files:
|
|
39
39
|
- lib/spec/ui/images/win32screenshot_not_installed.png
|
40
40
|
- lib/spec/ui/images/wrong_win32screenshot.png
|
41
41
|
- lib/spec/ui/screenshot_saver.rb
|
42
|
-
- lib/spec/ui/selenium
|
42
|
+
- lib/spec/ui/selenium.rb
|
43
43
|
- lib/spec/ui/selenium/driver_ext.rb
|
44
44
|
- lib/spec/ui/version.rb
|
45
45
|
- lib/spec/ui/watir.rb
|
@@ -51,7 +51,7 @@ files:
|
|
51
51
|
- examples/selenium/spec/spec_helper.rb
|
52
52
|
- examples/watir/Rakefile
|
53
53
|
- examples/watir/README.txt
|
54
|
-
- examples/watir/spec/
|
54
|
+
- examples/watir/spec/watir/find_rspecs_homepage_spec.rb
|
55
55
|
- examples/watir/spec/spec_helper.rb
|
56
56
|
- spec/spec_helper.rb
|
57
57
|
- spec/spec/ui/watir/matchers_spec.rb
|