Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix complete breakage of MacOS automations introduced in #2219 #2233

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 27 additions & 22 deletions docs/native/feature-parity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,30 @@ implemented. We hope that it will help you evaluate Patrol.
We strive for high feature parity across iOS and Android, but in some cases it's
impossible to reach 100%. macOS support is still in alpha, so it has no native features yet.

| **Feature** | **Android** | **iOS** | **macOS (alpha)** |
| --------------------------- | -------------- | ------------- | ----------------- |
| [Press home] ||||
| [Press back] || ❌ (no API) ||
| [Open any app] ||||
| [Open notifications] ||||
| [Tap on notification] ||||
| [Open quick settings] ||||
| [Open url] ||||
| [Toggle dark mode] ||||
| [Toggle airplane mode] | ✅ see [#1359] |||
| [Toggle cellular] ||||
| [Toggle Wi-Fi] ||||
| [Toggle Bluetooth] | ✅ see [#282] |||
| Toggle location | ✅ see [#283] | ✅ see [#326] ||
| [Tap] ||||
| [Double tap] ||||
| [Tap at coordinate] ||||
| [Enter text] ||||
| [Swipe] ||||
| [Handle permission dialogs] ||||
| Interact with WebView | ⚠️ see [#244] |||
| **Feature** | **Android** | **iOS** | **macOS (alpha)** |
| --------------------------- | -------------- | ------------------ | ----------------- |
| [Press home] ||||
| [Press back] || ❌ (no API) ||
| [Open any app] ||||
| [Open notifications] ||||
| [Tap on notification] ||||
| [Open quick settings] ||||
| [Open url] ||||
| [Toggle dark mode] ||||
| [Toggle airplane mode] | ✅ see [#1359] |||
| [Toggle cellular] ||||
| [Toggle Wi-Fi] ||||
| [Toggle Bluetooth] | ✅ see [#282] |||
| Toggle location | ✅ see [#283] | ✅ see [#326] ||
| [Tap] ||||
| [Double tap] ||||
| [Tap at coordinate] ||||
| [Enter text] ||||
| [Swipe] ||||
| [Handle permission dialogs] ||||
| Interact with WebView | ⚠️ see [#244] |||
| [Press volume down] || ✅ (simulator ❌) ||
| [Press volume up] || ✅ (simulator ❌) ||


[#244]: https://github.com/leancodepl/patrol/issues/244
Expand All @@ -45,6 +47,7 @@ impossible to reach 100%. macOS support is still in alpha, so it has no native f
[open notifications]: https://pub.dev/documentation/patrol/latest/patrol/NativeAutomator/openNotifications.html
[tap on notification]: https://pub.dev/documentation/patrol/latest/patrol/NativeAutomator/tapOnNotificationBySelector.html
[open quick settings]: https://pub.dev/documentation/patrol/latest/patrol/NativeAutomator/openQuickSettings.html
[open url]: https://pub.dev/documentation/patrol/latest/patrol/NativeAutomator/openUrl.html
[toggle dark mode]: https://pub.dev/documentation/patrol/latest/patrol/NativeAutomator/enableDarkMode.html
[toggle airplane mode]: https://pub.dev/documentation/patrol/latest/patrol/NativeAutomator/enableAirplaneMode.html
[toggle cellular]: https://pub.dev/documentation/patrol/latest/patrol/NativeAutomator/enableCellular.html
Expand All @@ -56,3 +59,5 @@ impossible to reach 100%. macOS support is still in alpha, so it has no native f
[enter text]: https://pub.dev/documentation/patrol/latest/patrol/NativeAutomator/enterText.html
[swipe]: https://pub.dev/documentation/patrol/latest/patrol/NativeAutomator/swipe.html
[handle permission dialogs]: https://pub.dev/documentation/patrol/latest/patrol/NativeAutomator/grantPermissionWhenInUse.html
[press volume down]: https://pub.dev/documentation/patrol/latest/patrol/NativeAutomator/pressVolumeDown.html
[press volume up]: https://pub.dev/documentation/patrol/latest/patrol/NativeAutomator/pressVolumeUp.html
1 change: 1 addition & 0 deletions packages/patrol/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Add privacy manifest for Apple.
- Disabled use of system proxy in iOS/macOS (could lead to broken tests).
- Fix complete breakage of MacOS automations introduced in #2219.

## 3.8.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

func openUrl(_ urlString: String) throws {
guard let url = URL(string: urlString) else {
PatrolError.internal("Invalid URL string: \(urlString)")
throw PatrolError.internal("Invalid URL string: \(urlString)")
}

runAction("opening url \(url)") {
Expand Down Expand Up @@ -186,13 +186,13 @@

// MARK: Volume settings
func pressVolumeUp() throws {
runAction("pressing volume up") {
try runAction("pressing volume up") {
throw PatrolError.methodNotImplemented("pressVolumeUp")
}
}

func pressVolumeDown() throws {
runAction("pressing volume down") {
try runAction("pressing volume down") {
throw PatrolError.methodNotImplemented("pressVolumeDown")
}
}
Expand Down
Loading