steam 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.textile +22 -4
  2. data/Rakefile +1 -1
  3. data/TODO +6 -0
  4. data/lib/steam/version.rb +1 -1
  5. metadata +29 -14
@@ -28,7 +28,7 @@ ENV['CLASSPATH'] = Dir["path/to/your/htmlunit/*.jar"].join(':')
28
28
  # after steam has been added to the load path, e.g. in features/support/env.rb
29
29
  Steam.config[:html_unit][:java_path] = 'path/to/your/htmlunit'</pre>
30
30
 
31
- If you're on Mac OS X then you also need to export the JAVA_HOME variable for RJB. See here for two solutions: "Installing RJB on Mac OS X":http://www.elctech.com/articles/sudo-java_home-and-mac-os-x. The visudo way worked for us. Don't forget to add yourself to the sudoers file, though.
31
+ If you are on Mac OS X and/or get an error saying that "JAVA_HOME is not set" then you need to export the JAVA_HOME variable for RJB. See here for two solutions: "Installing RJB on Mac OS X":http://www.elctech.com/articles/sudo-java_home-and-mac-os-x. The visudo way worked for us. Don't forget to add yourself to the sudoers file, though.
32
32
 
33
33
 
34
34
  <a name="configuration"></a>
@@ -41,15 +41,25 @@ E.g. in order to tweak the Java load params you can
41
41
 
42
42
  pre. Steam.config[:java_load_params] = "-Xmx2048M"
43
43
 
44
+ If you want to test your application through Cucumber features then you need to setup your Cucumber environment and steps accordingly. You can find an example for a Cucumber setup here: "env.rb":http://github.com/svenfuchs/steam/blob/master/example/cucumber/env.rb.
45
+
46
+ Steam is widely compatible with Webrat - many actions are implemented and take the same or very similar parameters as their Webrat equivalent. As a starting point you might want to copy the file "webrat_compatible_steps.rb":http://github.com/svenfuchs/steam/blob/master/example/cucumber/webrat_compatible_steps.rb over to your @features/step_definitions@ directory.
44
47
 
45
48
  <a name="usage"></a>
46
49
 
47
50
  h2. Usage
48
51
 
49
- You can use Steam by itself as well as with Cucumber. You can find an example for a Cucumber setup in examples/cucumber/env.rb.
52
+ To test your application it needs to be available through http, so usually you want to start a test server:
53
+
54
+ <pre>script/server -e test # Rails < 3.0.0
55
+ rails server -e test # Rails >= 3.0.0
56
+ rackup -E test # etc.</pre>
50
57
 
51
- Steam is widely compatible with Webrat - many actions are implemented and take the same or very similar parameters as their Webrat equivalent. You even might be able to use the default webrat_steps.rb that ships with Cucumber, *but his file is meant as an example and might be out of date.*
58
+ If you have Cucumber set up you should now be able to run your features through Steam in a separate terminal (unless you've detached your server):
52
59
 
60
+ <pre>cucumber features/*.feature</pre>
61
+
62
+ Be sure to restart the server if you make changes to your application. During development it might be useful to enable class reloading on the test server. You also might want to consider having separate environments for development with Cucumber/Steam and running the full test suite, e.g. on CI (where you keep class reloading disabled for faster test runs).
53
63
 
54
64
  <a name="demo"></a>
55
65
 
@@ -62,10 +72,18 @@ You can find a demo application here: "http://github.com/clemens/steam-demo":htt
62
72
 
63
73
  h2. Comparsion to others
64
74
 
75
+ Steam's advantages over plain Webrat:
76
+
77
+ * Steam can test your Javascript and CSS, 'nuff said
78
+
79
+ Plain Webrat's advantages over Steam:
80
+
81
+ * It's still a little bit easier to set up. All full-stack integration testing tools still require you to manage more than one process (i.e. you have to start a server for the application). Webrat can run your tests, the "browser" (session) and application all in the same process, just like classic Rails integration tests.
82
+
65
83
  Steam's advantages over Culerity/Celerity:
66
84
 
67
85
  * runs in Ruby MRI and does not require an entire JRuby environment.
68
- * Steam can have the HtmlUnit browser running in the same stack as your tests, thus making the whole thing less complex and hard to debug
86
+ * Steam can have the HtmlUnit browser running in the same process as your tests, thus making the whole thing less complex and hard to debug
69
87
  * Steam does not build on Celerity which is a quite heavy-weight Ruby wrapper around HtmlUnit adding a lot of unnecessary code
70
88
  * Steam uses "Locator":http://github.com/svenfuchs/locator
71
89
 
data/Rakefile CHANGED
@@ -16,7 +16,7 @@ begin
16
16
  s.files = FileList['[A-Z]*', 'lib/steam.rb', 'lib/{core_ext,steam}/**/*']
17
17
 
18
18
  s.add_dependency 'rjb', '>= 1.2.0'
19
- s.add_dependency 'locator', '>= 0.0.4'
19
+ s.add_dependency 'locator', '>= 0.0.6'
20
20
  end
21
21
  rescue LoadError
22
22
  puts 'Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com'
data/TODO CHANGED
@@ -5,3 +5,9 @@ HtmlUnit appears to be leaking memory; what's the deal?
5
5
  Make sure (a) that you are using the latest version of HtmlUnit, and (b) that you are calling WebClient.closeAllWindows() when you are finished with your WebClient instance.
6
6
 
7
7
 
8
+ check out for step tests: http://github.com/mattwynne/cucumber-step_definitions/blob/master/spec/spec_helper.rb
9
+
10
+ add note to readme:
11
+
12
+ Steam: can't create Java VM (RuntimeError).
13
+ JAVA_HOME was incorrectly set to /Library/Java/Home
@@ -1,3 +1,3 @@
1
1
  module Steam
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 4
9
+ version: 0.0.4
5
10
  platform: ruby
6
11
  authors:
7
12
  - Sven Fuchs
@@ -10,29 +15,37 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2010-02-28 00:00:00 +01:00
18
+ date: 2010-04-02 00:00:00 +02:00
14
19
  default_executable:
15
20
  dependencies:
16
21
  - !ruby/object:Gem::Dependency
17
22
  name: rjb
18
- type: :runtime
19
- version_requirement:
20
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
21
25
  requirements:
22
26
  - - ">="
23
27
  - !ruby/object:Gem::Version
28
+ segments:
29
+ - 1
30
+ - 2
31
+ - 0
24
32
  version: 1.2.0
25
- version:
33
+ type: :runtime
34
+ version_requirements: *id001
26
35
  - !ruby/object:Gem::Dependency
27
36
  name: locator
28
- type: :runtime
29
- version_requirement:
30
- version_requirements: !ruby/object:Gem::Requirement
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
31
39
  requirements:
32
40
  - - ">="
33
41
  - !ruby/object:Gem::Version
34
- version: 0.0.4
35
- version:
42
+ segments:
43
+ - 0
44
+ - 0
45
+ - 6
46
+ version: 0.0.6
47
+ type: :runtime
48
+ version_requirements: *id002
36
49
  description: Steam is a headless integration testing tool driving HtmlUnit to enable testing JavaScript-driven web sites.
37
50
  email: svenfuchs@artweb-design.de
38
51
  executables: []
@@ -89,18 +102,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
89
102
  requirements:
90
103
  - - ">="
91
104
  - !ruby/object:Gem::Version
105
+ segments:
106
+ - 0
92
107
  version: "0"
93
- version:
94
108
  required_rubygems_version: !ruby/object:Gem::Requirement
95
109
  requirements:
96
110
  - - ">="
97
111
  - !ruby/object:Gem::Version
112
+ segments:
113
+ - 0
98
114
  version: "0"
99
- version:
100
115
  requirements: []
101
116
 
102
117
  rubyforge_project:
103
- rubygems_version: 1.3.5
118
+ rubygems_version: 1.3.6
104
119
  signing_key:
105
120
  specification_version: 3
106
121
  summary: "Headless integration testing w/ HtmlUnit: enables testing JavaScript-driven web sites"