From 5f6fd1b9edbceb576e0c2e42829b514b526ca7a3 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Wed, 4 Oct 2023 14:27:13 -0400 Subject: [PATCH] [webview_flutter] Fix XCUITest in Xcode 15 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. --- .../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 39ec39e30c4..20b8c1bfec8 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() } } }