forked from appium/WebDriverAgent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXCUIDevice+FBHealthCheck.m
More file actions
47 lines (40 loc) · 1001 Bytes
/
XCUIDevice+FBHealthCheck.m
File metadata and controls
47 lines (40 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "XCUIDevice+FBHealthCheck.h"
#import "XCUIDevice+FBRotation.h"
#import "XCUIApplication+FBHelpers.h"
@implementation XCUIDevice (FBHealthCheck)
- (BOOL)fb_healthCheckWithApplication:(nullable XCUIApplication *)application
{
if (![self fb_elementQueryCheckWithApplication:application]) {
return NO;
}
if (![self fb_deviceInteractionCheck]) {
return NO;
}
return YES;
}
- (BOOL)fb_elementQueryCheckWithApplication:(nullable XCUIApplication *)application
{
if (!application) {
return NO;
}
if (!application.label) {
return NO;
}
if ([application descendantsMatchingType:XCUIElementTypeAny].count == 0 ) {
return NO;
}
return YES;
}
- (BOOL)fb_deviceInteractionCheck
{
[self pressButton:XCUIDeviceButtonHome];
return YES;
}
@end