From 6714d5099ad53329b0600a8b8ff6218305c74c05 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Wed, 4 Oct 2023 14:56:09 -0700 Subject: [PATCH] [webview_flutter] Fix XCUITest in Xcode 15 (#5071) For some reason tapping the "Done" button in the XCUITest stopped working in Xcode 15, but tapping it via coordinates works, so switch to that as a workaround. Fixes https://github.com/flutter/flutter/issues/134971 --- .../example/ios/RunnerUITests/URLLauncherUITests.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/url_launcher/url_launcher_ios/example/ios/RunnerUITests/URLLauncherUITests.swift b/packages/url_launcher/url_launcher_ios/example/ios/RunnerUITests/URLLauncherUITests.swift index 39ec39e30c47d..20b8c1bfec86a 100644 --- a/packages/url_launcher/url_launcher_ios/example/ios/RunnerUITests/URLLauncherUITests.swift +++ b/packages/url_launcher/url_launcher_ios/example/ios/RunnerUITests/URLLauncherUITests.swift @@ -31,7 +31,12 @@ class URLLauncherUITests: XCTestCase { XCTAssertTrue(app.buttons["ForwardButton"].waitForExistence(timeout: 30.0)) XCTAssertTrue(app.buttons["Share"].exists) XCTAssertTrue(app.buttons["OpenInSafariButton"].exists) - app.buttons["Done"].tap() + let doneButton = app.buttons["Done"] + XCTAssertTrue(doneButton.waitForExistence(timeout: 30.0)) + // This should just be doneButton.tap, but for some reason that stopped working in Xcode 15; + // tapping via coordinate works, however. + doneButton.coordinate(withNormalizedOffset: CGVector()).withOffset(CGVector(dx: 10, dy: 10)) + .tap() } } }