Skip to content

Commit a8d8f4c

Browse files
authored
[google_maps_flutter_ios] Remove iOS 14 availability check from example UI tests (flutter#13218)
Minimum for the oldest google_maps_flutter_ios sdk package is iOS 14: https://github.com/flutter/packages/blob/01d08731727c8dfcd9519cdbf376aa40499dc8f7/packages/google_maps_flutter/google_maps_flutter_ios/ios/google_maps_flutter_ios.podspec#L34 Remove old availability checks. ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent eb25929 commit a8d8f4c

4 files changed

Lines changed: 16 additions & 48 deletions

File tree

‎packages/google_maps_flutter/google_maps_flutter_ios/example/ios/RunnerUITests/GoogleMapsUITests.swift‎

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,11 @@ class GoogleMapsUITests: XCTestCase {
1919
app.launch()
2020

2121
addUIInterruptionMonitor(withDescription: "Permission popups") { interruptingElement in
22-
if #available(iOS 14, *) {
23-
let locationPermission = interruptingElement.buttons["Allow While Using App"]
24-
if !locationPermission.waitForExistence(timeout: kWaitTime) {
25-
XCTFail("Failed due to not able to find locationPermission button")
26-
}
27-
locationPermission.tap()
28-
} else {
29-
let allow = interruptingElement.buttons["Allow"]
30-
if !allow.waitForExistence(timeout: kWaitTime) {
31-
XCTFail("Failed due to not able to find Allow button")
32-
}
33-
allow.tap()
22+
let locationPermission = interruptingElement.buttons["Allow While Using App"]
23+
if !locationPermission.waitForExistence(timeout: kWaitTime) {
24+
XCTFail("Failed due to not able to find locationPermission button")
3425
}
26+
locationPermission.tap()
3527
return true
3628
}
3729
}

‎packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerUITests/GoogleMapsUITests.swift‎

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,11 @@ class GoogleMapsUITests: XCTestCase {
1919
app.launch()
2020

2121
addUIInterruptionMonitor(withDescription: "Permission popups") { interruptingElement in
22-
if #available(iOS 14, *) {
23-
let locationPermission = interruptingElement.buttons["Allow While Using App"]
24-
if !locationPermission.waitForExistence(timeout: kWaitTime) {
25-
XCTFail("Failed due to not able to find locationPermission button")
26-
}
27-
locationPermission.tap()
28-
} else {
29-
let allow = interruptingElement.buttons["Allow"]
30-
if !allow.waitForExistence(timeout: kWaitTime) {
31-
XCTFail("Failed due to not able to find Allow button")
32-
}
33-
allow.tap()
22+
let locationPermission = interruptingElement.buttons["Allow While Using App"]
23+
if !locationPermission.waitForExistence(timeout: kWaitTime) {
24+
XCTFail("Failed due to not able to find locationPermission button")
3425
}
26+
locationPermission.tap()
3527
return true
3628
}
3729
}

‎packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerUITests/GoogleMapsUITests.swift‎

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,11 @@ class GoogleMapsUITests: XCTestCase {
1919
app.launch()
2020

2121
addUIInterruptionMonitor(withDescription: "Permission popups") { interruptingElement in
22-
if #available(iOS 14, *) {
23-
let locationPermission = interruptingElement.buttons["Allow While Using App"]
24-
if !locationPermission.waitForExistence(timeout: kWaitTime) {
25-
XCTFail("Failed due to not able to find locationPermission button")
26-
}
27-
locationPermission.tap()
28-
} else {
29-
let allow = interruptingElement.buttons["Allow"]
30-
if !allow.waitForExistence(timeout: kWaitTime) {
31-
XCTFail("Failed due to not able to find Allow button")
32-
}
33-
allow.tap()
22+
let locationPermission = interruptingElement.buttons["Allow While Using App"]
23+
if !locationPermission.waitForExistence(timeout: kWaitTime) {
24+
XCTFail("Failed due to not able to find locationPermission button")
3425
}
26+
locationPermission.tap()
3527
return true
3628
}
3729
}

‎packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerUITests/GoogleMapsUITests.swift‎

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,11 @@ class GoogleMapsUITests: XCTestCase {
1919
app.launch()
2020

2121
addUIInterruptionMonitor(withDescription: "Permission popups") { interruptingElement in
22-
if #available(iOS 14, *) {
23-
let locationPermission = interruptingElement.buttons["Allow While Using App"]
24-
if !locationPermission.waitForExistence(timeout: kWaitTime) {
25-
XCTFail("Failed due to not able to find locationPermission button")
26-
}
27-
locationPermission.tap()
28-
} else {
29-
let allow = interruptingElement.buttons["Allow"]
30-
if !allow.waitForExistence(timeout: kWaitTime) {
31-
XCTFail("Failed due to not able to find Allow button")
32-
}
33-
allow.tap()
22+
let locationPermission = interruptingElement.buttons["Allow While Using App"]
23+
if !locationPermission.waitForExistence(timeout: kWaitTime) {
24+
XCTFail("Failed due to not able to find locationPermission button")
3425
}
26+
locationPermission.tap()
3527
return true
3628
}
3729
}

0 commit comments

Comments
 (0)