mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-21 20:38:57 +00:00
skype: now hangs up at the end. Better duration handling
This commit is contained in:
parent
751970f991
commit
ae4ae3da5e
@ -40,19 +40,19 @@ class Skype(AndroidUxPerfWorkload):
|
|||||||
2. Log in to a pre-defined account
|
2. Log in to a pre-defined account
|
||||||
3. Select a recipient from the Contacts list
|
3. Select a recipient from the Contacts list
|
||||||
4. Initiate either a ``voice`` or ``video`` call for ``duration`` time (in seconds)
|
4. Initiate either a ``voice`` or ``video`` call for ``duration`` time (in seconds)
|
||||||
|
Note: The actual duration of the call may not match exactly the intended duration
|
||||||
|
due to the uiautomation overhead.
|
||||||
|
|
||||||
**Skype Setup**
|
**Skype Setup**
|
||||||
|
|
||||||
- You should install Skype client from Google Play Store on the device
|
- You must have a Skype account set up and its credentials passed
|
||||||
(this was tested with client version 7.01.0.669; other recent versions
|
as parameters into this workload
|
||||||
should also work).
|
|
||||||
- You must have a Skype account set up.
|
|
||||||
- The contact to be called must be added (and has accepted) to the
|
- 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
|
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
|
the contact to be called *must* be visible on initial navigation to the
|
||||||
list.
|
list.
|
||||||
- For video calls the contact must be able to received the call. This
|
- For video calls the contact must be able to received the call. This
|
||||||
means that there must be a Skype client running (somewhere) with the
|
means that there must be a Skype client running (somewhere) with the
|
||||||
contact logged in and that client must have been configured to
|
contact logged in and that client must have been configured to
|
||||||
auto-accept calls from the account on the device (how to set this
|
auto-accept calls from the account on the device (how to set this
|
||||||
varies between different versions of Skype and between platforms --
|
varies between different versions of Skype and between platforms --
|
||||||
@ -72,7 +72,7 @@ class Skype(AndroidUxPerfWorkload):
|
|||||||
Parameter('contact_name', kind=str, default='Echo / Sound Test Service',
|
Parameter('contact_name', kind=str, default='Echo / Sound Test Service',
|
||||||
description='This is the contact display name as it appears in the people list'),
|
description='This is the contact display name as it appears in the people list'),
|
||||||
Parameter('duration', kind=int, default=10,
|
Parameter('duration', kind=int, default=10,
|
||||||
description='This is the duration of the call in seconds'),
|
description='This is the target duration of the call in seconds'),
|
||||||
Parameter('action', kind=str, allowed_values=['voice', 'video'], default='voice',
|
Parameter('action', kind=str, allowed_values=['voice', 'video'], default='voice',
|
||||||
description='Action to take - either voice call (default) or video'),
|
description='Action to take - either voice call (default) or video'),
|
||||||
]
|
]
|
||||||
|
Binary file not shown.
@ -67,9 +67,9 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
searchForContact(contactName);
|
searchForContact(contactName);
|
||||||
|
|
||||||
if (ACTION_VOICE.equalsIgnoreCase(callType)) {
|
if (ACTION_VOICE.equalsIgnoreCase(callType)) {
|
||||||
voiceCallTest(callDuration);
|
makeCall(callDuration, false);
|
||||||
} else if (ACTION_VIDEO.equalsIgnoreCase(callType)) {
|
} else if (ACTION_VIDEO.equalsIgnoreCase(callType)) {
|
||||||
videoCallTest(callDuration);
|
makeCall(callDuration, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
removeWatcher("infoPopUpWatcher");
|
removeWatcher("infoPopUpWatcher");
|
||||||
@ -96,7 +96,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
UiObject updateNotice =
|
UiObject updateNotice =
|
||||||
new UiObject(new UiSelector().resourceId(packageID + "update_notice_dont_show_again"));
|
new UiObject(new UiSelector().resourceId(packageID + "update_notice_dont_show_again"));
|
||||||
//Detect if the update notice popup is present
|
//Detect if the update notice popup is present
|
||||||
if (updateNotice.waitForExists(uiAutoTimeout)) {
|
if (updateNotice.waitForExists(TimeUnit.SECONDS.toMillis(30))) {
|
||||||
//Stop the notice from reappearing
|
//Stop the notice from reappearing
|
||||||
updateNotice.click();
|
updateNotice.click();
|
||||||
clickUiObject(BY_TEXT, "Continue", "android.widget.Button");
|
clickUiObject(BY_TEXT, "Continue", "android.widget.Button");
|
||||||
@ -165,35 +165,58 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
return infoPopUpWatcher;
|
return infoPopUpWatcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void voiceCallTest(int duration) throws Exception {
|
private void makeCall(int duration, boolean video) throws Exception {
|
||||||
String testTag = "call_voice";
|
String testTag = video ? "video" : "voice";
|
||||||
ActionLogger logger = new ActionLogger(testTag, parameters);
|
|
||||||
|
|
||||||
logger.start();
|
|
||||||
makeCall(duration, false, testTag);
|
|
||||||
logger.stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void videoCallTest(int duration) throws Exception {
|
|
||||||
String testTag = "call_video";
|
|
||||||
ActionLogger logger = new ActionLogger(testTag, parameters);
|
|
||||||
|
|
||||||
logger.start();
|
|
||||||
makeCall(duration, true, testTag);
|
|
||||||
logger.stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void makeCall(int duration, boolean video, String testTag) throws Exception {
|
|
||||||
String description = video ? "Video call" : "Call options";
|
String description = video ? "Video call" : "Call options";
|
||||||
|
|
||||||
UiObject callButton =
|
UiObject callButton =
|
||||||
new UiObject(new UiSelector().descriptionContains(description));
|
new UiObject(new UiSelector().descriptionContains(description));
|
||||||
callButton.clickAndWaitForNewWindow();
|
|
||||||
|
|
||||||
UiObject muteButton =
|
UiObject muteButton =
|
||||||
new UiObject(new UiSelector().descriptionContains("Mute"));
|
new UiObject(new UiSelector().descriptionContains("mute"));
|
||||||
muteButton.click();
|
UiObject endButton =
|
||||||
|
new UiObject(new UiSelector().descriptionContains("end"));
|
||||||
sleep(duration);
|
|
||||||
|
// Start the call and log how long that takes
|
||||||
|
ActionLogger logger = new ActionLogger(testTag + "_start", parameters);
|
||||||
|
logger.start();
|
||||||
|
long target = System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(duration);
|
||||||
|
callButton.clickAndWaitForNewWindow();
|
||||||
|
logger.stop();
|
||||||
|
|
||||||
|
// Wait for 'duration' seconds - attempt to mute while waiting
|
||||||
|
logger = new ActionLogger(testTag + "_call", parameters);
|
||||||
|
logger.start();
|
||||||
|
boolean muted = false;
|
||||||
|
while (System.currentTimeMillis() < target) {
|
||||||
|
if (muted == true) {
|
||||||
|
sleep(1);
|
||||||
|
} else {
|
||||||
|
muted = tryButton(muteButton, 500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.stop();
|
||||||
|
|
||||||
|
// Hang up the call and log how long that takes
|
||||||
|
logger = new ActionLogger(testTag + "_stop", parameters);
|
||||||
|
logger.start();
|
||||||
|
tryButton(endButton, 500);
|
||||||
|
logger.stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean tryButton(UiObject button, long timeout) throws Exception {
|
||||||
|
if (button.waitForExists(timeout)) {
|
||||||
|
button.click();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// The buttons could be hidden...
|
||||||
|
// Tap screen to make them appear and look again
|
||||||
|
tapDisplayCentre();
|
||||||
|
if (button.waitForExists(timeout)) {
|
||||||
|
button.click();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user