maestro icon indicating copy to clipboard operation
maestro copied to clipboard

feat: allow airplane mode control

Open NyCodeGHG opened this issue 1 year ago • 1 comments

Proposed Changes

add a new command for controlling the airplane mode of android devices.

Testing

ran the following flow on android 27 and 28 emulators:

appId: org.wikipedia
---
- launchApp
- setAirplaneMode: disable
- setAirplaneMode: enable

NyCodeGHG avatar Feb 06 '24 11:02 NyCodeGHG

@NyCodeGHG Nice 🎉 Let's update it to be a single command - toggleAirplaneMode instead and then we'll move forward with a formal review to get it merged. Thanks!

axelniklasson avatar May 22 '24 15:05 axelniklasson

@axelniklasson hi, thank you for the review. When I implemented this feature I had another option to toggle the airplane mode, but I removed it as it doesn't explicitly define the desired behavior. I can add another option to toggle if you want, but I'd prefer to keep the enable and disable options for those who want to be explicit.

NyCodeGHG avatar May 24 '24 07:05 NyCodeGHG

@axelniklasson hi, thank you for the review. When I implemented this feature I had another option to toggle the airplane mode, but I removed it as it doesn't explicitly define the desired behavior. I can add another option to toggle if you want, but I'd prefer to keep the enable and disable options for those who want to be explicit.

Hey, that's fair and a good use case to me. Let's keep the API as it is but also add - toggleAirplaneMode as a separate command

axelniklasson avatar May 24 '24 08:05 axelniklasson

@axelniklasson I'm not sure on the integration test case Can you elaborate?

NyCodeGHG avatar May 27 '24 10:05 NyCodeGHG

@axelniklasson I'm not sure on the integration test case Can you elaborate?

@NyCodeGHG let's add another test case to IntegrationTest.kt with an example Flow that uses the commands to ensure that all commands are parsed correctly etc. You can take a look at the other test cases to get a feel for how we usually test new commands

axelniklasson avatar May 27 '24 12:05 axelniklasson

Thanks @NyCodeGHG! Merging this now but please do also raise a PR in https://github.com/mobile-dev-inc/maestro-docs documenting the new commands - we'll merge it when we make the next release 👍

Thanks again for your contribution!

axelniklasson avatar May 27 '24 13:05 axelniklasson

will do!

NyCodeGHG avatar May 28 '24 07:05 NyCodeGHG