1
1
require 'rubygems'
2
2
require 'spec'
3
3
require 'hashdiff'
4
-
5
4
require_relative '../../lib/appium_lib'
5
+ require_relative 'common'
6
6
7
7
=begin
8
8
Run all Android tests:
16
16
a = OpenStruct . new x : 'ok'
17
17
raise 'x issue' unless a . x == 'ok'
18
18
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
-
54
19
dir = File . expand_path '..' , __FILE__
55
20
device = ARGV [ 0 ] . downcase . strip
56
21
devices = %w[ android selendroid ios ]
@@ -59,6 +24,8 @@ def catalog
59
24
one_test = ARGV [ 1 ]
60
25
test_dir = "/#{ device } /"
61
26
27
+ caps = Appium . load_appium_txt file : File . expand_path ( '..' , __FILE__ ) , verbose : true
28
+ caps = caps . merge ( { appium_lib : { debug : true , wait : 30 } } )
62
29
caps [ :app ] = ENV [ 'SAUCE_PATH' ] if ENV [ 'SAUCE_USERNAME' ] && ENV [ 'SAUCE_ACCESS_KEY' ]
63
30
64
31
trace_files = [ ]
0 commit comments