Skip to content

#835 added handlers for toggle_wifi,data and airplane mode - #837

Merged
SrinivasanTarget merged 6 commits into
appium:masterfrom
saikrishna321:toggle_handlers
Feb 20, 2018
Merged

SrinivasanTarget merged 6 commits into
appium:masterfrom
saikrishna321:toggle_handlers

Conversation

@saikrishna321

Copy link
Copy Markdown
Member

Types of changes

What types of changes are you proposing/introducing to Java client?
Put an x in the boxes that apply

  • No changes in production code.
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

commandRepository.put(POWER_AC_STATE, postC("/session/:sessionId/appium/device/power_ac"));
commandRepository.put(TOGGLE_WIFI, postC("/session/:sessionId/appium/device/toggle_wifi"));
commandRepository.put(TOGGLE_WIFI, postC("/session/:sessionId/appium/device/toggle_airplane_mode"));
commandRepository.put(TOGGLE_WIFI, postC("/session/:sessionId/appium/device/toggle_data"));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TOGGLE_AIRPLANE_MODE

CommandExecutionHelper.execute(this, toggleLocationServicesCommand());
}

public void toggleWifi() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This might be useful to have these methods in the separate SupportsNetworkStateManagement interface

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Okay i will do that :) cheers

CommandExecutionHelper.execute(this, toggleWifiCommand());
}

public void toggleAirplaneMode() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

docstrings are missing. BTW, this method works for Android only. Also, it foes not work since Android 7+

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In such case, what to do ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

apply the interface to Android driver only. Also, describe the limitations in the docstring

@mykola-mokhnach mykola-mokhnach Feb 19, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we move it inside SupportsSpecialEmulatorCommands

not needed. As you said Appium will anyway throw an exception if the command didn't work. Although, it might be useful to describe what is supported in the docstring

CommandExecutionHelper.execute(this, toggleAirplaneCommand());
}

public void toggleData() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This only works on Android. Also, the device should be rooted

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Shouldn't the server thrown exception in this case ?


/**
* Toggle Airplane mode and this works on OS 6.0
* and does not work on OS 7.0 and greater

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

6.0 and lesser

@appium appium deleted a comment Feb 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants