frank-cucumber 1.1.11.pre1 → 1.1.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -109,6 +109,7 @@ module Frank
109
109
 
110
110
  run %Q|xcodebuild -xcconfig Frank/frankify.xcconfig #{build_steps} #{extra_opts} #{separate_configuration_option} -sdk iphonesimulator DEPLOYMENT_LOCATION=YES DSTROOT="#{build_output_dir}" FRANK_LIBRARY_SEARCH_PATHS="\\"#{frank_lib_directory}\\""|
111
111
  end
112
+ exit $?.exitstatus if not $?.success?
112
113
 
113
114
  app = Dir.glob("#{build_output_dir}/*.app").delete_if { |x| x =~ /\/#{app_bundle_name}$/ }
114
115
  app = app.first
@@ -251,7 +252,7 @@ module Frank
251
252
  projects = workspace.projpaths
252
253
 
253
254
  projects.each { | current_project |
254
- lines = `xcodebuild -project #{current_project} -list`
255
+ lines = `xcodebuild -project "#{current_project}" -list`
255
256
 
256
257
  found_schemes = false
257
258
 
@@ -304,7 +305,7 @@ module Frank
304
305
 
305
306
  if options["target"] != nil
306
307
  project.targets.each { | proj_target |
307
- if target.name == options["target"]
308
+ if proj_target.name == options["target"]
308
309
  target = proj_target
309
310
  end
310
311
  }
@@ -4,16 +4,46 @@ module Frank module Cucumber
4
4
 
5
5
  module FrankHelper
6
6
 
7
+ def perform_action_on_selector( action, selector )
8
+ touch_successes = frankly_map( selector, action )
9
+ raise "could not find anything matching [#{selector}] which supports that action" if touch_successes == nil or touch_successes.empty?
10
+ raise "some objects do not support that action" if touch_successes.include?(false)
11
+ end
12
+
7
13
  def simulate_click( selector )
8
- touch_successes = frankly_map( selector, 'FEX_simulateClick' )
9
- raise "could not find anything matching [#{selector}] to press" if touch_successes == nil or touch_successes.empty?
10
- raise "some objects do not support the press action" if touch_successes.include?(false)
14
+ perform_action_on_selector( 'FEX_simulateClick', selector )
11
15
  end
12
16
 
13
17
  def bring_to_front( selector )
14
- touch_successes = frankly_map( selector, 'FEX_raise' )
15
- raise "could not find anything matching [#{selector}] to bring to the front" if touch_successes == nil or touch_successes.empty?
16
- raise "some objects do not support the bring to front action" if touch_successes.include?(false)
18
+ perform_action_on_selector( 'FEX_raise', selector )
19
+ end
20
+
21
+ def cancel( selector )
22
+ perform_action_on_selector( 'FEX_cancel', selector )
23
+ end
24
+
25
+ def confirm( selector )
26
+ perform_action_on_selector( 'FEX_confirm', selector )
27
+ end
28
+
29
+ def decrement_value( selector )
30
+ perform_action_on_selector( 'FEX_decrement', selector )
31
+ end
32
+
33
+ def delete_value( selector )
34
+ perform_action_on_selector( 'FEX_delete', selector )
35
+ end
36
+
37
+ def increment_value( selector )
38
+ perform_action_on_selector( 'FEX_increment', selector )
39
+ end
40
+
41
+ def pick( selector )
42
+ perform_action_on_selector( 'FEX_pick', selector )
43
+ end
44
+
45
+ def show_menu( selector )
46
+ perform_action_on_selector( 'FEX_showMenu', selector )
17
47
  end
18
48
 
19
49
  end
@@ -29,6 +29,19 @@ module HostScripting
29
29
  APPLESCRIPT}
30
30
  end
31
31
 
32
+ def quit_double_simulator
33
+ %x{osascript<<APPLESCRIPT
34
+ activate application "iPhone Simulator"
35
+ tell application "System Events"
36
+ tell process "#{Localize.t(:iphone_simulator)}"
37
+ if (value of static text 1 of window 1) is "#{Localize.t(:only_one_simulator)}" then
38
+ click button 1 of window 1
39
+ end if
40
+ end tell
41
+ end tell
42
+ }
43
+ end
44
+
32
45
  def simulator_reset_data
33
46
  %x{osascript<<APPLESCRIPT
34
47
  activate application "iPhone Simulator"
@@ -11,15 +11,15 @@ module KeyboardHelper
11
11
  # An implicit return is appended to the key sequence, unless you explicitly specify otherwise by setting the :append_return option to false.
12
12
  #
13
13
  # @example
14
- # # press the X, -, Y, and z keys on the
14
+ # # press the X, -, Y, and z keys on the
15
15
  # # iOS keyboard, then press return
16
16
  # type_into_keyboard("X-Yz")
17
17
  #
18
- # # press the 1, 2, and 3 keys on the
18
+ # # press the 1, 2, and 3 keys on the
19
19
  # # iOS keyboard, but don't press return afterwards
20
20
  # type_into_keyboard("123", :append_return => false)
21
21
  #
22
- # # press the 1, 2, and 3 keys on the
22
+ # # press the 1, 2, and 3 keys on the
23
23
  # # iOS keyboard, but don't press return afterwards
24
24
  # type_into_keyboard("123", :append_return => false)
25
25
  #
@@ -34,11 +34,27 @@ module KeyboardHelper
34
34
  if( options[:append_return] )
35
35
  text_to_type = text_to_type+"\n" unless text_to_type.end_with?("\n")
36
36
  end
37
- res = frank_server.send_post(
37
+ res = frank_server.send_post(
38
38
  'type_into_keyboard',
39
39
  :text_to_type => text_to_type
40
40
  )
41
41
  Frank::Cucumber::Gateway.evaluate_frankly_response( res, "typing the following into the keyboard '#{text_to_type}'" )
42
42
  end
43
+
44
+ def type_shortcut(*args)
45
+ if args[0].kind_of?(Array)
46
+ return type_shortcut(*args)
47
+ else
48
+ key = args.pop
49
+
50
+ res = frank_server.send_post(
51
+ 'type_into_keyboard',
52
+ :text_to_type => key,
53
+ :modifiers => args
54
+ )
55
+
56
+ Frank::Cucumber::Gateway.evaluate_frankly_response(res, "typing the following shortcut into the keyboard '#{key}' with modifiers #{args}")
57
+ end
58
+ end
43
59
  end
44
60
  end end
@@ -52,19 +52,17 @@ module Launcher
52
52
  end
53
53
 
54
54
  num_timeouts = 0
55
- loop do
56
- begin
57
- simulator.relaunch
58
- wait_for_frank_to_come_up
59
- break # if we make it this far without an exception then we're good to move on
60
-
61
- rescue Timeout::Error
62
- num_timeouts += 1
63
- puts "Encountered #{num_timeouts} timeouts while launching the app."
64
- if num_timeouts > 3
65
- raise "Encountered #{num_timeouts} timeouts in a row while trying to launch the app."
66
- end
55
+ begin
56
+ simulator.relaunch
57
+ wait_for_frank_to_come_up
58
+ rescue Timeout::Error
59
+ num_timeouts += 1
60
+ puts "Encountered #{num_timeouts} timeouts while launching the app."
61
+ if num_timeouts > 3
62
+ raise "Encountered #{num_timeouts} timeouts in a row while trying to launch the app."
67
63
  end
64
+ quit_double_simulator
65
+ retry
68
66
  end
69
67
 
70
68
  end
@@ -8,6 +8,7 @@ en:
8
8
  simulate_memory_warning: Simulate Memory Warning
9
9
  toggle_in_call_status_bar: Toggle In-Call Status Bar
10
10
  simulate_hardware_keyboard: Simulate Hardware Keyboard
11
+ only_one_simulator: Only one iOS Simulator can run at a time.
11
12
 
12
13
  fr:
13
14
  iphone_simulator: Simulateur iOS
@@ -19,6 +20,7 @@ fr:
19
20
  simulate_memory_warning: Simuler un avertissement de mémoire
20
21
  toggle_in_call_status_bar: Afficher/Masquer la barre d'état d'appel en cour
21
22
  simulate_hardware_keyboard: Simuler un clavier matériel
23
+ only_one_simulator: Un seul Simulateur iOS peut être exécuté à la fois.
22
24
 
23
25
  de:
24
26
  iphone_simulator: iOS-Simulator
@@ -30,6 +32,7 @@ de:
30
32
  simulate_memory_warning: Speicherwarnhinweis simulieren
31
33
  toggle_in_call_status_bar: Status für eingeh. Anrufe ein/aus
32
34
  simulate_hardware_keyboard: Hardware-Tastatur simulieren
35
+ only_one_simulator: Es kann jeweils nur eine iOS-Simulator-Instanz aktiv sein.
33
36
 
34
37
  ru:
35
38
  iphone_simulator: Симулятор iOS
@@ -41,6 +44,7 @@ ru:
41
44
  simulate_memory_warning: Симулировать предупреждение о нехватке памяти
42
45
  toggle_in_call_status_bar: Переключить на строку состояния поступающего вызова
43
46
  simulate_hardware_keyboard: Симулировать физическую клавиатуру
47
+ only_one_simulator: Два и более Симуляторов iOS не могут быть запущены одновременно.
44
48
 
45
49
  zh:
46
50
  iphone_simulator: iOS 模拟器
@@ -52,6 +56,7 @@ zh:
52
56
  simulate_memory_warning: 模拟内存警告
53
57
  toggle_in_call_status_bar: 切换呼叫状态栏
54
58
  simulate_hardware_keyboard: 模拟硬件键盘
59
+ only_one_simulator: 一次只能运行一个“iOS 模拟器”。
55
60
 
56
61
  ja:
57
62
  iphone_simulator: iOSシミュレータ
@@ -63,6 +68,7 @@ ja:
63
68
  simulate_memory_warning: メモリ警告をシミュレート
64
69
  toggle_in_call_status_bar: 着信ステータスバーを切り替える
65
70
  simulate_hardware_keyboard: ハードウェアキーボードをシミュレート
71
+ only_one_simulator: 実行できるiOSシミュレータは1度に1つのみです。
66
72
 
67
73
  es:
68
74
  iphone_simulator: Simulador iOS
@@ -74,3 +80,4 @@ es:
74
80
  simulate_memory_warning: Simular aviso de memoria
75
81
  toggle_in_call_status_bar: Activar/Desactivar barra de estado durante llamada
76
82
  simulate_hardware_keyboard: Simular teclado físico
83
+ only_one_simulator: Sólo se puede ejecutar un Simulador iOS a la vez.
@@ -1,5 +1,5 @@
1
1
  module Frank
2
2
  module Cucumber
3
- VERSION = "1.1.11.pre1"
3
+ VERSION = "1.1.12"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frank-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.11.pre1
5
- prerelease: 7
4
+ version: 1.1.12
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Pete Hodgson
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-24 00:00:00.000000000 Z
13
+ date: 2013-05-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: cucumber
@@ -376,9 +376,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
376
376
  required_rubygems_version: !ruby/object:Gem::Requirement
377
377
  none: false
378
378
  requirements:
379
- - - ! '>'
379
+ - - ! '>='
380
380
  - !ruby/object:Gem::Version
381
- version: 1.3.1
381
+ version: '0'
382
382
  requirements: []
383
383
  rubyforge_project:
384
384
  rubygems_version: 1.8.24