@@ -3,6 +3,12 @@ def before_first
3
3
screen . must_equal catalog
4
4
end
5
5
6
+ # go back to the main page
7
+ def go_back
8
+ back
9
+ wait { ! exists { id 'ArrowButton' } } # successfully transitioned back
10
+ end
11
+
6
12
t 'before_first' do
7
13
before_first
8
14
end
@@ -13,7 +19,7 @@ def before_first
13
19
14
20
# It appears that lockForDuration doesn't.
15
21
close_app
16
- launch
22
+ launch_app
17
23
end
18
24
19
25
t 'background_app' do
@@ -32,7 +38,7 @@ def before_first
32
38
33
39
t 'close and launch' do
34
40
close_app
35
- launch
41
+ launch_app
36
42
tag ( 'UIANavigationBar' ) . name . must_equal 'UICatalog'
37
43
end
38
44
@@ -45,12 +51,12 @@ def before_first
45
51
end
46
52
47
53
t 'current_context' do
48
- current_context . must_equal nil
54
+ current_context . must_equal 'NATIVE_APP'
49
55
end
50
56
51
57
t 'switch_to_default_context' do
52
58
switch_to_default_context
53
- current_context . must_equal nil
59
+ current_context . must_equal 'NATIVE_APP'
54
60
end
55
61
56
62
t 'app_strings' do
@@ -59,21 +65,21 @@ def before_first
59
65
end
60
66
61
67
t 'action_chain' do
62
- ac = Appium ::TouchAction . new
63
- e = find_element ( :name , 'Buttons, Various uses of UIButton' )
64
- ac . press element : e , x : 10 , y : 10
65
- ac . perform
66
- back
68
+ Appium ::TouchAction . new . press ( element : id ( 'ButtonsExplain' ) ) . perform
69
+ wait { id 'ArrowButton' } # successfully transitioned to buttons page
70
+ go_back
67
71
end
68
72
69
73
t 'swipe' do
70
74
swipe start_x : 75 , start_y : 500 , end_x : 75 , end_y : 0 , duration : 800
71
75
end
72
76
73
77
t 'pinch & zoom' do
74
- text ( 'Images, Use of UIImageView' ) . click
78
+ wait { id ( 'ImagesExplain' ) . click }
79
+ # both of these appear to do nothing on iOS 8
75
80
zoom 200
76
81
pinch 75
82
+ go_back
77
83
end
78
84
79
85
t 'pull_file' do
0 commit comments