Flutter Engine
 
Loading...
Searching...
No Matches
StatusBarTest.m
Go to the documentation of this file.
1// Copyright 2020 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#import "StatusBarTest.h"
6
7@implementation StatusBarTest
8
9- (void)setUp {
10 [super setUp];
11 self.continueAfterFailure = NO;
12
13 self.application = [[XCUIApplication alloc] init];
14 self.application.launchArguments = @[ @"--tap-status-bar" ];
15 [self.application launch];
16}
17
18- (void)testTapStatusBar {
19 XCUIApplication* systemApp =
20 [[XCUIApplication alloc] initWithBundleIdentifier:@"com.apple.springboard"];
21 XCUIElement* statusBar = [systemApp.statusBars firstMatch];
22 if (statusBar.isHittable) {
23 [statusBar tap];
24 } else {
25 XCUICoordinate* coordinates = [statusBar coordinateWithNormalizedOffset:CGVectorMake(0, 0)];
26 [coordinates tap];
27 }
28
29 XCUIElement* addTextField =
30 self.application
31 .textFields[@"0,PointerChange.add,device=0,buttons=0,signalKind=PointerSignalKind.none"];
32 BOOL exists = [addTextField waitForExistenceWithTimeout:1];
33 XCTAssertTrue(exists, @"");
34 XCUIElement* downTextField =
35 self.application
36 .textFields[@"1,PointerChange.down,device=0,buttons=0,signalKind=PointerSignalKind.none"];
37 exists = [downTextField waitForExistenceWithTimeout:1];
38 XCTAssertTrue(exists, @"");
39 XCUIElement* upTextField =
40 self.application
41 .textFields[@"2,PointerChange.up,device=0,buttons=0,signalKind=PointerSignalKind.none"];
42 exists = [upTextField waitForExistenceWithTimeout:1];
43 XCTAssertTrue(exists, @"");
44}
45
46@end
XCUIApplication * application
int BOOL