-
-
Notifications
You must be signed in to change notification settings - Fork 758
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
Add handlers for gsm, network, power and sms command #834
Conversation
|
||
private final String gsmcall; | ||
|
||
GsmCallActions(String gsmcall) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this constructor is redundant. All enum elements have name()
and ordinal()
properties. That's pretty all you need. Same comment to other enums
@@ -176,4 +183,68 @@ public void toggleLocationServices() { | |||
CommandExecutionHelper.execute(this, toggleLocationServicesCommand()); | |||
} | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather put these methods into separate interface named as SupportsSpecialEmulatorCommands
* | ||
* @return a key-value pair. The key is the command name. The value is a {@link Map} command arguments. | ||
*/ | ||
public static Map.Entry<String, Map<String, ?>> powerACCommand( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all these methods have one extra space between the return type and the method name
/** | ||
* Emulate power state change on the connected emulator. | ||
* | ||
* @param powerACState One of available Power AC state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather put a direct link to the corresponding enum here
Yeah but i'm not sure what to assert here? Do you have any better suggestion? @mykola-mokhnach |
try maybe this workaround |
try { | ||
driver.sendSMS("11111111", "call"); | ||
} catch (Exception e) { | ||
assertFalse( "method works only in emulators", true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use fail
call instead
* @param phoneNumber The phone number of the caller. | ||
* @param gsmCallActions One of available {@link GsmCallActions} values. | ||
*/ | ||
default void setGsmCall(String phoneNumber, GsmCallActions gsmCallActions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makeGsmCall
would be a better name
* @param gsmSignalStrength One of available {@link GsmSignalStrength} values. | ||
*/ | ||
default void setGsmSignalStrength(GsmSignalStrength gsmSignalStrength) { | ||
CommandExecutionHelper.execute( this, gsmSignalStrengthCommand(gsmSignalStrength)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra space before this
Change list
Add handlers for gsm, network, power and sms command
https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L366-L375
Types of changes
What types of changes are you proposing/introducing to Java client?
Put an
x
in the boxes that apply@mykola-mokhnach ping