Skip to content
This repository has been archived by the owner on May 20, 2020. It is now read-only.

New methods proposal #6

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

vrunoa
Copy link

@vrunoa vrunoa commented Jun 16, 2017

@jlipps encourage me to write a proposal for adding new methods for mobile specs.
It would be good to start providing new endpoints for common functionalities available on every mobile device but hasnt been implemented yet; such as battery states, level and external communication factors which can trigger actions on applications that users would like to test.
This idea came up because we already started implementing it for android emulators and is probably going to be used cross-platform, so we should get everybody's opinion before adding new endpoints.
What do you guys think ?

Copy link
Contributor

@jlipps jlipps left a comment

Choose a reason for hiding this comment

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

thanks for coming up with this stuff @vrunoa! made some comments, but hopefully some other folks will weigh in on the big picture here, and whether these methods are appropriate for some future version of the mobile spec (like @shs96c for example)

spec-draft.md Outdated

The battery state should have two options: ON, OFF depending if the power ac state it's charging or not.

* GET /session/:sessionId/appium/device/battery_state
Copy link
Contributor

Choose a reason for hiding this comment

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

here and in all the following, we don't need appium/device in the endpoint. this spec draft is a draft of what would potentially be an official spec at some point. the appium/ prefix is for appium-specific functionality that would not be a part of this draft. or if we wanted to implement this in appium before its admission into the draft.

so i would recommend one of these two:

GET /session/:sessionId/device/battery_state
GET /session/:sessionId/battery_state

if we have enough things to put behind /device that could be a reasonable global prefix

spec-draft.md Outdated
* ON
* OFF

In some cases, apps might respond different on low battery level so the idea is to provide a method to set specific battery level for the devices.
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe mention that this is percent? and should we state that it is a range of integers (rather than real values?).

spec-draft.md Outdated
* accepts PhoneNumber, GsmAction


`GsmAction`'s would be:
Copy link
Contributor

Choose a reason for hiding this comment

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

mention that these are strings?

spec-draft.md Outdated
### SMS
During this days a lot of apps depend on receiving sms, even if they are not messaging platform, apps may want to check sms to validate accounts, send promotion codes, etc. We should add

* POST /session/:sessionId/appium/device/sms_send
Copy link
Contributor

Choose a reason for hiding this comment

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

I think just POST .../sms is fine; POST has the semantics of "creating" an sms on the device. but this is a nit.

spec-draft.md Outdated
During this days a lot of apps depend on receiving sms, even if they are not messaging platform, apps may want to check sms to validate accounts, send promotion codes, etc. We should add

* POST /session/:sessionId/appium/device/sms_send
* accepts PhoneNumber, Message
Copy link
Contributor

Choose a reason for hiding this comment

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

what is Message? is it just a string?

spec-draft.md Outdated
The idea is to be able to mock phone calls entering the device and handle the actions that triggers; you may want to accept it, cancel or put it on hold.

* POST /session/:sessionId/appium/device/gsm_call
* accepts PhoneNumber, GsmAction
Copy link
Contributor

Choose a reason for hiding this comment

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

how are these parameters passed? is it something like:

{"number": <PhoneNumber>, "action": <GsmAction>}

?

Copy link
Contributor

@jlipps jlipps left a comment

Choose a reason for hiding this comment

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

looks good to me now, just should get some feedback from other interested parties. thanks @vrunoa

@vrunoa
Copy link
Author

vrunoa commented Apr 24, 2019

@jlipps @shs96c any feedback on this?

@CLAassistant
Copy link

CLAassistant commented Nov 23, 2019

CLA assistant check
All committers have signed the CLA.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants