2016-09-02 11:52:03 +01:00
|
|
|
# Copyright 2014-2016 ARM Limited
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
|
|
|
|
from wlauto import AndroidUxPerfWorkload, Parameter
|
|
|
|
|
|
|
|
|
|
|
|
class Skype(AndroidUxPerfWorkload):
|
|
|
|
|
|
|
|
name = 'skype'
|
2016-09-28 14:02:39 +01:00
|
|
|
package = 'com.skype.raider'
|
|
|
|
activity = '' # Skype has no default 'main' activity
|
|
|
|
view = [package + '/com.skype.android.app.calling.CallActivity',
|
|
|
|
package + '/com.skype.android.app.calling.PreCallActivity',
|
|
|
|
package + '/com.skype.android.app.chat.ChatActivity',
|
|
|
|
package + '/com.skype.android.app.main.HubActivity',
|
|
|
|
package + '/com.skype.android.app.main.SplashActivity',
|
|
|
|
package + '/com.skype.android.app.signin.SignInActivity',
|
|
|
|
package + '/com.skype.android.app.signin.UnifiedLandingPageActivity']
|
2016-09-02 11:52:03 +01:00
|
|
|
description = '''
|
|
|
|
A workload to perform standard productivity tasks within Skype. The
|
|
|
|
workload logs in to the Skype application, selects a recipient from the
|
|
|
|
contacts list and then initiates either a voice or video call.
|
|
|
|
|
|
|
|
Test description:
|
|
|
|
|
|
|
|
1. Open Skype application
|
|
|
|
2. Log in to a pre-defined account
|
|
|
|
3. Select a recipient from the Contacts list
|
|
|
|
4. Initiate either a ``voice`` or ``video`` call for ``duration`` time (in seconds)
|
2016-12-01 13:21:30 +00:00
|
|
|
Note: The actual duration of the call may not match exactly the intended duration
|
|
|
|
due to the uiautomation overhead.
|
2016-09-02 11:52:03 +01:00
|
|
|
|
|
|
|
**Skype Setup**
|
|
|
|
|
2016-12-01 13:21:30 +00:00
|
|
|
- You must have a Skype account set up and its credentials passed
|
|
|
|
as parameters into this workload
|
2016-09-02 11:52:03 +01:00
|
|
|
- The contact to be called must be added (and has accepted) to the
|
|
|
|
account. It's possible to have multiple contacts in the list, however
|
|
|
|
the contact to be called *must* be visible on initial navigation to the
|
|
|
|
list.
|
|
|
|
- For video calls the contact must be able to received the call. This
|
2016-12-01 13:21:30 +00:00
|
|
|
means that there must be a Skype client running (somewhere) with the
|
2016-09-02 11:52:03 +01:00
|
|
|
contact logged in and that client must have been configured to
|
|
|
|
auto-accept calls from the account on the device (how to set this
|
|
|
|
varies between different versions of Skype and between platforms --
|
|
|
|
please search online for specific instructions).
|
|
|
|
https://support.skype.com/en/faq/FA3751/can-i-automatically-answer-all-my-calls-with-video-in-skype-for-windows-desktop
|
2016-12-15 16:13:58 +00:00
|
|
|
|
|
|
|
Known working APK version: 7.01.0.669
|
2016-09-02 11:52:03 +01:00
|
|
|
'''
|
2016-10-17 11:02:41 +01:00
|
|
|
|
2016-09-02 11:52:03 +01:00
|
|
|
launch_main = False # overrides extended class
|
|
|
|
|
|
|
|
parameters = [
|
|
|
|
Parameter('login_name', kind=str, mandatory=True,
|
|
|
|
description='''
|
|
|
|
Account to use when logging into the device from which the call will be made
|
|
|
|
'''),
|
|
|
|
Parameter('login_pass', kind=str, mandatory=True,
|
|
|
|
description='Password associated with the account to log into the device'),
|
2016-09-28 14:02:39 +01:00
|
|
|
Parameter('contact_name', kind=str, default='Echo / Sound Test Service',
|
2016-09-02 11:52:03 +01:00
|
|
|
description='This is the contact display name as it appears in the people list'),
|
|
|
|
Parameter('duration', kind=int, default=10,
|
2016-12-01 13:21:30 +00:00
|
|
|
description='This is the target duration of the call in seconds'),
|
2016-09-02 11:52:03 +01:00
|
|
|
Parameter('action', kind=str, allowed_values=['voice', 'video'], default='voice',
|
|
|
|
description='Action to take - either voice call (default) or video'),
|
|
|
|
]
|
|
|
|
|
|
|
|
# This workload relies on the internet so check that there is a working
|
|
|
|
# internet connection
|
|
|
|
requires_network = True
|
|
|
|
|
|
|
|
def __init__(self, device, **kwargs):
|
|
|
|
super(Skype, self).__init__(device, **kwargs)
|
|
|
|
self.run_timeout = self.duration + 240
|
|
|
|
|
|
|
|
def validate(self):
|
|
|
|
super(Skype, self).validate()
|
|
|
|
self.uiauto_params['my_id'] = self.login_name
|
|
|
|
self.uiauto_params['my_pwd'] = self.login_pass
|
2017-02-09 16:49:12 +00:00
|
|
|
self.uiauto_params['name'] = self.contact_name
|
2016-09-02 11:52:03 +01:00
|
|
|
self.uiauto_params['duration'] = self.duration
|
|
|
|
self.uiauto_params['action'] = self.action
|
|
|
|
|
|
|
|
def setup(self, context):
|
|
|
|
super(Skype, self).setup(context)
|
2017-01-11 21:29:52 +00:00
|
|
|
self.launch_app()
|
|
|
|
|
|
|
|
def launch_app(self):
|
2016-09-02 11:52:03 +01:00
|
|
|
self.device.execute('am start -W -a android.intent.action.VIEW -d skype:dummy?dummy')
|