testgen 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +4 -0
- data/features/testgen_project.feature +1 -1
- data/features/{with_mojawk_option.feature → with_mohawk_option.feature} +21 -9
- data/lib/testgen/generators/project/Gemfile.tt +2 -2
- data/lib/testgen/generators/project/env.rb.tt +13 -12
- data/lib/testgen/version.rb +1 -1
- data/testgen.gemspec +1 -0
- metadata +8 -7
data/ChangeLog
CHANGED
@@ -14,7 +14,7 @@ Feature: Generating a project with TestGen
|
|
14
14
|
Then a file named "sample/Gemfile" should exist
|
15
15
|
And the file "sample/Gemfile" should contain "gem 'cucumber'"
|
16
16
|
And the file "sample/Gemfile" should contain "gem 'rspec'"
|
17
|
-
And the file "sample/Gemfile" should contain "source '
|
17
|
+
And the file "sample/Gemfile" should contain "source 'https://rubygems.org'"
|
18
18
|
|
19
19
|
|
20
20
|
Scenario: Generating the Rakefile file
|
@@ -1,27 +1,39 @@
|
|
1
1
|
Feature: Adding the --with-mohawk flag
|
2
2
|
|
3
|
-
Scenario: Adding the
|
3
|
+
Scenario: Adding the mohawk gems to Gemfile
|
4
4
|
When I run `testgen project sample --with-mohawk`
|
5
5
|
Then a file named "sample/Gemfile" should exist
|
6
|
-
And the file "sample/Gemfile" should contain "gem '
|
7
|
-
And the file "sample/Gemfile" should contain "gem '
|
6
|
+
And the file "sample/Gemfile" should contain "gem 'mohawk', '~> 0.0.5'"
|
7
|
+
And the file "sample/Gemfile" should contain "gem 'win32screenshot'"
|
8
8
|
And the file "sample/Gemfile" should contain "gem 'rake'"
|
9
9
|
|
10
10
|
Scenario: Adding mohawk to env.rb
|
11
11
|
When I run `testgen project sample --with-mohawk`
|
12
12
|
Then a file named "sample/features/support/env.rb" should exist
|
13
|
-
And the file "sample/features/support/env.rb" should contain "require 'childprocess'"
|
14
13
|
And the file "sample/features/support/env.rb" should contain "require 'mohawk'"
|
14
|
+
And the file "sample/features/support/env.rb" should contain "require 'win32screenshot'"
|
15
15
|
And the file "sample/features/support/env.rb" should contain "World(Mohawk::Navigation)"
|
16
16
|
|
17
17
|
Scenario: Creating the Driver and hooks
|
18
18
|
When I run `testgen project sample --with-mohawk`
|
19
19
|
Then a file named "sample/features/support/env.rb" should exist
|
20
|
-
And the file "sample/features/support/env.rb" should contain "
|
21
|
-
And the file "sample/features/support/env.rb" should contain "
|
22
|
-
And the file "sample/features/support/env.rb" should contain
|
23
|
-
|
24
|
-
|
20
|
+
And the file "sample/features/support/env.rb" should contain "Mohawk.app_path = PATH_TO_EXECUTABLE"
|
21
|
+
And the file "sample/features/support/env.rb" should contain "Mohawk.start"
|
22
|
+
And the file "sample/features/support/env.rb" should contain:
|
23
|
+
"""
|
24
|
+
def capture_screenshot(name)
|
25
|
+
Dir.mkdir('screenshots') unless Dir.exist? 'screenshots'
|
26
|
+
now = Time.now.to_s.gsub(/\W+/, '.')
|
27
|
+
Win32::Screenshot::Take.of(:desktop).write("screenshots/#{now}.#{name}.png")
|
28
|
+
end
|
29
|
+
"""
|
30
|
+
And the file "sample/features/support/env.rb" should contain:
|
31
|
+
"""
|
32
|
+
After do |scenario|
|
33
|
+
capture_screenshot(scenario.name.gsub(/\W+/,'_')) if scenario.failed?
|
34
|
+
Mohawk.stop
|
35
|
+
end
|
36
|
+
"""
|
25
37
|
|
26
38
|
Scenario: Should not create the hooks file
|
27
39
|
When I run `testgen project sample --with-mohawk`
|
@@ -1,21 +1,18 @@
|
|
1
1
|
<% if with_lib == 'true' -%>
|
2
2
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '../../', 'lib'))
|
3
|
-
<% end -%>
|
4
3
|
|
4
|
+
<% end -%>
|
5
5
|
require 'rspec-expectations'
|
6
6
|
<% unless pageobject_driver.downcase == 'none' -%>
|
7
7
|
require 'page-object'
|
8
8
|
<% end -%>
|
9
|
-
|
10
9
|
<% if with_gametel == 'true' -%>
|
11
10
|
require 'gametel'
|
12
11
|
<% end -%>
|
13
|
-
|
14
12
|
<% if with_mohawk == 'true' -%>
|
15
|
-
require 'childprocess'
|
16
13
|
require 'mohawk'
|
14
|
+
require 'win32screenshot'
|
17
15
|
<% end -%>
|
18
|
-
|
19
16
|
<% if with_lib == 'true' -%>
|
20
17
|
require 'require_all'
|
21
18
|
|
@@ -43,21 +40,25 @@ After do
|
|
43
40
|
Gametel.stop
|
44
41
|
end
|
45
42
|
<% end -%>
|
46
|
-
|
47
43
|
<% unless pageobject_driver.downcase == 'none' -%>
|
48
44
|
World(PageObject::PageFactory)
|
49
45
|
<% end -%>
|
50
|
-
|
51
46
|
<% if with_mohawk == 'true' -%>
|
52
47
|
World(Mohawk::Navigation)
|
48
|
+
Mohawk.app_path = PATH_TO_EXECUTABLE
|
49
|
+
|
50
|
+
def capture_screenshot(name)
|
51
|
+
Dir.mkdir('screenshots') unless Dir.exist? 'screenshots'
|
52
|
+
now = Time.now.to_s.gsub(/\W+/, '.')
|
53
|
+
Win32::Screenshot::Take.of(:desktop).write("screenshots/#{now}.#{name}.png")
|
54
|
+
end
|
53
55
|
|
54
56
|
Before do
|
55
|
-
|
56
|
-
@process.start
|
57
|
-
RAutomation::WaitHelper.wait_until {RAutomation::Window.new(:pid => @process.pid).present?}
|
57
|
+
Mohawk.start
|
58
58
|
end
|
59
59
|
|
60
|
-
After do
|
61
|
-
|
60
|
+
After do |scenario|
|
61
|
+
capture_screenshot(scenario.name.gsub(/\W+/,'_')) if scenario.failed?
|
62
|
+
Mohawk.stop
|
62
63
|
end
|
63
64
|
<% end -%>
|
data/lib/testgen/version.rb
CHANGED
data/testgen.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testgen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -115,7 +115,7 @@ files:
|
|
115
115
|
- features/testgen_with_pageobject.feature
|
116
116
|
- features/with_gametel_option.feature
|
117
117
|
- features/with_lib_option.feature
|
118
|
-
- features/
|
118
|
+
- features/with_mohawk_option.feature
|
119
119
|
- lib/testgen.rb
|
120
120
|
- lib/testgen/cli.rb
|
121
121
|
- lib/testgen/generators/project.rb
|
@@ -127,7 +127,8 @@ files:
|
|
127
127
|
- lib/testgen/version.rb
|
128
128
|
- testgen.gemspec
|
129
129
|
homepage: http://github.com/cheezy/testgen
|
130
|
-
licenses:
|
130
|
+
licenses:
|
131
|
+
- MIT
|
131
132
|
post_install_message:
|
132
133
|
rdoc_options: []
|
133
134
|
require_paths:
|
@@ -140,7 +141,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
140
141
|
version: '0'
|
141
142
|
segments:
|
142
143
|
- 0
|
143
|
-
hash:
|
144
|
+
hash: -4210127392086382656
|
144
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
146
|
none: false
|
146
147
|
requirements:
|
@@ -149,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
150
|
version: '0'
|
150
151
|
segments:
|
151
152
|
- 0
|
152
|
-
hash:
|
153
|
+
hash: -4210127392086382656
|
153
154
|
requirements: []
|
154
155
|
rubyforge_project: testgen
|
155
156
|
rubygems_version: 1.8.25
|
@@ -163,4 +164,4 @@ test_files:
|
|
163
164
|
- features/testgen_with_pageobject.feature
|
164
165
|
- features/with_gametel_option.feature
|
165
166
|
- features/with_lib_option.feature
|
166
|
-
- features/
|
167
|
+
- features/with_mohawk_option.feature
|