testgen 0.8.7 → 0.8.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/Readme.md +4 -0
- data/features/with_appium.feature +46 -0
- data/lib/testgen/cli.rb +4 -1
- data/lib/testgen/generators/project.rb +4 -2
- data/lib/testgen/generators/project/Gemfile.tt +5 -3
- data/lib/testgen/generators/project/env.rb.tt +30 -0
- data/lib/testgen/version.rb +1 -1
- metadata +20 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e6bbdb1712082df133c636c04d9e4712676e6de
|
4
|
+
data.tar.gz: c66e90823e72568fd6145d5f291f4abbae1d5b7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3980e40b53462e491d8b0771de8292614419b9b8d963e318f02375581798d5ec95a6c201d00ec3cbcf6ce21e90cd192e70a199e7cf39db7efa08595f4deb55a5
|
7
|
+
data.tar.gz: c0f5fe1818a07d79e74bd1ad99cf1f5c6a639782ab524ebd64f7fb0d70f76f5fbf426dcf072eeb91a87554b1817eb4d472f1636ff49095471f0014c3c88a9f89
|
data/ChangeLog
CHANGED
data/Readme.md
CHANGED
@@ -23,6 +23,10 @@ If you are testing an android application in the emulator or on a device, <em>te
|
|
23
23
|
|
24
24
|
testgen project <project_name> --with-gametel
|
25
25
|
|
26
|
+
If you want to setup project to use the Appium library
|
27
|
+
|
28
|
+
testgen project <project_name> --with-appium
|
29
|
+
|
26
30
|
## Native Windows testing
|
27
31
|
|
28
32
|
If you are testing a native windows application, <em>testgen</em> can setup the project to use the Mohawk gem.
|
@@ -0,0 +1,46 @@
|
|
1
|
+
Feature: Adding the --with-gametel flag
|
2
|
+
|
3
|
+
Scenario: Adding the require_all and appium gems to Gemfile
|
4
|
+
When I run `testgen project sample --with-appium`
|
5
|
+
Then a file named "sample/Gemfile" should exist
|
6
|
+
And the file "sample/Gemfile" should contain "gem 'require_all'"
|
7
|
+
And the file "sample/Gemfile" should contain "gem 'appium_lib'"
|
8
|
+
And the file "sample/Gemfile" should contain "gem 'cucumber'"
|
9
|
+
|
10
|
+
Scenario: Adding appium to env.rb
|
11
|
+
When I run `testgen project sample --with-appium`
|
12
|
+
Then a file named "sample/features/support/env.rb" should exist
|
13
|
+
And the file "sample/features/support/env.rb" should contain "require 'appium_lib'"
|
14
|
+
And the file "sample/features/support/env.rb" should contain "AppiumWorld.new"
|
15
|
+
|
16
|
+
Scenario: Creating the keystore
|
17
|
+
When I run `testgen project sample --with-appium`
|
18
|
+
Then a file named "sample/features/support/env.rb" should exist
|
19
|
+
And the file "sample/features/support/env.rb" should contain "@desired_caps = {"
|
20
|
+
And the file "sample/features/support/env.rb" should contain "caps: {"
|
21
|
+
And the file "sample/features/support/env.rb" should contain "platformName: 'android'"
|
22
|
+
And the file "sample/features/support/env.rb" should contain "deviceName: ENV['DEVICE_NAME']"
|
23
|
+
And the file "sample/features/support/env.rb" should contain "app: '<your_app>'"
|
24
|
+
And the file "sample/features/support/env.rb" should contain "},"
|
25
|
+
And the file "sample/features/support/env.rb" should contain "appium_lib: {"
|
26
|
+
And the file "sample/features/support/env.rb" should contain "port: 4723"
|
27
|
+
|
28
|
+
Scenario: Creating the Driver and hooks
|
29
|
+
When I run `testgen project sample --with-appium`
|
30
|
+
Then a file named "sample/features/support/env.rb" should exist
|
31
|
+
And the file "sample/features/support/env.rb" should contain "Appium::Driver.new(@desired_caps).start_driver"
|
32
|
+
And the file "sample/features/support/env.rb" should contain "Appium.promote_appium_methods Object"
|
33
|
+
And the file "sample/features/support/env.rb" should contain "driver_quit"
|
34
|
+
|
35
|
+
|
36
|
+
Scenario: Should not create the hooks file
|
37
|
+
When I run `testgen project sample --with-appium`
|
38
|
+
Then a file named "sample/features/support/hooks.rb" should not exist
|
39
|
+
|
40
|
+
Scenario: Creating the screens directory under support
|
41
|
+
When I run `testgen project sample --with-appium`
|
42
|
+
Then a directory named "sample/features/support/screens" should exist
|
43
|
+
|
44
|
+
Scenario: Creating the screens directory under lib when using --wth-lib
|
45
|
+
When I run `testgen project sample --with-appium --with-lib`
|
46
|
+
Then a directory named "sample/lib/screens" should exist
|
data/lib/testgen/cli.rb
CHANGED
@@ -9,12 +9,15 @@ module TestGen
|
|
9
9
|
method_option :with_lib, :type => :boolean, :desc => "Place shared objects under lib directory"
|
10
10
|
method_option :with_gametel, :type => :boolean, :desc => "Add support for gametel gem"
|
11
11
|
method_option :with_mohawk, :type => :boolean, :desc => 'Adds support for mohawk gem'
|
12
|
+
method_option :with_appium, :type => :boolean, :desc => 'Add support for appium'
|
13
|
+
|
12
14
|
def project(name)
|
13
15
|
driver = options[:pageobject_driver].nil? ? 'none' : options[:pageobject_driver]
|
14
16
|
with_lib = options[:with_lib] ? 'true' : 'false'
|
15
17
|
with_gametel = options[:with_gametel] ? 'true' : 'false'
|
16
18
|
with_mohawk = options[:with_mohawk] ? 'true' : 'false'
|
17
|
-
|
19
|
+
with_appium = options[:with_appium] ? 'true' : 'false'
|
20
|
+
TestGen::Generators::Project.start([name, driver, with_lib, with_gametel, with_mohawk, with_appium])
|
18
21
|
end
|
19
22
|
|
20
23
|
end
|
@@ -10,6 +10,8 @@ module TestGen
|
|
10
10
|
argument :with_lib, :type => :string, :desc => 'Place all shared objects in the lib directory'
|
11
11
|
argument :with_gametel, :type => :string, :desc => 'Add support for the gametel gem'
|
12
12
|
argument :with_mohawk, :type => :string, :desc => 'Add support for the mohawk gem'
|
13
|
+
argument :with_appium, :type => :string, :desc => 'Add support for appium gem'
|
14
|
+
|
13
15
|
desc "Generates a project structure for testing with Cucumber"
|
14
16
|
|
15
17
|
def self.source_root
|
@@ -53,10 +55,10 @@ module TestGen
|
|
53
55
|
def create_pages_directory
|
54
56
|
if gen_lib
|
55
57
|
empty_directory("#{name}/lib/pages") unless no_driver_selected
|
56
|
-
empty_directory("#{name}/lib/screens") if with_gametel == 'true'
|
58
|
+
empty_directory("#{name}/lib/screens") if with_gametel == 'true'|| with_mohawk == 'true' || with_appium == 'true'
|
57
59
|
else
|
58
60
|
empty_directory("#{name}/features/support/pages") unless no_driver_selected
|
59
|
-
empty_directory("#{name}/features/support/screens") if with_gametel == 'true'
|
61
|
+
empty_directory("#{name}/features/support/screens") if with_gametel == 'true' || with_mohawk == 'true' || with_appium == 'true'
|
60
62
|
end
|
61
63
|
end
|
62
64
|
|
@@ -6,16 +6,18 @@ gem 'rake'
|
|
6
6
|
<% unless pageobject_driver.downcase == 'none' -%>
|
7
7
|
gem 'page-object'
|
8
8
|
<% end -%>
|
9
|
-
<% if with_lib == 'true' or with_gametel == 'true' -%>
|
9
|
+
<% if with_lib == 'true' or with_gametel == 'true' or with_appium == 'true' -%>
|
10
10
|
gem 'require_all'
|
11
11
|
<% end -%>
|
12
12
|
<% if with_gametel == 'true' -%>
|
13
13
|
gem 'gametel'
|
14
|
-
gem 'rake'
|
15
14
|
<% end -%>
|
16
15
|
<% if with_mohawk == 'true' -%>
|
17
16
|
gem 'mohawk', '~> 0.1'
|
18
17
|
gem 'ffi', '1.9.0'
|
19
18
|
gem 'win32screenshot'
|
20
|
-
|
19
|
+
<% end -%>
|
20
|
+
<% if with_appium =='true' -%>
|
21
|
+
gem 'appium_lib'
|
22
|
+
gem 'selenium-cucumber'
|
21
23
|
<% end -%>
|
@@ -40,6 +40,36 @@ After do
|
|
40
40
|
Gametel.stop
|
41
41
|
end
|
42
42
|
<% end -%>
|
43
|
+
<% if with_appium == 'true' -%>
|
44
|
+
require 'appium_lib'
|
45
|
+
|
46
|
+
|
47
|
+
class AppiumWorld
|
48
|
+
end
|
49
|
+
|
50
|
+
PROJECT_DIR = File.expand_path(File.dirname(__FILE__) + '../../..')
|
51
|
+
|
52
|
+
@desired_caps = {
|
53
|
+
caps: {
|
54
|
+
platformName: 'android',
|
55
|
+
deviceName: ENV['DEVICE_NAME'],
|
56
|
+
app: '<your_app>',
|
57
|
+
},
|
58
|
+
appium_lib: {
|
59
|
+
port: 4723
|
60
|
+
}
|
61
|
+
}
|
62
|
+
Appium::Driver.new(@desired_caps).start_driver
|
63
|
+
Appium.promote_appium_methods Object
|
64
|
+
|
65
|
+
World do
|
66
|
+
AppiumWorld.new
|
67
|
+
end
|
68
|
+
|
69
|
+
at_exit do
|
70
|
+
driver_quit
|
71
|
+
end
|
72
|
+
<% end -%>
|
43
73
|
<% unless pageobject_driver.downcase == 'none' -%>
|
44
74
|
World(PageObject::PageFactory)
|
45
75
|
<% end -%>
|
data/lib/testgen/version.rb
CHANGED
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
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.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeffrey S. Morgan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.17.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.17.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: cucumber
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 1.2.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 2.13.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 2.13.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: require_all
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: aruba
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
description: A collection of generators build things for testers using Cucumber
|
@@ -88,9 +88,9 @@ executables:
|
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
|
-
- .gitignore
|
92
|
-
- .ruby-gemset
|
93
|
-
- .ruby-version
|
91
|
+
- ".gitignore"
|
92
|
+
- ".ruby-gemset"
|
93
|
+
- ".ruby-version"
|
94
94
|
- ChangeLog
|
95
95
|
- Gemfile
|
96
96
|
- Guardfile
|
@@ -102,6 +102,7 @@ files:
|
|
102
102
|
- features/support/hooks.rb
|
103
103
|
- features/testgen_project.feature
|
104
104
|
- features/testgen_with_pageobject.feature
|
105
|
+
- features/with_appium.feature
|
105
106
|
- features/with_gametel_option.feature
|
106
107
|
- features/with_lib_option.feature
|
107
108
|
- features/with_mohawk_option.feature
|
@@ -125,17 +126,17 @@ require_paths:
|
|
125
126
|
- lib
|
126
127
|
required_ruby_version: !ruby/object:Gem::Requirement
|
127
128
|
requirements:
|
128
|
-
- -
|
129
|
+
- - ">="
|
129
130
|
- !ruby/object:Gem::Version
|
130
131
|
version: '0'
|
131
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
133
|
requirements:
|
133
|
-
- -
|
134
|
+
- - ">="
|
134
135
|
- !ruby/object:Gem::Version
|
135
136
|
version: '0'
|
136
137
|
requirements: []
|
137
138
|
rubyforge_project: testgen
|
138
|
-
rubygems_version: 2.
|
139
|
+
rubygems_version: 2.5.1
|
139
140
|
signing_key:
|
140
141
|
specification_version: 4
|
141
142
|
summary: Generators for testers using Cucumber
|
@@ -144,6 +145,7 @@ test_files:
|
|
144
145
|
- features/support/hooks.rb
|
145
146
|
- features/testgen_project.feature
|
146
147
|
- features/testgen_with_pageobject.feature
|
148
|
+
- features/with_appium.feature
|
147
149
|
- features/with_gametel_option.feature
|
148
150
|
- features/with_lib_option.feature
|
149
151
|
- features/with_mohawk_option.feature
|