Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
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 XCUIElement* textField = self.application.textFields[@"handleScrollToTop"];
20 BOOL exists = [textField waitForExistenceWithTimeout:1];
21 XCTAssertFalse(exists, @"");
22
23 XCUIApplication* systemApp =
24 [[XCUIApplication alloc] initWithBundleIdentifier:@"com.apple.springboard"];
25 XCUIElement* statusBar = [systemApp.statusBars firstMatch];
26 if (statusBar.isHittable) {
27 [statusBar tap];
28 } else {
29 XCUICoordinate* coordinates = [statusBar coordinateWithNormalizedOffset:CGVectorMake(0, 0)];
30 [coordinates tap];
31 }
32 exists = [textField waitForExistenceWithTimeout:1];
33 XCTAssertTrue(exists, @"");
34}
35
36@end
XCUIApplication * application
int BOOL