Permalink
Browse files

updated to use new Gametel features

  • Loading branch information...
1 parent fedaf45 commit 470e8f9b7be304b7bdef2ddc708610cc36feb192 @cheezy committed Apr 8, 2013
Showing with 8 additions and 17 deletions.
  1. +5 −7 features/with_gametel_option.feature
  2. +3 −10 lib/testgen/generators/project/env.rb.tt
View
12 features/with_gametel_option.feature
@@ -1,3 +1,4 @@
+@focus
Feature: Adding the --with-gametel flag
Scenario: Adding the require_all and gametel gems to Gemfile
@@ -10,8 +11,6 @@ Feature: Adding the --with-gametel flag
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)"
@@ -27,11 +26,10 @@ Feature: Adding the --with-gametel flag
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(ACTIVITY_NAME_GOES_HERE)"
- And the file "sample/features/support/env.rb" should contain "server.stop"
+ And the file "sample/features/support/env.rb" should contain "@driver = Gametel.start(ACTIVITY_NAME_GOES_HERE, keystore)"
+ And the file "sample/features/support/env.rb" should contain "Gametel.stop"
+ And the file "sample/features/support/env.rb" should contain "Gametel.apk_path = PATH_TO_APK"
+
Scenario: Should not create the hooks file
When I run `testgen project sample --with-gametel`
View
13 lib/testgen/generators/project/env.rb.tt
@@ -8,8 +8,6 @@ require 'page-object'
<% end -%>
<% if with_gametel == 'true' -%>
-require 'brazenhead'
-require 'brazenhead/server'
require 'gametel'
<% end -%>
@@ -34,19 +32,14 @@ keystore = {
:keystore_password => 'android'
}
-server = Brazenhead::Server.new(PATH_TO_APK, keystore)
-
-class Driver
- include Brazenhead
-end
+Gametel.apk_path = PATH_TO_APK
Before do
- @driver = Driver.new
- server.start(ACTIVITY_NAME_GOES_HERE)
+ @driver = Gametel.start(ACTIVITY_NAME_GOES_HERE, keystore)
end
After do
- server.stop
+ Gametel.stop
end
<% end -%>

0 comments on commit 470e8f9

Please sign in to comment.