mirror of
https://github.com/flutter/flutter
synced 2024-08-27 12:00:58 +00:00
[platform_view]longer wait time for element (#108907)
This commit is contained in:
parent
f1b42bb08f
commit
28fdb64509
|
@ -4,6 +4,8 @@
|
|||
|
||||
@import XCTest;
|
||||
|
||||
static const CGFloat kStandardTimeOut = 60.0;
|
||||
|
||||
@interface XCUIElement(KeyboardFocus)
|
||||
@property (nonatomic, readonly) BOOL flt_hasKeyboardFocus;
|
||||
@end
|
||||
|
@ -27,18 +29,17 @@
|
|||
[self.app launch];
|
||||
}
|
||||
- (void)testPlatformViewFocus {
|
||||
|
||||
XCUIElement *entranceButton = self.app.buttons[@"platform view focus test"];
|
||||
XCTAssertTrue([entranceButton waitForExistenceWithTimeout:1]);
|
||||
XCTAssertTrue([entranceButton waitForExistenceWithTimeout:kStandardTimeOut], @"The element tree is %@", self.app.debugDescription);
|
||||
[entranceButton tap];
|
||||
|
||||
XCUIElement *platformView = self.app.textFields[@"platform_view[0]"];
|
||||
XCTAssertTrue([platformView waitForExistenceWithTimeout:1]);
|
||||
XCTAssertTrue([platformView waitForExistenceWithTimeout:kStandardTimeOut]);
|
||||
XCUIElement *flutterTextField = self.app.textFields[@"Flutter Text Field"];
|
||||
XCTAssertTrue([flutterTextField waitForExistenceWithTimeout:1]);
|
||||
XCTAssertTrue([flutterTextField waitForExistenceWithTimeout:kStandardTimeOut]);
|
||||
|
||||
[flutterTextField tap];
|
||||
XCTAssertTrue([self.app.windows.element waitForExistenceWithTimeout:1]);
|
||||
XCTAssertTrue([self.app.windows.element waitForExistenceWithTimeout:kStandardTimeOut]);
|
||||
XCTAssertFalse(platformView.flt_hasKeyboardFocus);
|
||||
XCTAssertTrue(flutterTextField.flt_hasKeyboardFocus);
|
||||
|
||||
|
|
Loading…
Reference in a new issue