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

feat: allow airplane mode control #1672

Merged
merged 3 commits into from
May 27, 2024

Conversation

NyCodeGHG
Copy link
Contributor

@NyCodeGHG NyCodeGHG commented Feb 6, 2024

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 NyCodeGHG marked this pull request as draft February 6, 2024 12:04
@NyCodeGHG NyCodeGHG force-pushed the feature/airplane-mode branch from 087e275 to 77db04d Compare February 16, 2024 09:17
@NyCodeGHG NyCodeGHG marked this pull request as ready for review February 16, 2024 09:18
@NyCodeGHG NyCodeGHG force-pushed the feature/airplane-mode branch from 77db04d to efc4977 Compare February 16, 2024 09:37
@axelniklasson axelniklasson added external-contribution platform: android Testing Android apps is affected enhancement New feature request or improvement of an existing feature labels May 20, 2024
@axelniklasson axelniklasson self-requested a review May 22, 2024 15:02
@axelniklasson axelniklasson self-assigned this May 22, 2024
@axelniklasson
Copy link
Contributor

@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!

Copy link
Contributor

@axelniklasson axelniklasson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NyCodeGHG
Copy link
Contributor Author

@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.

@axelniklasson
Copy link
Contributor

@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

@NyCodeGHG NyCodeGHG force-pushed the feature/airplane-mode branch from a808812 to 60b1cbb Compare May 24, 2024 10:37
Copy link
Contributor

@axelniklasson axelniklasson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this works well for me! Can you also raise a PR in https://github.com/mobile-dev-inc/maestro-docs as well as adding another test case to the integration tests? Thanks!

@NyCodeGHG NyCodeGHG force-pushed the feature/airplane-mode branch from 60b1cbb to 409d7a8 Compare May 27, 2024 10:23
@NyCodeGHG
Copy link
Contributor Author

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

@axelniklasson
Copy link
Contributor

@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
Copy link
Contributor

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 axelniklasson merged commit 212996e into mobile-dev-inc:main May 27, 2024
1 check passed
@NyCodeGHG NyCodeGHG deleted the feature/airplane-mode branch May 28, 2024 07:19
@NyCodeGHG
Copy link
Contributor Author

will do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature request or improvement of an existing feature platform: android Testing Android apps is affected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants