Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- loadTestDB
- module H901_E911
- def self.1X(loopTime)
- tcase = TestCase.new("1X")
- tcase << TestAction.new(:gotoApp_1) do
- gotoApp('Settings')
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Title_9) do
- $ruiObj = RUIObject.new.with('objectid', -487328458).with('selfid', -590333345).with('textdescid', 1517398520).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 28)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'Call')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:Switch_Switchwidget_11) do
- $ruiObj = RUIObject.new.with('objectid', -1351004236).with('selfid', -472628224).with('textdescid', 1068541676).with('uniqueparentid', 0).with('classresourceid', 1594664046)
- .with('uitreeindex', 5)
- .with('classname', 'Switch')
- .with('resource-id', 'com.android.phone:id/switchWidget')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:gotoApp_7) do
- gotoApp('Phone')
- waitsecond(2)
- end
- tcase << TestAction.new(:EditText_Digits_3) do
- $ruiObj = RUIObject.new.with('objectid', 477485968).with('selfid', -1326421482).with('textdescid', 1917163152).with('uniqueparentid', 0)
- .with('uitreeindex', 8)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.contacts:id/digits')
- $ruiObj.inputtext('*#546368#*901#')
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Title_5) do
- $ruiObj = RUIObject.new.with('objectid', 684902757).with('selfid', 538152793).with('textdescid', -1915478867).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 4)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'Field Test')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Text1_7) do
- $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', -141259386).with('textdescid', -734720867).with('uniqueparentid', 0).with('classresourceid', 490068035)
- .with('uitreeindex', 1)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/text1')
- .with('text', 'Modem Settings')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:swipeDown_13) do
- swipe_vertical 500
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Text1_9) do
- $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', 12767364).with('textdescid', 1760273017).with('uniqueparentid', 0).with('classresourceid', 490068035)
- .with('uitreeindex', 6)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/text1')
- .with('text', 'RAT Selection')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Text1_15) do
- $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', -552066504).with('textdescid', -91161493).with('uniqueparentid', 0).with('classresourceid', 490068035)
- .with('uitreeindex', 7)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/text1')
- .with('text', 'GSM only')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:Button_Button1_17) do
- $ruiObj = RUIObject.new.with('objectid', 2089308220).with('selfid', -1318451484).with('textdescid', 1664978912).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button1')
- .with('text', 'OK')
- $ruiObj.click
- waitsecond(2)
- end
- tcase.run(loopTime)
- end
- def self.1X_VoLTE(loopTime)
- tcase = TestCase.new("1X_VoLTE")
- tcase << TestAction.new(:gotoApp_1) do
- gotoApp('Phone')
- waitsecond(2)
- end
- tcase << TestAction.new(:EditText_Digits_3) do
- $ruiObj = RUIObject.new.with('objectid', 477485968).with('selfid', -1326421482).with('textdescid', 1917163152).with('uniqueparentid', 0)
- .with('uitreeindex', 8)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.contacts:id/digits')
- $ruiObj.inputtext('*#546368#*901#')
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Title_5) do
- $ruiObj = RUIObject.new.with('objectid', 684902757).with('selfid', 538152793).with('textdescid', -1915478867).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 4)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'Field Test')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Text1_7) do
- $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', -141259386).with('textdescid', -734720867).with('uniqueparentid', 0).with('classresourceid', 490068035)
- .with('uitreeindex', 1)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/text1')
- .with('text', 'Modem Settings')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:swipeDown_13) do
- swipe_vertical 500
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Text1_9) do
- $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', 12767364).with('textdescid', 1760273017).with('uniqueparentid', 0).with('classresourceid', 490068035)
- .with('uitreeindex', 6)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/text1')
- .with('text', 'RAT Selection')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Text1_2) do
- $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', 228129265).with('textdescid', -1674896430).with('uniqueparentid', 0).with('classresourceid', 490068035)
- .with('uitreeindex', 4)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/text1')
- .with('text', 'LTE GSM')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:Button_Button1_17) do
- $ruiObj = RUIObject.new.with('objectid', 2089308220).with('selfid', -1318451484).with('textdescid', 1664978912).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button1')
- .with('text', 'OK')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:pressHome_4) do
- pressHome
- waitsecond(2)
- end
- tcase << TestAction.new(:gotoApp_6) do
- gotoApp('Settings')
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Title_8) do
- $ruiObj = RUIObject.new.with('objectid', -487328458).with('selfid', -590333345).with('textdescid', 1517398520).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 28)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'Call')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:Switch_Switchwidget_12) do
- $ruiObj = RUIObject.new.with('objectid', -1351004236).with('selfid', -472628224).with('textdescid', 1068541676).with('uniqueparentid', 0).with('classresourceid', 1594664046)
- .with('uitreeindex', 5)
- .with('classname', 'Switch')
- .with('resource-id', 'com.android.phone:id/switchWidget')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:pressHome_14) do
- pressHome
- waitsecond(2)
- end
- tcase.run(loopTime)
- end
- def self.Airplane_mode(loopTime)
- tcase = TestCase.new("Airplane_mode")
- tcase << TestAction.new(:gotoApp_1) do
- gotoApp('Settings')
- waitsecond(2)
- end
- tcase << TestAction.new(:Switch_Easyswitchwidget_3) do
- $ruiObj = RUIObject.new.with('objectid', -1833586242).with('selfid', 1873612220).with('textdescid', -1006598622).with('uniqueparentid', 0).with('classresourceid', -1846730710)
- .with('uitreeindex', 11)
- .with('pretext', 'Airplane mode')
- .with('classname', 'Switch')
- .with('resource-id', 'com.lge.settings.easy:id/easySwitchWidget')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:Button_Button1_11) do
- $ruiObj = RUIObject.new.with('objectid', -1752023654).with('selfid', -1318451484).with('textdescid', -491413954).with('uniqueparentid', 0)
- .with('uitreeindex', 3)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button1')
- .with('text', 'OK')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:pressBack_5) do
- pressBack
- waitsecond(2)
- end
- tcase << TestAction.new(:pressBack_7) do
- pressBack
- waitsecond(2)
- end
- tcase << TestAction.new(:pressHome_9) do
- pressHome
- waitsecond(2)
- end
- tcase.run(loopTime)
- end
- def self.VoLTE(loopTime)
- tcase = TestCase.new("VoLTE")
- tcase << TestAction.new(:gotoApp_1) do
- gotoApp('Phone')
- waitsecond(2)
- end
- tcase << TestAction.new(:EditText_Digits_3) do
- $ruiObj = RUIObject.new.with('objectid', 477485968).with('selfid', -1326421482).with('textdescid', 1917163152).with('uniqueparentid', 0)
- .with('uitreeindex', 8)
- .with('classname', 'EditText')
- .with('resource-id', 'com.android.contacts:id/digits')
- $ruiObj.inputtext('*#546368#*901#')
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Title_5) do
- $ruiObj = RUIObject.new.with('objectid', 684902757).with('selfid', 538152793).with('textdescid', -1915478867).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 4)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'Field Test')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Text1_7) do
- $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', -141259386).with('textdescid', -734720867).with('uniqueparentid', 0).with('classresourceid', 490068035)
- .with('uitreeindex', 1)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/text1')
- .with('text', 'Modem Settings')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:swipeDown_13) do
- swipe_vertical 500
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Text1_9) do
- $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', 12767364).with('textdescid', 1760273017).with('uniqueparentid', 0).with('classresourceid', 490068035)
- .with('uitreeindex', 6)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/text1')
- .with('text', 'RAT Selection')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Text1_2) do
- $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', 230521052).with('textdescid', -1600751033).with('uniqueparentid', 0).with('classresourceid', 490068035)
- .with('uitreeindex', 2)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/text1')
- .with('text', 'LTE only')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:Button_Button1_4) do
- $ruiObj = RUIObject.new.with('objectid', 2089308220).with('selfid', -1318451484).with('textdescid', 1664978912).with('uniqueparentid', 0)
- .with('uitreeindex', 1)
- .with('classname', 'Button')
- .with('resource-id', 'android:id/button1')
- .with('text', 'OK')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:pressHome_2) do
- pressHome
- waitsecond(2)
- end
- tcase << TestAction.new(:gotoApp_4) do
- gotoApp('Settings')
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Title_6) do
- $ruiObj = RUIObject.new.with('objectid', -487328458).with('selfid', -590333345).with('textdescid', 1517398520).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 28)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'Call')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:Switch_Switchwidget_12) do
- $ruiObj = RUIObject.new.with('objectid', -1351004236).with('selfid', -472628224).with('textdescid', 1068541676).with('uniqueparentid', 0).with('classresourceid', 1594664046)
- .with('uitreeindex', 5)
- .with('classname', 'Switch')
- .with('resource-id', 'com.android.phone:id/switchWidget')
- $ruiObj.click
- waitsecond(2)
- end
- tcase.run(loopTime)
- end
- def self.VoWiFi_off(loopTime)
- tcase = TestCase.new("VoWiFi_off")
- tcase << TestAction.new(:gotoApp_11) do
- gotoApp('Settings')
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Title_13) do
- $ruiObj = RUIObject.new.with('objectid', -487328458).with('selfid', -590333345).with('textdescid', 1517398520).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 28)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'Call')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Summary_18) do
- $ruiObj = RUIObject.new.with('objectid', -1552058251).with('selfid', -693239925).with('textdescid', 1624146713).with('uniqueparentid', 0).with('classresourceid', -1930775675)
- .with('uitreeindex', 7)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/summary')
- .with('text', 'Disabled')
- $ruiObj.isNotExist
- ifFailJumpTo(:pressBack_22)
- waitsecond(2)
- end
- tcase << TestAction.new(:Switch_Switchwidget_20) do
- $ruiObj = RUIObject.new.with('objectid', -1747487326).with('selfid', -1269964819).with('textdescid', 1662467774).with('uniqueparentid', 0).with('classresourceid', 1136742875)
- .with('uitreeindex', 9)
- .with('classname', 'Switch')
- .with('resource-id', 'android:id/switchWidget')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:pressBack_22) do
- pressBack
- waitsecond(2)
- end
- tcase << TestAction.new(:pressBack_24) do
- pressBack
- waitsecond(2)
- end
- tcase << TestAction.new(:pressHome_26) do
- pressHome
- waitsecond(2)
- end
- tcase.run(loopTime)
- end
- def self.VoWiFi_on(loopTime)
- tcase = TestCase.new("VoWiFi_on")
- tcase << TestAction.new(:gotoApp_11) do
- gotoApp('Settings')
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Title_13) do
- $ruiObj = RUIObject.new.with('objectid', -487328458).with('selfid', -590333345).with('textdescid', 1517398520).with('uniqueparentid', 0).with('classresourceid', 490183159)
- .with('uitreeindex', 28)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/title')
- .with('text', 'Call')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:TextView_Summary_18) do
- $ruiObj = RUIObject.new.with('objectid', -1552058251).with('selfid', -693239925).with('textdescid', 1624146713).with('uniqueparentid', 0).with('classresourceid', -1930775675)
- .with('uitreeindex', 7)
- .with('classname', 'TextView')
- .with('resource-id', 'android:id/summary')
- .with('text', 'Disabled')
- $ruiObj.isExist
- ifFailJumpTo(:pressBack_22)
- waitsecond(2)
- end
- tcase << TestAction.new(:Switch_Switchwidget_20) do
- $ruiObj = RUIObject.new.with('objectid', -1747487326).with('selfid', -1269964819).with('textdescid', 1662467774).with('uniqueparentid', 0).with('classresourceid', 1136742875)
- .with('uitreeindex', 9)
- .with('classname', 'Switch')
- .with('resource-id', 'android:id/switchWidget')
- $ruiObj.click
- waitsecond(2)
- end
- tcase << TestAction.new(:pressBack_22) do
- pressBack
- waitsecond(2)
- end
- tcase << TestAction.new(:pressBack_24) do
- pressBack
- waitsecond(2)
- end
- tcase << TestAction.new(:pressHome_26) do
- pressHome
- waitsecond(2)
- end
- tcase.run(loopTime)
- end
- def self.startTest(loopTime)
- tcase = TestCase.new("startTest")
- tcase.run(loopTime)
- end
- def self.mainLoop(loopTime)
- WebSocketXServer.setAutoUpdate(false)
- index = $mainResumeMainLoop
- $mainResumeMainLoop = 0
- writelog("mainLoop::#{index}::Resume") if index > 0
- while index < loopTime
- $curMainLoopNum = index
- $actionParamInput = "none"
- startTest 1
- waitsecond(2)
- $actionParamInput = "none"
- 1X 1
- waitsecond(2)
- $actionParamInput = "none"
- 1X_VoLTE 1
- waitsecond(2)
- $actionParamInput = "none"
- Airplane_mode 1
- waitsecond(2)
- $actionParamInput = "none"
- VoLTE 1
- waitsecond(2)
- $actionParamInput = "none"
- VoWiFi_off 1
- waitsecond(2)
- $actionParamInput = "none"
- VoWiFi_on 1
- waitsecond(2)
- 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..."
- end
- def self.run(loop)
- mainLoop loop
- end
- end
- $exceptionPackageNameList = []
- $exceptionPackageNameList_exclude = []
- def exception_handler
- H901_E911.exception_handler
- end
- $curProjectLogFile = $useLastLogFile
- $curProjectLogFile = "H901_E911_#{getTimeStamp}.log" if $useLastLogFile.nil?
- $useLastLogFile = nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement