Created
November 11, 2015 23:16
-
-
Save n3mtbf/f5867ee49df2bc10f6cc to your computer and use it in GitHub Desktop.
H1_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 H1_Concurrency | |
def self.Browser(loopTime) | |
tcase = TestCase.new("Browser") | |
tcase << TestAction.new(:gotoApp_7) do | |
gotoApp('Chrome') | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:clickXY_1096_204_2) do | |
click(1096,204) | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:EditText_UrlBar_2) do | |
$ruiObj = RUIObject.new.with('objectid', 882195433).with('selfid', 613381324).with('textdescid', 1578254679).with('uniqueparentid', 0) | |
.with('uitreeindex', 215) | |
.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(:clickXY_1112_204_2) do | |
click(1112,204) | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:EditText_UrlBar_2_1) do | |
$ruiObj = RUIObject.new.with('objectid', 882195433).with('selfid', 613381324).with('textdescid', 1578254679).with('uniqueparentid', 0) | |
.with('uitreeindex', 215) | |
.with('classname', 'EditText') | |
.with('resource-id', 'com.android.chrome:id/url_bar') | |
$ruiObj.inputtext('www.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(:pressHome_13) do | |
pressHome | |
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(:ImageButton_QuickButtonCleanView_2) do | |
$ruiObj = RUIObject.new.with('objectid', 2094475324).with('selfid', -1659256094).with('textdescid', 1888606697).with('uniqueparentid', 0) | |
.with('uitreeindex', 4) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.lge.camera:id/quick_button_clean_view') | |
.with('content-desc', 'View') | |
$ruiObj.click | |
noFailCheck | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:ImageButton_QuickNormalImageView_3) do | |
$ruiObj = RUIObject.new.with('objectid', -1828351537).with('selfid', -62449628).with('textdescid', -1345909955).with('uniqueparentid', 0) | |
.with('uitreeindex', 6) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.lge.camera:id/quick_normal_image_view') | |
.with('content-desc', 'Basic') | |
$ruiObj.click | |
noFailCheck | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:ImageButton_ShutterBottomComp_4) do | |
$ruiObj = RUIObject.new.with('objectid', -216722415).with('selfid', -92772729).with('textdescid', 1720830782).with('uniqueparentid', 0) | |
.with('uitreeindex', 5) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.lge.camera:id/shutter_bottom_comp') | |
.with('content-desc', 'Shutter') | |
$ruiObj.click | |
noFailCheck | |
waitsecond(2) | |
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.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_208_616_4) do | |
click(208,616) | |
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.Emails(loopTime) | |
tcase = TestCase.new("Emails") | |
tcase << TestAction.new(:gotoApp_1) do | |
gotoApp('Gmail') | |
waitsecond(2) | |
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 | |
waitsecond(2) | |
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') | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:pressEnter_2) do | |
pressEnter | |
waitsecond(2) | |
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') | |
waitsecond(2) | |
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.') | |
waitsecond(2) | |
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 | |
waitsecond(2) | |
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.GPS(loopTime) | |
tcase = TestCase.new("GPS") | |
tcase << TestAction.new(:gotoApp_1) do | |
gotoApp('Maps') | |
waitsecond(2) | |
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 | |
waitsecond(2) | |
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 | |
waitsecond(2) | |
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(2) | |
end | |
tcase << TestAction.new(:clickXY_1092_228_4) do | |
click(1092,228) | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:EditText_SearchOmniboxEditText_2) do | |
$ruiObj = RUIObject.new.with('objectid', -1009816570).with('selfid', 1989833907).with('textdescid', -1239542566).with('uniqueparentid', 0) | |
.with('uitreeindex', 8) | |
.with('classname', 'EditText') | |
.with('resource-id', 'com.google.android.apps.gmm:id/search_omnibox_edit_text') | |
$ruiObj.inputtext('3225 N Harbor Dr') | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:pressEnter_2) do | |
pressEnter | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:clickXY_1252_2024_4) do | |
click(1252,2024) | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:clickXY_1264_2008_6) do | |
click(1264,2008) | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:Button_Button1_8) 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 | |
noFailCheck | |
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(2) | |
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.MMS(loopTime) | |
tcase = TestCase.new("MMS") | |
tcase << TestAction.new(:gotoApp_1) do | |
gotoApp('Messaging') | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:ImageView_FabImg_1) do | |
$ruiObj = RUIObject.new.with('objectid', -1942697351).with('selfid', 1638137891).with('textdescid', 371477056).with('uniqueparentid', 0) | |
.with('uitreeindex', 12) | |
.with('classname', 'ImageView') | |
.with('resource-id', 'com.android.mms:id/fab_img') | |
.with('content-desc', 'New message') | |
$ruiObj.click | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:ImageButton_Contacts_2) do | |
$ruiObj = RUIObject.new.with('objectid', -2124182915).with('selfid', -358910880).with('textdescid', 1935590710).with('uniqueparentid', 0) | |
.with('uitreeindex', 1) | |
.with('classname', 'ImageButton') | |
.with('content-desc', 'Contacts') | |
$ruiObj.click | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:EditText_SearchSrcText_3) do | |
$ruiObj = RUIObject.new.with('objectid', -471210648).with('selfid', 1544702019).with('textdescid', 1799722536).with('uniqueparentid', -1383453713) | |
.with('uitreeindex', 6) | |
.with('classname', 'EditText') | |
.with('resource-id', 'android:id/search_src_text') | |
.with('content-desc', 'Search query') | |
$ruiObj.inputtext('A01') | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:clickXY_556_912_6) do | |
click(556,912) | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:Button_BtnDone_7) do | |
$ruiObj = RUIObject.new.with('objectid', -1115765366).with('selfid', 670790066).with('textdescid', 289433256).with('uniqueparentid', 0) | |
.with('uitreeindex', 27) | |
.with('classname', 'Button') | |
.with('resource-id', 'com.android.contacts:id/btn_done') | |
.with('text', 'Done') | |
$ruiObj.click | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:EditText_Enter_8) do | |
$ruiObj = RUIObject.new.with('objectid', -158768307).with('selfid', -454502120).with('textdescid', -842188788).with('uniqueparentid', 0).with('classresourceid', 1666676343) | |
.with('uitreeindex', 10) | |
.with('classname', 'EditText') | |
.with('content-desc', 'Enter message') | |
$ruiObj.inputtext('Testing "Concurrency tests"') | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:ImageButton_AttachbuttonRight_2) do | |
$ruiObj = RUIObject.new.with('objectid', 2024823859).with('selfid', -1211001229).with('textdescid', 152921714).with('uniqueparentid', 0) | |
.with('uitreeindex', 15) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.android.mms:id/attachButton_right') | |
.with('content-desc', 'Attach') | |
$ruiObj.click | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:TextView_Text1_3) do | |
$ruiObj = RUIObject.new.with('objectid', -786651428).with('selfid', -1538867418).with('textdescid', 1602617353).with('uniqueparentid', 0).with('classresourceid', -1838901301) | |
.with('uitreeindex', 2) | |
.with('classname', 'TextView') | |
.with('resource-id', 'com.android.mms:id/text1') | |
.with('text', 'Image') | |
$ruiObj.click | |
waitsecond(4) | |
end | |
tcase << TestAction.new(:Button_PermissionAllowButton_2) do | |
$ruiObj = RUIObject.new.with('objectid', 973397371).with('selfid', 1444367499).with('textdescid', -1740624804).with('uniqueparentid', 0) | |
.with('uitreeindex', 3) | |
.with('classname', 'Button') | |
.with('resource-id', 'com.android.packageinstaller:id/permission_allow_button') | |
.with('text', 'Allow') | |
$ruiObj.click | |
end | |
tcase << TestAction.new(:clickXY_224_664_6) do | |
click(224,664) | |
waitsecond(4) | |
end | |
tcase << TestAction.new(:Button_SendButtonText_4) do | |
$ruiObj = RUIObject.new.with('objectid', 353843972).with('selfid', 742186862).with('textdescid', -1914765924).with('uniqueparentid', 0) | |
.with('uitreeindex', 10) | |
.with('classname', 'Button') | |
.with('resource-id', 'com.android.mms:id/send_button_text') | |
.with('content-desc', 'Send') | |
.with('text', 'Send') | |
$ruiObj.click | |
waitsecond(2) | |
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.Multimedia(loopTime) | |
tcase = TestCase.new("Multimedia") | |
tcase << TestAction.new(:gotoApp_1) do | |
gotoApp('Gallery') | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:ImageButton_Open_1) do | |
$ruiObj = RUIObject.new.with('objectid', 1547446343).with('selfid', 1589392844).with('textdescid', -1415314368).with('uniqueparentid', 0) | |
.with('uitreeindex', 0) | |
.with('classname', 'ImageButton') | |
.with('content-desc', 'Open navigation drawer') | |
$ruiObj.click | |
noFailCheck | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:CheckedTextView_DrawerItem_2) do | |
$ruiObj = RUIObject.new.with('objectid', -401550358).with('selfid', 229733217).with('textdescid', 1081503090).with('uniqueparentid', 0).with('classresourceid', 396870609) | |
.with('uitreeindex', 4) | |
.with('classname', 'CheckedTextView') | |
.with('resource-id', 'com.android.gallery3d:id/drawer_item') | |
.with('text', 'Videos') | |
$ruiObj.click | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:clickXY_404_572_3) do | |
click(404,572) | |
waitsecond(32) | |
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.run(loopTime) | |
end | |
def self.SMS(loopTime) | |
tcase = TestCase.new("SMS") | |
tcase << TestAction.new(:gotoApp_1) do | |
gotoApp('Messaging') | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:ImageView_FabImg_1) do | |
$ruiObj = RUIObject.new.with('objectid', -1942697351).with('selfid', 1638137891).with('textdescid', 371477056).with('uniqueparentid', 0) | |
.with('uitreeindex', 12) | |
.with('classname', 'ImageView') | |
.with('resource-id', 'com.android.mms:id/fab_img') | |
.with('content-desc', 'New message') | |
$ruiObj.click | |
noFailCheck | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:ImageButton_Contacts_2) do | |
$ruiObj = RUIObject.new.with('objectid', -2124182915).with('selfid', -358910880).with('textdescid', 1935590710).with('uniqueparentid', 0) | |
.with('uitreeindex', 1) | |
.with('classname', 'ImageButton') | |
.with('content-desc', 'Contacts') | |
$ruiObj.click | |
noFailCheck | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:EditText_SearchSrcText_3) do | |
$ruiObj = RUIObject.new.with('objectid', -471210648).with('selfid', 1544702019).with('textdescid', 1799722536).with('uniqueparentid', -1383453713) | |
.with('uitreeindex', 6) | |
.with('classname', 'EditText') | |
.with('resource-id', 'android:id/search_src_text') | |
.with('content-desc', 'Search query') | |
$ruiObj.inputtext('A01') | |
noFailCheck | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:clickXY_556_912_6) do | |
click(556,912) | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:Button_BtnDone_7) do | |
$ruiObj = RUIObject.new.with('objectid', -1115765366).with('selfid', 670790066).with('textdescid', 289433256).with('uniqueparentid', 0) | |
.with('uitreeindex', 27) | |
.with('classname', 'Button') | |
.with('resource-id', 'com.android.contacts:id/btn_done') | |
.with('text', 'Done') | |
$ruiObj.click | |
noFailCheck | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:EditText_Enter_8) do | |
$ruiObj = RUIObject.new.with('objectid', -158768307).with('selfid', -454502120).with('textdescid', -842188788).with('uniqueparentid', 0).with('classresourceid', 1666676343) | |
.with('uitreeindex', 10) | |
.with('classname', 'EditText') | |
.with('content-desc', 'Enter message') | |
$ruiObj.inputtext('Testing "Concurrency tests"') | |
noFailCheck | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:Button_SendButtonText_2) do | |
$ruiObj = RUIObject.new.with('objectid', 353843972).with('selfid', 742186862).with('textdescid', -1914765924).with('uniqueparentid', 0) | |
.with('uitreeindex', 10) | |
.with('classname', 'Button') | |
.with('resource-id', 'com.android.mms:id/send_button_text') | |
.with('content-desc', 'Send') | |
.with('text', 'Send') | |
$ruiObj.click | |
waitsecond(2) | |
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.Video(loopTime) | |
tcase = TestCase.new("Video") | |
tcase << TestAction.new(:gotoApp_1) do | |
gotoApp('Camera') | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:ImageButton_QuickButtonCleanView_2) do | |
$ruiObj = RUIObject.new.with('objectid', 2094475324).with('selfid', -1659256094).with('textdescid', 1888606697).with('uniqueparentid', 0) | |
.with('uitreeindex', 4) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.lge.camera:id/quick_button_clean_view') | |
.with('content-desc', 'View') | |
$ruiObj.click | |
noFailCheck | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:ImageButton_QuickNormalImageView_3) do | |
$ruiObj = RUIObject.new.with('objectid', -1828351537).with('selfid', -62449628).with('textdescid', -1345909955).with('uniqueparentid', 0) | |
.with('uitreeindex', 6) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.lge.camera:id/quick_normal_image_view') | |
.with('content-desc', 'Basic') | |
$ruiObj.click | |
noFailCheck | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:ImageButton_ShutterTopComp_2) do | |
$ruiObj = RUIObject.new.with('objectid', -1799776401).with('selfid', -1818636331).with('textdescid', -839551902).with('uniqueparentid', 0) | |
.with('uitreeindex', 8) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.lge.camera:id/shutter_top_comp') | |
.with('content-desc', 'Start recording') | |
$ruiObj.click | |
noFailCheck | |
waitsecond(4) | |
end | |
tcase << TestAction.new(:ImageButton_ShutterTopComp_4) do | |
$ruiObj = RUIObject.new.with('objectid', -1799776401).with('selfid', -1930433243).with('textdescid', 415097668).with('uniqueparentid', 0) | |
.with('uitreeindex', 4) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.lge.camera:id/shutter_top_comp') | |
.with('content-desc', 'Stop recording') | |
$ruiObj.click | |
noFailCheck | |
waitsecond(2) | |
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.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_1080_632_2) do | |
click(1080,632) | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:gotoApp_2) do | |
gotoApp('Phone') | |
waitsecond(4) | |
end | |
tcase << TestAction.new(:Button_Endbutton_1) do | |
$ruiObj = RUIObject.new.with('objectid', 1093625292).with('selfid', 813321472).with('textdescid', -609726311).with('uniqueparentid', 0) | |
.with('uitreeindex', 4) | |
.with('classname', 'Button') | |
.with('resource-id', 'com.lge.ltecall:id/endButton') | |
.with('text', 'End') | |
$ruiObj.select('Similiar').click | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:TextView_Tabtext_2) do | |
$ruiObj = RUIObject.new.with('objectid', -66640566).with('selfid', 566119687).with('textdescid', 1718553658).with('uniqueparentid', 0) | |
.with('uitreeindex', 2) | |
.with('classname', 'TextView') | |
.with('resource-id', 'com.android.contacts:id/tabText') | |
.with('text', 'Dial') | |
$ruiObj.click | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:ImageButton_Btndelete_2) do | |
$ruiObj = RUIObject.new.with('objectid', 1208458233).with('selfid', 194799554).with('textdescid', -91453704).with('uniqueparentid', 0) | |
.with('uitreeindex', 31) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.android.contacts:id/btnDelete') | |
.with('content-desc', 'Backspace') | |
$ruiObj.longClick | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:EditText_Digits_2) do | |
$ruiObj = RUIObject.new.with('objectid', 1211786433).with('selfid', -1326421482).with('textdescid', -1089326209).with('uniqueparentid', 0) | |
.with('uitreeindex', 8) | |
.with('classname', 'EditText') | |
.with('resource-id', 'com.android.contacts:id/digits') | |
$ruiObj.inputtext('18008662453') | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:ImageButton_Btnlogscall_3) do | |
$ruiObj = RUIObject.new.with('objectid', -1396768901).with('selfid', -2053967649).with('textdescid', 1795842883).with('uniqueparentid', 0) | |
.with('uitreeindex', 29) | |
.with('classname', 'ImageButton') | |
.with('resource-id', 'com.android.contacts:id/btnLogsCall') | |
.with('content-desc', 'Call') | |
$ruiObj.click | |
waitsecond(1) | |
end | |
tcase.run(loopTime) | |
end | |
def self.Youtube(loopTime) | |
tcase = TestCase.new("Youtube") | |
tcase << TestAction.new(:gotoApp_1) do | |
gotoApp('YouTube') | |
waitsecond(1) | |
end | |
tcase << TestAction.new(:TextView_DoneButton_2) do | |
$ruiObj = RUIObject.new.with('objectid', -1205593873).with('selfid', -1917900695).with('textdescid', 1076943437).with('uniqueparentid', 0) | |
.with('uitreeindex', 2) | |
.with('classname', 'TextView') | |
.with('resource-id', 'com.google.android.youtube:id/done_button') | |
.with('text', 'Done') | |
$ruiObj.click | |
waitsecond(4) | |
end | |
tcase << TestAction.new(:clickXY_700_1256_7) do | |
click(700,1256) | |
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.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(2) | |
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_2) do | |
$ruiObj = RUIObject.new.with('objectid', 2008023572).with('selfid', -589731018).with('textdescid', 498664031).with('uniqueparentid', 0).with('classresourceid', 490183159) | |
.with('uitreeindex', 9) | |
.with('classname', 'TextView') | |
.with('resource-id', 'android: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_OFF_2) do | |
$ruiObj = RUIObject.new.with('objectid', 1178284996).with('selfid', -533646533).with('textdescid', -1104515187).with('uniqueparentid', 0) | |
.with('uitreeindex', 2) | |
.with('classname', 'Switch') | |
.with('text', 'OFF') | |
$ruiObj.click | |
waitsecond(2) | |
end | |
tcase << TestAction.new(:Switch_ON_4) do | |
$ruiObj = RUIObject.new.with('objectid', 1178284996).with('selfid', 1645353587).with('textdescid', -1975291963).with('uniqueparentid', 0) | |
.with('uitreeindex', 2) | |
.with('classname', 'Switch') | |
.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_2) do | |
$ruiObj = RUIObject.new.with('objectid', 2008023572).with('selfid', -589731018).with('textdescid', 498664031).with('uniqueparentid', 0).with('classresourceid', 490183159) | |
.with('uitreeindex', 9) | |
.with('classname', 'TextView') | |
.with('resource-id', 'android: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_ON_4) do | |
$ruiObj = RUIObject.new.with('objectid', 1178284996).with('selfid', 1645353587).with('textdescid', -1975291963).with('uniqueparentid', 0) | |
.with('uitreeindex', 2) | |
.with('classname', 'Switch') | |
.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.mainLoop(loopTime) | |
UIEngineWSHttpServer.setAutoUpdate(false) | |
index = $mainResumeMainLoop | |
$mainResumeMainLoop = 0 | |
writelog("mainLoop::#{index}::Resume") if index > 0 | |
while index < loopTime | |
$curMainLoopNum = index | |
$actionParamInput = "none" | |
startTest 1 | |
$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" | |
Voice 1 | |
$actionParamInput = "none" | |
Browser 1 | |
$actionParamInput = "none" | |
Multimedia 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.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 | |
H1_Concurrency.exception_handler | |
end | |
$curProjectLogFile = $useLastLogFile | |
$curProjectLogFile = "H1_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