forked from flutter/packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[google_map_flutter_ios] fix
didBeginDraggingMarker
typo (flutter#5085
) Fix the typo in `didBeginDraggingMarker` The UITest will drag the marker then looking for the text indications that all the dragging callbacks are called, like the screenshot below: <img width="388" alt="Screenshot 2023-10-06 at 3 36 46 PM" src="https://github.com/flutter/packages/assets/3756895/d9e78c99-bb1d-4f47-a0d4-2f699fa9f743"> fixes flutter/flutter#135778
- Loading branch information
Chris Yang
authored
Oct 10, 2023
1 parent
9804d95
commit 158ec1f
Showing
8 changed files
with
235 additions
and
13 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...aps_flutter_ios/example/ios13/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
...ogle_maps_flutter/google_maps_flutter_ios/example/ios13/ios/RunnerUITests/RunnerUITests.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#import <XCTest/XCTest.h> | ||
|
||
static const NSTimeInterval kWaitTime = 60; | ||
|
||
@interface RunnerUITests : XCTestCase | ||
|
||
@end | ||
|
||
@implementation RunnerUITests | ||
|
||
- (void)testMarkerDraggingCallbacks { | ||
XCUIApplication *application = [[XCUIApplication alloc] init]; | ||
[application launch]; | ||
XCUIElement *placeMarkerButton = application.staticTexts[@"Place marker"]; | ||
if (![placeMarkerButton waitForExistenceWithTimeout:kWaitTime]) { | ||
NSLog(@"application.debugDescription: %@", application.debugDescription); | ||
XCTFail(@"Failed to find the Place marker button."); | ||
} | ||
[placeMarkerButton tap]; | ||
|
||
XCUIElement *Add = application.buttons[@"Add"]; | ||
if (![Add waitForExistenceWithTimeout:kWaitTime]) { | ||
NSLog(@"application.debugDescription: %@", application.debugDescription); | ||
XCTFail(@"Failed to find the Add button."); | ||
} | ||
[Add tap]; | ||
|
||
XCUIElement *marker = application.buttons[@"marker_id_1"]; | ||
if (![marker waitForExistenceWithTimeout:kWaitTime]) { | ||
NSLog(@"application.debugDescription: %@", application.debugDescription); | ||
XCTFail(@"Failed to find the marker."); | ||
} | ||
[marker tap]; | ||
|
||
XCUIElement *toggleDraggable = application.buttons[@"toggle draggable"]; | ||
if (![toggleDraggable waitForExistenceWithTimeout:kWaitTime]) { | ||
NSLog(@"application.debugDescription: %@", application.debugDescription); | ||
XCTFail(@"Failed to find the toggle draggable."); | ||
} | ||
[toggleDraggable tap]; | ||
|
||
// Drag marker to center | ||
[marker pressForDuration:5 thenDragToElement:application]; | ||
|
||
NSPredicate *predicateDragStart = | ||
[NSPredicate predicateWithFormat:@"label CONTAINS[c] %@", @"_onMarkerDragStart"]; | ||
NSPredicate *predicateDrag = | ||
[NSPredicate predicateWithFormat:@"label CONTAINS[c] %@", @"_onMarkerDrag called"]; | ||
NSPredicate *predicateDragEnd = | ||
[NSPredicate predicateWithFormat:@"label CONTAINS[c] %@", @"_onMarkerDragEnd"]; | ||
|
||
XCUIElement *dragStart = [application.staticTexts matchingPredicate:predicateDragStart].element; | ||
if (![dragStart waitForExistenceWithTimeout:kWaitTime]) { | ||
NSLog(@"application.debugDescription: %@", application.debugDescription); | ||
XCTFail(@"Failed to find the _onMarkerDragStart."); | ||
} | ||
XCTAssertTrue(dragStart.exists); | ||
|
||
XCUIElement *drag = [application.staticTexts matchingPredicate:predicateDrag].element; | ||
if (![drag waitForExistenceWithTimeout:kWaitTime]) { | ||
NSLog(@"application.debugDescription: %@", application.debugDescription); | ||
XCTFail(@"Failed to find the _onMarkerDrag."); | ||
} | ||
XCTAssertTrue(drag.exists); | ||
|
||
XCUIElement *dragEnd = [application.staticTexts matchingPredicate:predicateDragEnd].element; | ||
if (![dragEnd waitForExistenceWithTimeout:kWaitTime]) { | ||
NSLog(@"application.debugDescription: %@", application.debugDescription); | ||
XCTFail(@"Failed to find the _onMarkerDragEnd."); | ||
} | ||
XCTAssertTrue(dragEnd.exists); | ||
} | ||
|
||
@end |
Oops, something went wrong.