|
1 | 1 | describe 'common/device' do
|
2 |
| - before_first { screen.must_equal catalog } |
3 |
| - |
4 |
| - t 'lock' do |
5 |
| - lock 5 |
6 |
| - tag('button').name.must_equal 'SlideToUnlock' |
7 |
| - |
8 |
| - # It appears that lockForDuration doesn't. |
9 |
| - closeApp |
10 |
| - launch |
11 |
| - end |
12 |
| - |
13 |
| - t 'background_app' do |
14 |
| - background_app 5 |
15 |
| - screen.must_equal catalog |
16 |
| - end |
17 |
| - |
18 |
| - t 'is_installed' do |
19 |
| - installed = is_installed? "Derrp" |
20 |
| - installed.must_equal false |
21 |
| - end |
22 |
| - |
23 |
| - t 'shake' do |
24 |
| - shake |
25 |
| - end |
26 |
| - |
27 |
| - t 'close and launch' do |
28 |
| - closeApp |
29 |
| - launch |
30 |
| - tag('navigationBar').name.must_equal 'UICatalog' |
31 |
| - end |
32 |
| - |
33 |
| - t 'reset' do |
34 |
| - reset |
35 |
| - end |
36 |
| - |
37 |
| - t 'available_contexts' do |
38 |
| - available_contexts.must_equal ["NATIVE_APP"] |
39 |
| - end |
40 |
| - |
41 |
| - t 'current_context' do |
42 |
| - current_context.must_equal nil |
43 |
| - end |
44 |
| - |
45 |
| - t 'switch_to_default_context' do |
46 |
| - switch_to_default_context |
47 |
| - current_context.must_equal nil |
48 |
| - end |
49 |
| - |
50 |
| - t 'app_strings' do |
51 |
| - app_strings.must_include "SearchBarExplain" |
52 |
| - end |
53 |
| - |
54 |
| - t 'action_chain' do |
55 |
| - ac = Appium::TouchAction.new |
56 |
| - e = find_element(:name, 'Buttons, Various uses of UIButton') |
57 |
| - ac.press element: e, x: 10, y: 10 |
58 |
| - ac.perform |
59 |
| - back |
60 |
| - end |
61 |
| - |
62 |
| - t 'swipe' do |
63 |
| - swipe start_x: 75, start_y: 500, end_x: 75, end_y: 0, duration: 0.8 |
64 |
| - end |
65 |
| - |
66 |
| - t 'pinch & zoom' do |
67 |
| - s_text('Images, Use of UIImageView').click |
68 |
| - zoom 200 |
69 |
| - pinch 75 |
70 |
| - end |
71 |
| - |
72 |
| - t 'file movement' do |
| 2 | + def before_first |
| 3 | + screen.must_equal catalog |
| 4 | + end |
| 5 | + |
| 6 | + t { before_first } |
| 7 | + |
| 8 | + t 'lock' do |
| 9 | + lock 5 |
| 10 | + tag('button').name.must_equal 'SlideToUnlock' |
| 11 | + |
| 12 | + # It appears that lockForDuration doesn't. |
| 13 | + closeApp |
| 14 | + launch |
| 15 | + end |
| 16 | + |
| 17 | + t 'background_app' do |
| 18 | + background_app 5 |
| 19 | + screen.must_equal catalog |
| 20 | + end |
| 21 | + |
| 22 | + t 'is_installed' do |
| 23 | + installed = is_installed? "Derrp" |
| 24 | + installed.must_equal false |
| 25 | + end |
| 26 | + |
| 27 | + t 'shake' do |
| 28 | + shake |
| 29 | + end |
| 30 | + |
| 31 | + t 'close and launch' do |
| 32 | + closeApp |
| 33 | + launch |
| 34 | + tag('navigationBar').name.must_equal 'UICatalog' |
| 35 | + end |
| 36 | + |
| 37 | + t 'reset' do |
| 38 | + reset |
| 39 | + end |
| 40 | + |
| 41 | + t 'available_contexts' do |
| 42 | + available_contexts.must_equal ["NATIVE_APP"] |
| 43 | + end |
| 44 | + |
| 45 | + t 'current_context' do |
| 46 | + current_context.must_equal nil |
| 47 | + end |
| 48 | + |
| 49 | + t 'switch_to_default_context' do |
| 50 | + switch_to_default_context |
| 51 | + current_context.must_equal nil |
| 52 | + end |
| 53 | + |
| 54 | + t 'app_strings' do |
| 55 | + app_strings.must_include "SearchBarExplain" |
| 56 | + end |
| 57 | + |
| 58 | + t 'action_chain' do |
| 59 | + ac = Appium::TouchAction.new |
| 60 | + e = find_element(:name, 'Buttons, Various uses of UIButton') |
| 61 | + ac.press element: e, x: 10, y: 10 |
| 62 | + ac.perform |
| 63 | + back |
| 64 | + end |
| 65 | + |
| 66 | + t 'swipe' do |
| 67 | + swipe start_x: 75, start_y: 500, end_x: 75, end_y: 0, duration: 0.8 |
| 68 | + end |
| 69 | + |
| 70 | + t 'pinch & zoom' do |
| 71 | + s_text('Images, Use of UIImageView').click |
| 72 | + zoom 200 |
| 73 | + pinch 75 |
| 74 | + end |
| 75 | + |
| 76 | + t 'file movement' do |
73 | 77 | read_file = pull_file 'Library/AddressBook/AddressBook.sqlitedb'
|
74 | 78 | read_file.start_with?('SQLite format').must_equal true
|
75 | 79 | end
|
|
0 commit comments