Skip to content

Commit 335100e

Browse files
Move iOS helpers to common.rb
1 parent ab915cf commit 335100e

File tree

1 file changed

+3
-36
lines changed

1 file changed

+3
-36
lines changed

ios_tests/lib/run.rb

+3-36
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
require 'rubygems'
22
require 'spec'
33
require 'hashdiff'
4-
54
require_relative '../../lib/appium_lib'
5+
require_relative 'common'
66

77
=begin
88
Run all Android tests:
@@ -16,41 +16,6 @@
1616
a = OpenStruct.new x: 'ok'
1717
raise 'x issue' unless a.x == 'ok'
1818

19-
# common methods
20-
def back_click(opts={})
21-
opts ||= {}
22-
search_wait = opts.fetch(:wait, 60 * 1.7)
23-
# iOS may have multiple 'back' buttons
24-
# select the first displayed? back button.
25-
wait(search_wait) do
26-
button_exact('Back').click
27-
end
28-
end
29-
30-
def leave_textfields
31-
back_click
32-
screen.must_equal catalog
33-
end
34-
35-
def go_to_textfields
36-
screen.must_equal catalog
37-
wait_true { text('textfield').click; screen == 'TextFields' } # wait for screen transition
38-
screen.must_equal 'TextFields'
39-
end
40-
41-
def screen
42-
$driver.find_element(:class, 'UIANavigationBar').name
43-
end
44-
45-
def catalog
46-
'UICatalog'
47-
end
48-
49-
##
50-
51-
caps = Appium.load_appium_txt file: File.expand_path('..', __FILE__), verbose: true
52-
caps = caps.merge({ appium_lib: { debug: true, wait: 30 } })
53-
5419
dir = File.expand_path '..', __FILE__
5520
device = ARGV[0].downcase.strip
5621
devices = %w[ android selendroid ios ]
@@ -59,6 +24,8 @@ def catalog
5924
one_test = ARGV[1]
6025
test_dir = "/#{device}/"
6126

27+
caps = Appium.load_appium_txt file: File.expand_path('..', __FILE__), verbose: true
28+
caps = caps.merge({ appium_lib: { debug: true, wait: 30 } })
6229
caps[:app] = ENV['SAUCE_PATH'] if ENV['SAUCE_USERNAME'] && ENV['SAUCE_ACCESS_KEY']
6330

6431
trace_files = []

0 commit comments

Comments
 (0)