Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- loadTestDB
- module N3_MTBF
- def self.MenuNavigation_05_01_09_01(loopTime)
- tcase = TestCase.new("MenuNavigation_05_01_09_01")
- tcase << TestAction.new(:pressHome_1) do
- pressHome
- end
- tcase << TestAction.new(:scriptAction_off) do
- $ignoreDefaultExpHandler = true
- waitsecond(2)
- end
- tcase << TestAction.new(:scriptAction_StartTestLog) do
- logStartTest("05_01_09_01_Menu_Navigation")
- waitsecond(2)
- end
- tcase << TestAction.new(:scriptAction_resetCounter) do
- $appCounter = 0
- waitsecond(2)
- end
- tcase << TestAction.new(:scriptAction_loop) do
- until $appCounter > 26
- $appCounter += 1
- gotoApp(db('NavApp')[$appCounter-1])
- waitsecond(2)
- pressHome
- end
- waitsecond(2)
- end
- tcase << TestAction.new(:scriptAction_StopLogTest) do
- if $appCounter == 26
- $myTestResult = true
- else
- $myTestRsult = false
- $myFailReason = "Failed"
- end
- logStopTest("05_01_09_01_Menu_Navigation")
- waitsecond(2)
- end
- tcase.run(loopTime)
- end
- def self.Messaging_05_01_02_03(loopTime)
- tcase = TestCase.new("Messaging_05_01_02_03")
- tcase << TestAction.new(:scriptAction_28) do
- logStartTest("Messaging_05_01_02_03")
- end
- tcase << TestAction.new(:gotoApp_2) do
- gotoApp('Messenger')
- end
- tcase << TestAction.new(:ImageView_StartNewConversationButton_2) do
- $ruiObj = RUIObject.new.with('objectid', -274740130).with('selfid', 916878134).with('textdescid', -2118059933).with('uniqueparentid', 0)
- .with('uitreeindex', 6)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
- .with('content-desc', 'Start new conversation')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:MultiAutoCompleteTextView_RecipientTextView_4) do
- $ruiObj = RUIObject.new.with('objectid', -1115682772).with('selfid', 1163803387).with('textdescid', -226427532).with('uniqueparentid', 0).with('classresourceid', 461007471)
- .with('uitreeindex', 1)
- .with('classname', 'MultiAutoCompleteTextView')
- .with('resource-id', 'com.google.android.apps.messaging:id/recipient_text_view')
- $ruiObj.inputtext('A01')
- waitsecond(1)
- end
- tcase << TestAction.new(:clickXY_315_513_2) do
- click(315,513)
- waitsecond(1)
- end
- tcase << TestAction.new(:EditText_ComposeMessageText_8) do
- $ruiObj = RUIObject.new.with('objectid', 1578981159).with('selfid', -1932318364).with('textdescid', 1703775705).with('uniqueparentid', 0)
- .with('uitreeindex', 5)
- .with('classname', 'EditText')
- .with('resource-id', 'com.google.android.apps.messaging:id/compose_message_text')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_141_1) do
- $ruiObj.inputtext('Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzaaaaaaaaaabbbbbbbbbbcccccccccc')
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_SendMessageButton_17) do
- $ruiObj = RUIObject.new.with('objectid', -1329122643).with('selfid', -1857249780).with('textdescid', 1740568962).with('uniqueparentid', 0)
- .with('uitreeindex', 9)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.google.android.apps.messaging:id/send_message_button')
- .with('content-desc', 'Send Message')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:pressBack_5) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_6) do
- pressBack
- end
- tcase << TestAction.new(:clickXY_344_384_2) do
- click(344,384)
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageView_More_19) do
- $ruiObj = RUIObject.new.with('objectid', -1276401870).with('selfid', 328478669).with('textdescid', -2023409951).with('uniqueparentid', 0)
- .with('uitreeindex', 17)
- .with('classname', 'ImageView')
- .with('content-desc', 'More options')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Title_21) do
- $ruiObj = RUIObject.new.with('objectid', -1362741768).with('selfid', 1635205580).with('textdescid', 299180429).with('uniqueparentid', 0).with('classresourceid', -128793897)
- .with('uitreeindex', 4)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.apps.messaging:id/title')
- .with('text', 'Delete')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:Button_Button1_23) do
- $ruiObj = RUIObject.new.with('objectid', -49953928).with('selfid', 1012902611).with('textdescid', -2073088243).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button1')
- .with('text', 'Delete')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageView_StartNewConversationButton_25) do
- $ruiObj = RUIObject.new.with('objectid', -274740130).with('selfid', 916878134).with('textdescid', -2118059933).with('uniqueparentid', 0)
- .with('uitreeindex', 6)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
- .with('content-desc', 'Start new conversation')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_30) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "Message not sent"
- end
- logStopTest("Messaging_05_01_02_03")
- end
- tcase << TestAction.new(:pressBack_53) do
- pressBack
- waitsecond(1)
- end
- tcase << TestAction.new(:pressBack_26) do
- pressBack
- waitsecond(1)
- end
- tcase.run(loopTime)
- end
- def self.MultiMedia_05_01_07_01(loopTime)
- tcase = TestCase.new("MultiMedia_05_01_07_01")
- tcase << TestAction.new(:scriptAction_1) do
- logStartTest("05_01_07_01_MultiMedia")
- end
- tcase << TestAction.new(:gotoApp_1) do
- gotoApp('Camera')
- end
- tcase << TestAction.new(:Button_PermissionAllowButton_2) do
- $ruiObj = RUIObject.new.with('objectid', 308455030).with('selfid', 1444367499).with('textdescid', -770153727).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
- .with('text', 'Allow')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:Button_ConfirmButton_4) do
- $ruiObj = RUIObject.new.with('objectid', -1187921382).with('selfid', -1055162259).with('textdescid', 1673606663).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.camera2:id/confirm_button')
- .with('text', 'NEXT')
- $ruiObj.click
- waitsecond(4)
- end
- tcase << TestAction.new(:swipeLeft_2) do
- swipe_horizontal_back 50
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_SelectorText_4) do
- $ruiObj = RUIObject.new.with('objectid', -1418579728).with('selfid', 361169431).with('textdescid', -1051676587).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.camera2:id/selector_text')
- .with('text', 'Video')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:ImageView_ShutterButton_11) do
- $ruiObj = RUIObject.new.with('objectid', -1444537032).with('selfid', 111453042).with('textdescid', 1162006437).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.android.camera2:id/shutter_button')
- .with('content-desc', 'Shutter')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:wait30second_14) do
- waitsecond(30)
- end
- tcase << TestAction.new(:ImageView_ShutterButton_StopRec) do
- $ruiObj = RUIObject.new.with('objectid', -1444537032).with('selfid', 111453042).with('textdescid', 1162006437).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.android.camera2:id/shutter_button')
- .with('content-desc', 'Shutter')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:swipeRight_3) do
- swipe_horizontal 50
- waitsecond(2)
- end
- tcase << TestAction.new(:ImageView_PlayButton_4) do
- $ruiObj = RUIObject.new.with('objectid', -1073029866).with('selfid', 2111760943).with('textdescid', 658172825).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.android.camera2:id/play_button')
- .with('content-desc', 'Play Video')
- $ruiObj.isExist
- waitsecond(2)
- end
- tcase << TestAction.new(:scriptAction_5) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason == "Video does not exist"
- end
- logStopTest("05_01_07_01_MultiMedia")
- end
- tcase << TestAction.new(:pressBack_6) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_7) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_8) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.MultiMedia_05_01_07_02(loopTime)
- tcase = TestCase.new("MultiMedia_05_01_07_02")
- tcase << TestAction.new(:scriptAction_1) do
- logStartTest("05_01_07_02_MultiMedia")
- end
- tcase << TestAction.new(:gotoApp_1) do
- gotoApp('Camera')
- waitsecond(2)
- end
- tcase << TestAction.new(:swipeRight_1) do
- swipe_horizontal 50
- waitsecond(2)
- end
- tcase << TestAction.new(:ImageView_PlayButton_3) do
- $ruiObj = RUIObject.new.with('objectid', -1073029866).with('selfid', 2111760943).with('textdescid', 658172825).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.android.camera2:id/play_button')
- .with('content-desc', 'Play Video')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:wait32second_4) do
- waitsecond(32)
- end
- tcase << TestAction.new(:clickXY_789_1272_4) do
- click(789,1272)
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_PhotosVideoplayerPauseButton_6) do
- $ruiObj = RUIObject.new.with('objectid', -587577221).with('selfid', -1751474194).with('textdescid', -1872164212).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.google.android.apps.photos:id/photos_videoplayer_pause_button')
- .with('content-desc', 'Pause video')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_7) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason == "Video did not play successfuly"
- end
- logStopTest("05_01_07_02_MultiMedia")
- end
- tcase << TestAction.new(:pressBack_8) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_9) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_10) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.MultiMedia_05_01_07_03(loopTime)
- tcase = TestCase.new("MultiMedia_05_01_07_03")
- tcase << TestAction.new(:scriptAction_1) do
- logStartTest("05_01_07_03_MultiMedia")
- end
- tcase << TestAction.new(:gotoApp_1) do
- gotoApp('Camera')
- waitsecond(2)
- end
- tcase << TestAction.new(:swipeRight_1) do
- swipe_horizontal 50
- waitsecond(2)
- end
- tcase << TestAction.new(:ImageButton_FilmstripBottomControlDelete_2) do
- $ruiObj = RUIObject.new.with('objectid', -412917821).with('selfid', 1499646221).with('textdescid', -903038264).with('uniqueparentid', 0)
- .with('uitreeindex', 5)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.camera2:id/filmstrip_bottom_control_delete')
- .with('content-desc', 'Delete')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_FilmstripBottomControlDelete_3) do
- $ruiObj = RUIObject.new.with('objectid', -412917821).with('selfid', 1499646221).with('textdescid', -903038264).with('uniqueparentid', 0)
- .with('uitreeindex', 5)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.camera2:id/filmstrip_bottom_control_delete')
- .with('content-desc', 'Delete')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_4) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason == "Video fail to delete"
- end
- logStopTest("05_01_07_03_MultiMedia")
- end
- tcase << TestAction.new(:pressBack_5) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_6) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_7) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.MultiMedia_05_01_07_04(loopTime)
- tcase = TestCase.new("MultiMedia_05_01_07_04")
- tcase << TestAction.new(:scriptAction_1) do
- logStartTest("05_01_07_04_MultiMedia")
- end
- tcase << TestAction.new(:gotoApp_1) do
- gotoApp('Camera')
- end
- tcase << TestAction.new(:swipeLeft_1) do
- swipe_horizontal_back 50
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_SelectorText_Camera) do
- $ruiObj = RUIObject.new.with('objectid', -1418579728).with('selfid', 2055244041).with('textdescid', 1854346827).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.camera2:id/selector_text')
- .with('text', 'Camera')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageView_ShutterButton_4) do
- $ruiObj = RUIObject.new.with('objectid', -1444537032).with('selfid', 111453042).with('textdescid', 1162006437).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.android.camera2:id/shutter_button')
- .with('content-desc', 'Shutter')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:swipeRight_8) do
- swipe_horizontal 50
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_FilmstripBottomControlDelete_2) do
- $ruiObj = RUIObject.new.with('objectid', -412917821).with('selfid', 1499646221).with('textdescid', -903038264).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.camera2:id/filmstrip_bottom_control_delete')
- .with('content-desc', 'Delete')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_10) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason == "Take picture FAILED"
- end
- logStopTest("05_01_07_04_MultiMedia")
- end
- tcase << TestAction.new(:pressBack_11) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_12) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_13) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.MultiMedia_05_01_07_05(loopTime)
- tcase = TestCase.new("MultiMedia_05_01_07_05")
- tcase << TestAction.new(:scriptAction_1) do
- logStartTest("05_01_07_05_MultiMedia")
- end
- tcase << TestAction.new(:gotoApp_1) do
- gotoApp('Camera')
- end
- tcase << TestAction.new(:swipeRight_4) do
- swipe_horizontal 50
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_FilmstripBottomControlDelete_2) do
- $ruiObj = RUIObject.new.with('objectid', -412917821).with('selfid', 1499646221).with('textdescid', -903038264).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.camera2:id/filmstrip_bottom_control_delete')
- .with('content-desc', 'Delete')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_8) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason == "Picutre not open"
- end
- logStopTest("05_01_07_05_MultiMedia")
- end
- tcase << TestAction.new(:pressBack_9) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_10) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_11) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.MultiMedia_05_01_07_06(loopTime)
- tcase = TestCase.new("MultiMedia_05_01_07_06")
- tcase << TestAction.new(:scriptAction_1) do
- logStartTest("05_01_07_06_MultiMedia")
- end
- tcase << TestAction.new(:gotoApp_1) do
- gotoApp('Camera')
- waitsecond(2)
- end
- tcase << TestAction.new(:swipeRight_4) do
- swipe_horizontal 50
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_FilmstripBottomControlDelete_2) do
- $ruiObj = RUIObject.new.with('objectid', -412917821).with('selfid', 1499646221).with('textdescid', -903038264).with('uniqueparentid', 0)
- .with('uitreeindex', 5)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.camera2:id/filmstrip_bottom_control_delete')
- .with('content-desc', 'Delete')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_CameraUndoDeletionButton_4) do
- $ruiObj = RUIObject.new.with('objectid', -1457329828).with('selfid', 350673501).with('textdescid', -1850027016).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.camera2:id/camera_undo_deletion_button')
- .with('text', 'UNDO')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_5) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason == "Picture is not found"
- end
- logStopTest("05_01_07_06_MultiMedia")
- end
- tcase << TestAction.new(:pressBack_6) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_7) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_8) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.MultiMedia_05_01_07_10(loopTime)
- tcase = TestCase.new("MultiMedia_05_01_07_10")
- tcase << TestAction.new(:scriptAction_1) do
- logStartTest("05_01_07_10_MultiMedia")
- end
- tcase << TestAction.new(:gotoApp_1) do
- gotoApp('YouTube')
- waitsecond(4)
- end
- tcase << TestAction.new(:ImageView_Thumbnail_3) do
- $ruiObj = RUIObject.new.with('objectid', 875683821).with('selfid', -2120336906).with('textdescid', 1376394707).with('uniqueparentid', 0)
- .with('uitreeindex', 10)
- .with('pretext', 'WATCH MORE')
- .with('classname', 'ImageView')
- .with('resource-id', 'com.google.android.youtube:id/thumbnail')
- $ruiObj.select('Similiar').click
- end
- tcase << TestAction.new(:wait10second_3) do
- waitsecond(10)
- end
- tcase << TestAction.new(:TextView_SubscribeText_7) do
- $ruiObj = RUIObject.new.with('objectid', -1804126143).with('selfid', 636792720).with('textdescid', -1109859643).with('uniqueparentid', -309765969).with('classresourceid', -1336578208)
- .with('uitreeindex', 9)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.youtube:id/subscribe_text')
- .with('content-desc', 'Subscribe to this channel')
- .with('text', 'Subscribe')
- $ruiObj.isExist
- end
- tcase << TestAction.new(:scriptAction_9) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason == "Video Streaming does not work"
- end
- logStopTest("05_01_07_10_MultiMedia")
- end
- tcase << TestAction.new(:pressBack_10) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_11) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_12) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.MultiTasking_05_01_08_01(loopTime)
- tcase = TestCase.new("MultiTasking_05_01_08_01")
- tcase << TestAction.new(:scriptAction_StartTest) do
- logStartTest("05_01_08_01_MultiTasking")
- end
- tcase << TestAction.new(:gotoApp_1_1) do
- gotoApp('Contacts')
- end
- tcase << TestAction.new(:TextView_MenuSearch_2) do
- $ruiObj = RUIObject.new.with('objectid', 1659045365).with('selfid', -439570021).with('textdescid', 660324755).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.contacts:id/menu_search')
- .with('content-desc', 'Search')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:EditText_SearchView_3_1) do
- $ruiObj = RUIObject.new.with('objectid', 255377705).with('selfid', -247474260).with('textdescid', -673225705).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.contacts:id/search_view')
- $ruiObj.inputtext('A01 a01')
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_ClivNameTextview_8_1) do
- $ruiObj = RUIObject.new.with('objectid', -1210856875).with('selfid', 1607638428).with('textdescid', -1633378553).with('uniqueparentid', 0).with('classresourceid', -744251330)
- .with('uitreeindex', 9)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.contacts:id/cliv_name_textview')
- .with('text', 'A01 a01')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageView_Icon_2) do
- $ruiObj = RUIObject.new.with('objectid', -293488011).with('selfid', -864261134).with('textdescid', -508193717).with('uniqueparentid', 0).with('classresourceid', -619883284)
- .with('uitreeindex', 4)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.android.contacts:id/icon')
- $ruiObj.select('Similiar').click
- waitsecond(1)
- end
- tcase << TestAction.new(:wait8second_31) do
- waitsecond(8)
- end
- tcase << TestAction.new(:scriptAction_BTAnswerCall) do
- sendBTCmd('answerCall')
- waitsecond(4)
- end
- tcase << TestAction.new(:scriptAction_LogStopTest) do
- $myTestResult = checkLastBTCmdResult
- if $myTestResult == false
- $myFailReason = "Call not come to other dev"
- end
- logStopTest("05_01_08_01_MultiTasking")
- end
- tcase.run(loopTime)
- end
- def self.MultiTasking_05_01_08_02(loopTime)
- tcase = TestCase.new("MultiTasking_05_01_08_02")
- tcase << TestAction.new(:scriptAction_StartTestLog) do
- logStartTest("05_01_08_02_MultiTasking")
- end
- tcase << TestAction.new(:gotoApp_1_1) do
- gotoApp('Contacts')
- waitsecond(2)
- end
- tcase << TestAction.new(:gotoApp_1_2) do
- gotoApp('Messenger')
- waitsecond(2)
- end
- tcase << TestAction.new(:gotoApp_1_3) do
- gotoApp('Phone')
- waitsecond(2)
- end
- tcase << TestAction.new(:gotoApp_1_4) do
- gotoApp('Play Store')
- waitsecond(2)
- end
- tcase << TestAction.new(:gotoApp_2) do
- gotoApp('Camera')
- waitsecond(2)
- end
- tcase << TestAction.new(:gotoApp_1_5_1) do
- gotoApp('Chrome')
- waitsecond(2)
- end
- tcase << TestAction.new(:ImageButton_DocumentMenuButton_5) do
- $ruiObj = RUIObject.new.with('objectid', -1808270022).with('selfid', -336731118).with('textdescid', -1833889831).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.chrome:id/document_menu_button')
- .with('content-desc', 'More options')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_LogStopTest) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "Apps not loaded"
- end
- logStopTest("05_01_08_02_MultiTasking")
- end
- tcase << TestAction.new(:pressBack_6) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_7) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.MultiTasking_05_01_08_03(loopTime)
- tcase = TestCase.new("MultiTasking_05_01_08_03")
- tcase << TestAction.new(:scriptAction_StartTestLog) do
- logStartTest("05_01_08_03_MultiTasking")
- end
- tcase << TestAction.new(:gotoApp_1_1) do
- gotoApp('Phone')
- end
- tcase << TestAction.new(:TextView_Text_12) do
- $ruiObj = RUIObject.new.with('objectid', 277925862).with('selfid', 938939901).with('textdescid', -793529845).with('uniqueparentid', 0).with('classresourceid', -526721384)
- .with('uitreeindex', 3)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.dialer:id/text')
- .with('text', 'Return to call in progress')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_13) do
- $ruiObj = RUIObject.new.with('objectid', 1693952669).with('selfid', 1448123190).with('textdescid', 751911782).with('uniqueparentid', 0)
- .with('uitreeindex', 10)
- .with('pretext', '0352')
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
- .with('content-desc', 'End Call')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_LogStopTest) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "End button not found"
- end
- logStopTest("05_01_08_03_MultiTasking")
- end
- tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_18) do
- $ruiObj = RUIObject.new.with('objectid', 1693952669).with('selfid', 1448123190).with('textdescid', 751911782).with('uniqueparentid', 0)
- .with('uitreeindex', 10)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
- .with('content-desc', 'End Call')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:pressHome_20) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.MultiTasking_05_01_08_04(loopTime)
- tcase = TestCase.new("MultiTasking_05_01_08_04")
- tcase << TestAction.new(:scriptAction_StartTestLog) do
- logStartTest("05_01_08_04_MultiTasking")
- end
- tcase << TestAction.new(:gotoApp_1_1) do
- gotoApp('Chrome')
- end
- tcase << TestAction.new(:Button_TermsAccept_5) do
- $ruiObj = RUIObject.new.with('objectid', 1131623741).with('selfid', 659232449).with('textdescid', -1120600562).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.chrome:id/terms_accept')
- .with('text', 'Accept continue')
- $ruiObj.click
- end
- tcase << TestAction.new(:Button_PositiveButton_6) do
- $ruiObj = RUIObject.new.with('objectid', -1302979962).with('selfid', 780691289).with('textdescid', 1735628115).with('uniqueparentid', 0)
- .with('uitreeindex', 5)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.chrome:id/positive_button')
- .with('text', 'Next')
- $ruiObj.click
- end
- tcase << TestAction.new(:Button_PositiveButton_7) do
- $ruiObj = RUIObject.new.with('objectid', -953817212).with('selfid', 780402664).with('textdescid', 1478534434).with('uniqueparentid', 0)
- .with('uitreeindex', 7)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.chrome:id/positive_button')
- .with('text', 'Done')
- $ruiObj.click
- end
- tcase << TestAction.new(:EditText_UrlBar_8) do
- $ruiObj = RUIObject.new.with('objectid', 882195433).with('selfid', 613381324).with('textdescid', 1578254679).with('uniqueparentid', 0)
- .with('uitreeindex', 7)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.chrome:id/url_bar')
- $ruiObj.inputtext('www.att.com')
- waitsecond(1)
- end
- tcase << TestAction.new(:pressEnter_5_1) do
- pressEnter
- waitsecond(4)
- end
- tcase << TestAction.new(:wait2second_2) do
- waitsecond(2)
- end
- tcase << TestAction.new(:scriptAction_LogStopTest) do
- $reload = RUIObject.new.with('objectid', -1485276626).with('selfid', 131798869).with('textdescid', -1148751605).with('uniqueparentid', -932380963)
- .with('uitreeindex', 1)
- .with('classname', 'Button')
- .with('content-desc', 'RELOAD').exists?
- $progressBar = RUIObject.new.with('objectid', 460148827).with('selfid', -703099949).with('textdescid', 1379711781).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('pretext', 'Block')
- .with('classname', 'ProgressBar')
- .with('resource-id', 'com.android.chrome:id/progress').exists?
- if ($progressBar or $reload) == true
- $myTestResult = false
- else
- $myTestResult = true
- end
- if $myTestResult == false
- $myFailReason = "Browser is not starting"
- end
- logStopTest("05_01_08_04_MultiTasking")
- end
- tcase << TestAction.new(:pressHome_1) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.MultiTasking_05_01_08_05(loopTime)
- tcase = TestCase.new("MultiTasking_05_01_08_05")
- tcase << TestAction.new(:scriptAction_StartTestLog) do
- logStartTest("05_01_08_05_MultiTasking")
- end
- tcase << TestAction.new(:gotoApp_1_1) do
- gotoApp('Contacts')
- waitsecond(2)
- end
- tcase << TestAction.new(:gotoApp_1_2) do
- gotoApp('Messenger')
- waitsecond(2)
- end
- tcase << TestAction.new(:gotoApp_1_3) do
- gotoApp('Phone')
- waitsecond(2)
- end
- tcase << TestAction.new(:gotoApp_1_4) do
- gotoApp('Play Store')
- waitsecond(2)
- end
- tcase << TestAction.new(:gotoApp_2) do
- gotoApp('Camera')
- waitsecond(2)
- end
- tcase << TestAction.new(:gotoApp_1_5) do
- gotoApp('Chrome')
- waitsecond(2)
- end
- tcase << TestAction.new(:ImageButton_DocumentMenuButton_2) do
- $ruiObj = RUIObject.new.with('objectid', -1808270022).with('selfid', -336731118).with('textdescid', -1833889831).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.chrome:id/document_menu_button')
- .with('content-desc', 'More options')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_LogStopTest) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "End button not found"
- end
- logStopTest("05_01_08_05_MultiTasking")
- end
- tcase << TestAction.new(:pressBack_3) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_4) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.MultiTasking_05_01_08_06(loopTime)
- tcase = TestCase.new("MultiTasking_05_01_08_06")
- tcase << TestAction.new(:scriptAction_StartTestLog) do
- logStartTest("05_01_08_06_MultiTasking")
- end
- tcase << TestAction.new(:gotoApp_1_1) do
- gotoApp('Chrome')
- end
- tcase << TestAction.new(:ImageButton_DocumentMenuButton_2) do
- $ruiObj = RUIObject.new.with('objectid', -1808270022).with('selfid', -336731118).with('textdescid', -1833889831).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.chrome:id/document_menu_button')
- .with('content-desc', 'More options')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_LogStopTest) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "End button not found"
- end
- logStopTest("05_01_08_06_MultiTasking")
- end
- tcase << TestAction.new(:pressHome_1) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.mainLoop(loopTime)
- $gistToken = "2dd76a146387a5d2d6aebd2baa4f89a7f0f27664"
- WebSocketXServer.setAutoUpdate(false)
- index = $mainResumeMainLoop
- $mainResumeMainLoop = 0
- writelog("mainLoop::#{index}::Resume") if index > 0
- while index < loopTime
- $curMainLoopNum = index
- $saveLogToGist = true
- $actionParamInput = "none"
- Telephony_05_01_01_01 80
- $actionParamInput = "none"
- Telephony_05_01_01_03 80
- $actionParamInput = "none"
- Telephony_05_01_01_05 100
- $actionParamInput = "none"
- Telephony_05_01_01_07 20
- $actionParamInput = "none"
- Telephony_05_01_01_06 20
- if rand(100) < 0
- for mode in db('ModemMode')
- puts "Change to #{mode}"
- if mode == 'LTE'
- writelog("Messaging_05_01_02_03_LTE")
- change_LTE 1
- Messaging_05_01_02_03 30
- elsif mode == '3G'
- writelog("Messaging_05_01_02_03_3G")
- change_3G 1
- Messaging_05_01_02_03 20
- end
- end
- end
- $actionParamInput = "none"
- Messaging_05_01_02_03 50
- if rand(100) < 0
- for mode in db('ModemMode')
- puts "Change to #{mode}"
- if mode == 'LTE'
- writelog("Messaging_05_01_02_05_LTE")
- change_LTE 1
- Messaging_05_01_02_05 30
- elsif mode == '3G'
- writelog("Messaging_05_01_02_05_3G")
- change_3G 1
- Messaging_05_01_02_05 20
- end
- end
- end
- $actionParamInput = "none"
- Messaging_05_01_02_05 50
- if rand(100) < 0
- for mode in db('ModemMode')
- puts "Change to #{mode}"
- if mode == 'LTE'
- writelog("Messaging_05_01_02_06_LTE")
- change_LTE 1
- Messaging_05_01_02_06 30
- elsif mode == '3G'
- writelog("Messaging_05_01_02_06_3G")
- change_3G 1
- Messaging_05_01_02_06 20
- end
- end
- end
- $actionParamInput = "none"
- Messaging_05_01_02_06 50
- if rand(100) < 0
- for mode in db('ModemMode')
- puts "Change to #{mode}"
- if mode == 'LTE'
- writelog("Email_05_01_03_01_LTE")
- change_LTE 1
- Email_05_01_03_01 30
- elsif mode == '3G'
- writelog("Email_05_01_03_01_3G")
- change_3G 1
- Email_05_01_03_01 20
- end
- end
- end
- $actionParamInput = "none"
- Email_05_01_03_01 50
- if rand(100) < 0
- for mode in db('ModemMode')
- puts "Change to #{mode}"
- if mode == 'LTE'
- writelog("Email_05_01_03_02_LTE")
- change_LTE 1
- Email_05_01_03_02 30
- elsif mode == '3G'
- writelog("Email_05_01_03_02_3G")
- change_3G 1
- Email_05_01_03_02 20
- end
- end
- end
- $actionParamInput = "none"
- Email_05_01_03_02 50
- $actionParamInput = "none"
- Email_05_01_03_03 50
- if rand(100) < 0
- for mode in db('ModemMode')
- puts "Change to #{mode}"
- if mode == 'LTE'
- writelog("Browser_05_01_04_01_LTE")
- change_LTE 1
- Browser_05_01_04_01 30
- elsif mode == '3G'
- writelog("Browser_05_01_04_01_3G")
- change_3G 1
- Browser_05_01_04_01 20
- end
- end
- end
- $actionParamInput = "none"
- Browser_05_01_04_01 50
- if rand(100) < 0
- for mode in db('ModemMode')
- puts "Change to #{mode}"
- if mode == 'LTE'
- writelog("Browser_05_01_04_02_LTE")
- change_LTE 1
- Browser_05_01_04_02 30
- elsif mode == '3G'
- writelog("Browser_05_01_04_02_3G")
- change_3G 1
- Browser_05_01_04_02 20
- end
- end
- end
- $actionParamInput = "none"
- Browser_05_01_04_02 50
- if rand(100) < 0
- for mode in db('ModemMode')
- puts "Change to #{mode}"
- if mode == 'LTE'
- writelog("Browser_05_01_04_03_LTE")
- change_LTE 1
- Browser_05_01_04_03 6
- elsif mode == '3G'
- writelog("Browser_05_01_04_03_3G")
- change_3G 1
- Browser_05_01_04_03 4
- end
- end
- end
- $actionParamInput = "none"
- Browser_05_01_04_03 10
- $actionParamInput = "none"
- StoreFrontDownload_05_01_05_01 20
- $actionParamInput = "none"
- StoreFrontDownload_05_01_05_02 10
- $actionParamInput = "none"
- StoreFrontDownload_05_01_05_04 1
- $actionParamInput = "none"
- StoreFrontDownload_05_01_05_05 10
- $actionParamInput = "none"
- StoreFrontDownload_05_01_05_06 10
- $actionParamInput = "none"
- StoreFrontDownload_05_01_05_07 1
- $lNumIndex = 0
- $actionParamInput = "none"
- PIM_05_01_06_01 5
- $actionParamInput = "none"
- PIM_05_01_06_02 1
- $lNumIndex = 0
- $actionParamInput = "none"
- PIM_05_01_06_03 5
- $actionParamInput = "none"
- PIM_05_01_06_04 1
- $actionParamInput = "none"
- MultiMedia_05_01_07_01 1
- $actionParamInput = "none"
- MultiMedia_05_01_07_02 1
- $actionParamInput = "none"
- MultiMedia_05_01_07_03 1
- $actionParamInput = "none"
- MultiMedia_05_01_07_04 20
- $actionParamInput = "none"
- MultiMedia_05_01_07_05 20
- $actionParamInput = "none"
- MultiMedia_05_01_07_06 20
- $actionParamInput = "none"
- MultiMedia_05_01_07_10 10
- $actionParamInput = "none"
- MultiTasking_05_01_08_01 1
- $actionParamInput = "none"
- MultiTasking_05_01_08_02 50
- $actionParamInput = "none"
- MultiTasking_05_01_08_03 1
- $actionParamInput = "none"
- MultiTasking_05_01_08_04 1
- $actionParamInput = "none"
- MultiTasking_05_01_08_05 50
- $actionParamInput = "none"
- MultiTasking_05_01_08_06 1
- $actionParamInput = "none"
- MenuNavigation_05_01_09_01 1
- $actionParamInput = "none"
- WiFi_05_01_10_01 20
- $actionParamInput = "none"
- WiFi_05_01_10_02 20
- $actionParamInput = "none"
- NFC_05_01_11_01 20
- $actionParamInput = "none"
- VoLTE_Telephony_05_01_12_01 100
- $actionParamInput = "none"
- VoLTE_Telephony_05_01_12_02 100
- $actionParamInput = "none"
- VoLTE_Telephony_05_01_12_03 100
- sendStatus("Done::mainLoop::Loop::#{index}")
- writelog("Finish::Loop::#{$curMainLoopNum}")
- saveLogFileToGist if $saveLogToGist
- index += 1
- end
- $engineStatus = "Idle"
- resetStatus
- sendStatus("Finish::mainLoop::END")
- end
- def self.NFC_05_01_11_01(loopTime)
- tcase = TestCase.new("NFC_05_01_11_01")
- tcase << TestAction.new(:gotoApp_2_1) do
- gotoApp('Settings')
- waitsecond(2)
- end
- tcase << TestAction.new(:scriptAction_StartTestLog) do
- logStartTest("05_01_11_01_NFC")
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Title_5) do
- $ruiObj = RUIObject.new.with('objectid', 1287569942).with('selfid', 1719763922).with('textdescid', -2047169343).with('uniqueparentid', 0).with('classresourceid', 1368752647)
- .with('uitreeindex', 10)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.settings:id/title')
- .with('text', 'More')
- $ruiObj.click
- noFailCheck
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Summary_4) do
- $ruiObj = RUIObject.new.with('objectid', 1704199271).with('selfid', 659735872).with('textdescid', -890658038).with('uniqueparentid', 0).with('classresourceid', -1930775675)
- .with('uitreeindex', 5)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/summary')
- .with('text', 'Allow data exchange when the phone touches another device')
- $ruiObj.click
- noFailCheck
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Summary_5) do
- $ruiObj = RUIObject.new.with('objectid', 1704199271).with('selfid', 659735872).with('textdescid', -890658038).with('uniqueparentid', 0).with('classresourceid', -1930775675)
- .with('uitreeindex', 5)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/summary')
- .with('text', 'Allow data exchange when the phone touches another device')
- $ruiObj.click
- noFailCheck
- waitsecond(2)
- end
- tcase << TestAction.new(:Switch_Switchwidget_6) do
- $ruiObj = RUIObject.new.with('objectid', -1244030269).with('selfid', 339668546).with('textdescid', 582979566).with('uniqueparentid', 0).with('classresourceid', 1136742875)
- .with('uitreeindex', 6)
- .with('classname', 'Switch')
- .with('resource-id', 'android:id/switchWidget')
- .with('text', 'OFF')
- $ruiObj.isExist
- waitsecond(2)
- end
- tcase << TestAction.new(:pressBack_7) do
- pressBack
- waitsecond(2)
- end
- tcase << TestAction.new(:pressBack_8) do
- pressBack
- waitsecond(2)
- end
- tcase << TestAction.new(:scriptAction_LogStopTest) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "End button not found"
- end
- logStopTest("05_01_11_01_NFC")
- waitsecond(2)
- end
- tcase << TestAction.new(:pressBack_10) do
- pressBack
- waitsecond(2)
- end
- tcase.run(loopTime)
- end
- def self.PIM_05_01_06_01(loopTime)
- tcase = TestCase.new("PIM_05_01_06_01")
- tcase << TestAction.new(:scriptAction_StartTestLog) do
- logStartTest("05_01_06_01_PIM")
- end
- tcase << TestAction.new(:gotoApp_4) do
- gotoApp('Calendar')
- end
- tcase << TestAction.new(:ImageView_RightArrow_2) do
- $ruiObj = RUIObject.new.with('objectid', 120576481).with('selfid', -773553589).with('textdescid', -1353191203).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.google.android.calendar:id/right_arrow')
- .with('content-desc', 'next page')
- $ruiObj.click
- end
- tcase << TestAction.new(:ImageView_RightArrow_4) do
- $ruiObj = RUIObject.new.with('objectid', 120576481).with('selfid', -773553589).with('textdescid', -1353191203).with('uniqueparentid', 0)
- .with('uitreeindex', 5)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.google.android.calendar:id/right_arrow')
- .with('content-desc', 'next page')
- $ruiObj.click
- end
- tcase << TestAction.new(:ImageView_RightArrow_6) do
- $ruiObj = RUIObject.new.with('objectid', 120576481).with('selfid', -773553589).with('textdescid', -1353191203).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.google.android.calendar:id/right_arrow')
- .with('content-desc', 'next page')
- $ruiObj.click
- end
- tcase << TestAction.new(:Button_DoneButton_8) do
- $ruiObj = RUIObject.new.with('objectid', -530367081).with('selfid', -1798297218).with('textdescid', -319241591).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'Button')
- .with('resource-id', 'com.google.android.calendar:id/done_button')
- .with('content-desc', 'Got it')
- .with('text', 'Got it')
- $ruiObj.click
- end
- tcase << TestAction.new(:TextView_ActionToday_29) do
- $ruiObj = RUIObject.new.with('objectid', 528783273).with('selfid', 751135543).with('textdescid', 225813207).with('uniqueparentid', -1270233744)
- .with('uitreeindex', 4)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.calendar:id/action_today')
- .with('content-desc', 'Jump to Today')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_AddEventButton_4) do
- $ruiObj = RUIObject.new.with('objectid', -557924199).with('selfid', 1055916483).with('textdescid', -1000414339).with('uniqueparentid', -1270233744)
- .with('uitreeindex', 17)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.google.android.calendar:id/add_event_button')
- .with('content-desc', 'Create new event')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:Button_PermissionDenyButton_2_1) do
- $ruiObj = RUIObject.new.with('objectid', -1413390985).with('selfid', 1927735163).with('textdescid', -1944711285).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.packageinstaller:id/permission_deny_button')
- .with('text', 'Deny')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:EditText_Input_4) do
- $ruiObj = RUIObject.new.with('objectid', 643796938).with('selfid', 33055906).with('textdescid', -1517131370).with('uniqueparentid', 0).with('classresourceid', -228582578)
- .with('uitreeindex', 4)
- .with('classname', 'EditText')
- .with('resource-id', 'com.google.android.calendar:id/input')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_10) do
- $ruiObj = RUIObject.new.with('objectid', 643796938).with('selfid', 33055906).with('textdescid', -1517131370).with('uniqueparentid', 0).with('classresourceid', -228582578)
- .with('uitreeindex', 4)
- .with('classname', 'EditText')
- .with('resource-id', 'com.google.android.calendar:id/input')
- $lNumIndex = 0 if !$lNumIndex or ($lNumIndex>5)
- $lNumIndex += 1
- puts "test num::" + $lNumIndex.to_s
- $ruiObj.inputtext("Event #{$lNumIndex.to_s}")
- waitsecond(1)
- end
- tcase << TestAction.new(:clickXY_996_1674_3) do
- click(996,1674)
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Save_15) do
- $ruiObj = RUIObject.new.with('objectid', 622720990).with('selfid', 1984463047).with('textdescid', 1502260065).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.calendar:id/save')
- .with('text', 'Save')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_ActionToday_7) do
- $ruiObj = RUIObject.new.with('objectid', 528783273).with('selfid', 751135543).with('textdescid', 225813207).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.calendar:id/action_today')
- .with('content-desc', 'Jump to Today')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_AddEventButton_9) do
- $ruiObj = RUIObject.new.with('objectid', -557924199).with('selfid', 1055916483).with('textdescid', -1000414339).with('uniqueparentid', 0)
- .with('uitreeindex', 11)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.google.android.calendar:id/add_event_button')
- .with('content-desc', 'Create new event')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_2) do
- $lNumIndex = 0 if $lNumIndex >= 5
- end
- tcase << TestAction.new(:pressBack_30) do
- pressBack
- end
- tcase << TestAction.new(:scriptAction_LogStopTest) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "End button not found"
- end
- logStopTest("05_01_06_01_PIM")
- end
- tcase << TestAction.new(:pressBack_10) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_2) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.PIM_05_01_06_02(loopTime)
- tcase = TestCase.new("PIM_05_01_06_02")
- tcase << TestAction.new(:gotoApp_2) do
- gotoApp('Clock')
- end
- tcase << TestAction.new(:scriptAction_StartTestLog) do
- logStartTest("05_01_06_02_PIM")
- end
- tcase << TestAction.new(:ImageView_Alarm_2) do
- $ruiObj = RUIObject.new.with('objectid', -989130666).with('selfid', 1648079).with('textdescid', -932529113).with('uniqueparentid', 0)
- .with('uitreeindex', 0)
- .with('classname', 'ImageView')
- .with('content-desc', 'Alarm')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Tomorrowlabel_6) do
- $ruiObj = RUIObject.new.with('objectid', 334182653).with('selfid', -892048669).with('textdescid', 461112888).with('uniqueparentid', 0).with('classresourceid', 1094670868)
- .with('uitreeindex', 16)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.deskclock:id/tomorrowLabel')
- .with('text', 'Tomorrow')
- $ruiObj.click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:swipeDown_8) do
- swipe_vertical 500
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_Delete_10) do
- $ruiObj = RUIObject.new.with('objectid', -2007993746).with('selfid', -691879837).with('textdescid', -169857874).with('uniqueparentid', 0).with('classresourceid', -1515260703)
- .with('uitreeindex', 16)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.deskclock:id/delete')
- .with('content-desc', 'Delete alarm')
- $ruiObj.click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_Fab_2) do
- $ruiObj = RUIObject.new.with('objectid', -1036814733).with('selfid', -1627154305).with('textdescid', 2021246789).with('uniqueparentid', 0)
- .with('uitreeindex', 9)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.deskclock:id/fab')
- .with('content-desc', 'Add alarm')
- $ruiObj.click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:Button_Button1_3) do
- $ruiObj = RUIObject.new.with('objectid', -814134535).with('selfid', -1318451484).with('textdescid', -1953962979).with('uniqueparentid', 0)
- .with('uitreeindex', 19)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button1')
- .with('text', 'OK')
- $ruiObj.click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_Delete_2) do
- $ruiObj = RUIObject.new.with('objectid', -2007993746).with('selfid', -691879837).with('textdescid', -169857874).with('uniqueparentid', 0).with('classresourceid', -1515260703)
- .with('uitreeindex', 16)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.deskclock:id/delete')
- .with('content-desc', 'Delete alarm')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:pressBack_5) do
- pressBack
- end
- tcase << TestAction.new(:scriptAction_LogStopTest) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "End button not found"
- end
- logStopTest("05_01_06_02_PIM")
- end
- tcase << TestAction.new(:pressBack_7) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.PIM_05_01_06_03(loopTime)
- tcase = TestCase.new("PIM_05_01_06_03")
- tcase << TestAction.new(:scriptAction_StartTestLog) do
- logStartTest("05_01_06_03_PIM")
- waitsecond(2)
- end
- tcase << TestAction.new(:gotoApp_2) do
- gotoApp('Calendar')
- waitsecond(2)
- end
- tcase << TestAction.new(:View_July_1) do
- $lNumIndex = 0 if !$lNumIndex or ($lNumIndex>5)
- $lNumIndex += 1
- puts "test num::" + $lNumIndex.to_s
- $ruiObj = RUIObject.new.with('objectid', 377102742).with('selfid', 2028807658).with('textdescid', 549625083).with('uniqueparentid', 0)
- .with('classname', 'android.view.View')
- .with('content-desc', "Event #{$lNumIndex.to_s}")
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:ImageView_InfoActionEditHit_8) do
- $ruiObj = RUIObject.new.with('objectid', 380027987).with('selfid', -1403720607).with('textdescid', 1865331735).with('uniqueparentid', 0)
- .with('uitreeindex', 6)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.google.android.calendar:id/info_action_edit_hit')
- .with('content-desc', 'Edit')
- $ruiObj.click
- waitsecond(4)
- end
- tcase << TestAction.new(:Button_Delete_3) do
- $ruiObj = RUIObject.new.with('objectid', 2104812391).with('selfid', 372889832).with('textdescid', -1027791815).with('uniqueparentid', 0)
- .with('uitreeindex', 27)
- .with('classname', 'Button')
- .with('resource-id', 'com.google.android.calendar:id/delete')
- .with('content-desc', 'Delete')
- .with('text', 'Delete')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:Button_Button1_6) do
- $ruiObj = RUIObject.new.with('objectid', 479367618).with('selfid', -1318451484).with('textdescid', -1986027930).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button1')
- .with('text', 'OK')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:View_1100_5) do
- $ruiObj = RUIObject.new.with('objectid', 377102742).with('selfid', 2028807658).with('textdescid', 549625083).with('uniqueparentid', 0)
- .with('classname', 'android.view.View')
- .with('content-desc', "Event #{$lNumIndex.to_s}")
- $ruiObj.isNotExist
- waitsecond(2)
- end
- tcase << TestAction.new(:scriptAction_2) do
- $lNumIndex = 0 if $lNumIndex >= 5
- waitsecond(2)
- end
- tcase << TestAction.new(:pressBack_7) do
- pressBack
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_LogStopTest) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "End button not found"
- end
- logStopTest("05_01_06_03_PIM")
- waitsecond(2)
- end
- tcase << TestAction.new(:pressBack_9) do
- pressBack
- waitsecond(1)
- end
- tcase.run(loopTime)
- end
- def self.PIM_05_01_06_04(loopTime)
- tcase = TestCase.new("PIM_05_01_06_04")
- tcase << TestAction.new(:gotoApp_2) do
- gotoApp('Clock')
- end
- tcase << TestAction.new(:scriptAction_StartTestLog) do
- logStartTest("05_01_06_04_PIM")
- end
- tcase << TestAction.new(:ImageView_Alarm_6) do
- $ruiObj = RUIObject.new.with('objectid', 1945401211).with('selfid', 1648079).with('textdescid', 1960914508).with('uniqueparentid', 0)
- .with('uitreeindex', 5)
- .with('classname', 'ImageView')
- .with('content-desc', 'Alarm')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:Switch_Onoff_7) do
- $ruiObj = RUIObject.new.with('objectid', 753165747).with('selfid', 2073383840).with('textdescid', -1273753036).with('uniqueparentid', 0).with('classresourceid', -1611357869)
- .with('uitreeindex', 9)
- .with('classname', 'Switch')
- .with('resource-id', 'com.android.deskclock:id/onoff')
- .with('text', 'ON')
- $ruiObj.isExist
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Tomorrowlabel_8) do
- $ruiObj = RUIObject.new.with('objectid', -54535908).with('selfid', -892048669).with('textdescid', 45763479).with('uniqueparentid', 0).with('classresourceid', 1094670868)
- .with('uitreeindex', 10)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.deskclock:id/tomorrowLabel')
- .with('text', 'Tomorrow')
- $ruiObj.click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:swipeDown_9) do
- swipe_vertical 500
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_Delete_12) do
- $ruiObj = RUIObject.new.with('objectid', -156281843).with('selfid', -691879837).with('textdescid', -1923352273).with('uniqueparentid', 0).with('classresourceid', -1515260703)
- .with('uitreeindex', 10)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.deskclock:id/delete')
- .with('content-desc', 'Delete alarm')
- $ruiObj.click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:Switch_Onoff_13) do
- $ruiObj = RUIObject.new.with('objectid', 753165747).with('selfid', 2073383840).with('textdescid', -1273753036).with('uniqueparentid', 0).with('classresourceid', -1611357869)
- .with('uitreeindex', 5)
- .with('classname', 'Switch')
- .with('resource-id', 'com.android.deskclock:id/onoff')
- .with('text', 'ON')
- $ruiObj.isNotExist
- waitsecond(1)
- end
- tcase << TestAction.new(:pressBack_15) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_16) do
- pressBack
- end
- tcase << TestAction.new(:scriptAction_LogStopTest) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "End button not found"
- end
- logStopTest("05_01_06_04_PIM")
- end
- tcase.run(loopTime)
- end
- def self.StoreFrontDownload_05_01_05_01(loopTime)
- tcase = TestCase.new("StoreFrontDownload_05_01_05_01")
- tcase << TestAction.new(:scriptAction_1) do
- logStartTest("05_01_05_01_StoreFrontDownload")
- end
- tcase << TestAction.new(:gotoApp_2) do
- gotoApp('Play Store')
- waitsecond(8)
- end
- tcase << TestAction.new(:ImageView_SearchBoxIdleText_4_1) do
- $ruiObj = RUIObject.new.with('objectid', 1987043402).with('selfid', 88317888).with('textdescid', -133777698).with('uniqueparentid', 0)
- .with('uitreeindex', 32)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.android.vending:id/search_box_idle_text')
- .with('content-desc', 'Search')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_True_False) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason == "Store Front is not loaded"
- end
- logStopTest("05_01_05_01_StoreFrontDownload")
- end
- tcase << TestAction.new(:pressBack_7) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_2) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.StoreFrontDownload_05_01_05_02(loopTime)
- tcase = TestCase.new("StoreFrontDownload_05_01_05_02")
- tcase << TestAction.new(:scriptAction_1) do
- logStartTest("05_01_05_02_StoreFrontDownload")
- end
- tcase << TestAction.new(:gotoApp_2) do
- gotoApp('Play Store')
- waitsecond(8)
- end
- tcase << TestAction.new(:ImageView_NavigationButton_Menu) do
- $ruiObj = RUIObject.new.with('objectid', 231512643).with('selfid', -1588424753).with('textdescid', -544180676).with('uniqueparentid', 0)
- .with('uitreeindex', 31)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.android.vending:id/navigation_button')
- .with('content-desc', 'Menu')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageView_SearchBoxIdleText_5) do
- $ruiObj = RUIObject.new.with('objectid', 1987043402).with('selfid', 88317888).with('textdescid', -133777698).with('uniqueparentid', 0)
- .with('uitreeindex', 32)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.android.vending:id/search_box_idle_text')
- .with('content-desc', 'Search')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:EditText_SearchBoxTextInput_6) do
- $ruiObj = RUIObject.new.with('objectid', 1660565057).with('selfid', 209465679).with('textdescid', -62090753).with('uniqueparentid', 0)
- .with('uitreeindex', 32)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.vending:id/search_box_text_input')
- $ruiObj.inputtext('ColorNote')
- waitsecond(1)
- end
- tcase << TestAction.new(:pressEnter_2) do
- pressEnter
- waitsecond(4)
- end
- tcase << TestAction.new(:TextView_LiTitle_4) do
- $ruiObj = RUIObject.new.with('objectid', 1456557201).with('selfid', -1969590474).with('textdescid', 83190698).with('uniqueparentid', 0)
- .with('uitreeindex', 5)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.vending:id/li_title')
- .with('content-desc', 'App: ColorNote Notepad Notes')
- .with('text', 'ColorNote Notepad Notes')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:Button_UninstallButton_UnInstall_exist) do
- $ruiObj = RUIObject.new.with('objectid', -1388871150).with('selfid', -895718918).with('textdescid', -1334831508).with('uniqueparentid', 0)
- .with('uitreeindex', 7)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.vending:id/uninstall_button')
- .with('text', 'UNINSTALL')
- $ruiObj.isExist
- ifFailJumpTo(:Button_BuyButton_1)
- waitsecond(1)
- end
- tcase << TestAction.new(:Button_UninstallButton_UninstallCK_1) do
- $ruiObj = RUIObject.new.with('objectid', -1388871150).with('selfid', -895718918).with('textdescid', -1334831508).with('uniqueparentid', 0)
- .with('uitreeindex', 7)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.vending:id/uninstall_button')
- .with('text', 'UNINSTALL')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:Button_Button1_Clk_OK) do
- $ruiObj = RUIObject.new.with('objectid', 1379336962).with('selfid', -1318451484).with('textdescid', -1993773146).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button1')
- .with('text', 'OK')
- $ruiObj.click
- waitsecond(8)
- end
- tcase << TestAction.new(:Button_BuyButton_1) do
- $ruiObj = RUIObject.new.with('objectid', 1237348910).with('selfid', -652886121).with('textdescid', 538738615).with('uniqueparentid', 0)
- .with('uitreeindex', 7)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.vending:id/buy_button')
- .with('text', 'INSTALL')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_ContinueButtonLabel_3_Press_Accept) do
- $ruiObj = RUIObject.new.with('objectid', 1608355813).with('selfid', 961982222).with('textdescid', -287969571).with('uniqueparentid', 0)
- .with('uitreeindex', 7)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.vending:id/continue_button_label')
- .with('text', 'ACCEPT')
- $ruiObj.click
- waitsecond(8)
- end
- tcase << TestAction.new(:wait8second_6) do
- waitsecond(8)
- end
- tcase << TestAction.new(:Button_UninstallButton_UninstallCK) do
- $ruiObj = RUIObject.new.with('objectid', -1388871150).with('selfid', -895718918).with('textdescid', -1334831508).with('uniqueparentid', 0)
- .with('uitreeindex', 7)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.vending:id/uninstall_button')
- .with('text', 'UNINSTALL')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_CheckPass) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason == "Install Failed"
- end
- logStopTest("05_01_05_02_StoreFrontDownload")
- end
- tcase << TestAction.new(:pressBack_16) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_17) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_19) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.StoreFrontDownload_05_01_05_04(loopTime)
- tcase = TestCase.new("StoreFrontDownload_05_01_05_04")
- tcase << TestAction.new(:scriptAction_1) do
- logStartTest("05_01_05_04_StoreFrontDownload")
- end
- tcase << TestAction.new(:gotoApp_2) do
- gotoApp('Play Store')
- end
- tcase << TestAction.new(:TextView_LiTitle_APPS) do
- $ruiObj = RUIObject.new.with('objectid', -1564107443).with('selfid', 1565542305).with('textdescid', 284184411).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.vending:id/li_title')
- .with('text', 'APPS')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:pressBack_3) do
- pressBack
- end
- tcase << TestAction.new(:scriptAction_True_False) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason == "Store Front cannot open and close"
- end
- logStopTest("05_01_05_04_StoreFrontDownload")
- end
- tcase << TestAction.new(:pressBack_2) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_3) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.StoreFrontDownload_05_01_05_05(loopTime)
- tcase = TestCase.new("StoreFrontDownload_05_01_05_05")
- tcase << TestAction.new(:scriptAction_1) do
- logStartTest("05_01_05_05_StoreFrontDownload")
- end
- tcase << TestAction.new(:gotoApp_2) do
- gotoApp('ColorNote')
- end
- tcase << TestAction.new(:TextView_EmptyText_AddNoteCK) do
- $ruiObj = RUIObject.new.with('objectid', -1225710509).with('selfid', -126164144).with('textdescid', -1803056542).with('uniqueparentid', 0)
- .with('uitreeindex', 6)
- .with('classname', 'TextView')
- .with('resource-id', 'com.socialnmobile.dictapps.notepad.color.note:id/empty_text')
- .with('text', 'Add Note')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:pressBack_4) do
- pressBack
- end
- tcase << TestAction.new(:scriptAction_True_False) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason == "Store Front is not loaded"
- end
- logStopTest("05_01_05_05_StoreFrontDownload")
- end
- tcase << TestAction.new(:pressHome_1) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.StoreFrontDownload_05_01_05_06(loopTime)
- tcase = TestCase.new("StoreFrontDownload_05_01_05_06")
- tcase << TestAction.new(:scriptAction_1) do
- logStartTest("05_01_05_06_StoreFrontDownload")
- end
- tcase << TestAction.new(:gotoApp_2) do
- gotoApp('Play Store')
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageView_SearchBoxIdleText_12) do
- $ruiObj = RUIObject.new.with('objectid', 1987043402).with('selfid', 88317888).with('textdescid', -133777698).with('uniqueparentid', 0)
- .with('uitreeindex', 28)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.android.vending:id/search_box_idle_text')
- .with('content-desc', 'Search')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:EditText_SearchBoxTextInput_13) do
- $ruiObj = RUIObject.new.with('objectid', 1660565057).with('selfid', 209465679).with('textdescid', -62090753).with('uniqueparentid', 0)
- .with('uitreeindex', 28)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.vending:id/search_box_text_input')
- $ruiObj.inputtext('ColorNote')
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_SuggestText_16) do
- $ruiObj = RUIObject.new.with('objectid', 193809363).with('selfid', 208620854).with('textdescid', 1052874934).with('uniqueparentid', 0)
- .with('uitreeindex', 32)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.vending:id/suggest_text')
- .with('text', 'ColorNote Notepad Notes')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_LiTitle_2) do
- $ruiObj = RUIObject.new.with('objectid', 1456557201).with('selfid', -1969590474).with('textdescid', 83190698).with('uniqueparentid', 0)
- .with('uitreeindex', 5)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.vending:id/li_title')
- .with('content-desc', 'App: ColorNote Notepad Notes')
- .with('text', 'ColorNote Notepad Notes')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:Button_LaunchButton_18) do
- $ruiObj = RUIObject.new.with('objectid', 515078971).with('selfid', 328139855).with('textdescid', 387228145).with('uniqueparentid', 0)
- .with('uitreeindex', 8)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.vending:id/launch_button')
- .with('text', 'OPEN')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_EmptyText_AddNoteCK) do
- $ruiObj = RUIObject.new.with('objectid', -1225710509).with('selfid', -126164144).with('textdescid', -1803056542).with('uniqueparentid', 0)
- .with('uitreeindex', 6)
- .with('classname', 'TextView')
- .with('resource-id', 'com.socialnmobile.dictapps.notepad.color.note:id/empty_text')
- .with('text', 'Add Note')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:pressBack_20) do
- pressBack
- end
- tcase << TestAction.new(:scriptAction_22) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason == "Open DL app from Store Front Fail"
- end
- logStopTest("05_01_05_06_StoreFrontDownload")
- end
- tcase << TestAction.new(:pressBack_23) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_2) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_24) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.StoreFrontDownload_05_01_05_07(loopTime)
- tcase = TestCase.new("StoreFrontDownload_05_01_05_07")
- tcase << TestAction.new(:scriptAction_1) do
- logStartTest("05_01_05_07_StoreFrontDownload")
- end
- tcase << TestAction.new(:gotoApp_2) do
- gotoApp('Play Store')
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageView_SearchBoxIdleText_5) do
- $ruiObj = RUIObject.new.with('objectid', 1987043402).with('selfid', 88317888).with('textdescid', -133777698).with('uniqueparentid', 0)
- .with('uitreeindex', 32)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.android.vending:id/search_box_idle_text')
- .with('content-desc', 'Search')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:EditText_SearchBoxTextInput_6) do
- $ruiObj = RUIObject.new.with('objectid', 1660565057).with('selfid', 209465679).with('textdescid', -62090753).with('uniqueparentid', 0)
- .with('uitreeindex', 32)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.vending:id/search_box_text_input')
- $ruiObj.inputtext('ColorNote')
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_SuggestText_7_Click_ColorNote) do
- $ruiObj = RUIObject.new.with('objectid', 193809363).with('selfid', 208620854).with('textdescid', 1052874934).with('uniqueparentid', 0)
- .with('uitreeindex', 36)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.vending:id/suggest_text')
- .with('text', 'ColorNote Notepad Notes')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_LiTitle_2) do
- $ruiObj = RUIObject.new.with('objectid', 1456557201).with('selfid', -1969590474).with('textdescid', 83190698).with('uniqueparentid', 0)
- .with('uitreeindex', 5)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.vending:id/li_title')
- .with('content-desc', 'App: ColorNote Notepad Notes')
- .with('text', 'ColorNote Notepad Notes')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:Button_UninstallButton_15_pressed) do
- $ruiObj = RUIObject.new.with('objectid', -1388871150).with('selfid', -895718918).with('textdescid', -1334831508).with('uniqueparentid', 0)
- .with('uitreeindex', 7)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.vending:id/uninstall_button')
- .with('text', 'UNINSTALL')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:Button_Button1_16_pressed_OK) do
- $ruiObj = RUIObject.new.with('objectid', 1379336962).with('selfid', -1318451484).with('textdescid', -1993773146).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button1')
- .with('text', 'OK')
- $ruiObj.click
- waitsecond(8)
- end
- tcase << TestAction.new(:Button_BuyButton_18_Install) do
- $ruiObj = RUIObject.new.with('objectid', 1237348910).with('selfid', -652886121).with('textdescid', 538738615).with('uniqueparentid', 0)
- .with('uitreeindex', 7)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.vending:id/buy_button')
- .with('text', 'INSTALL')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_CheckPass) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason == "Install Failed"
- end
- logStopTest("05_01_05_07_StoreFrontDownload")
- end
- tcase << TestAction.new(:pressBack_16) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_17) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_19) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.Telephony_05_01_01_06(loopTime)
- tcase = TestCase.new("Telephony_05_01_01_06")
- tcase << TestAction.new(:scriptAction_StartTestLog) do
- logStartTest("05_01_01_06_Telephony")
- end
- tcase << TestAction.new(:gotoApp_3) do
- gotoApp('Contacts')
- end
- tcase << TestAction.new(:TextView_MenuSearch_4) do
- $ruiObj = RUIObject.new.with('objectid', 1551078554).with('selfid', -439570021).with('textdescid', 534830222).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.contacts:id/menu_search')
- .with('content-desc', 'Search')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:EditText_SearchView_5) do
- $ruiObj = RUIObject.new.with('objectid', 977615524).with('selfid', -247474260).with('textdescid', 241310204).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.contacts:id/search_view')
- $ruiObj.inputtext('tn tn')
- waitsecond(1)
- end
- tcase << TestAction.new(:pressEnter_18) do
- pressEnter
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_ClivNameTextview_19) do
- $ruiObj = RUIObject.new.with('objectid', -1210856875).with('selfid', 194238690).with('textdescid', -1180900197).with('uniqueparentid', 0).with('classresourceid', -744251330)
- .with('uitreeindex', 5)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.contacts:id/cliv_name_textview')
- .with('text', 'tn')
- $ruiObj.select('ItemFirst').click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_LargeTitle_2) do
- $ruiObj = RUIObject.new.with('objectid', -1985058549).with('selfid', -446575753).with('textdescid', -622639339).with('uniqueparentid', 0)
- .with('uitreeindex', 18)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.contacts:id/large_title')
- .with('text', 'Tn tn')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_More_20) do
- $ruiObj = RUIObject.new.with('objectid', 1530299704).with('selfid', 1290820192).with('textdescid', -357708773).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'ImageButton')
- .with('content-desc', 'More options')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Title_21) do
- $ruiObj = RUIObject.new.with('objectid', -1398759800).with('selfid', -342341268).with('textdescid', -918160867).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 0)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'Delete')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:Button_Button1_22) do
- $ruiObj = RUIObject.new.with('objectid', -195446968).with('selfid', -1318451484).with('textdescid', 917278956).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button1')
- .with('text', 'OK')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:Button_Button1_22_1) do
- $ruiObj = RUIObject.new.with('objectid', -195446968).with('selfid', -1318451484).with('textdescid', 917278956).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button1')
- .with('text', 'OK')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_LogStopTest) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "End button not found"
- end
- logStopTest("05_01_01_06_Telephony")
- end
- tcase << TestAction.new(:pressBack_2) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_3) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.Telephony_05_01_01_07(loopTime)
- tcase = TestCase.new("Telephony_05_01_01_07")
- tcase << TestAction.new(:scriptAction_StartTestLog) do
- logStartTest("05_01_01_07_Telephony")
- end
- tcase << TestAction.new(:gotoApp_3) do
- gotoApp('Contacts')
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_FloatingActionButton_4) do
- $ruiObj = RUIObject.new.with('objectid', -767699037).with('selfid', 1968371911).with('textdescid', 1777597732).with('uniqueparentid', 0)
- .with('uitreeindex', 22)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.contacts:id/floating_action_button')
- .with('content-desc', 'add new contact')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:clickXY_246_1098_2) do
- click(246,1098)
- waitsecond(1)
- end
- tcase << TestAction.new(:EditText_6) do
- $ruiObj = RUIObject.new.with('objectid', -81050771).with('selfid', 1666676343).with('textdescid', 1782393427).with('uniqueparentid', 0).with('classresourceid', 1666676343)
- .with('uitreeindex', 9)
- .with('pretext', 'nalabqct01gmailcom?0')
- .with('classname', 'EditText')
- $ruiObj.inputtext('tn tn')
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_MenuSave_10) do
- $ruiObj = RUIObject.new.with('objectid', -921598295).with('selfid', -351480207).with('textdescid', -1293285452).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.contacts:id/menu_save')
- .with('content-desc', 'Save')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_MenuSave_10_1) do
- $ruiObj = RUIObject.new.with('objectid', -921598295).with('selfid', -351480207).with('textdescid', -1293285452).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.contacts:id/menu_save')
- .with('content-desc', 'Save')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_LogStopTest) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "Contact is not saved"
- end
- logStopTest("05_01_01_07_Telephony")
- end
- tcase << TestAction.new(:pressBack_5) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_6) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.Telephony_test(loopTime)
- tcase = TestCase.new("Telephony_test")
- tcase << TestAction.new(:scriptAction_2) do
- $saveLogToGist = true
- end
- tcase << TestAction.new(:callTest_5_1) do
- $actionParamInput = "none"
- Telephony_05_01_01_01 80
- end
- tcase << TestAction.new(:callTest_274) do
- $actionParamInput = "none"
- Telephony_05_01_01_03 80
- end
- tcase << TestAction.new(:callTest_21) do
- $actionParamInput = "none"
- Telephony_05_01_01_05 100
- end
- tcase << TestAction.new(:callTest_40) do
- $actionParamInput = "none"
- Telephony_05_01_01_06 20
- end
- tcase << TestAction.new(:callTest_40_1) do
- $actionParamInput = "none"
- Telephony_05_01_01_07 20
- end
- tcase << TestAction.new(:callTest_43_1) do
- $actionParamInput = "none"
- VoLTE_Telephony_05_01_12_01 100
- end
- tcase << TestAction.new(:callTest_43_1_1) do
- $actionParamInput = "none"
- VoLTE_Telephony_05_01_12_02 100
- end
- tcase << TestAction.new(:callTest_43_1_1_1) do
- $actionParamInput = "none"
- VoLTE_Telephony_05_01_12_03 100
- end
- tcase.run(loopTime)
- end
- def self.VoLTE_Telephony_05_01_12_01(loopTime)
- tcase = TestCase.new("VoLTE_Telephony_05_01_12_01")
- tcase << TestAction.new(:scriptAction_StartTest) do
- logStartTest("05_01_12_01_VoLTE_Telephony")
- end
- tcase << TestAction.new(:gotoApp_1_1) do
- gotoApp('Contacts')
- end
- tcase << TestAction.new(:TextView_MenuSearch_2) do
- $ruiObj = RUIObject.new.with('objectid', 1659045365).with('selfid', -439570021).with('textdescid', 660324755).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.contacts:id/menu_search')
- .with('content-desc', 'Search')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:EditText_SearchView_4) do
- $ruiObj = RUIObject.new.with('objectid', 255377705).with('selfid', -247474260).with('textdescid', -673225705).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.contacts:id/search_view')
- $ruiObj.inputtext('A01 a01')
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_ClivNameTextview_8_1) do
- $ruiObj = RUIObject.new.with('objectid', -1210856875).with('selfid', 1607638428).with('textdescid', -1633378553).with('uniqueparentid', 0).with('classresourceid', -744251330)
- .with('uitreeindex', 9)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.contacts:id/cliv_name_textview')
- .with('text', 'A01 a01')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:clickXY_120_1290_6) do
- click(120,1290)
- waitsecond(2)
- end
- tcase << TestAction.new(:wait8second_31) do
- waitsecond(8)
- end
- tcase << TestAction.new(:scriptAction_BTAnswerCall) do
- sendBTCmd('answerCall')
- waitsecond(4)
- end
- tcase << TestAction.new(:scriptAction_LogStopTest_1_1) do
- $myTestResult = checkLastBTCmdResult
- if $myTestResult == false
- $myFailReason = "Call not come to other dev"
- end
- logStopTest("05_01_12_01_VoLTE_Telephony")
- end
- tcase << TestAction.new(:scriptAction_BTEndCall) do
- sendBTCmd('endCall')
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_7) do
- $ruiObj = RUIObject.new.with('objectid', -866535814).with('selfid', 1448123190).with('textdescid', -89777303).with('uniqueparentid', 0)
- .with('uitreeindex', 8)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
- .with('content-desc', 'End Call')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:pressBack_3) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_4) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.VoLTE_Telephony_05_01_12_02(loopTime)
- tcase = TestCase.new("VoLTE_Telephony_05_01_12_02")
- tcase << TestAction.new(:scriptAction_StartTest) do
- logStartTest("05_01_12_02_VoLTE_Telephony")
- end
- tcase << TestAction.new(:gotoApp_1_1) do
- gotoApp('Phone')
- end
- tcase << TestAction.new(:View_Recents_2) do
- $ruiObj = RUIObject.new.with('objectid', 1536973457).with('selfid', 954785271).with('textdescid', 1871997065).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'android.view.View')
- .with('content-desc', 'Recents')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageView_PrimaryActionButton_8) do
- $ruiObj = RUIObject.new.with('objectid', 1321106203).with('selfid', 1174798435).with('textdescid', 1240128135).with('uniqueparentid', 0)
- .with('uitreeindex', 8)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.android.dialer:id/primary_action_button')
- .with('content-desc', 'Call A01 a01')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:wait8second_31) do
- waitsecond(8)
- end
- tcase << TestAction.new(:scriptAction_BTAnswerCall) do
- sendBTCmd('answerCall')
- waitsecond(4)
- end
- tcase << TestAction.new(:scriptAction_LogStopTest) do
- $myTestResult = checkLastBTCmdResult
- if $myTestResult == false
- $myFailReason = "Call not come to other dev"
- end
- logStopTest("05_01_12_02_VoLTE_Telephony")
- end
- tcase << TestAction.new(:scriptAction_BTEndCall) do
- sendBTCmd('endCall')
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_7) do
- $ruiObj = RUIObject.new.with('objectid', -866535814).with('selfid', 1448123190).with('textdescid', -89777303).with('uniqueparentid', 0)
- .with('uitreeindex', 8)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
- .with('content-desc', 'End Call')
- $ruiObj.click
- noFailCheck
- end
- tcase << TestAction.new(:pressBack_1) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_2) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.WiFi_05_01_10_01(loopTime)
- tcase = TestCase.new("WiFi_05_01_10_01")
- tcase << TestAction.new(:scriptAction_2) do
- logStartTest("05_01_10_01_WiFi")
- end
- tcase << TestAction.new(:gotoApp_1_1) do
- gotoApp('Settings')
- end
- tcase << TestAction.new(:swipeUp_1) do
- swipe_vertical_back 500
- end
- tcase << TestAction.new(:swipeUp_2) do
- swipe_vertical_back 500
- end
- tcase << TestAction.new(:swipeUp_3) do
- swipe_vertical_back 500
- end
- tcase << TestAction.new(:swipeUp_4) do
- swipe_vertical_back 500
- end
- tcase << TestAction.new(:TextView_Title_Wifi) do
- $ruiObj = RUIObject.new.with('objectid', 1287569942).with('selfid', 1720054706).with('textdescid', -2038155039).with('uniqueparentid', 0).with('classresourceid', 1368752647)
- .with('uitreeindex', 4)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.settings:id/title')
- .with('text', 'WiFi')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_SwitchText_15) do
- $ruiObj = RUIObject.new.with('objectid', -1971573453).with('selfid', 1955659484).with('textdescid', 1769741716).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.settings:id/switch_text')
- .with('text', 'On')
- $ruiObj.isExist
- ifFailJumpTo(:Switch_SwitchWidget_OFF)
- waitsecond(1)
- end
- tcase << TestAction.new(:Switch_SwitchWidget_ON) do
- $ruiObj = RUIObject.new.with('objectid', -489552312).with('selfid', -1921366703).with('textdescid', -2107285431).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'Switch')
- .with('resource-id', 'com.android.settings:id/switch_widget')
- .with('text', 'ON')
- $ruiObj.click
- waitsecond(4)
- end
- tcase << TestAction.new(:Switch_SwitchWidget_OFF) do
- $ruiObj = RUIObject.new.with('objectid', -489552312).with('selfid', 567174173).with('textdescid', -901345399).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'Switch')
- .with('resource-id', 'com.android.settings:id/switch_widget')
- .with('text', 'OFF')
- $ruiObj.click
- waitsecond(8)
- end
- tcase << TestAction.new(:TextView_SwitchText_9) do
- $ruiObj = RUIObject.new.with('objectid', -1971573453).with('selfid', 1955659484).with('textdescid', 1769741716).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.settings:id/switch_text')
- .with('text', 'On')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:Switch_SwitchWidget_ON_1) do
- $ruiObj = RUIObject.new.with('objectid', -489552312).with('selfid', -1921366703).with('textdescid', -2107285431).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'Switch')
- .with('resource-id', 'com.android.settings:id/switch_widget')
- .with('text', 'ON')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_10_TrueFalse) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason == "WiFi cannot turn ON"
- end
- logStopTest("05_01_10_01_WiFi")
- end
- tcase << TestAction.new(:pressBack_20) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_21) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_22) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.WiFi_05_01_10_02(loopTime)
- tcase = TestCase.new("WiFi_05_01_10_02")
- tcase << TestAction.new(:scriptAction_2) do
- logStartTest("05_01_10_02_WiFi")
- end
- tcase << TestAction.new(:gotoApp_4) do
- gotoApp('Settings')
- end
- tcase << TestAction.new(:swipeUp_2) do
- swipe_vertical_back 500
- end
- tcase << TestAction.new(:swipeUp_4) do
- swipe_vertical_back 500
- end
- tcase << TestAction.new(:swipeUp_6) do
- swipe_vertical_back 500
- end
- tcase << TestAction.new(:swipeUp_8) do
- swipe_vertical_back 500
- end
- tcase << TestAction.new(:TextView_Title_5) do
- $ruiObj = RUIObject.new.with('objectid', 1287569942).with('selfid', 1720054706).with('textdescid', -2038155039).with('uniqueparentid', 0).with('classresourceid', 1368752647)
- .with('uitreeindex', 4)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.settings:id/title')
- .with('text', 'WiFi')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_SwitchText_2) do
- $ruiObj = RUIObject.new.with('objectid', -1971573453).with('selfid', 495901714).with('textdescid', -972587138).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.settings:id/switch_text')
- .with('text', 'Off')
- $ruiObj.isExist
- ifFailJumpTo(:TextView_Summary_Connected)
- waitsecond(2)
- end
- tcase << TestAction.new(:Switch_SwitchWidget_3) do
- $ruiObj = RUIObject.new.with('objectid', -489552312).with('selfid', 567174173).with('textdescid', -901345399).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'Switch')
- .with('resource-id', 'com.android.settings:id/switch_widget')
- .with('text', 'OFF')
- $ruiObj.click
- waitsecond(8)
- end
- tcase << TestAction.new(:wait4second_2) do
- waitsecond(4)
- end
- tcase << TestAction.new(:TextView_Summary_Connected) do
- $ruiObj = RUIObject.new.with('objectid', 1704199271).with('selfid', -404041766).with('textdescid', -634935376).with('uniqueparentid', 0).with('classresourceid', -1930775675)
- .with('uitreeindex', 7)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/summary')
- .with('text', 'Connected')
- $ruiObj.isExist
- ifFailJumpTo(:TextView_Title_QCTCOMP_2)
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Title_QCTCOMP) do
- $ruiObj = RUIObject.new.with('objectid', 274971481).with('selfid', -71636208).with('textdescid', 341957782).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 6)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'QCTCOMP')
- $ruiObj.click
- waitsecond(4)
- end
- tcase << TestAction.new(:Button_Button3_Disconnect_1) do
- $ruiObj = RUIObject.new.with('objectid', 972638586).with('selfid', 1759634711).with('textdescid', -1808285939).with('uniqueparentid', 0)
- .with('uitreeindex', 11)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button3')
- .with('text', 'Forget')
- $ruiObj.click
- waitsecond(8)
- end
- tcase << TestAction.new(:TextView_Title_QCTCOMP_2) do
- $ruiObj = RUIObject.new.with('objectid', 274971481).with('selfid', -71636208).with('textdescid', 341957782).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 10)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'QCTCOMP')
- $ruiObj.isExist
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Title_7) do
- $ruiObj = RUIObject.new.with('objectid', 274971481).with('selfid', -71636208).with('textdescid', 341957782).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 12)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'QCTCOMP')
- $ruiObj.click
- waitsecond(8)
- end
- tcase << TestAction.new(:EditText_Password_8) do
- $ruiObj = RUIObject.new.with('objectid', 780695774).with('selfid', 8195995).with('textdescid', -1568234750).with('uniqueparentid', 0).with('classresourceid', 1413676103)
- .with('uitreeindex', 2)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.settings:id/password')
- $ruiObj.inputtext('12abcdef34')
- waitsecond(2)
- end
- tcase << TestAction.new(:Button_Button1_Connect) do
- $ruiObj = RUIObject.new.with('objectid', 972638584).with('selfid', 736098498).with('textdescid', -870791618).with('uniqueparentid', 0)
- .with('uitreeindex', 7)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button1')
- .with('text', 'Connect')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:wait8second_11_20s) do
- waitsecond(20)
- end
- tcase << TestAction.new(:TextView_Summary_2) do
- $ruiObj = RUIObject.new.with('objectid', 1704199271).with('selfid', -404041766).with('textdescid', -634935376).with('uniqueparentid', 0).with('classresourceid', -1930775675)
- .with('uitreeindex', 7)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/summary')
- .with('text', 'Connected')
- $ruiObj.isExist
- waitsecond(2)
- end
- tcase << TestAction.new(:scriptAction_23_TrueFalse) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason == "WiFi cannot connected"
- end
- logStopTest("05_01_10_02_WiFi")
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Title_QCTCOM_Disconnect) do
- $ruiObj = RUIObject.new.with('objectid', 274971481).with('selfid', -71636208).with('textdescid', 341957782).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 6)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'QCTCOMP')
- $ruiObj.click
- waitsecond(4)
- end
- tcase << TestAction.new(:Button_Button3_Disconnect_2) do
- $ruiObj = RUIObject.new.with('objectid', 972638586).with('selfid', 1759634711).with('textdescid', -1808285939).with('uniqueparentid', 0)
- .with('uitreeindex', 11)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button3')
- .with('text', 'Forget')
- $ruiObj.click
- waitsecond(8)
- end
- tcase << TestAction.new(:pressBack_15) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_16) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_17) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.android_ExpHandler(loopTime)
- tcase = TestCase.new("android_ExpHandler")
- tcase << TestAction.new(:scriptAction_check) do
- $err = "system popup detected::#{takeScreenShot}::screenshot saved"
- $myTestResult = false
- puts $err
- logcat($err)
- writelog($err)
- uiObj("Button").click if uiObj("Button").exists
- waitsecond(2)
- end
- tcase.run(loopTime)
- end
- def self.change_3G(loopTime)
- tcase = TestCase.new("change_3G")
- tcase << TestAction.new(:gotoApp_16) do
- gotoApp('Settings')
- end
- tcase << TestAction.new(:TextView_Title_3) do
- $ruiObj = RUIObject.new.with('objectid', 163488192).with('selfid', 1719763922).with('textdescid', -163928853).with('uniqueparentid', 0).with('classresourceid', 1368752647)
- .with('uitreeindex', 10)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.settings:id/title')
- .with('text', 'More')
- $ruiObj.click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Title_4) do
- $ruiObj = RUIObject.new.with('objectid', -350873494).with('selfid', 1467675546).with('textdescid', -657722085).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 11)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'Cellular networks')
- $ruiObj.click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Title_5) do
- $ruiObj = RUIObject.new.with('objectid', 860106418).with('selfid', 517165292).with('textdescid', 1981620935).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 5)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'Preferred network type')
- $ruiObj.click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:CheckedTextView_Text1_6) do
- $ruiObj = RUIObject.new.with('objectid', -442050023).with('selfid', 969723944).with('textdescid', -1541834331).with('uniqueparentid', 0).with('classresourceid', 2074814108)
- .with('uitreeindex', 2)
- .with('classname', 'CheckedTextView')
- .with('resource-id', 'android:id/text1')
- .with('text', '3G')
- $ruiObj.click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:pressBack_7) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_8) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_9) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.change_LTE(loopTime)
- tcase = TestCase.new("change_LTE")
- tcase << TestAction.new(:gotoApp_16) do
- gotoApp('Settings')
- end
- tcase << TestAction.new(:TextView_Title_3) do
- $ruiObj = RUIObject.new.with('objectid', 163488192).with('selfid', 1719763922).with('textdescid', -163928853).with('uniqueparentid', 0).with('classresourceid', 1368752647)
- .with('uitreeindex', 10)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.settings:id/title')
- .with('text', 'More')
- $ruiObj.click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Title_4) do
- $ruiObj = RUIObject.new.with('objectid', -350873494).with('selfid', 1467675546).with('textdescid', -657722085).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 11)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'Cellular networks')
- $ruiObj.click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Title_5) do
- $ruiObj = RUIObject.new.with('objectid', 860106418).with('selfid', 517165292).with('textdescid', 1981620935).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 5)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'Preferred network type')
- $ruiObj.click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:CheckedTextView_Text1_2) do
- $ruiObj = RUIObject.new.with('objectid', -442050023).with('selfid', 1679268164).with('textdescid', 1652493263).with('uniqueparentid', 0).with('classresourceid', 2074814108)
- .with('uitreeindex', 1)
- .with('classname', 'CheckedTextView')
- .with('resource-id', 'android:id/text1')
- .with('text', 'LTE recommended')
- $ruiObj.click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:pressBack_7) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_8) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_9) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.connectWifi(loopTime)
- tcase = TestCase.new("connectWifi")
- tcase << TestAction.new(:scriptAction_2) do
- logStartTest("05_01_10_02_WiFi")
- end
- tcase << TestAction.new(:gotoApp_4) do
- gotoApp('Settings')
- end
- tcase << TestAction.new(:swipeUp_2) do
- swipe_vertical_back 500
- end
- tcase << TestAction.new(:swipeUp_4) do
- swipe_vertical_back 500
- end
- tcase << TestAction.new(:swipeUp_6) do
- swipe_vertical_back 500
- end
- tcase << TestAction.new(:swipeUp_8) do
- swipe_vertical_back 500
- end
- tcase << TestAction.new(:TextView_Title_5) do
- $ruiObj = RUIObject.new.with('objectid', 1287569942).with('selfid', 1720054706).with('textdescid', -2038155039).with('uniqueparentid', 0).with('classresourceid', 1368752647)
- .with('uitreeindex', 4)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.settings:id/title')
- .with('text', 'WiFi')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_SwitchText_2) do
- $ruiObj = RUIObject.new.with('objectid', -1971573453).with('selfid', 495901714).with('textdescid', -972587138).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.settings:id/switch_text')
- .with('text', 'Off')
- $ruiObj.isExist
- ifFailJumpTo(:TextView_Title_2)
- waitsecond(2)
- end
- tcase << TestAction.new(:Switch_SwitchWidget_3) do
- $ruiObj = RUIObject.new.with('objectid', -489552312).with('selfid', 567174173).with('textdescid', -901345399).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'Switch')
- .with('resource-id', 'com.android.settings:id/switch_widget')
- .with('text', 'OFF')
- $ruiObj.click
- waitsecond(8)
- end
- tcase << TestAction.new(:wait4second_2) do
- waitsecond(4)
- end
- tcase << TestAction.new(:TextView_Title_2) do
- $ruiObj = RUIObject.new.with('objectid', 274971481).with('selfid', -71636208).with('textdescid', 341957782).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 12)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'QCTCOMP')
- $ruiObj.click
- waitsecond(4)
- end
- tcase << TestAction.new(:EditText_Password_8) do
- $ruiObj = RUIObject.new.with('objectid', 780695774).with('selfid', 8195995).with('textdescid', -1568234750).with('uniqueparentid', 0).with('classresourceid', 1413676103)
- .with('uitreeindex', 2)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.settings:id/password')
- $ruiObj.inputtext('12abcdef34')
- waitsecond(1)
- end
- tcase << TestAction.new(:Button_Button1_Connect) do
- $ruiObj = RUIObject.new.with('objectid', 972638584).with('selfid', 736098498).with('textdescid', -870791618).with('uniqueparentid', 0)
- .with('uitreeindex', 7)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button1')
- .with('text', 'Connect')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:wait8second_11_20s) do
- waitsecond(20)
- end
- tcase << TestAction.new(:TextView_Summary_2) do
- $ruiObj = RUIObject.new.with('objectid', 1704199271).with('selfid', -404041766).with('textdescid', -634935376).with('uniqueparentid', 0).with('classresourceid', -1930775675)
- .with('uitreeindex', 7)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/summary')
- .with('text', 'Connected')
- $ruiObj.isExist
- waitsecond(2)
- end
- tcase << TestAction.new(:scriptAction_23_TrueFalse) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason == "WiFi cannot connected"
- end
- logStopTest("05_01_10_02_WiFi")
- waitsecond(2)
- end
- tcase << TestAction.new(:pressBack_15) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_16) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_17) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.startTest(loopTime)
- tcase = TestCase.new("startTest")
- tcase << TestAction.new(:pressBack_1) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_2) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_3) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.Browser_05_01_04_03(loopTime)
- tcase = TestCase.new("Browser_05_01_04_03")
- tcase << TestAction.new(:scriptAction_2_1_1_1) do
- logStartTest("Browser_05_01_04_03")
- end
- tcase << TestAction.new(:gotoApp_2) do
- gotoApp('Chrome')
- end
- tcase << TestAction.new(:EditText_UrlBar_27) do
- $ruiObj = RUIObject.new.with('objectid', 1651866124).with('selfid', 613381324).with('textdescid', -331757676).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.chrome:id/url_bar')
- $ruiObj.inputtext('www.ebay.com')
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:pressEnter_10) do
- pressEnter
- waitsecond(4)
- end
- tcase << TestAction.new(:EditText_UrlBar_4) do
- $ruiObj = RUIObject.new.with('objectid', 1651866124).with('selfid', 613381324).with('textdescid', -331757676).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.chrome:id/url_bar')
- $ruiObj.inputtext('www.yahoo.com')
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:pressEnter_12) do
- pressEnter
- waitsecond(4)
- end
- tcase << TestAction.new(:EditText_UrlBar_5) do
- $ruiObj = RUIObject.new.with('objectid', 1651866124).with('selfid', 613381324).with('textdescid', -331757676).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.chrome:id/url_bar')
- $ruiObj.inputtext('www.amazon.com')
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:pressEnter_14) do
- pressEnter
- waitsecond(4)
- end
- tcase << TestAction.new(:EditText_UrlBar_6) do
- $ruiObj = RUIObject.new.with('objectid', 1651866124).with('selfid', 613381324).with('textdescid', -331757676).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.chrome:id/url_bar')
- $ruiObj.inputtext('www.youtube.com')
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:pressEnter_16) do
- pressEnter
- waitsecond(4)
- end
- tcase << TestAction.new(:EditText_UrlBar_7) do
- $ruiObj = RUIObject.new.with('objectid', 1651866124).with('selfid', 613381324).with('textdescid', -331757676).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.chrome:id/url_bar')
- $ruiObj.inputtext('www.nytimes.com')
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:pressEnter_18) do
- pressEnter
- waitsecond(4)
- end
- tcase << TestAction.new(:wait2second_2) do
- waitsecond(2)
- end
- tcase << TestAction.new(:scriptAction_1_1_1_1) do
- $reload = RUIObject.new.with('objectid', -1485276626).with('selfid', 131798869).with('textdescid', -1148751605).with('uniqueparentid', -932380963)
- .with('uitreeindex', 1)
- .with('classname', 'Button')
- .with('content-desc', 'RELOAD').exists?
- $progressBar = RUIObject.new.with('objectid', 460148827).with('selfid', -703099949).with('textdescid', 1379711781).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('pretext', 'Block')
- .with('classname', 'ProgressBar')
- .with('resource-id', 'com.android.chrome:id/progress').exists?
- if ($progressBar or $reload) == true
- $myTestResult = false
- else
- $myTestResult = true
- end
- if $myTestResult == false
- $myFailReason = "Page not loaded."
- end
- logStopTest("Browser_05_01_04_03")
- end
- tcase << TestAction.new(:pressHome_8) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.Browser_05_01_04_02(loopTime)
- tcase = TestCase.new("Browser_05_01_04_02")
- tcase << TestAction.new(:scriptAction_2_1) do
- logStartTest("Browser_05_01_04_02")
- end
- tcase << TestAction.new(:gotoApp_21) do
- gotoApp('Chrome')
- end
- tcase << TestAction.new(:EditText_UrlBar_5) do
- $ruiObj = RUIObject.new.with('objectid', 1651866124).with('selfid', 613381324).with('textdescid', -331757676).with('uniqueparentid', 0)
- .with('uitreeindex', 10)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.chrome:id/url_bar')
- $ruiObj.inputtext('www.naver.com')
- waitsecond(1)
- end
- tcase << TestAction.new(:pressEnter_6) do
- pressEnter
- waitsecond(4)
- end
- tcase << TestAction.new(:clickXY_411_744_8) do
- click(411,744)
- waitsecond(4)
- end
- tcase << TestAction.new(:swipeDown_9) do
- swipe_vertical 500
- end
- tcase << TestAction.new(:scriptAction_1_1_1) do
- $reload = RUIObject.new.with('objectid', -1485276626).with('selfid', 131798869).with('textdescid', -1148751605).with('uniqueparentid', -932380963)
- .with('uitreeindex', 1)
- .with('classname', 'Button')
- .with('content-desc', 'RELOAD').exists?
- $progressBar = RUIObject.new.with('objectid', 460148827).with('selfid', -703099949).with('textdescid', 1379711781).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('pretext', 'Block')
- .with('classname', 'ProgressBar')
- .with('resource-id', 'com.android.chrome:id/progress').exists?
- if ($progressBar or $reload) == true
- $myTestResult = false
- else
- $myTestResult = true
- end
- if $myTestResult == false
- $myFailReason = "Page not loaded."
- end
- logStopTest("Browser_05_01_04_02")
- end
- tcase << TestAction.new(:pressBack_10) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_1) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.Browser_05_01_04_01(loopTime)
- tcase = TestCase.new("Browser_05_01_04_01")
- tcase << TestAction.new(:scriptAction_2) do
- logStartTest("Browser_05_01_04_01")
- end
- tcase << TestAction.new(:gotoApp_2) do
- gotoApp('Chrome')
- end
- tcase << TestAction.new(:Button_TermsAccept_2) do
- $ruiObj = RUIObject.new.with('objectid', -731197748).with('selfid', 659232449).with('textdescid', 1426387421).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.chrome:id/terms_accept')
- .with('text', 'Accept continue')
- $ruiObj.click
- noFailCheck
- end
- tcase << TestAction.new(:Button_PositiveButton_4) do
- $ruiObj = RUIObject.new.with('objectid', 608181399).with('selfid', 780691289).with('textdescid', -1851914588).with('uniqueparentid', 0)
- .with('uitreeindex', 5)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.chrome:id/positive_button')
- .with('text', 'Next')
- $ruiObj.click
- noFailCheck
- end
- tcase << TestAction.new(:Button_PositiveButton_6) do
- $ruiObj = RUIObject.new.with('objectid', -255474603).with('selfid', 780402664).with('textdescid', -1721638605).with('uniqueparentid', 0)
- .with('uitreeindex', 7)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.chrome:id/positive_button')
- .with('text', 'Done')
- $ruiObj.click
- noFailCheck
- end
- tcase << TestAction.new(:EditText_UrlBar_2) do
- $ruiObj = RUIObject.new.with('objectid', 1651866124).with('selfid', 613381324).with('textdescid', -331757676).with('uniqueparentid', 0)
- .with('uitreeindex', 9)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.chrome:id/url_bar')
- $ruiObj.inputtext('m.att.com')
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:pressEnter_5) do
- pressEnter
- waitsecond(2)
- end
- tcase << TestAction.new(:wait4second_2) do
- waitsecond(4)
- end
- tcase << TestAction.new(:scriptAction_1_1) do
- $reload = RUIObject.new.with('objectid', -1485276626).with('selfid', 131798869).with('textdescid', -1148751605).with('uniqueparentid', -932380963)
- .with('uitreeindex', 1)
- .with('classname', 'Button')
- .with('content-desc', 'RELOAD').exists?
- $progressBar = RUIObject.new.with('objectid', 460148827).with('selfid', -703099949).with('textdescid', 1379711781).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('pretext', 'Block')
- .with('classname', 'ProgressBar')
- .with('resource-id', 'com.android.chrome:id/progress').exists?
- if ($progressBar || $reload) == true
- $myTestResult = false
- else
- $myTestResult = true
- end
- if $myTestResult == false
- $myFailReason = "Page not loaded."
- end
- logStopTest("Browser_05_01_04_01")
- end
- tcase << TestAction.new(:pressBack_1) do
- pressBack
- end
- tcase << TestAction.new(:pressHome_1) do
- pressHome
- end
- tcase.run(loopTime)
- end
- def self.Email_05_01_03_03(loopTime)
- tcase = TestCase.new("Email_05_01_03_03")
- tcase << TestAction.new(:scriptAction_3) do
- logStartTest("Email_05_01_03_03")
- end
- tcase << TestAction.new(:gotoApp_3) do
- gotoApp('Gmail')
- end
- tcase << TestAction.new(:ImageButton_Navigate_2) do
- $ruiObj = RUIObject.new.with('objectid', -387960062).with('selfid', -123872605).with('textdescid', -1698616212).with('uniqueparentid', 0)
- .with('uitreeindex', 0)
- .with('classname', 'ImageButton')
- .with('content-desc', 'Navigate up')
- $ruiObj.click
- end
- tcase << TestAction.new(:TextView_Name_25_1) do
- $ruiObj = RUIObject.new.with('objectid', -630461263).with('selfid', 1424467117).with('textdescid', -1091979836).with('uniqueparentid', 0).with('classresourceid', 790406410)
- .with('uitreeindex', 11)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.gm:id/name')
- .with('text', 'Social')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:clickXY_441_774_2) do
- click(441,774)
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageView_Reply_4) do
- $ruiObj = RUIObject.new.with('objectid', -1328236453).with('selfid', -78599687).with('textdescid', 562783621).with('uniqueparentid', 0)
- .with('uitreeindex', 114)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.google.android.gm:id/reply')
- .with('content-desc', 'Reply')
- $ruiObj.isExist
- end
- tcase << TestAction.new(:scriptAction_8_1_1) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "Email not opened"
- end
- logStopTest("Email_05_01_03_03")
- end
- tcase << TestAction.new(:pressBack_1) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_2) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.Email_05_01_03_02(loopTime)
- tcase = TestCase.new("Email_05_01_03_02")
- tcase << TestAction.new(:scriptAction_12) do
- logStartTest("Email_05_01_03_02")
- end
- tcase << TestAction.new(:gotoApp_3) do
- gotoApp('Gmail')
- end
- tcase << TestAction.new(:ImageButton_ComposeButton_27) do
- $ruiObj = RUIObject.new.with('objectid', 2010391035).with('selfid', 1808564263).with('textdescid', -481574643).with('uniqueparentid', 0)
- .with('uitreeindex', 23)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.google.android.gm:id/compose_button')
- .with('content-desc', 'Compose')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:MultiAutoCompleteTextView_To_44) do
- $ruiObj = RUIObject.new.with('objectid', -1987566378).with('selfid', -538836202).with('textdescid', 151401701).with('uniqueparentid', 0).with('classresourceid', 1488875515)
- .with('uitreeindex', 9)
- .with('classname', 'MultiAutoCompleteTextView')
- .with('resource-id', 'com.google.android.gm:id/to')
- .with('content-desc', 'To')
- $ruiObj.inputtext('dvgats1@gmail.com')
- end
- tcase << TestAction.new(:pressEnter_3) do
- pressEnter
- end
- tcase << TestAction.new(:EditText_Subject_67) do
- $ruiObj = RUIObject.new.with('objectid', -1237078311).with('selfid', -477614756).with('textdescid', 305278055).with('uniqueparentid', 0).with('classresourceid', 927865352)
- .with('uitreeindex', 12)
- .with('classname', 'EditText')
- .with('resource-id', 'com.google.android.gm:id/subject')
- $ruiObj.inputtext('Email Test')
- end
- tcase << TestAction.new(:EditText_Body_83) do
- $ruiObj = RUIObject.new.with('objectid', -947933892).with('selfid', 132829042).with('textdescid', 678820452).with('uniqueparentid', 0).with('classresourceid', 52429382)
- .with('uitreeindex', 14)
- .with('classname', 'EditText')
- .with('resource-id', 'com.google.android.gm:id/body')
- $ruiObj.inputtext('Testing UiEngine Email Test!!!')
- end
- tcase << TestAction.new(:TextView_AddAttachment_10) do
- $ruiObj = RUIObject.new.with('objectid', -173497965).with('selfid', 1566257663).with('textdescid', -1339317046).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.gm:id/add_attachment')
- .with('content-desc', 'Attach file')
- $ruiObj.click
- end
- tcase << TestAction.new(:TextView_Title_12) do
- $ruiObj = RUIObject.new.with('objectid', 665784376).with('selfid', -1478650284).with('textdescid', 1395090321).with('uniqueparentid', 0).with('classresourceid', -1261418567)
- .with('uitreeindex', 0)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.gm:id/title')
- .with('text', 'Attach file')
- $ruiObj.click
- end
- tcase << TestAction.new(:ImageButton_Show_14) do
- $ruiObj = RUIObject.new.with('objectid', -1807230859).with('selfid', -929198491).with('textdescid', 629574489).with('uniqueparentid', 0)
- .with('uitreeindex', 0)
- .with('classname', 'ImageButton')
- .with('content-desc', 'Show roots')
- $ruiObj.click
- end
- tcase << TestAction.new(:TextView_Title_16) do
- $ruiObj = RUIObject.new.with('objectid', 942770025).with('selfid', -192133575).with('textdescid', 790630097).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 15)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'Images')
- $ruiObj.click
- end
- tcase << TestAction.new(:TextView_Title_41) do
- $ruiObj = RUIObject.new.with('objectid', -119887707).with('selfid', -429664675).with('textdescid', 1147870057).with('uniqueparentid', 0)
- .with('uitreeindex', 26)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', '1M')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:clickXY_285_531_6) do
- click(285,531)
- end
- tcase << TestAction.new(:TextView_Send_18) do
- $ruiObj = RUIObject.new.with('objectid', 263473178).with('selfid', 2103341243).with('textdescid', -1351242642).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.gm:id/send')
- .with('content-desc', 'Send')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Search_2) do
- $ruiObj = RUIObject.new.with('objectid', -1003571279).with('selfid', 1669908731).with('textdescid', 932594519).with('uniqueparentid', 1865666832)
- .with('uitreeindex', 2)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.gm:id/search')
- .with('content-desc', 'Search')
- $ruiObj.isExist
- end
- tcase << TestAction.new(:ImageButton_Navigate_13) do
- $ruiObj = RUIObject.new.with('objectid', 602079874).with('selfid', -123872605).with('textdescid', -1025319956).with('uniqueparentid', 0)
- .with('uitreeindex', 0)
- .with('classname', 'ImageButton')
- .with('content-desc', 'Navigate up')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Name_2) do
- $ruiObj = RUIObject.new.with('objectid', -630461263).with('selfid', -610816808).with('textdescid', 727067449).with('uniqueparentid', 0).with('classresourceid', 790406410)
- .with('uitreeindex', 21)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.gm:id/name')
- .with('text', 'Sent')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:clickXY_300_720_2) do
- click(300,720)
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Delete_23) do
- $ruiObj = RUIObject.new.with('objectid', -1432692812).with('selfid', -390800203).with('textdescid', -779181577).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.gm:id/delete')
- .with('content-desc', 'Delete')
- $ruiObj.click
- end
- tcase << TestAction.new(:scriptAction_8) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "Email not sent"
- end
- logStopTest("Email_05_01_03_02")
- end
- tcase << TestAction.new(:pressBack_3) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_4) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.Email_05_01_03_01(loopTime)
- tcase = TestCase.new("Email_05_01_03_01")
- tcase << TestAction.new(:scriptAction_12) do
- logStartTest("Email_05_01_03_01")
- end
- tcase << TestAction.new(:gotoApp_3) do
- gotoApp('Gmail')
- end
- tcase << TestAction.new(:ImageButton_ComposeButton_2) do
- $ruiObj = RUIObject.new.with('objectid', 2010391035).with('selfid', 1808564263).with('textdescid', -481574643).with('uniqueparentid', 0)
- .with('uitreeindex', 10)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.google.android.gm:id/compose_button')
- .with('content-desc', 'Compose')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:MultiAutoCompleteTextView_To_45) do
- $ruiObj = RUIObject.new.with('objectid', -1987566378).with('selfid', -538836202).with('textdescid', 151401701).with('uniqueparentid', 0).with('classresourceid', 1488875515)
- .with('uitreeindex', 9)
- .with('classname', 'MultiAutoCompleteTextView')
- .with('resource-id', 'com.google.android.gm:id/to')
- .with('content-desc', 'To')
- $ruiObj.inputtext('dvgats1@gmail.com')
- end
- tcase << TestAction.new(:pressEnter_3) do
- pressEnter
- end
- tcase << TestAction.new(:EditText_Subject_65) do
- $ruiObj = RUIObject.new.with('objectid', -1237078311).with('selfid', -477614756).with('textdescid', 305278055).with('uniqueparentid', 0).with('classresourceid', 927865352)
- .with('uitreeindex', 11)
- .with('classname', 'EditText')
- .with('resource-id', 'com.google.android.gm:id/subject')
- $ruiObj.inputtext('Email Test')
- end
- tcase << TestAction.new(:EditText_Body_84) do
- $ruiObj = RUIObject.new.with('objectid', -947933892).with('selfid', 132829042).with('textdescid', 678820452).with('uniqueparentid', 0).with('classresourceid', 52429382)
- .with('uitreeindex', 12)
- .with('classname', 'EditText')
- .with('resource-id', 'com.google.android.gm:id/body')
- $ruiObj.inputtext('Testing UiEngine Email Test!!!')
- end
- tcase << TestAction.new(:TextView_Send_12) do
- $ruiObj = RUIObject.new.with('objectid', 263473178).with('selfid', 2103341243).with('textdescid', -1351242642).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.gm:id/send')
- .with('content-desc', 'Send')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_ComposeButton_14) do
- $ruiObj = RUIObject.new.with('objectid', 2010391035).with('selfid', 1808564263).with('textdescid', -481574643).with('uniqueparentid', 0)
- .with('uitreeindex', 5)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.google.android.gm:id/compose_button')
- .with('content-desc', 'Compose')
- $ruiObj.isExist
- end
- tcase << TestAction.new(:ImageButton_Navigate_13) do
- $ruiObj = RUIObject.new.with('objectid', 602079874).with('selfid', -123872605).with('textdescid', -1025319956).with('uniqueparentid', 0)
- .with('uitreeindex', 0)
- .with('classname', 'ImageButton')
- .with('content-desc', 'Navigate up')
- $ruiObj.click
- end
- tcase << TestAction.new(:TextView_Name_17) do
- $ruiObj = RUIObject.new.with('objectid', -630461263).with('selfid', -610816808).with('textdescid', 727067449).with('uniqueparentid', 0).with('classresourceid', 790406410)
- .with('uitreeindex', 24)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.gm:id/name')
- .with('text', 'Sent')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:clickXY_300_720_2_1) do
- click(300,720)
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Delete_19) do
- $ruiObj = RUIObject.new.with('objectid', -1432692812).with('selfid', -390800203).with('textdescid', -779181577).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.gm:id/delete')
- .with('content-desc', 'Delete')
- $ruiObj.click
- end
- tcase << TestAction.new(:scriptAction_8) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "Email not sent"
- end
- logStopTest("Email_05_01_03_01")
- end
- tcase << TestAction.new(:pressBack_3) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_4) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.Messaging_05_01_02_06(loopTime)
- tcase = TestCase.new("Messaging_05_01_02_06")
- tcase << TestAction.new(:scriptAction_28) do
- logStartTest("Messaging_05_01_02_06")
- end
- tcase << TestAction.new(:gotoApp_2) do
- gotoApp('Messenger')
- end
- tcase << TestAction.new(:ImageView_StartNewConversationButton_2) do
- $ruiObj = RUIObject.new.with('objectid', -274740130).with('selfid', 916878134).with('textdescid', -2118059933).with('uniqueparentid', 0)
- .with('uitreeindex', 6)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
- .with('content-desc', 'Start new conversation')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:MultiAutoCompleteTextView_RecipientTextView_4) do
- $ruiObj = RUIObject.new.with('objectid', -1115682772).with('selfid', 1163803387).with('textdescid', -226427532).with('uniqueparentid', 0).with('classresourceid', 461007471)
- .with('uitreeindex', 1)
- .with('classname', 'MultiAutoCompleteTextView')
- .with('resource-id', 'com.google.android.apps.messaging:id/recipient_text_view')
- $ruiObj.inputtext('A01')
- waitsecond(1)
- end
- tcase << TestAction.new(:clickXY_213_504_2) do
- click(213,504)
- waitsecond(1)
- end
- tcase << TestAction.new(:EditText_ComposeMessageText_8) do
- $ruiObj = RUIObject.new.with('objectid', 1578981159).with('selfid', -1932318364).with('textdescid', 1703775705).with('uniqueparentid', 0)
- .with('uitreeindex', 5)
- .with('classname', 'EditText')
- .with('resource-id', 'com.google.android.apps.messaging:id/compose_message_text')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_141_1) do
- $ruiObj.inputtext('Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzaaaaaaaaaabbbbbbbbbbcccccccccc')
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_AttachMediaButton_4) do
- $ruiObj = RUIObject.new.with('objectid', 840041021).with('selfid', -952088716).with('textdescid', -438944396).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.google.android.apps.messaging:id/attach_media_button')
- .with('content-desc', 'Add an attachment')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_Choose_6_1_1) do
- $ruiObj = RUIObject.new.with('objectid', 1408822083).with('selfid', 538927602).with('textdescid', 531479902).with('uniqueparentid', 0)
- .with('uitreeindex', 13)
- .with('classname', 'ImageButton')
- .with('content-desc', 'Choose images from this device')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageView_Image_2) do
- $ruiObj = RUIObject.new.with('objectid', 210721229).with('selfid', -1447729616).with('textdescid', -2055736335).with('uniqueparentid', 0)
- .with('uitreeindex', 8)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.google.android.apps.messaging:id/image')
- .with('content-desc', 'Choose image from document library')
- $ruiObj.longClick
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_Show_22) do
- $ruiObj = RUIObject.new.with('objectid', -1807230859).with('selfid', -929198491).with('textdescid', 629574489).with('uniqueparentid', 0)
- .with('uitreeindex', 0)
- .with('classname', 'ImageButton')
- .with('content-desc', 'Show roots')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Title_6) do
- $ruiObj = RUIObject.new.with('objectid', 942770025).with('selfid', -192133575).with('textdescid', 790630097).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 30)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'Images')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Title_8) do
- $ruiObj = RUIObject.new.with('objectid', -119887707).with('selfid', -429664675).with('textdescid', 1147870057).with('uniqueparentid', 0)
- .with('uitreeindex', 26)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', '1M')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:clickXY_189_513_30) do
- click(189,513)
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_CloseButton_2) do
- $ruiObj = RUIObject.new.with('objectid', -1834819923).with('selfid', -966281882).with('textdescid', -863126440).with('uniqueparentid', 716741550).with('classresourceid', 369276917)
- .with('uitreeindex', 1)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.google.android.apps.messaging:id/close_button')
- .with('content-desc', 'Discard attachment')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_4) do
- if checkLastExistResult === true
- $letsCount = 1
- else
- $letsCount = 0
- end
- end
- tcase << TestAction.new(:ImageButton_SendMessageButton_17) do
- $ruiObj = RUIObject.new.with('objectid', -1329122643).with('selfid', -1857249780).with('textdescid', 1740568962).with('uniqueparentid', 0)
- .with('uitreeindex', 9)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.google.android.apps.messaging:id/send_message_button')
- .with('content-desc', 'Send Message')
- $ruiObj.click
- waitsecond(8)
- end
- tcase << TestAction.new(:pressBack_5) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_6) do
- pressBack
- end
- tcase << TestAction.new(:clickXY_344_384_2) do
- click(344,384)
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageView_More_19) do
- $ruiObj = RUIObject.new.with('objectid', -1276401870).with('selfid', 328478669).with('textdescid', -2023409951).with('uniqueparentid', 0)
- .with('uitreeindex', 17)
- .with('classname', 'ImageView')
- .with('content-desc', 'More options')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Title_21) do
- $ruiObj = RUIObject.new.with('objectid', -1362741768).with('selfid', 1635205580).with('textdescid', 299180429).with('uniqueparentid', 0).with('classresourceid', -128793897)
- .with('uitreeindex', 4)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.apps.messaging:id/title')
- .with('text', 'Delete')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:Button_Button1_23) do
- $ruiObj = RUIObject.new.with('objectid', -49953928).with('selfid', 1012902611).with('textdescid', -2073088243).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button1')
- .with('text', 'Delete')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageView_StartNewConversationButton_25) do
- $ruiObj = RUIObject.new.with('objectid', -274740130).with('selfid', 916878134).with('textdescid', -2118059933).with('uniqueparentid', 0)
- .with('uitreeindex', 6)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
- .with('content-desc', 'Start new conversation')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_30) do
- if checkLastExistResult === true and $letsCount === 1
- $myTestResult = true
- else
- $myTestResult = false
- end
- if $myTestResult == false
- $myFailReason = "Message not sent"
- end
- logStopTest("Messaging_05_01_02_06")
- end
- tcase << TestAction.new(:pressBack_53) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_26) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.Messaging_05_01_02_05(loopTime)
- tcase = TestCase.new("Messaging_05_01_02_05")
- tcase << TestAction.new(:scriptAction_28) do
- logStartTest("Messaging_05_01_02_05")
- end
- tcase << TestAction.new(:gotoApp_2) do
- gotoApp('Messenger')
- end
- tcase << TestAction.new(:ImageView_StartNewConversationButton_2) do
- $ruiObj = RUIObject.new.with('objectid', -274740130).with('selfid', 916878134).with('textdescid', -2118059933).with('uniqueparentid', 0)
- .with('uitreeindex', 6)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
- .with('content-desc', 'Start new conversation')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:MultiAutoCompleteTextView_RecipientTextView_4) do
- $ruiObj = RUIObject.new.with('objectid', -1115682772).with('selfid', 1163803387).with('textdescid', -226427532).with('uniqueparentid', 0).with('classresourceid', 461007471)
- .with('uitreeindex', 1)
- .with('classname', 'MultiAutoCompleteTextView')
- .with('resource-id', 'com.google.android.apps.messaging:id/recipient_text_view')
- $ruiObj.inputtext('A01')
- waitsecond(1)
- end
- tcase << TestAction.new(:clickXY_213_504_2) do
- click(213,504)
- waitsecond(1)
- end
- tcase << TestAction.new(:EditText_ComposeMessageText_8) do
- $ruiObj = RUIObject.new.with('objectid', 1578981159).with('selfid', -1932318364).with('textdescid', 1703775705).with('uniqueparentid', 0)
- .with('uitreeindex', 5)
- .with('classname', 'EditText')
- .with('resource-id', 'com.google.android.apps.messaging:id/compose_message_text')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_141_1) do
- $ruiObj.inputtext('Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzaaaaaaaaaabbbbbbbbbbcccccccccc')
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_AttachMediaButton_4) do
- $ruiObj = RUIObject.new.with('objectid', 840041021).with('selfid', -952088716).with('textdescid', -438944396).with('uniqueparentid', 0)
- .with('uitreeindex', 4)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.google.android.apps.messaging:id/attach_media_button')
- .with('content-desc', 'Add an attachment')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_Choose_6) do
- $ruiObj = RUIObject.new.with('objectid', 1408822083).with('selfid', 538927602).with('textdescid', 531479902).with('uniqueparentid', 0)
- .with('uitreeindex', 13)
- .with('classname', 'ImageButton')
- .with('content-desc', 'Choose images from this device')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:Button_PermissionAllowButton_2) do
- $ruiObj = RUIObject.new.with('objectid', 308455030).with('selfid', 1444367499).with('textdescid', -770153727).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'Button')
- .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
- .with('text', 'Allow')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageView_Image_34) do
- $ruiObj = RUIObject.new.with('objectid', 210721229).with('selfid', -1447729616).with('textdescid', -2055736335).with('uniqueparentid', 0)
- .with('uitreeindex', 6)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.google.android.apps.messaging:id/image')
- .with('content-desc', 'Choose image from document library')
- $ruiObj.longClick
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_Show_22) do
- $ruiObj = RUIObject.new.with('objectid', -1807230859).with('selfid', -929198491).with('textdescid', 629574489).with('uniqueparentid', 0)
- .with('uitreeindex', 0)
- .with('classname', 'ImageButton')
- .with('content-desc', 'Show roots')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Title_24) do
- $ruiObj = RUIObject.new.with('objectid', 942770025).with('selfid', 176439065).with('textdescid', -668519951).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 46)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'Videos')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Title_11) do
- $ruiObj = RUIObject.new.with('objectid', -119887707).with('selfid', -429664675).with('textdescid', 1147870057).with('uniqueparentid', 0)
- .with('uitreeindex', 12)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', '1M')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:clickXY_189_513_30) do
- click(189,513)
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_CloseButton_2) do
- $ruiObj = RUIObject.new.with('objectid', -1834819923).with('selfid', -966281882).with('textdescid', -863126440).with('uniqueparentid', 0).with('classresourceid', 369276917)
- .with('uitreeindex', 1)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.google.android.apps.messaging:id/close_button')
- .with('content-desc', 'Discard attachment')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_4) do
- if checkLastExistResult === true
- $letsCount = 1;
- else
- $letsCount = 0;
- end
- waitsecond(2)
- end
- tcase << TestAction.new(:ImageButton_SendMessageButton_17) do
- $ruiObj = RUIObject.new.with('objectid', -1329122643).with('selfid', -1857249780).with('textdescid', 1740568962).with('uniqueparentid', 0)
- .with('uitreeindex', 9)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.google.android.apps.messaging:id/send_message_button')
- .with('content-desc', 'Send Message')
- $ruiObj.click
- waitsecond(8)
- end
- tcase << TestAction.new(:pressBack_5) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_6) do
- pressBack
- end
- tcase << TestAction.new(:clickXY_344_384_2) do
- click(344,384)
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageView_More_19) do
- $ruiObj = RUIObject.new.with('objectid', -1276401870).with('selfid', 328478669).with('textdescid', -2023409951).with('uniqueparentid', 0)
- .with('uitreeindex', 17)
- .with('classname', 'ImageView')
- .with('content-desc', 'More options')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:TextView_Title_21) do
- $ruiObj = RUIObject.new.with('objectid', -1362741768).with('selfid', 1635205580).with('textdescid', 299180429).with('uniqueparentid', 0).with('classresourceid', -128793897)
- .with('uitreeindex', 4)
- .with('classname', 'TextView')
- .with('resource-id', 'com.google.android.apps.messaging:id/title')
- .with('text', 'Delete')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:Button_Button1_23) do
- $ruiObj = RUIObject.new.with('objectid', -49953928).with('selfid', 1012902611).with('textdescid', -2073088243).with('uniqueparentid', 0)
- .with('uitreeindex', 2)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button1')
- .with('text', 'Delete')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageView_StartNewConversationButton_25) do
- $ruiObj = RUIObject.new.with('objectid', -274740130).with('selfid', 916878134).with('textdescid', -2118059933).with('uniqueparentid', 0)
- .with('uitreeindex', 6)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
- .with('content-desc', 'Start new conversation')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_30) do
- if $letsCount === 1 and checkLastExistResult === true
- $myTestResult = true
- else
- $myTestResult = false
- end
- if $myTestResult === false
- $myFailReason = "Message not sent"
- end
- logStopTest("Messaging_05_01_02_05")
- waitsecond(1)
- end
- tcase << TestAction.new(:pressBack_53) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_26) do
- pressBack
- waitsecond(1)
- end
- tcase.run(loopTime)
- end
- def self.Telephony_05_01_01_05(loopTime)
- tcase = TestCase.new("Telephony_05_01_01_05")
- tcase << TestAction.new(:pressHome_18) do
- pressHome
- end
- tcase << TestAction.new(:scriptAction_StartTestLog) do
- logStartTest("05_01_01_05_Telephony")
- end
- tcase << TestAction.new(:scriptAction_BTMakeCall) do
- sendBTCmd("makeCall('#{db('CallNumber')[0]}')")
- waitsecond(8)
- end
- tcase << TestAction.new(:wait8second_12) do
- waitsecond(8)
- end
- tcase << TestAction.new(:wait8second_14) do
- waitsecond(8)
- end
- tcase << TestAction.new(:wait8second_16) do
- waitsecond(8)
- end
- tcase << TestAction.new(:clickXY_765_258_1_1) do
- click(765,258)
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_4) do
- $ruiObj = RUIObject.new.with('objectid', -866535814).with('selfid', 1448123190).with('textdescid', -89777303).with('uniqueparentid', 561858152)
- .with('uitreeindex', 9)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
- .with('content-desc', 'End Call')
- $ruiObj.select('Similiar').isNotExist
- ifFailJumpTo(:ImageButton_FloatingEndCallActionButton_2)
- waitsecond(1)
- end
- tcase << TestAction.new(:clickXY_765_258_1_1_1) do
- click(765,258)
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_2) do
- $ruiObj = RUIObject.new.with('objectid', 1693952669).with('selfid', 1448123190).with('textdescid', 751911782).with('uniqueparentid', 0)
- .with('uitreeindex', 10)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
- .with('content-desc', 'End Call')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_LogStopTest_1) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "End button not found"
- end
- logStopTest("05_01_01_05_Telephony")
- end
- tcase << TestAction.new(:scriptAction_BTEndCall) do
- sendBTCmd('endCall')
- end
- tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_9) do
- $ruiObj = RUIObject.new.with('objectid', -866535814).with('selfid', 1448123190).with('textdescid', -89777303).with('uniqueparentid', 561858152)
- .with('uitreeindex', 9)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
- .with('content-desc', 'End Call')
- $ruiObj.select('Similiar').click
- noFailCheck
- end
- tcase << TestAction.new(:pressBack_1) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_2) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.Telephony_05_01_01_03(loopTime)
- tcase = TestCase.new("Telephony_05_01_01_03")
- tcase << TestAction.new(:scriptAction_StartTest) do
- logStartTest("05_01_01_03_Telephony")
- end
- tcase << TestAction.new(:gotoApp_1_1) do
- gotoApp('Phone')
- end
- tcase << TestAction.new(:View_Recents_1_1) do
- $ruiObj = RUIObject.new.with('objectid', 1536973457).with('selfid', 954785271).with('textdescid', 1871997065).with('uniqueparentid', 0)
- .with('classname', 'android.view.View')
- .with('content-desc', 'Recents')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageView_PrimaryActionButton_2) do
- $ruiObj = RUIObject.new.with('objectid', 1321106203).with('selfid', 1174798435).with('textdescid', 1240128135).with('uniqueparentid', 0)
- .with('uitreeindex', 8)
- .with('classname', 'ImageView')
- .with('resource-id', 'com.android.dialer:id/primary_action_button')
- .with('content-desc', 'Call A01 a01')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:wait8second_31) do
- waitsecond(8)
- end
- tcase << TestAction.new(:wait4second_4) do
- waitsecond(4)
- end
- tcase << TestAction.new(:scriptAction_BTAnswerCall) do
- sendBTCmd('answerCall')
- waitsecond(4)
- end
- tcase << TestAction.new(:wait4second_6) do
- waitsecond(4)
- end
- tcase << TestAction.new(:scriptAction_LogStopTest) do
- $myTestResult = checkLastBTCmdResult
- if $myTestResult == false
- $myFailReason = "Call not come to other dev"
- end
- logStopTest("05_01_01_03_Telephony")
- end
- tcase << TestAction.new(:scriptAction_BTEndCall) do
- sendBTCmd('endCall')
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_7) do
- $ruiObj = RUIObject.new.with('objectid', -866535814).with('selfid', 1448123190).with('textdescid', -89777303).with('uniqueparentid', 0)
- .with('uitreeindex', 8)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
- .with('content-desc', 'End Call')
- $ruiObj.click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:pressBack_1) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_2) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.Telephony_05_01_01_01(loopTime)
- tcase = TestCase.new("Telephony_05_01_01_01")
- tcase << TestAction.new(:scriptAction_StartTest) do
- logStartTest("05_01_01_01_Telephony")
- end
- tcase << TestAction.new(:gotoApp_1_1) do
- gotoApp('Contacts')
- end
- tcase << TestAction.new(:TextView_MenuSearch_2) do
- $ruiObj = RUIObject.new.with('objectid', 1659045365).with('selfid', -439570021).with('textdescid', 660324755).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.contacts:id/menu_search')
- .with('content-desc', 'Search')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:EditText_SearchView_4) do
- $ruiObj = RUIObject.new.with('objectid', 255377705).with('selfid', -247474260).with('textdescid', -673225705).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.contacts:id/search_view')
- $ruiObj.inputtext('A01')
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_ClivNameTextview_8_1) do
- $ruiObj = RUIObject.new.with('objectid', -1210856875).with('selfid', 1607638428).with('textdescid', -1633378553).with('uniqueparentid', 0).with('classresourceid', -744251330)
- .with('uitreeindex', 9)
- .with('classname', 'TextView')
- .with('resource-id', 'com.android.contacts:id/cliv_name_textview')
- .with('text', 'A01 a01')
- $ruiObj.click
- waitsecond(1)
- end
- tcase << TestAction.new(:clickXY_117_1302_4) do
- click(117,1302)
- waitsecond(2)
- end
- tcase << TestAction.new(:wait8second_31) do
- waitsecond(8)
- end
- tcase << TestAction.new(:wait4second_31_1) do
- waitsecond(8)
- end
- tcase << TestAction.new(:scriptAction_BTAnswerCall) do
- sendBTCmd('answerCall')
- waitsecond(4)
- end
- tcase << TestAction.new(:wait4second_6) do
- waitsecond(4)
- end
- tcase << TestAction.new(:scriptAction_LogStopTest_1_1) do
- $myTestResult = checkLastBTCmdResult
- if $myTestResult == false
- $myFailReason = "Call not come to other dev"
- end
- logStopTest("05_01_01_01_Telephony")
- end
- tcase << TestAction.new(:scriptAction_BTEndCall) do
- sendBTCmd('endCall')
- end
- tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_7) do
- $ruiObj = RUIObject.new.with('objectid', -866535814).with('selfid', 1448123190).with('textdescid', -89777303).with('uniqueparentid', 0)
- .with('uitreeindex', 8)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
- .with('content-desc', 'End Call')
- $ruiObj.click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:pressBack_3) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_4) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.VoLTE_Telephony_05_01_12_03(loopTime)
- tcase = TestCase.new("VoLTE_Telephony_05_01_12_03")
- tcase << TestAction.new(:pressHome_18) do
- pressHome
- end
- tcase << TestAction.new(:scriptAction_StartTestLog) do
- logStartTest("05_01_12_03_VoLTE_Telephony")
- end
- tcase << TestAction.new(:scriptAction_BTMakeCall) do
- sendBTCmd("makeCall('#{db('CallNumber')[0]}')")
- waitsecond(8)
- end
- tcase << TestAction.new(:wait8second_12) do
- waitsecond(8)
- end
- tcase << TestAction.new(:wait8second_14) do
- waitsecond(8)
- end
- tcase << TestAction.new(:wait8second_16) do
- waitsecond(8)
- end
- tcase << TestAction.new(:clickXY_765_252_1_1) do
- click(765,252)
- waitsecond(4)
- end
- tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_4) do
- $ruiObj = RUIObject.new.with('objectid', -866535814).with('selfid', 1448123190).with('textdescid', -89777303).with('uniqueparentid', 561858152)
- .with('uitreeindex', 9)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
- .with('content-desc', 'End Call')
- $ruiObj.select('Similiar').isNotExist
- ifFailJumpTo(:wait8second_7)
- waitsecond(1)
- end
- tcase << TestAction.new(:clickXY_765_252_1_1_1) do
- click(765,252)
- waitsecond(4)
- end
- tcase << TestAction.new(:wait8second_7) do
- waitsecond(6)
- end
- tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_2) do
- $ruiObj = RUIObject.new.with('objectid', 1693952669).with('selfid', 1448123190).with('textdescid', 751911782).with('uniqueparentid', 0)
- .with('uitreeindex', 10)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
- .with('content-desc', 'End Call')
- $ruiObj.isExist
- waitsecond(1)
- end
- tcase << TestAction.new(:scriptAction_LogStopTest_1) do
- $myTestResult = checkLastExistResult
- if $myTestResult == false
- $myFailReason = "End button not found"
- end
- logStopTest("05_01_12_03_VoLTE_Telephony")
- end
- tcase << TestAction.new(:scriptAction_BTEndCall) do
- sendBTCmd('endCall')
- waitsecond(1)
- end
- tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_9) do
- $ruiObj = RUIObject.new.with('objectid', -866535814).with('selfid', 1448123190).with('textdescid', -89777303).with('uniqueparentid', 561858152)
- .with('uitreeindex', 9)
- .with('classname', 'ImageButton')
- .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
- .with('content-desc', 'End Call')
- $ruiObj.select('Similiar').click
- noFailCheck
- waitsecond(1)
- end
- tcase << TestAction.new(:pressBack_1) do
- pressBack
- end
- tcase << TestAction.new(:pressBack_2) do
- pressBack
- end
- tcase.run(loopTime)
- end
- def self.exception_handler
- puts "Module Exception Hanlder..."
- if ($lastPackageName == "android")
- android_ExpHandler(1)
- end
- end
- def self.run(loop)
- mainLoop loop
- end
- end
- $exceptionPackageNameList = []
- $exceptionPackageNameList_exclude = []
- $exceptionPackageNameList << "android"
- def exception_handler
- N3_MTBF.exception_handler
- end
- $curProjectLogFile = $useLastLogFile
- $curProjectLogFile = "N3_MTBF_#{getTimeStamp}.log" if $useLastLogFile.nil?
- $useLastLogFile = nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement