mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-04-15 07:10:56 +01:00
Minor fixes
Parse boolean from parameters Pull up TextView class string into constant
This commit is contained in:
parent
636194be3f
commit
01568d8184
Binary file not shown.
@ -28,6 +28,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
public static final String TAG = "skypeecho";
|
public static final String TAG = "skypeecho";
|
||||||
public static final String PACKAGE = "com.skype.raider";
|
public static final String PACKAGE = "com.skype.raider";
|
||||||
public static final String PACKAGE_ID = "com.skype.raider:id/";
|
public static final String PACKAGE_ID = "com.skype.raider:id/";
|
||||||
|
public static final String TEXT_VIEW = "android.widget.TextView";
|
||||||
|
|
||||||
public static String sendSmsButtonResourceId = PACKAGE_ID + "chat_menu_item_send_sms";
|
public static String sendSmsButtonResourceId = PACKAGE_ID + "chat_menu_item_send_sms";
|
||||||
public static String voiceCallButtonResourceId = PACKAGE_ID + "chat_menu_item_call_voice";
|
public static String voiceCallButtonResourceId = PACKAGE_ID + "chat_menu_item_call_voice";
|
||||||
@ -63,7 +64,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
args.callType = bundle.getString("action");
|
args.callType = bundle.getString("action");
|
||||||
args.resultsFile = bundle.getString("results_file");
|
args.resultsFile = bundle.getString("results_file");
|
||||||
args.outputDir = bundle.getString("output_dir");
|
args.outputDir = bundle.getString("output_dir");
|
||||||
args.dumpsysEnabled = bundle.getBoolean("dumpsys_enabled");
|
args.dumpsysEnabled = Boolean.parseBoolean(bundle.getString("dumpsys_enabled"));
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +82,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
String callType = parameters.getString("action");
|
String callType = parameters.getString("action");
|
||||||
String resultsFile = parameters.getString("results_file");
|
String resultsFile = parameters.getString("results_file");
|
||||||
outputDir = parameters.getString("output_dir", "/sdcard/wa-working");
|
outputDir = parameters.getString("output_dir", "/sdcard/wa-working");
|
||||||
dumpsysEnabled = parameters.getBoolean("dumpsys_enabled", true);
|
dumpsysEnabled = Boolean.parseBoolean(parameters.getString("dumpsys_enabled"));
|
||||||
|
|
||||||
// Run tests
|
// Run tests
|
||||||
Timer overallTimer = new Timer();
|
Timer overallTimer = new Timer();
|
||||||
@ -142,9 +143,9 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
// On phones, it is represented by an image with description
|
// On phones, it is represented by an image with description
|
||||||
// On tablets, it the full text is shown without a description
|
// On tablets, it the full text is shown without a description
|
||||||
try {
|
try {
|
||||||
peopleTab = getUiObjectByDescription("People", "android.widget.TextView");
|
peopleTab = getUiObjectByDescription("People", TEXT_VIEW);
|
||||||
} catch (UiObjectNotFoundException e) {
|
} catch (UiObjectNotFoundException e) {
|
||||||
peopleTab = getUiObjectByText("People", "android.widget.TextView");
|
peopleTab = getUiObjectByText("People", TEXT_VIEW);
|
||||||
}
|
}
|
||||||
peopleTab.click();
|
peopleTab.click();
|
||||||
|
|
||||||
@ -152,10 +153,10 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
// so try twice before declaring failure
|
// so try twice before declaring failure
|
||||||
UiObject contactCard;
|
UiObject contactCard;
|
||||||
try {
|
try {
|
||||||
contactCard = getUiObjectByText(name, "android.widget.TextView");
|
contactCard = getUiObjectByText(name, TEXT_VIEW);
|
||||||
} catch (UiObjectNotFoundException e) {
|
} catch (UiObjectNotFoundException e) {
|
||||||
contactCard = getUiObjectByText(name, "android.widget.TextView");
|
contactCard = getUiObjectByText(name, TEXT_VIEW);
|
||||||
// contactCard = getUiObjectByText(id, "android.widget.TextView");
|
// contactCard = getUiObjectByText(id, TEXT_VIEW);
|
||||||
}
|
}
|
||||||
contactCard.clickAndWaitForNewWindow();
|
contactCard.clickAndWaitForNewWindow();
|
||||||
timer.end();
|
timer.end();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user