awetestlib 0.1.11-x86-mingw32 → 0.1.12-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
@@ -35,6 +35,7 @@ Gem::Specification.new do |s|
35
35
  s.add_dependency('json', '1.4.6') #for safari support
36
36
  s.add_dependency('pry')
37
37
  s.add_dependency('cucumber')
38
+ s.add_dependency('calabash-cucumber')
38
39
  s.require_paths = ["lib"] #,"ext"]
39
40
  s.files = `git ls-files`.split("\n")
40
41
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
data/bin/awetestlib CHANGED
@@ -19,6 +19,9 @@ elsif cmd == "netbeans_setup"
19
19
  elsif cmd == 'cucumber_setup'
20
20
  require File.join(File.dirname(__FILE__),"awetestlib-cucumber-setup")
21
21
  awetestlib_cucumber_setup
22
+ elsif cmd == 'mobile_app_setup'
23
+ require File.join(File.dirname(__FILE__),"awetestlib-mobile-app-setup")
24
+ awetestlib_mobile_app_setup
22
25
  else
23
26
 
24
27
  require 'optparse'
@@ -18,6 +18,9 @@ def print_usage
18
18
  awetestlib netbeans_setup <project_name>
19
19
  setup a netbeans project
20
20
 
21
+ awetestlib mobile_app_setup <project_name>
22
+ setup a mobile app project
23
+
21
24
  awetestlib cucumber_setup
22
25
  setup cucumber regression and provide skeleton folder structure
23
26
 
@@ -0,0 +1,31 @@
1
+ def awetestlib_mobile_app_setup
2
+ if ARGV[1].nil?
3
+ @proj_dir = "sample_mobile_app"
4
+ else
5
+ @proj_dir = ARGV[1]
6
+ end
7
+
8
+ @cucumber_dir = File.join(FileUtils.pwd, @proj_dir)
9
+ @source_dir = File.join(File.dirname(__FILE__), '..', 'setup_samples', 'sample_mobile_app')
10
+
11
+ if File.exists?(@cucumber_dir)
12
+ puts "Mobile app project directory already exists."
13
+ exit 1
14
+ end
15
+
16
+ msg("Question") do
17
+ puts "I'm about to create a mobile app project named #{ARGV[1]} in this directory" if ARGV[1]
18
+ puts "I'm about to create a mobile app project named sample_mobile_app in this directory" if ARGV[1].nil?
19
+ puts "Please hit return to confirm that's what you want."
20
+ puts "NOTE: You may need to run this command as an administrator."
21
+ end
22
+ exit 2 unless STDIN.gets.chomp == ''
23
+
24
+ FileUtils.cp_r(@source_dir, @cucumber_dir)
25
+
26
+ msg("Info") do
27
+ puts "Configuring files and settings..."
28
+ puts "A skeleton project has been created with a features and step definitions folder"
29
+ end
30
+
31
+ end
data/lib/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Awetestlib
2
- VERSION = "0.1.11"
3
- VERSION_DATE = "2012-09-06"
2
+ VERSION = "0.1.12"
3
+ VERSION_DATE = "2012-09-10"
4
4
  end
@@ -0,0 +1,14 @@
1
+ Feature:
2
+ I want to test cucumber
3
+
4
+ Scenario:
5
+
6
+ When I touch "Number"
7
+ Then I should see "Sorted by Atomic Number"
8
+ When I touch "Symbol"
9
+ Then I should see "Sorted by Atomic Symbol"
10
+ When I touch "State"
11
+ Then I should see "Grouped by State"
12
+
13
+
14
+
@@ -0,0 +1,80 @@
1
+ Then /^let me debug$/ do
2
+ binding.pry
3
+ end
4
+
5
+ Then /^I swipe "(.*?)" from the "(.*?)" label$/ do |dir, ele| #Then I swipe "up" from the "Locations" label
6
+ query("view:'UILabel' marked:'#{ele}' first", "swipeInDirection:", dir)
7
+ end
8
+
9
+ Then /^I use the keyboard to fill in the textfield marked "(.*?)" with "(.*?)"$/ do |text_field_mark, text_to_type|
10
+ query( "view marked:'#{text_field_mark}'", 'setText:', text_to_type )
11
+ end
12
+
13
+ Then /^I touch the switch with index "(.*?)"$/ do |idx| #Then I touch the switch with index "1"
14
+ touch("view:'UISwitch' index:#{idx}")
15
+ end
16
+
17
+ And /I wait (\d+) seconds?/ do |seconds| #Then I wait 3 seconds
18
+ sleep(seconds.to_i)
19
+ end
20
+
21
+ Then /^I type "(.*?)" in the text field with id "(.*?)"$/ do |txt, id|
22
+ set_text("webView css:'input' id:'#{id}'", txt)
23
+ end
24
+
25
+
26
+ Then /^I touch the WebView text "(.*?)"$/ do |txt|
27
+ sleep 1
28
+ wait_for(10){element_exists("webView css:'a' textContent:'#{txt}'")}
29
+ touch("webView css:'a' textContent:'#{txt}'")
30
+ end
31
+
32
+ Then /^I touch the WebView button "(.*?)"$/ do |txt|
33
+ sleep 1
34
+ wait_for(10){element_exists("webView css:'input' textContent:'#{txt}'")}
35
+ touch("webView css:'input' textContent:'#{txt}'")
36
+ end
37
+
38
+ Then /^I should see the WebView text "(.*?)"$/ do |txt|
39
+ sleep 1
40
+ if !query("webView textContent:'#{txt}'").empty?
41
+ true
42
+ else
43
+ fail("Did not find WebView text '#{txt}")
44
+ end
45
+ end
46
+
47
+ Then /^I should not see the WebView text "(.*?)"$/ do |txt|
48
+ sleep 1
49
+ if query("webView textContent:'#{txt}'").empty?
50
+ true
51
+ else
52
+ fail("Found WebView text '#{txt}'")
53
+ end
54
+ end
55
+
56
+ Then /^I touch the WebView button with value "(.*?)"$/ do |val|
57
+ wait_for(10){element_exists("webView css:'input' value:'#{val}'")}
58
+ touch("webView css:'input' value:'#{val}'")
59
+ end
60
+
61
+ When /^I touch the WebView link with index "(.*?)"$/ do |idx|
62
+ wait_for(10){element_exists("webView css:'a' index:#{idx}")}
63
+ touch("webView css:'a' index:#{idx}")
64
+ end
65
+
66
+ def send_command ( command )
67
+ %x{osascript<<APPLESCRIPT
68
+ tell application "System Events"
69
+ tell application "iPhone Simulator" to activate
70
+ keystroke "#{command}"
71
+ delay 1
72
+ key code 36
73
+ end tell
74
+ APPLESCRIPT}
75
+ end
76
+
77
+ When /^I send the command "([^\\"]*)"$/ do |cmd|
78
+ send_command(cmd)
79
+ end
80
+
@@ -0,0 +1,3 @@
1
+ require 'calabash-cucumber/cucumber'
2
+ require 'calabash-cucumber/calabash_steps'
3
+ require 'pry'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awetestlib
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 11
10
- version: 0.1.11
9
+ - 12
10
+ version: 0.1.12
11
11
  platform: x86-mingw32
12
12
  authors:
13
13
  - Anthony Woo
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-09-06 00:00:00 Z
19
+ date: 2012-09-10 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: watir-webdriver
@@ -280,6 +280,7 @@ executables:
280
280
  - awetestlib
281
281
  - awetestlib-cucumber-setup.rb
282
282
  - awetestlib-helpers.rb
283
+ - awetestlib-mobile-app-setup.rb
283
284
  - awetestlib-netbeans-setup.rb
284
285
  - awetestlib-regression-setup.rb
285
286
  - awetestlib-rubymine-setup.rb
@@ -300,6 +301,7 @@ files:
300
301
  - bin/awetestlib
301
302
  - bin/awetestlib-cucumber-setup.rb
302
303
  - bin/awetestlib-helpers.rb
304
+ - bin/awetestlib-mobile-app-setup.rb
303
305
  - bin/awetestlib-netbeans-setup.rb
304
306
  - bin/awetestlib-regression-setup.rb
305
307
  - bin/awetestlib-rubymine-setup.rb
@@ -332,6 +334,10 @@ files:
332
334
  - setup_samples/sample_cucumber/features/step_definitions/predefined_steps.rb
333
335
  - setup_samples/sample_cucumber/features/support/env.rb
334
336
  - setup_samples/sample_cucumber/features/yahoo_mail.feature
337
+ - setup_samples/sample_mobile_app/TheElements.zip
338
+ - setup_samples/sample_mobile_app/features/my_first.feature
339
+ - setup_samples/sample_mobile_app/features/step_definitions/predefined_webview_steps.rb
340
+ - setup_samples/sample_mobile_app/features/support/env.rb
335
341
  - setup_samples/sample_netbeans/demo.rb
336
342
  - setup_samples/sample_netbeans/nbproject/configs/Demo.properties
337
343
  - setup_samples/sample_netbeans/nbproject/private/config.properties