File tree 3 files changed +12
-4
lines changed
3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1
1
[caps]
2
2
platformName = "android"
3
3
app = "./api.apk"
4
- appPackage = ""
5
- appActivity = ""
4
+ appPackage = "io.appium.android.apis "
5
+ appActivity = ".ApiDemos "
6
6
7
7
[appium_lib]
8
8
sauce_username = ""
Original file line number Diff line number Diff line change 15
15
# regular rescue will not handle exceptions outside of StandardError hierarchy
16
16
# must rescue Exception explicitly to rescue everything
17
17
proc { wait ( *wait_time ) { raise NoMemoryError } } . must_raise Timeout ::Error
18
+ proc { wait ( 0.2 , 0.0 ) { raise NoMemoryError } } . must_raise Timeout ::Error
18
19
end
19
20
20
21
t 'ignore' do
40
41
41
42
# regular rescue will not handle exceptions outside of StandardError hierarchy
42
43
# must rescue Exception explicitly to rescue everything
43
- proc { wait ( *wait_time ) { raise NoMemoryError } } . must_raise Timeout ::Error
44
+ proc { wait_true ( *wait_time ) { raise NoMemoryError } } . must_raise Timeout ::Error
45
+ proc { wait_true ( 0.2 , 0.0 ) { raise NoMemoryError } } . must_raise Timeout ::Error
44
46
end
45
47
46
48
t 'back' do
Original file line number Diff line number Diff line change @@ -113,9 +113,15 @@ def page opts={}
113
113
# Lists package, activity, and adb shell am start -n value for current app.
114
114
# Works on local host only (not remote).
115
115
# noinspection RubyArgCount
116
+ # example line:
117
+ # "mFocusedApp=AppWindowToken{b1420058 token=Token{b128add0 ActivityRecord{b1264d10 u0 com.example.android.apis/.ApiDemos t23}}}"
116
118
def current_app
117
119
line = `adb shell dumpsys window windows` . each_line . grep ( /mFocusedApp/ ) . first . strip
118
- pair = line . split ( ' ' ) . last . gsub ( '}' , '' ) . split '/'
120
+
121
+ match = line . match ( / ([^\/ ]+\/ [^ ]+) / )
122
+ return nil unless match && match [ 1 ]
123
+
124
+ pair = match [ 1 ] . split '/'
119
125
pkg = pair . first
120
126
act = pair . last
121
127
OpenStruct . new ( line : line ,
You can’t perform that action at this time.
0 commit comments