mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-03-14 06:38:36 +00:00
Merge 169c1ed28fa161c46740ebe92574084219fc3732 into 40d281b336979d5de76791889e828a70d08565fa
This commit is contained in:
commit
aa60a369c0
Binary file not shown.
@ -100,7 +100,7 @@ public class BaseUiAutomation extends UiAutomatorTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void sleep(int second) {
|
||||
public void sleepSeconds(int second) {
|
||||
super.sleep(second * 1000);
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ public class BaseUiAutomation extends UiAutomatorTestCase {
|
||||
long currentTime = System.currentTimeMillis();
|
||||
boolean found = false;
|
||||
while ((currentTime - startTime) < timeout) {
|
||||
sleep(2); // poll every two seconds
|
||||
sleepSeconds(2); // poll every two seconds
|
||||
|
||||
while ((line = reader.readLine()) != null) {
|
||||
if (line.contains(searchText)) {
|
||||
|
Binary file not shown.
@ -78,7 +78,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
threadNumberField.setText(numThreads);
|
||||
|
||||
getUiDevice().pressBack();
|
||||
sleep(shortDelaySeconds);
|
||||
sleepSeconds(shortDelaySeconds);
|
||||
// If the device does not have a physical keyboard, a virtual one might have
|
||||
// poped up when setting the number of threads. If that happend, then the above
|
||||
// backpress would dismiss the vkb and another one will be necessary to return
|
||||
@ -86,7 +86,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
if(threadNumberField.exists())
|
||||
{
|
||||
getUiDevice().pressBack();
|
||||
sleep(shortDelaySeconds);
|
||||
sleepSeconds(shortDelaySeconds);
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
UiObject startButton = new UiObject(selector.className("android.widget.ImageButton")
|
||||
.packageName("com.eembc.coremark"));
|
||||
startButton.click();
|
||||
sleep(shortDelaySeconds);
|
||||
sleepSeconds(shortDelaySeconds);
|
||||
}
|
||||
|
||||
public void waitForAndExtractResuts() throws Exception {
|
||||
@ -110,6 +110,6 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
.packageName("com.eembc.coremark"));
|
||||
resultText.waitForExists(TimeUnit.SECONDS.toMillis(shortDelaySeconds));
|
||||
Log.v(TAG, resultText.getText());
|
||||
sleep(shortDelaySeconds);
|
||||
sleepSeconds(shortDelaySeconds);
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
Bundle status = new Bundle();
|
||||
status.putString("product", getUiDevice().getProductName());
|
||||
UiSelector selector = new UiSelector();
|
||||
sleep(3);
|
||||
sleepSeconds(3);
|
||||
UiObject btn_microbench = new UiObject(selector .textContains("Micro")
|
||||
.className("android.widget.Button"));
|
||||
btn_microbench.click();
|
||||
@ -53,13 +53,13 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
|
||||
waitObject(complete_text);
|
||||
|
||||
sleep(2);
|
||||
sleepSeconds(2);
|
||||
complete_text.click();
|
||||
} finally{
|
||||
//complete_text.click();
|
||||
}
|
||||
|
||||
sleep(5);
|
||||
sleepSeconds(5);
|
||||
takeScreenshot("Androbench");
|
||||
getAutomationSupport().sendStatus(Activity.RESULT_OK, status);
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
UiObject closeButton = new UiObject(selector.text("Cancel"));
|
||||
if (closeButton.waitForExists(TimeUnit.SECONDS.toMillis(initialTimeoutSeconds))) {
|
||||
closeButton.click();
|
||||
sleep(1); // diaglog dismissal
|
||||
sleepSeconds(1); // diaglog dismissal
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@ -121,7 +121,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
UiObject closeButton = new UiObject(selector.text("Close"));
|
||||
if (closeButton.waitForExists(TimeUnit.SECONDS.toMillis(initialTimeoutSeconds))) {
|
||||
closeButton.click();
|
||||
sleep(1); // diaglog dismissal
|
||||
sleepSeconds(1); // diaglog dismissal
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@ -137,7 +137,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
// dismiss it as long as keeps popping up.
|
||||
while (closeButton.waitForExists(2)) {
|
||||
closeButton.click();
|
||||
sleep(1); // diaglog dismissal
|
||||
sleepSeconds(1); // diaglog dismissal
|
||||
dismissed = true;
|
||||
}
|
||||
return dismissed;
|
||||
@ -149,7 +149,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
.className("android.widget.Button"));
|
||||
test.waitForExists(initialTimeoutSeconds);
|
||||
test.click();
|
||||
sleep(1); // possible tab transtion
|
||||
sleepSeconds(1); // possible tab transtion
|
||||
}
|
||||
|
||||
/* In version 5 of antutu, the test has been changed from a button widget to a textview */
|
||||
@ -160,7 +160,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
.className("android.widget.TextView"));
|
||||
test.waitForExists(initialTimeoutSeconds);
|
||||
test.click();
|
||||
sleep(1); // possible tab transtion
|
||||
sleepSeconds(1); // possible tab transtion
|
||||
}
|
||||
|
||||
|
||||
@ -168,14 +168,14 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
UiSelector selector = new UiSelector();
|
||||
UiObject test = new UiObject(selector.text("Test"));
|
||||
test.click();
|
||||
sleep(1); // possible tab transtion
|
||||
sleepSeconds(1); // possible tab transtion
|
||||
}
|
||||
|
||||
public void disableSdCardTests() throws Exception {
|
||||
UiSelector selector = new UiSelector();
|
||||
UiObject custom = new UiObject(selector.textContains("Custom"));
|
||||
custom.click();
|
||||
sleep(1); // tab transition
|
||||
sleepSeconds(1); // tab transition
|
||||
|
||||
UiObject sdCardButton = new UiObject(selector.text("SD card IO"));
|
||||
sdCardButton.click();
|
||||
@ -203,7 +203,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
if (detailsButton.exists() || barChart.exists()) {
|
||||
break;
|
||||
}
|
||||
sleep(5);
|
||||
sleepSeconds(5);
|
||||
}
|
||||
|
||||
if (barChart.exists()) {
|
||||
@ -218,7 +218,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
if (qrText.exists()) {
|
||||
break;
|
||||
}
|
||||
sleep(5);
|
||||
sleepSeconds(5);
|
||||
}
|
||||
}
|
||||
|
||||
@ -313,7 +313,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
UiSelector selector = new UiSelector();
|
||||
UiObject detailsButton = new UiObject(new UiSelector().className("android.widget.Button")
|
||||
.text("Details"));
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
getUiDevice().pressBack();
|
||||
}
|
||||
}
|
||||
@ -343,7 +343,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
foundResults = true;
|
||||
break;
|
||||
}
|
||||
sleep(5);
|
||||
sleepSeconds(5);
|
||||
}
|
||||
|
||||
if (!foundResults) {
|
||||
@ -360,20 +360,20 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
|
||||
if (detailTextView.exists()) {
|
||||
detailTextView.click();
|
||||
sleep(1); // tab transition
|
||||
sleepSeconds(1); // tab transition
|
||||
|
||||
UiObject testTextView = new UiObject(selector.text("Test")
|
||||
.className("android.widget.TextView"));
|
||||
if (testTextView.exists()) {
|
||||
testTextView.click();
|
||||
sleep(1); // tab transition
|
||||
sleepSeconds(1); // tab transition
|
||||
}
|
||||
|
||||
UiObject scoresTextView = new UiObject(selector.text("Scores")
|
||||
.className("android.widget.TextView"));
|
||||
if (scoresTextView.exists()) {
|
||||
scoresTextView.click();
|
||||
sleep(1); // tab transition
|
||||
sleepSeconds(1); // tab transition
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
UiObject detailsButton = new UiObject(selector.text("Details")
|
||||
.className("android.widget.Button"));
|
||||
detailsButton.click();
|
||||
sleep(2);
|
||||
sleepSeconds(2);
|
||||
|
||||
UiObject linearObject;
|
||||
UiObject detailedScore;
|
||||
|
@ -69,19 +69,19 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
// switch to camera capture mode
|
||||
UiObject clickModes = new UiObject(new UiSelector().descriptionMatches("Camera, video or panorama selector"));
|
||||
clickModes.click();
|
||||
sleep(sleepTime);
|
||||
sleepSeconds(sleepTime);
|
||||
|
||||
UiObject changeModeToCapture = new UiObject(new UiSelector().descriptionMatches("Switch to photo"));
|
||||
|
||||
changeModeToCapture.click();
|
||||
sleep(sleepTime);
|
||||
sleepSeconds(sleepTime);
|
||||
|
||||
// click to capture photos
|
||||
UiObject clickCaptureButton = new UiObject(new UiSelector().descriptionMatches("Shutter button"));
|
||||
|
||||
for (int i = 0; i < iterations; i++) {
|
||||
clickCaptureButton.longClick();
|
||||
sleep(timeDurationBetweenEachCapture);
|
||||
sleepSeconds(timeDurationBetweenEachCapture);
|
||||
}
|
||||
getUiDevice().pressBack();
|
||||
}
|
||||
@ -92,7 +92,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
UiObject tutorialText = new UiObject(new UiSelector().resourceId("com.android.camera2:id/photoVideoSwipeTutorialText"));
|
||||
if (tutorialText.waitForExists(TimeUnit.SECONDS.toMillis(5))) {
|
||||
tutorialText.swipeLeft(5);
|
||||
sleep(sleepTime);
|
||||
sleepSeconds(sleepTime);
|
||||
tutorialText.swipeRight(5);
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
|
||||
for (int i = 0; i < iterations; i++) {
|
||||
clickCaptureButton.longClick();
|
||||
sleep(timeDurationBetweenEachCapture);
|
||||
sleepSeconds(timeDurationBetweenEachCapture);
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,14 +118,14 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
// switch to video mode
|
||||
UiObject changeModeToCapture = new UiObject(new UiSelector().descriptionMatches("Switch to Camera Mode"));
|
||||
changeModeToCapture.click();
|
||||
sleep(sleepTime);
|
||||
sleepSeconds(sleepTime);
|
||||
|
||||
// click to capture photos
|
||||
UiObject clickCaptureButton = new UiObject(new UiSelector().descriptionMatches("Shutter"));
|
||||
|
||||
for (int i = 0; i < iterations; i++) {
|
||||
clickCaptureButton.longClick();
|
||||
sleep(timeDurationBetweenEachCapture);
|
||||
sleepSeconds(timeDurationBetweenEachCapture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,15 +69,15 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
// switch to camera capture mode
|
||||
UiObject clickModes = new UiObject(new UiSelector().descriptionMatches("Camera, video or panorama selector"));
|
||||
clickModes.click();
|
||||
sleep(sleepTime);
|
||||
sleepSeconds(sleepTime);
|
||||
|
||||
UiObject changeModeToCapture = new UiObject(new UiSelector().descriptionMatches("Switch to video"));
|
||||
changeModeToCapture.click();
|
||||
sleep(sleepTime);
|
||||
sleepSeconds(sleepTime);
|
||||
|
||||
UiObject clickRecordingButton = new UiObject(new UiSelector().descriptionMatches("Shutter button"));
|
||||
clickRecordingButton.longClick();
|
||||
sleep(recordingTime);
|
||||
sleepSeconds(recordingTime);
|
||||
|
||||
// Stop video recording
|
||||
clickRecordingButton.longClick();
|
||||
@ -89,7 +89,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
UiObject tutorialText = new UiObject(new UiSelector().resourceId("com.android.camera2:id/photoVideoSwipeTutorialText"));
|
||||
if (tutorialText.waitForExists(TimeUnit.SECONDS.toMillis(5))) {
|
||||
tutorialText.swipeLeft(5);
|
||||
sleep(sleepTime);
|
||||
sleepSeconds(sleepTime);
|
||||
tutorialText.swipeRight(5);
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
// click to capture photos
|
||||
UiObject clickCaptureButton = new UiObject(new UiSelector().resourceId(captureButtonId));
|
||||
clickCaptureButton.longClick();
|
||||
sleep(recordingTime);
|
||||
sleepSeconds(recordingTime);
|
||||
|
||||
// stop video recording
|
||||
clickCaptureButton.longClick();
|
||||
@ -124,11 +124,11 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
// Switch to video mode
|
||||
UiObject changeModeToCapture = new UiObject(new UiSelector().descriptionMatches("Switch to Video Camera"));
|
||||
changeModeToCapture.click();
|
||||
sleep(sleepTime);
|
||||
sleepSeconds(sleepTime);
|
||||
|
||||
UiObject clickRecordingButton = new UiObject(new UiSelector().descriptionMatches("Shutter"));
|
||||
clickRecordingButton.longClick();
|
||||
sleep(recordingTime);
|
||||
sleepSeconds(recordingTime);
|
||||
|
||||
// Stop video recording
|
||||
clickRecordingButton.longClick();
|
||||
|
@ -41,21 +41,21 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
.className("android.widget.TextView"));
|
||||
|
||||
text_bench.click();
|
||||
sleep(2);
|
||||
sleepSeconds(2);
|
||||
|
||||
try{
|
||||
UiObject stop_text = new UiObject(selector.textContains("Benchmarking ...")
|
||||
.className("android.widget.TextView"));
|
||||
waitUntilNoObject(stop_text, 600);
|
||||
|
||||
sleep(2);
|
||||
sleepSeconds(2);
|
||||
}finally{
|
||||
takeScreenshot("cf-bench");
|
||||
}
|
||||
|
||||
UiScrollable res = new UiScrollable(new UiSelector());//.scrollable(true));
|
||||
res.flingToEnd(10);
|
||||
sleep(2);
|
||||
sleepSeconds(2);
|
||||
|
||||
getAutomationSupport().sendStatus(Activity.RESULT_OK, status);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
|
||||
logInButton.clickAndWaitForNewWindow(timeout);
|
||||
|
||||
sleep(timeout);
|
||||
sleepSeconds(timeout);
|
||||
|
||||
//Click on message logo
|
||||
UiObject messageLogo = new UiObject(new UiSelector()
|
||||
@ -78,7 +78,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
.className("android.widget.RelativeLayout").index(1)));
|
||||
clickMessage.clickAndWaitForNewWindow(timeout);
|
||||
|
||||
sleep(timeout);
|
||||
sleepSeconds(timeout);
|
||||
|
||||
UiObject sendMessage = new UiObject(new UiSelector()
|
||||
.className("android.widget.FrameLayout").index(4)
|
||||
@ -89,7 +89,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
.text("Write a message")));
|
||||
sendMessage.click();
|
||||
|
||||
sleep(timeout);
|
||||
sleepSeconds(timeout);
|
||||
|
||||
UiObject editMessage = new UiObject(new UiSelector()
|
||||
.className("android.widget.EditText").text("Write a message"));
|
||||
@ -101,9 +101,9 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
sendButton.click();
|
||||
|
||||
getUiDevice().pressDPadDown();
|
||||
sleep(timeout);
|
||||
sleepSeconds(timeout);
|
||||
getUiDevice().pressBack();
|
||||
sleep(timeout);
|
||||
sleepSeconds(timeout);
|
||||
getUiDevice().pressBack();
|
||||
|
||||
//Check for notifications
|
||||
@ -124,9 +124,9 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
.className("android.widget.LinearLayout").index(1)));
|
||||
clickNotify.clickAndWaitForNewWindow(timeout);
|
||||
|
||||
sleep(timeout);
|
||||
sleepSeconds(timeout);
|
||||
getUiDevice().pressBack();
|
||||
sleep(timeout);
|
||||
sleepSeconds(timeout);
|
||||
getUiDevice().pressBack();
|
||||
|
||||
//Search for the facebook account
|
||||
@ -155,21 +155,21 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
|
||||
editSearch.clearTextField();
|
||||
editSearch.setText("amol kamble");
|
||||
sleep(timeout);
|
||||
sleepSeconds(timeout);
|
||||
|
||||
UiObject clickOnSearchResult = new UiObject(new UiSelector()
|
||||
.className("android.webkit.WebView").index(0));
|
||||
clickOnSearchResult.clickTopLeft();
|
||||
|
||||
sleep(2 * timeout);
|
||||
sleepSeconds(2 * timeout);
|
||||
|
||||
getUiDevice().pressBack();
|
||||
sleep(timeout);
|
||||
sleepSeconds(timeout);
|
||||
getUiDevice().pressBack();
|
||||
|
||||
clickBar.click();
|
||||
|
||||
sleep(timeout);
|
||||
sleepSeconds(timeout);
|
||||
|
||||
//Click on find friends
|
||||
UiObject clickFriends = new UiObject(new UiSelector()
|
||||
@ -188,7 +188,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
UiObject friends = clickFriends.getChild(new UiSelector()
|
||||
.className("android.widget.RelativeLayout").index(3));
|
||||
friends.click();
|
||||
sleep(timeout);
|
||||
sleepSeconds(timeout);
|
||||
getUiDevice().pressBack();
|
||||
|
||||
//Update the status
|
||||
|
@ -146,16 +146,16 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
public void scrollThroughResults() throws Exception {
|
||||
UiSelector selector = new UiSelector();
|
||||
getUiDevice().pressKeyCode(KeyEvent.KEYCODE_PAGE_DOWN);
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
getUiDevice().pressKeyCode(KeyEvent.KEYCODE_PAGE_DOWN);
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
getUiDevice().pressKeyCode(KeyEvent.KEYCODE_PAGE_DOWN);
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
getUiDevice().pressKeyCode(KeyEvent.KEYCODE_PAGE_DOWN);
|
||||
}
|
||||
|
||||
public void shareResults() throws Exception {
|
||||
sleep(2); // transition
|
||||
sleepSeconds(2); // transition
|
||||
UiSelector selector = new UiSelector();
|
||||
getUiDevice().pressMenu();
|
||||
UiObject shareButton = new UiObject(selector.text("Share")
|
||||
|
@ -151,7 +151,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
|
||||
public void extractResults() throws Exception {
|
||||
Log.v(TAG, "Extracting results.");
|
||||
sleep(2); // wait for the results screen to fully load.
|
||||
sleepSeconds(2); // wait for the results screen to fully load.
|
||||
UiSelector selector = new UiSelector();
|
||||
UiObject fpsText = new UiObject(selector.className("android.widget.TextView")
|
||||
.textContains("fps")
|
||||
|
Binary file not shown.
@ -49,7 +49,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
packageName = parameters.getString("package");
|
||||
packageID = packageName + ":id/";
|
||||
|
||||
sleep(5); // Pause while splash screen loads
|
||||
sleepSeconds(5); // Pause while splash screen loads
|
||||
setScreenOrientation(ScreenOrientation.NATURAL);
|
||||
dismissWelcomeView();
|
||||
closePromotionPopUp();
|
||||
@ -104,13 +104,13 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
UiObject workingFolder =
|
||||
new UiObject(new UiSelector().text("wa-working"));
|
||||
if (!workingFolder.exists()) {
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
uiDeviceSwipeLeft(10);
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
uiDeviceSwipeLeft(10);
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
uiDeviceSwipeLeft(10);
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
Binary file not shown.
@ -141,9 +141,9 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
endButton.click();
|
||||
|
||||
// Select a random sample book to add to My library
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
tapDisplayCentre();
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
|
||||
// Click done button (uses same resource-id)
|
||||
endButton.click();
|
||||
@ -204,7 +204,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
while (!label.exists()) {
|
||||
if (searchTime > 0) {
|
||||
uiDeviceSwipeDown(100);
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
searchTime--;
|
||||
} else {
|
||||
throw new UiObjectNotFoundException(
|
||||
@ -503,7 +503,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
}
|
||||
}
|
||||
|
||||
sleep(2);
|
||||
sleepSeconds(2);
|
||||
tapDisplayCentre(); // exit reader settings dialog
|
||||
waitForPage();
|
||||
}
|
||||
@ -539,7 +539,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
.focusable(true)));
|
||||
// On some devices the object in the view hierarchy is found before it
|
||||
// becomes visible on the screen. Therefore add pause instead.
|
||||
sleep(3);
|
||||
sleepSeconds(3);
|
||||
|
||||
if (!activityReader.waitForExists(viewTimeout)) {
|
||||
throw new UiObjectNotFoundException("Could not find \"activity reader view\".");
|
||||
@ -554,7 +554,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
new UiObject(new UiSelector().resourceId(packageID + "action_bar"));
|
||||
if (!actionBar.exists()) {
|
||||
tapDisplayCentre();
|
||||
sleep(1); // Allow previous views to settle
|
||||
sleepSeconds(1); // Allow previous views to settle
|
||||
}
|
||||
|
||||
UiObject card =
|
||||
@ -570,11 +570,11 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
int y = (int)(getDisplayCentreHeight() * 0.8);
|
||||
while (card.exists()) {
|
||||
tapDisplay(x, y);
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
}
|
||||
|
||||
tapDisplay(x, y);
|
||||
sleep(1); // Allow previous views to settle
|
||||
sleepSeconds(1); // Allow previous views to settle
|
||||
}
|
||||
|
||||
if (!actionBar.exists()) {
|
||||
@ -587,7 +587,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
new UiObject(new UiSelector().resourceId(packageID + "action_bar"));
|
||||
if (actionBar.exists()) {
|
||||
tapDisplayCentre();
|
||||
sleep(1); // Allow previous views to settle
|
||||
sleepSeconds(1); // Allow previous views to settle
|
||||
}
|
||||
|
||||
if (actionBar.exists()) {
|
||||
|
Binary file not shown.
@ -61,13 +61,13 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
changeAckTimeout(100);
|
||||
// UI automation begins here
|
||||
skipWelcomeScreen();
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
dismissWorkOfflineBanner();
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
enablePowerpointCompat();
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
testEditNewSlidesDocument(newDocumentName, workingDirectoryName, doTextEntry);
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
// Open document
|
||||
openDocument(pushedDocumentName, workingDirectoryName);
|
||||
waitForProgress(WAIT_TIMEOUT_1SEC*30);
|
||||
@ -312,19 +312,19 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
enterTextInSlide(".*[Tt]itle.*", docName);
|
||||
// Save
|
||||
saveDocument(docName);
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
}
|
||||
|
||||
// Slide 2 - Image
|
||||
insertSlide("Title only");
|
||||
insertImage(workingDirectoryName);
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
|
||||
// If text wasn't entered in first slide, save prompt will appear here
|
||||
if (!doTextEntry) {
|
||||
// Save
|
||||
saveDocument(docName);
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
}
|
||||
|
||||
// Slide 3 - Shape
|
||||
@ -333,7 +333,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
insertShape(shapeName);
|
||||
modifyShape(shapeName);
|
||||
getUiDevice().pressBack();
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
|
||||
// Tidy up
|
||||
getUiDevice().pressBack();
|
||||
@ -366,7 +366,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
waitForProgress(WAIT_TIMEOUT_1SEC*5);
|
||||
}
|
||||
logger.stop();
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
|
||||
// scroll backward in edit mode
|
||||
logger = new ActionLogger(testTag + "_editbackward", parameters);
|
||||
@ -376,7 +376,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
waitForProgress(WAIT_TIMEOUT_1SEC*5);
|
||||
}
|
||||
logger.stop();
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
|
||||
// run slideshow
|
||||
logger = new ActionLogger(testTag + "_run", parameters);
|
||||
@ -392,7 +392,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
presentation.waitForExists(WAIT_TIMEOUT_1SEC*30);
|
||||
}
|
||||
logger.stop();
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
|
||||
slideIndex = 0;
|
||||
|
||||
@ -404,7 +404,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
waitForProgress(WAIT_TIMEOUT_1SEC*5);
|
||||
}
|
||||
logger.stop();
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
|
||||
// scroll backward in slideshow mode
|
||||
logger = new ActionLogger(testTag + "_playbackward", parameters);
|
||||
@ -414,7 +414,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
waitForProgress(WAIT_TIMEOUT_1SEC*5);
|
||||
}
|
||||
logger.stop();
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
|
||||
getUiDevice().pressBack();
|
||||
getUiDevice().pressBack();
|
||||
|
@ -85,7 +85,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
writer.println(urlAddress);
|
||||
break;
|
||||
}
|
||||
sleep(10);
|
||||
sleepSeconds(10);
|
||||
}
|
||||
} else if (browser.equals("chrome")) { // Code for Chrome browser
|
||||
UiObject adressBar = new UiObject(new UiSelector()
|
||||
@ -106,7 +106,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
writer.println(urlAddress);
|
||||
break;
|
||||
}
|
||||
sleep(10);
|
||||
sleepSeconds(10);
|
||||
}
|
||||
}
|
||||
writer.close();
|
||||
|
Binary file not shown.
@ -12,7 +12,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.arm.wlauto.uiauto.skype;
|
||||
|
||||
import android.os.Bundle;
|
||||
@ -194,6 +193,6 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
new UiObject(new UiSelector().descriptionContains("Mute"));
|
||||
muteButton.click();
|
||||
|
||||
sleep(duration);
|
||||
sleepSeconds(duration);
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
Bundle status = new Bundle();
|
||||
status.putString("product", getUiDevice().getProductName());
|
||||
UiSelector selector = new UiSelector();
|
||||
sleep(3);
|
||||
sleepSeconds(3);
|
||||
UiObject text_bench = new UiObject(selector.text("Run SmartBench")
|
||||
.className("android.widget.TextView"));
|
||||
text_bench.click();
|
||||
@ -48,13 +48,13 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
|
||||
waitObject(complete_text);
|
||||
|
||||
sleep(2);
|
||||
sleepSeconds(2);
|
||||
complete_text.click();
|
||||
} finally{
|
||||
//complete_text.click();
|
||||
}
|
||||
|
||||
sleep(5);
|
||||
sleepSeconds(5);
|
||||
takeScreenshot("SmartBench");
|
||||
getAutomationSupport().sendStatus(Activity.RESULT_OK, status);
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
.className("android.widget.Button"));
|
||||
waitUntilNoObject(stop_text, 600);
|
||||
|
||||
sleep(2);
|
||||
sleepSeconds(2);
|
||||
this.extractResults();
|
||||
} finally {
|
||||
}
|
||||
@ -94,7 +94,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
if (!label.exists()){
|
||||
resultList.scrollForward();
|
||||
index--;
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
continue;
|
||||
}
|
||||
Log.v("sqlite", label.getText() + " = " + value.getText().replace("\n", " "));
|
||||
|
@ -178,9 +178,9 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
throw new UiObjectNotFoundException("Could not find \"Swipe screen\".");
|
||||
}
|
||||
}
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
swipeScreen.swipeLeft(2);
|
||||
sleep(1);
|
||||
sleepSeconds(1);
|
||||
swipeScreen.swipeLeft(2);
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
UiObject videoCurrentTime = new UiObject(new UiSelector()
|
||||
.className("android.widget.TextView").index(0));
|
||||
|
||||
sleep(samplingInterval);
|
||||
sleepSeconds(samplingInterval);
|
||||
|
||||
// Handle the time taken by the getText function
|
||||
timeBeforeGetText = new Date().getTime() / 1000;
|
||||
@ -146,7 +146,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
|
||||
}
|
||||
} else {
|
||||
sleep(videoTime);
|
||||
sleepSeconds(videoTime);
|
||||
}
|
||||
getUiDevice().pressBack();
|
||||
getUiDevice().pressHome();
|
||||
|
Binary file not shown.
@ -182,7 +182,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
new UiObject(new UiSelector().textContains("Skip ad"));
|
||||
if (skip.waitForExists(WAIT_TIMEOUT_1SEC*5)) {
|
||||
skip.click();
|
||||
sleep(VIDEO_SLEEP_SECONDS);
|
||||
sleepSeconds(VIDEO_SLEEP_SECONDS);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -199,11 +199,11 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
|
||||
public void pausePlayVideo() throws Exception {
|
||||
UiObject player = getUiObjectByResourceId(packageID + "player_fragment_container");
|
||||
sleep(VIDEO_SLEEP_SECONDS);
|
||||
sleepSeconds(VIDEO_SLEEP_SECONDS);
|
||||
repeatClickUiObject(player, 2, 100);
|
||||
sleep(1); // pause the video momentarily
|
||||
sleepSeconds(1); // pause the video momentarily
|
||||
player.click();
|
||||
sleep(VIDEO_SLEEP_SECONDS);
|
||||
sleepSeconds(VIDEO_SLEEP_SECONDS);
|
||||
}
|
||||
|
||||
public void checkVideoInfo() throws Exception {
|
||||
@ -237,6 +237,6 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
}
|
||||
// After flinging, give the window enough time to settle down before
|
||||
// the next step, or else UiAutomator fails to find views in time
|
||||
sleep(VIDEO_SLEEP_SECONDS);
|
||||
sleepSeconds(VIDEO_SLEEP_SECONDS);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user