public class SoloTestAndroidApi extends SoloTest
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_AUT_APK |
ARG_KEY_AUT_APK, ARG_KEY_AVD, ARG_KEY_INSTRUMENT_ARG, ARG_KEY_MESSENGER_APK, ARG_KEY_NO_AUT, ARG_KEY_NO_MESSENGER, ARG_KEY_NO_RUNNER, ARG_KEY_PERSIST_AVD, ARG_KEY_REMOVE_INSTALLED_APK, ARG_KEY_RESIGN_JAR, ARG_KEY_TESTRUNNER_APK, ARG_KEY_TESTRUNNER_SOURCE, argAUTpassed, argINSTRUMENTpassed, argMESSENGERpassed, argRESIGNJARpassed, argRUNNERpassed, argRUNNERSOURCEpassed, avdSerialNo, debugEnabled, DEFAULT_INSTRUMENT_ARG, DEFAULT_MESSENGER_APK, DEFAULT_TESTRUNNER_APK, DEFAULT_TESTRUNNER_SOURCE_DIR, log, mainActivityUID, persistEmulators, removeinstalledapk, robotiumTimeout, robotiumUtils, solo, unlockEmulatorScreen, weLaunchedEmulator
Constructor and Description |
---|
SoloTestAndroidApi() |
SoloTestAndroidApi(java.lang.String[] args) |
SoloTestAndroidApi(java.lang.String messengerApk,
java.lang.String testRunnerApk,
java.lang.String instrumentArg) |
Modifier and Type | Method and Description |
---|---|
void |
fail(java.lang.String message)
Before you call this method, you MUST execute a command by solo.
Otherwise, you will NOT get the correct result information. If you just want to print message, call super#fail(String) instead. |
(package private) void |
gotoCustomTitleActivity()
"App -> Activity -> Custom Title" is the path to 'Custom Title Activity'.
|
(package private) void |
gotoDateTimePicker()
"Views -> Date Widgets -> 1.
|
(package private) void |
gotoDefaultThemeActivity()
"Views -> Controls -> Default Theme" is the path to 'DefaultTheme Activity'.
|
(package private) void |
gotoDialogActivity()
"App -> Dialog " is the path to 'Dialog Activity'.
|
(package private) void |
gotoIconGrid()
"Views -> Grid -> 1.
|
(package private) void |
gotoInflateMenu()
"App -> Menu -> Inflate from XML" is the path to 'MenuInflateFromXml Activity'.
|
(package private) void |
gotoPhotoGallery()
"Views -> Gallery -> 1.
|
(package private) void |
gotoViewsList()
"Views" is the path to 'Views List'.
|
static void |
main(java.lang.String[] args) |
(package private) void |
showRemoteResult()
Before you call this method, you MUST execute a command by solo.
Otherwise, you will NOT get the correct result information. When you want to know the remote result info, call this method. Normally, when you fail, you want to know the reason, you can call this. |
protected void |
test()
Use solo to test Android ApiDemos
Solo.finishOpenedActivities()
Solo.getCurrentActivity()
Solo.waitForActivity(String)
Solo.assertMemoryNotLow()
Solo.getAllOpenActivities()
Solo.setActivityOrientation(int)
Solo.getActivityMonitor()
The other Robotium-RC methods will be tested in the following methods:
They are independent from one to other, so you can comment any them during the regression test. |
protected void |
testRelateToApplication(java.lang.String editTextIdToVerify)
Solo.getString(String)
Solo.getView(int)
The test depends on the application itself. |
(package private) void |
verifyAssertActivityMethods(java.lang.String activityClass,
java.lang.String activityName)
|
(package private) void |
verifyGetViewByIdMethods(int RID,
boolean positiveTest)
Tested methods:
Solo.getView(int) |
(package private) void |
verifyWaitActivityMethods(java.lang.String activityName,
boolean positiveTest)
Verify following methods:
Solo.waitForActivity(String)
Solo.waitForActivity(String, int) |
(package private) void |
verifyWaitForViewUIDMethods(java.lang.String viewUID,
boolean positiveTest)
Tested methods:
Solo.waitForViewUID(String)
Solo.waitForViewUID(String, int, boolean) |
debug, error, getAUTApk, getInstrumentArg, getLogsInterface, getMessengerApk, getResignJar, getTestRunnerApk, getTestRunnerSourceDir, goBackToViewUID, info, initialize, isRemoveinstalledapk, pass, pause, preparation, prepareDevice, prepareLogsInterface, process, removeInstalledAPK, scrollToBottoum, scrollToTop, setAUTApk, setInstallAUT, setInstallMessenger, setInstallRunner, setInstrumentArg, setLogsInterface, setMessengerApk, setProtocolDebug, setRebuildRunner, setRemoveinstalledapk, setResignJar, setRunnerDebug, setTestRunnerApk, setTestRunnerSourceDir, stopEmulator, terminate, warn, wrapRegex
public static final java.lang.String DEFAULT_AUT_APK
public SoloTestAndroidApi()
public SoloTestAndroidApi(java.lang.String messengerApk, java.lang.String testRunnerApk, java.lang.String instrumentArg)
public SoloTestAndroidApi(java.lang.String[] args)
args
- Array of String: {"messenger=XXX", "runner=XXX", "instrument=XXX"}protected void test()
Use solo to test Android ApiDemosTest methods as: Solo.finishOpenedActivities()
Solo.getCurrentActivity()
Solo.waitForActivity(String)
Solo.assertMemoryNotLow()
Solo.getAllOpenActivities()
Solo.setActivityOrientation(int)
Solo.getActivityMonitor()
The other Robotium-RC methods will be tested in the following methods: They are independent from one to other, so you can comment any them during the regression test.
test
in class SoloTest
verifyAssertActivityMethods(String, String)
,
verifyWaitActivityMethods(String, boolean)
,
#testCustomTitleActivity()
,
#testDefaultThemeActivity()
,
#testDialogActivity()
,
testDatePicker()
,
gotoViewsList()
,
gotoInflateMenu()
,
gotoPhotoGallery()
,
gotoIconGrid()
protected void testRelateToApplication(java.lang.String editTextIdToVerify)
Solo.getString(String)
Solo.getView(int)
The test depends on the application itself. The parameter is got from the ApiDemos android project
testEditBoxInCustomActivity()
void verifyWaitActivityMethods(java.lang.String activityName, boolean positiveTest) throws java.lang.Exception
Verify following methods:Solo.waitForActivity(String)
Solo.waitForActivity(String, int)
activityName
- String, The current activity's namepositiveTest
- boolean, true for positive test, the activityName should be valid.
false for negative test, the activityName should NOT be valid.java.lang.Exception
void verifyAssertActivityMethods(java.lang.String activityClass, java.lang.String activityName) throws java.lang.Exception
Verify following methods:Solo.assertCurrentActivityClass(String, String)
Solo.assertCurrentActivityClass(String, String, boolean)
Solo.assertCurrentActivityName(String, String)
Solo.assertCurrentActivityName(String, String, boolean)
activityClass
- The current activity's class nameactivityName
- The current activity's namejava.lang.Exception
void gotoCustomTitleActivity() throws java.lang.Exception
"App -> Activity -> Custom Title" is the path to 'Custom Title Activity'. This method will open the 'Custom Title Activity', then it will callAll tests are positive.#testEditBox()
to test some methods related to EditBox, finally it will go back to the first page of ApiDemos. During this process, it will test the following methods Tested methods:Solo.waitForView(String)
Solo.waitForView(String, int, long)
Solo.getView(String, int)
Solo.clickOnText(String)
Solo.clickOnText(String, int)
Solo.clickOnText(String, int, boolean)
Solo.clickInList(int)
Solo.goBackToActivity(String)
java.lang.Exception
void gotoDialogActivity() throws java.lang.Exception
"App -> Dialog " is the path to 'Dialog Activity'. This method will open the 'Dialog Activity' and make some test finally it will go back to the first page of ApiDemos. During this process, it will test the following methods Tested methods:All tests are positive.Solo.clickInList(int)
Solo.clickInList(int, int)
Solo.clickLongInList(int)
Solo.clickLongInList(int, int)
Solo.clickLongInList(int, int, int)
java.lang.Exception
testProgressBar()
,
testButtons()
void gotoDefaultThemeActivity() throws java.lang.Exception
"Views -> Controls -> Default Theme" is the path to 'DefaultTheme Activity'. This method will open the 'DefaultTheme Activity', then it will callAll tests are positive.#testEditBox()
to test some methods related to EditBox, finally it will go back to the first page of ApiDemos. During this process, it will test the following methods Tested methods:Solo.clickOnText(String, int, boolean)
Solo.clickOnText(String, int)
Solo.clickOnText(String)
Solo.getText(int)
Solo.getText(String)
Solo.getText(String, boolean)
Solo.getView(String, int)
Solo.waitForView(String)
Solo.getTopParent(String)
java.lang.Exception
void verifyWaitForViewUIDMethods(java.lang.String viewUID, boolean positiveTest) throws java.lang.Exception
Tested methods:Solo.waitForViewUID(String)
Solo.waitForViewUID(String, int, boolean)
viewUID
- String, the view's uidpositiveTest
- boolean, true for positive test, the viewUID should exist.
false for negative test, the viewUID should NOT exist.java.lang.Exception
void verifyGetViewByIdMethods(int RID, boolean positiveTest) throws java.lang.Exception
Tested methods:
Solo.getView(int)
RID
- int, The id used to get the view. This is the generated ID during compilation of AUT.positiveTest
- boolean, true for positive test, the RID should exist;
false for negative test, the RID should NOT exist.java.lang.Exception
void gotoDateTimePicker() throws java.lang.Exception
"Views -> Date Widgets -> 1. Dialog" is the path to 'Date Time Picker'. This method will open the DatePicker and TimePicker, and test related methods. Tested methods:All tests are positive.Solo.clickLongOnText(String)
Solo.clickLongOnText(String, int)
Solo.clickLongOnText(String, int, int)
Solo.clickLongOnText(String, int, boolean)
Solo.getView(String, int)
Solo.waitForView(String)
java.lang.Exception
void gotoViewsList() throws java.lang.Exception
"Views" is the path to 'Views List'. Tested methods:All tests are positive.Solo.getView(String, int)
Solo.waitForView(String)
Solo.clickOnText(String, int, boolean)
java.lang.Exception
void gotoInflateMenu() throws java.lang.Exception
"App -> Menu -> Inflate from XML" is the path to 'MenuInflateFromXml Activity'. This method will open the 'MenuInflateFromXml Activity', then it will callAll tests are positive.testMenu(String)
to test some methods related to Menu, finally it will go back to the first page of ApiDemos. During this process, it will test the following methods Tested methods:Solo.waitForView(String)
Solo.waitForView(String, int, long)
Solo.getView(String, int)
Solo.clickOnText(String)
Solo.clickOnText(String, int)
Solo.clickOnText(String, int, boolean)
Solo.clickInList(int)
Solo.goBackToActivity(String)
java.lang.Exception
#testMenu()
void gotoPhotoGallery() throws java.lang.Exception
"Views -> Gallery -> 1. Photos" is the path to 'Gallery1 Activity'. This method will open the 'Gallery1 Activity', then it will callAll tests are positive.testDrag()
to test some methods related to drag, finally it will go back to the first page of ApiDemos. During this process, it will test the following methods Tested methods:Solo.waitForView(String)
Solo.waitForView(String, int, long)
Solo.getView(String, int)
Solo.clickOnText(String)
Solo.clickOnText(String, int)
Solo.clickOnText(String, int, boolean)
Solo.clickInList(int)
Solo.goBackToActivity(String)
java.lang.Exception
testDrag()
void gotoIconGrid() throws java.lang.Exception
"Views -> Grid -> 1. Icon Grid" is the path to 'Grid1 Activity'. This method will open the 'Grid1 Activity', then it will callAll tests are positive.testGrid()
to test some methods related to grid, finally it will go back to the first page of ApiDemos. During this process, it will test the following methods Tested methods:Solo.waitForView(String)
Solo.waitForView(String, int, long)
Solo.getView(String, int)
Solo.clickOnText(String)
Solo.clickOnText(String, int)
Solo.clickOnText(String, int, boolean)
Solo.clickInList(int)
Solo.goBackToActivity(String)
java.lang.Exception
testGrid()
public void fail(java.lang.String message)
super#fail(String)
instead.void showRemoteResult()
public static void main(java.lang.String[] args)
args
- Array of String passed from commnand line: messenger=XXX runner=XXX instrument=XXXCopyright © SAS Institute. All Rights Reserved.