Created
September 30, 2015 18:30
-
-
Save n3mtbf/5a701d71681289692927 to your computer and use it in GitHub Desktop.
Concurrency_RubyRunGenerated
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loadTestDB | |
module Concurrency | |
def self.Browser(loopTime) | |
tcase = TestCase.new("Browser") | |
tcase << TestAction.new(:gotoApp_7) do | |
gotoApp('Chrome') | |
end | |
tcase << TestAction.new(:EditText_UrlBar_7_1) do | |
$ruiObj = RUIObject.new.with('objectid', 882195433).with('selfid', 613381324).with('textdescid', 1578254679).with('uniqueparentid', 0) | |
.with('uitreeindex', 320) | |
.with('classname', 'EditText') | |
.with('resource-id', 'com.android.chrome:id/url_bar') | |
$ruiObj.inputtext('m.naver.com') | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:pressEnter_15) do | |
pressEnter | |
waitsecond(4) | |
end | |
tcase << TestAction.new(:EditText_UrlBar_7) do | |
$ruiObj = RUIObject.new.with('objectid', 882195433).with('selfid', 613381324).with('textdescid', 1578254679).with('uniqueparentid', 0) | |
.with('uitreeindex', 320) | |
.with('classname', 'EditText') | |
.with('resource-id', 'com.android.chrome:id/url_bar') | |
$ruiObj.inputtext('google.com') | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:pressEnter_17) do | |
pressEnter | |
waitsecond(4) | |
end | |
tcase << TestAction.new(:pressBack_11) do | |
pressBack | |
end | |
tcase << TestAction.new(:pressBack_12) do | |
pressBack | |
end | |
tcase << TestAction.new(:scriptAction_1) do | |
logStopTest("Browser") | |
end | |
tcase.run(loopTime) | |
end | |
def self.Camera(loopTime) | |
tcase = TestCase.new("Camera") | |
tcase << TestAction.new(:gotoApp_1) do | |
gotoApp('Camera') | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:Button_PermissionDenyButton_2) 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 | |
end | |
tcase << TestAction.new(:Button_ConfirmButton_2) 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 | |
end | |
tcase << TestAction.new(:Button_ConfirmButton_4) do | |
$ruiObj = RUIObject.new.with('objectid', 394395107).with('selfid', 1033122537).with('textdescid', -476148038).with('uniqueparentid', 0) | |
.with('uitreeindex', 6) | |
.with('classname', 'Button') | |
.with('resource-id', 'com.android.camera2:id/confirm_button') | |
.with('text', 'OK GOT IT') | |
$ruiObj.click | |
end | |
tcase << TestAction.new(:swipeLeft_2) do | |
swipe_horizontal_back 50 | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:ImageView_PhotoVideoButton_4) do | |
$ruiObj = RUIObject.new.with('objectid', 1525621660).with('selfid', 940549150).with('textdescid', 49631236).with('uniqueparentid', 0) | |
.with('uitreeindex', 7) | |
.with('classname', 'ImageView') | |
.with('resource-id', 'com.android.camera2:id/photo_video_button') | |
$ruiObj.click | |
waitsecond(1) | |
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 << TestAction.new(:scriptAction_1_1) do | |
logStopTest("Camera") | |
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 | |
$actionParamInput = "none" | |
Voice 1 | |
$actionParamInput = "none" | |
Browser 1 | |
$actionParamInput = "none" | |
Youtube 1 | |
$actionParamInput = "none" | |
Voice 1 | |
$actionParamInput = "none" | |
Emails 1 | |
$actionParamInput = "none" | |
Voice 1 | |
$actionParamInput = "none" | |
SMS 1 | |
$actionParamInput = "none" | |
MMS 1 | |
$actionParamInput = "none" | |
Voice 1 | |
$actionParamInput = "none" | |
GPS 1 | |
$actionParamInput = "none" | |
Voice 1 | |
$actionParamInput = "none" | |
Camera 1 | |
$actionParamInput = "none" | |
Video 1 | |
$actionParamInput = "none" | |
wifi 1 | |
$actionParamInput = "none" | |
Data 1 | |
$actionParamInput = "none" | |
Browser 1 | |
$actionParamInput = "none" | |
Youtube 1 | |
$actionParamInput = "none" | |
Emails 1 | |
$actionParamInput = "none" | |
Voice2 1 | |
$actionParamInput = "none" | |
SMS 1 | |
$actionParamInput = "none" | |
MMS 1 | |
$actionParamInput = "none" | |
Camera 1 | |
$actionParamInput = "none" | |
Video 1 | |
$actionParamInput = "none" | |
Multimedia 1 | |
$actionParamInput = "none" | |
Voice 1 | |
$actionParamInput = "none" | |
Data 1 | |
$actionParamInput = "none" | |
Camera 1 | |
$actionParamInput = "none" | |
Video 1 | |
$actionParamInput = "none" | |
Multimedia 1 | |
$actionParamInput = "none" | |
wifiOff 1 | |
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.Data(loopTime) | |
tcase = TestCase.new("Data") | |
tcase << TestAction.new(:gotoApp_2_1) do | |
gotoApp('AndFTP') | |
end | |
tcase << TestAction.new(:ImageView_CellIconImage_3) do | |
$ruiObj = RUIObject.new.with('objectid', 1579875351).with('selfid', -1965414104).with('textdescid', 1731495657).with('uniqueparentid', 0) | |
.with('uitreeindex', 7) | |
.with('classname', 'ImageView') | |
.with('resource-id', 'lysesoft.andftp:id/cell_icon_image') | |
$ruiObj.click | |
waitsecond(4) | |
end | |
tcase << TestAction.new(:TextView_BrowserItemName_4) do | |
$ruiObj = RUIObject.new.with('objectid', 607501065).with('selfid', 783401590).with('textdescid', 612347803).with('uniqueparentid', 0).with('classresourceid', -324157026) | |
.with('uitreeindex', 14) | |
.with('classname', 'TextView') | |
.with('resource-id', 'lysesoft.andftp:id/browser_item_name') | |
.with('text', '00QCTComptence') | |
$ruiObj.click | |
waitsecond(4) | |
end | |
tcase << TestAction.new(:TextView_BrowserItemSize_5) do | |
$ruiObj = RUIObject.new.with('objectid', 607658111).with('selfid', 370075006).with('textdescid', 1657532289).with('uniqueparentid', 0).with('classresourceid', -323999980) | |
.with('uitreeindex', 23) | |
.with('pretext', '99Concurrency') | |
.with('classname', 'TextView') | |
.with('resource-id', 'lysesoft.andftp:id/browser_item_size') | |
$ruiObj.click | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:clickXY_258_396_6) do | |
click(258,396) | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:TextView_Download_7) do | |
$ruiObj = RUIObject.new.with('objectid', -1040420566).with('selfid', 1782988902).with('textdescid', -1566896290).with('uniqueparentid', 0) | |
.with('uitreeindex', 3) | |
.with('classname', 'TextView') | |
.with('content-desc', 'Download') | |
$ruiObj.click | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:Button_Button1_8) do | |
$ruiObj = RUIObject.new.with('objectid', 415387334).with('selfid', -1318451484).with('textdescid', 1038170474).with('uniqueparentid', 0) | |
.with('uitreeindex', 5) | |
.with('classname', 'Button') | |
.with('resource-id', 'android:id/button1') | |
.with('text', 'OK') | |
$ruiObj.click | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:Button_Button1_2) do | |
$ruiObj = RUIObject.new.with('objectid', 415387334).with('selfid', -1318451484).with('textdescid', 1038170474).with('uniqueparentid', 0) | |
.with('uitreeindex', 7) | |
.with('classname', 'Button') | |
.with('resource-id', 'android:id/button1') | |
.with('text', 'OK') | |
$ruiObj.click | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:pressHome_9) do | |
pressHome | |
end | |
tcase << TestAction.new(:scriptAction_1) do | |
logStopTest("Data") | |
end | |
tcase.run(loopTime) | |
end | |
def self.DataEnd(loopTime) | |
tcase = TestCase.new("DataEnd") | |
tcase << TestAction.new(:gotoApp_2) do | |
gotoApp('AndFTP') | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:Button_ProgressCancel_4) do | |
$ruiObj = RUIObject.new.with('objectid', -646559864).with('selfid', -1723240818).with('textdescid', 1120146478).with('uniqueparentid', 0) | |
.with('uitreeindex', 5) | |
.with('classname', 'Button') | |
.with('resource-id', 'lysesoft.andftp:id/progress_cancel') | |
.with('text', 'Cancel') | |
$ruiObj.click | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:Button_ProgressSelect_5) do | |
$ruiObj = RUIObject.new.with('objectid', -184857078).with('selfid', 1303670098).with('textdescid', 1262548654).with('uniqueparentid', 0) | |
.with('uitreeindex', 4) | |
.with('classname', 'Button') | |
.with('resource-id', 'lysesoft.andftp:id/progress_select') | |
.with('text', 'OK') | |
$ruiObj.click | |
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.Emails(loopTime) | |
tcase = TestCase.new("Emails") | |
tcase << TestAction.new(:gotoApp_1) do | |
gotoApp('Gmail') | |
end | |
tcase << TestAction.new(:ImageButton_ComposeButton_1) do | |
$ruiObj = RUIObject.new.with('objectid', 1590740167).with('selfid', 1808564263).with('textdescid', -1633397543).with('uniqueparentid', 0) | |
.with('uitreeindex', 9) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.google.android.gm:id/compose_button') | |
.with('content-desc', 'Compose') | |
$ruiObj.click | |
noFailCheck | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:MultiAutoCompleteTextView_To_2) do | |
$ruiObj = RUIObject.new.with('objectid', 1412494739).with('selfid', -538836202).with('textdescid', -639413688).with('uniqueparentid', 0).with('classresourceid', 1488875515) | |
.with('uitreeindex', 8) | |
.with('classname', 'MultiAutoCompleteTextView') | |
.with('resource-id', 'com.google.android.gm:id/to') | |
.with('content-desc', 'To') | |
$ruiObj.inputtext('dvgats1@yahoo.com') | |
noFailCheck | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:pressEnter_2) do | |
pressEnter | |
end | |
tcase << TestAction.new(:EditText_Subject_3) do | |
$ruiObj = RUIObject.new.with('objectid', -1492734634).with('selfid', -477614756).with('textdescid', 969866634).with('uniqueparentid', 0).with('classresourceid', 927865352) | |
.with('uitreeindex', 10) | |
.with('classname', 'EditText') | |
.with('resource-id', 'com.google.android.gm:id/subject') | |
$ruiObj.inputtext('Concurrency Test') | |
noFailCheck | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:EditText_Body_5) do | |
$ruiObj = RUIObject.new.with('objectid', -472419783).with('selfid', 132829042).with('textdescid', -1760111353).with('uniqueparentid', 0).with('classresourceid', 52429382) | |
.with('uitreeindex', 11) | |
.with('classname', 'EditText') | |
.with('resource-id', 'com.google.android.gm:id/body') | |
$ruiObj.inputtext('This is concurrency tests sending email during call.') | |
noFailCheck | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:TextView_Send_6) do | |
$ruiObj = RUIObject.new.with('objectid', 1442003251).with('selfid', 2103341243).with('textdescid', -1481441995).with('uniqueparentid', 0) | |
.with('uitreeindex', 3) | |
.with('classname', 'TextView') | |
.with('resource-id', 'com.google.android.gm:id/send') | |
.with('content-desc', 'Send') | |
$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 << TestAction.new(:scriptAction_1_1_1) do | |
logStopTest("Emails") | |
end | |
tcase.run(loopTime) | |
end | |
def self.GPS(loopTime) | |
tcase = TestCase.new("GPS") | |
tcase << TestAction.new(:gotoApp_1) do | |
gotoApp('Maps') | |
end | |
tcase << TestAction.new(:TextView_Accept_2) do | |
$ruiObj = RUIObject.new.with('objectid', -2142217036).with('selfid', -411926495).with('textdescid', -336996923).with('uniqueparentid', 0).with('classresourceid', -938935918) | |
.with('uitreeindex', 3) | |
.with('classname', 'TextView') | |
.with('text', 'Accept continue') | |
$ruiObj.click | |
noFailCheck | |
end | |
tcase << TestAction.new(:Button_Skip_3) do | |
$ruiObj = RUIObject.new.with('objectid', 1318191317).with('selfid', 343772849).with('textdescid', -671073450).with('uniqueparentid', 0).with('classresourceid', 2001146706) | |
.with('uitreeindex', 4) | |
.with('classname', 'Button') | |
.with('text', 'Skip') | |
$ruiObj.click | |
noFailCheck | |
end | |
tcase << TestAction.new(:ImageView_Clear_2) do | |
$ruiObj = RUIObject.new.with('objectid', 1493645968).with('selfid', 59009363).with('textdescid', -602195619).with('uniqueparentid', 0) | |
.with('uitreeindex', 10) | |
.with('classname', 'ImageView') | |
.with('content-desc', 'Clear') | |
$ruiObj.click | |
noFailCheck | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:clickXY_402_147_6) do | |
click(402,147) | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:EditText_SearchOmniboxEditText_8) do | |
$ruiObj = RUIObject.new.with('objectid', -1009816570).with('selfid', 1989833907).with('textdescid', -1239542566).with('uniqueparentid', 0) | |
.with('uitreeindex', 15) | |
.with('classname', 'EditText') | |
.with('resource-id', 'com.google.android.apps.gmm:id/search_omnibox_edit_text') | |
$ruiObj.inputtext('3225 N Harbor Dr') | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:pressEnter_2) do | |
pressEnter | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:clickXY_954_1575_10) do | |
click(954,1575) | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:TextView_Start_2) do | |
$ruiObj = RUIObject.new.with('objectid', 1559030246).with('selfid', -687427324).with('textdescid', 1603675636).with('uniqueparentid', 0) | |
.with('uitreeindex', 19) | |
.with('classname', 'TextView') | |
.with('text', 'Start navigation') | |
$ruiObj.click | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:Button_Button1_4) do | |
$ruiObj = RUIObject.new.with('objectid', -111119685).with('selfid', 924899888).with('textdescid', 2046338963).with('uniqueparentid', 0) | |
.with('uitreeindex', 4) | |
.with('classname', 'Button') | |
.with('resource-id', 'android:id/button1') | |
.with('text', 'Accept') | |
$ruiObj.click | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:ImageView_Close_9) do | |
$ruiObj = RUIObject.new.with('objectid', 500839813).with('selfid', 1990642820).with('textdescid', 903691479).with('uniqueparentid', 0) | |
.with('uitreeindex', 0) | |
.with('classname', 'ImageView') | |
.with('content-desc', 'Close navigation') | |
$ruiObj.click | |
noFailCheck | |
waitsecond(1) | |
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 << TestAction.new(:scriptAction_1_1_1_1) do | |
logStopTest("GPS") | |
end | |
tcase.run(loopTime) | |
end | |
def self.MMS(loopTime) | |
tcase = TestCase.new("MMS") | |
tcase << TestAction.new(:gotoApp_1) 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', 7) | |
.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 a01') | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:TextView_ContactName_6) do | |
$ruiObj = RUIObject.new.with('objectid', -749737141).with('selfid', 1084775715).with('textdescid', -1688259887).with('uniqueparentid', 0).with('classresourceid', -848607765) | |
.with('uitreeindex', 6) | |
.with('classname', 'TextView') | |
.with('resource-id', 'com.google.android.apps.messaging:id/contact_name') | |
.with('text', 'A01 a01') | |
$ruiObj.click | |
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', 19) | |
.with('classname', 'EditText') | |
.with('resource-id', 'com.google.android.apps.messaging:id/compose_message_text') | |
$ruiObj.inputtext('Testing "Concurrency tests"') | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:ImageButton_AttachMediaButton_10) do | |
$ruiObj = RUIObject.new.with('objectid', 840041021).with('selfid', -952088716).with('textdescid', -438944396).with('uniqueparentid', 0) | |
.with('uitreeindex', 11) | |
.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(: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_PermissionAllowButton_4) 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(:ImageButton_Capture_16) do | |
$ruiObj = RUIObject.new.with('objectid', 1408822083).with('selfid', 534305278).with('textdescid', -1011568910).with('uniqueparentid', 0) | |
.with('uitreeindex', 28) | |
.with('classname', 'ImageButton') | |
.with('content-desc', 'Capture pictures or video') | |
$ruiObj.click | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:ImageButton_CameraCaptureButton_18) do | |
$ruiObj = RUIObject.new.with('objectid', -418176112).with('selfid', -1841152110).with('textdescid', 1969099733).with('uniqueparentid', 0) | |
.with('uitreeindex', 18) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.google.android.apps.messaging:id/camera_capture_button') | |
.with('content-desc', 'Take picture') | |
$ruiObj.click | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:ImageButton_SendMessageButton_20) do | |
$ruiObj = RUIObject.new.with('objectid', -1329122643).with('selfid', -1857249780).with('textdescid', 1740568962).with('uniqueparentid', 0) | |
.with('uitreeindex', 10) | |
.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_10) do | |
pressBack | |
end | |
tcase << TestAction.new(:pressBack_11) do | |
pressBack | |
end | |
tcase << TestAction.new(:pressHome_12) do | |
pressHome | |
end | |
tcase << TestAction.new(:scriptAction_1_1_1_1_1) do | |
logStopTest("MMS") | |
end | |
tcase.run(loopTime) | |
end | |
def self.Multimedia(loopTime) | |
tcase = TestCase.new("Multimedia") | |
tcase << TestAction.new(:gotoApp_1) do | |
gotoApp('Camera') | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:View_RoundedThumbnailView_2) do | |
$ruiObj = RUIObject.new.with('objectid', -2099327908).with('selfid', -1804265706).with('textdescid', -654655676).with('uniqueparentid', 0) | |
.with('uitreeindex', 6) | |
.with('classname', 'android.view.View') | |
.with('resource-id', 'com.android.camera2:id/rounded_thumbnail_view') | |
$ruiObj.click | |
waitsecond(1) | |
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', 1) | |
.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(:pressBack_4) do | |
pressBack | |
end | |
tcase << TestAction.new(:pressBack_5) do | |
pressBack | |
end | |
tcase << TestAction.new(:pressHome_6) do | |
pressHome | |
end | |
tcase << TestAction.new(:scriptAction_1_1_1_1_1_1) do | |
logStopTest("Multimedia") | |
end | |
tcase.run(loopTime) | |
end | |
def self.Video(loopTime) | |
tcase = TestCase.new("Video") | |
tcase << TestAction.new(:gotoApp_1) do | |
gotoApp('Camera') | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:Button_ConfirmButton_2) 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 | |
end | |
tcase << TestAction.new(:ImageView_Menubutton_2) do | |
$ruiObj = RUIObject.new.with('objectid', -892204371).with('selfid', 322734124).with('textdescid', -1888531693).with('uniqueparentid', 0) | |
.with('uitreeindex', 8) | |
.with('classname', 'ImageView') | |
.with('resource-id', 'com.android.camera2:id/menuButton') | |
$ruiObj.click | |
waitsecond(1) | |
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', 9) | |
.with('classname', 'TextView') | |
.with('resource-id', 'com.android.camera2:id/selector_text') | |
.with('text', 'Video') | |
$ruiObj.click | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:ImageView_PhotoVideoButton_4) do | |
$ruiObj = RUIObject.new.with('objectid', 1525621660).with('selfid', 940549150).with('textdescid', 49631236).with('uniqueparentid', 0) | |
.with('uitreeindex', 5) | |
.with('classname', 'ImageView') | |
.with('resource-id', 'com.android.camera2:id/photo_video_button') | |
$ruiObj.click | |
waitsecond(4) | |
end | |
tcase << TestAction.new(:ImageView_PhotoVideoButton_6) do | |
$ruiObj = RUIObject.new.with('objectid', 1525621660).with('selfid', 940549150).with('textdescid', 49631236).with('uniqueparentid', 0) | |
.with('uitreeindex', 4) | |
.with('classname', 'ImageView') | |
.with('resource-id', 'com.android.camera2:id/photo_video_button') | |
$ruiObj.click | |
waitsecond(1) | |
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 << TestAction.new(:scriptAction_1_1_1_1_1_1_1_1) do | |
logStopTest("Video") | |
end | |
tcase.run(loopTime) | |
end | |
def self.Voice(loopTime) | |
tcase = TestCase.new("Voice") | |
tcase << TestAction.new(:pressHome_1) do | |
pressHome | |
end | |
tcase << TestAction.new(:scriptAction_4) do | |
UiDevice.getInstance.openNotification() | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:clickXY_228_429_7_1) do | |
click(228,429) | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:gotoApp_2_1) do | |
gotoApp('Phone') | |
end | |
tcase << TestAction.new(:dial) do | |
$ruiObj = RUIObject.new.with('objectid', -1006649703).with('selfid', -826783573).with('textdescid', 1279743754).with('uniqueparentid', 0) | |
.with('uitreeindex', 9) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.android.dialer:id/floating_action_button') | |
.with('content-desc', 'dial pad') | |
$ruiObj.click | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:ImageButton_Deletebutton_18) do | |
$ruiObj = RUIObject.new.with('objectid', 1381732041).with('selfid', -276886386).with('textdescid', 1670453736).with('uniqueparentid', 0) | |
.with('uitreeindex', 3) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.android.dialer:id/deleteButton') | |
.with('content-desc', 'backspace') | |
$ruiObj.click | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:EditText_Digits_19) do | |
$ruiObj = RUIObject.new.with('objectid', 1135511844).with('selfid', 2090466848).with('textdescid', 841128828).with('uniqueparentid', 0) | |
.with('uitreeindex', 2) | |
.with('classname', 'EditText') | |
.with('resource-id', 'com.android.dialer:id/digits') | |
$ruiObj.inputtext('18008662453') | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:ImageButton_DialpadFloatingActionButton_20) do | |
$ruiObj = RUIObject.new.with('objectid', -231063972).with('selfid', -361167454).with('textdescid', 598834612).with('uniqueparentid', 0) | |
.with('uitreeindex', 27) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.android.dialer:id/dialpad_floating_action_button') | |
.with('content-desc', 'dial') | |
$ruiObj.click | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:scriptAction_1_1_1_1_1_1_1_1) do | |
logStopTest("Voice") | |
end | |
tcase.run(loopTime) | |
end | |
def self.Voice2(loopTime) | |
tcase = TestCase.new("Voice2") | |
tcase << TestAction.new(:gotoApp_2) do | |
gotoApp('Phone') | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:TextView_Text_10) do | |
$ruiObj = RUIObject.new.with('objectid', 277925862).with('selfid', 938939901).with('textdescid', -793529845).with('uniqueparentid', 0).with('classresourceid', -526721384) | |
.with('uitreeindex', 5) | |
.with('classname', 'TextView') | |
.with('resource-id', 'com.android.dialer:id/text') | |
.with('text', 'Return to call in progress') | |
$ruiObj.isExist | |
ifFailJumpTo(:dial) | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:TextView_Text_10_1) do | |
$ruiObj = RUIObject.new.with('objectid', 277925862).with('selfid', 938939901).with('textdescid', -793529845).with('uniqueparentid', 0).with('classresourceid', -526721384) | |
.with('uitreeindex', 5) | |
.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_12) 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(:gotoApp_2_1) do | |
gotoApp('Phone') | |
end | |
tcase << TestAction.new(:dial) do | |
$ruiObj = RUIObject.new.with('objectid', -1006649703).with('selfid', -826783573).with('textdescid', 1279743754).with('uniqueparentid', 0) | |
.with('uitreeindex', 9) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.android.dialer:id/floating_action_button') | |
.with('content-desc', 'dial pad') | |
$ruiObj.click | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:ImageButton_Deletebutton_18) do | |
$ruiObj = RUIObject.new.with('objectid', 1381732041).with('selfid', -276886386).with('textdescid', 1670453736).with('uniqueparentid', 0) | |
.with('uitreeindex', 3) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.android.dialer:id/deleteButton') | |
.with('content-desc', 'backspace') | |
$ruiObj.longClick | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:EditText_Digits_19) do | |
$ruiObj = RUIObject.new.with('objectid', 1135511844).with('selfid', 2090466848).with('textdescid', 841128828).with('uniqueparentid', 0) | |
.with('uitreeindex', 2) | |
.with('classname', 'EditText') | |
.with('resource-id', 'com.android.dialer:id/digits') | |
$ruiObj.inputtext('18008662453') | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:ImageButton_DialpadFloatingActionButton_20) do | |
$ruiObj = RUIObject.new.with('objectid', -231063972).with('selfid', -361167454).with('textdescid', 598834612).with('uniqueparentid', 0) | |
.with('uitreeindex', 27) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.android.dialer:id/dialpad_floating_action_button') | |
.with('content-desc', 'dial') | |
$ruiObj.click | |
waitsecond(8) | |
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', 6) | |
.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(:scriptAction_1_1_1_1_1_1_1_1) do | |
logStopTest("Voice") | |
end | |
tcase.run(loopTime) | |
end | |
def self.Youtube(loopTime) | |
tcase = TestCase.new("Youtube") | |
tcase << TestAction.new(:gotoApp_1) do | |
gotoApp('YouTube') | |
waitsecond(4) | |
end | |
tcase << TestAction.new(:ImageView_Thumbnail_2) do | |
$ruiObj = RUIObject.new.with('objectid', -1915832258).with('selfid', -2120336906).with('textdescid', 738742178).with('uniqueparentid', 0) | |
.with('uitreeindex', 5) | |
.with('pretext', 'Home') | |
.with('classname', 'ImageView') | |
.with('resource-id', 'com.google.android.youtube:id/thumbnail') | |
$ruiObj.click | |
waitsecond(8) | |
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 << TestAction.new(:scriptAction_1_1_1_1_1_1_1_1_1) do | |
logStopTest("Youtube") | |
end | |
tcase.run(loopTime) | |
end | |
def self.endcall(loopTime) | |
tcase = TestCase.new("endcall") | |
tcase << TestAction.new(:scriptAction_3) do | |
UiDevice.getInstance.openNotification() | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:swipeDown_2) do | |
swipe_vertical 500 | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:clickXY_1136_628_1) do | |
click(1136,628) | |
waitsecond(2) | |
end | |
tcase.run(loopTime) | |
end | |
def self.ltecall_ExpHandler(loopTime) | |
tcase = TestCase.new("ltecall_ExpHandler") | |
tcase << TestAction.new(:wait1second_1) do | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:scriptAction_2) do | |
puts "Detected Incomming Call" | |
$UIDev.swipe(200,$UIDev.getDisplayHeight-300,$UIDev.getDisplayWidth-50,$UIDev.getDisplayHeight-300,10) | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:clickXY_291_246_2) do | |
click(291,246) | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:wait2second_3) do | |
waitsecond(2) | |
end | |
tcase.run(loopTime) | |
end | |
def self.startTest(loopTime) | |
tcase = TestCase.new("startTest") | |
tcase << TestAction.new(:pressBack_1) do | |
pressBack | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:pressBack_2) do | |
pressBack | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:pressHome_3) do | |
pressHome | |
waitsecond(2) | |
end | |
tcase.run(loopTime) | |
end | |
def self.wifi(loopTime) | |
tcase = TestCase.new("wifi") | |
tcase << TestAction.new(:gotoApp_1) do | |
gotoApp('Settings') | |
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_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_Title_6_1) 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.isNotExist | |
ifFailJumpTo(:TextView_Title_6) | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:Switch_SwitchWidget_11) 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(:TextView_Title_6) 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(1) | |
end | |
tcase << TestAction.new(:EditText_Password_7) 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_8) 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(:pressBack_12) do | |
pressBack | |
end | |
tcase << TestAction.new(:pressBack_13) do | |
pressBack | |
end | |
tcase << TestAction.new(:pressHome_14) do | |
pressHome | |
end | |
tcase.run(loopTime) | |
end | |
def self.wifiOff(loopTime) | |
tcase = TestCase.new("wifiOff") | |
tcase << TestAction.new(:gotoApp_1) do | |
gotoApp('Settings') | |
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_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_Title_6_1) 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.isExist | |
ifFailJumpTo(:pressBack_12) | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:Switch_SwitchWidget_11) 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(:pressBack_12) do | |
pressBack | |
end | |
tcase << TestAction.new(:pressBack_13) do | |
pressBack | |
end | |
tcase << TestAction.new(:pressHome_14) do | |
pressHome | |
end | |
tcase.run(loopTime) | |
end | |
def self.SMS(loopTime) | |
tcase = TestCase.new("SMS") | |
tcase << TestAction.new(:gotoApp_1) 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', 7) | |
.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 a01') | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:TextView_ContactName_6) do | |
$ruiObj = RUIObject.new.with('objectid', -749737141).with('selfid', 1084775715).with('textdescid', -1688259887).with('uniqueparentid', 0).with('classresourceid', -848607765) | |
.with('uitreeindex', 6) | |
.with('classname', 'TextView') | |
.with('resource-id', 'com.google.android.apps.messaging:id/contact_name') | |
.with('text', 'A01 a01') | |
$ruiObj.click | |
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', 19) | |
.with('classname', 'EditText') | |
.with('resource-id', 'com.google.android.apps.messaging:id/compose_message_text') | |
$ruiObj.inputtext('Testing "Concurrency tests"') | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:ImageButton_SendMessageButton_10) do | |
$ruiObj = RUIObject.new.with('objectid', -1329122643).with('selfid', -1857249780).with('textdescid', 1740568962).with('uniqueparentid', 0) | |
.with('uitreeindex', 10) | |
.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_10) do | |
pressBack | |
end | |
tcase << TestAction.new(:pressBack_11) do | |
pressBack | |
end | |
tcase << TestAction.new(:pressHome_12) do | |
pressHome | |
end | |
tcase << TestAction.new(:scriptAction_1_1_1_1_1_1_1) do | |
logStopTest("SMS") | |
end | |
tcase.run(loopTime) | |
end | |
def self.exception_handler | |
puts "Module Exception Hanlder..." | |
if ($lastPackageName == "ltecall") | |
ltecall_ExpHandler(1) | |
end | |
end | |
def self.run(loop) | |
mainLoop loop | |
end | |
end | |
$exceptionPackageNameList = [] | |
$exceptionPackageNameList_exclude = [] | |
$exceptionPackageNameList << "ltecall" | |
def exception_handler | |
Concurrency.exception_handler | |
end | |
$curProjectLogFile = $useLastLogFile | |
$curProjectLogFile = "Concurrency_#{getTimeStamp}.log" if $useLastLogFile.nil? | |
$useLastLogFile = nil | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment