Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated to take advantage of latest gametel features

  • Loading branch information...
commit 335194e2130c63df5d167a0d8af30d713eb36d19 1 parent b3a25e8
@cheezy authored
View
28 features/with_gametel_option.feature
@@ -6,20 +6,40 @@ Feature: Adding the --with-gametel flag
And the file "sample/Gemfile" should contain "gem 'require_all'"
And the file "sample/Gemfile" should contain "gem 'gametel'"
- Scenario: Adding page-object to env.rb
+ Scenario: Adding gametel to env.rb
When I run `testgen project sample --with-gametel`
Then a file named "sample/features/support/env.rb" should exist
+ And the file "sample/features/support/env.rb" should contain "require 'brazenhead'"
+ And the file "sample/features/support/env.rb" should contain "require 'brazenhead/server'"
And the file "sample/features/support/env.rb" should contain "require 'gametel'"
- And the file "sample/features/support/env.rb" should contain "World(Gametel::Navigation)"
+ And the file "sample/features/support/env.rb" should contain "World(Gametel::Navigation)"
+
+ Scenario: Creating the keystore
+ When I run `testgen project sample --with-gametel`
+ Then a file named "sample/features/support/env.rb" should exist
+ And the file "sample/features/support/env.rb" should contain "keystore = {"
+ And the file "sample/features/support/env.rb" should contain ":path => File.expand_path('~/.android/debug.keystore')"
+ And the file "sample/features/support/env.rb" should contain ":alias => 'androiddebugkey'"
+ And the file "sample/features/support/env.rb" should contain ":password => 'android'"
+ And the file "sample/features/support/env.rb" should contain ":keystore_password => 'android'"
+
+ Scenario: Creating the Driver and hooks
+ When I run `testgen project sample --with-gametel`
+ Then a file named "sample/features/support/env.rb" should exist
+ And the file "sample/features/support/env.rb" should contain "server = Brazenhead::Server.new(PATH_TO_APK, keystore)"
+ And the file "sample/features/support/env.rb" should contain "class Driver"
+ And the file "sample/features/support/env.rb" should contain "@driver = Driver.new"
+ And the file "sample/features/support/env.rb" should contain "server.start(APK_NAME_GOES_HERE)"
+ And the file "sample/features/support/env.rb" should contain "server.stop"
Scenario: Should not create the hooks file
When I run `testgen project sample --with-gametel`
Then a file named "sample/features/support/hooks.rb" should not exist
- Scenario: Creating the pages directory under support
+ Scenario: Creating the screens directory under support
When I run `testgen project sample --with-gametel`
Then a directory named "sample/features/support/screens" should exist
- Scenario: Creating the pages directory under lib when using --wth-lib
+ Scenario: Creating the screens directory under lib when using --wth-lib
When I run `testgen project sample --with-gametel --with-lib`
Then a directory named "sample/lib/screens" should exist
View
24 lib/testgen/generators/project/env.rb.tt
@@ -14,9 +14,33 @@ require_all 'lib'
<% end -%>
<% if with_gametel == 'true' -%>
+require 'brazenhead'
+require 'brazenhead/server'
require 'gametel'
World(Gametel::Navigation)
+
+keystore = {
+ :path => File.expand_path('~/.android/debug.keystore'),
+ :alias => 'androiddebugkey',
+ :password => 'android',
+ :keystore_password => 'android'
+}
+
+server = Brazenhead::Server.new(PATH_TO_APK, keystore)
+
+class Driver
+ include Brazenhead
+end
+
+Before do
+ @driver = Driver.new
+ server.start(APK_NAME_GOES_HERE)
+end
+
+After do
+ server.stop
+end
<% end -%>
<% unless pageobject_driver.downcase == 'none' -%>
Please sign in to comment.
Something went wrong with that request. Please try again.