Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.52 KB | None | 0 0
  1.  
  2. loadTestDB
  3.  
  4. module H901_E911
  5.  
  6. def self.1X(loopTime)
  7.  
  8. tcase = TestCase.new("1X")
  9.  
  10. tcase << TestAction.new(:gotoApp_1) do
  11. gotoApp('Settings')
  12.  
  13. waitsecond(2)
  14. end
  15.  
  16. tcase << TestAction.new(:TextView_Title_9) do
  17. $ruiObj = RUIObject.new.with('objectid', -487328458).with('selfid', -590333345).with('textdescid', 1517398520).with('uniqueparentid', 0).with('classresourceid', 490183159)
  18. .with('uitreeindex', 28)
  19. .with('classname', 'TextView')
  20. .with('resource-id', 'android:id/title')
  21. .with('text', 'Call')
  22.  
  23. $ruiObj.click
  24.  
  25. waitsecond(2)
  26. end
  27.  
  28. tcase << TestAction.new(:Switch_Switchwidget_11) do
  29. $ruiObj = RUIObject.new.with('objectid', -1351004236).with('selfid', -472628224).with('textdescid', 1068541676).with('uniqueparentid', 0).with('classresourceid', 1594664046)
  30. .with('uitreeindex', 5)
  31. .with('classname', 'Switch')
  32. .with('resource-id', 'com.android.phone:id/switchWidget')
  33.  
  34. $ruiObj.click
  35.  
  36. waitsecond(2)
  37. end
  38.  
  39. tcase << TestAction.new(:gotoApp_7) do
  40. gotoApp('Phone')
  41.  
  42. waitsecond(2)
  43. end
  44.  
  45. tcase << TestAction.new(:EditText_Digits_3) do
  46. $ruiObj = RUIObject.new.with('objectid', 477485968).with('selfid', -1326421482).with('textdescid', 1917163152).with('uniqueparentid', 0)
  47. .with('uitreeindex', 8)
  48. .with('classname', 'EditText')
  49. .with('resource-id', 'com.android.contacts:id/digits')
  50.  
  51. $ruiObj.inputtext('*#546368#*901#')
  52.  
  53. waitsecond(2)
  54. end
  55.  
  56. tcase << TestAction.new(:TextView_Title_5) do
  57. $ruiObj = RUIObject.new.with('objectid', 684902757).with('selfid', 538152793).with('textdescid', -1915478867).with('uniqueparentid', 0).with('classresourceid', 490183159)
  58. .with('uitreeindex', 4)
  59. .with('classname', 'TextView')
  60. .with('resource-id', 'android:id/title')
  61. .with('text', 'Field Test')
  62.  
  63. $ruiObj.click
  64.  
  65. waitsecond(2)
  66. end
  67.  
  68. tcase << TestAction.new(:TextView_Text1_7) do
  69. $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', -141259386).with('textdescid', -734720867).with('uniqueparentid', 0).with('classresourceid', 490068035)
  70. .with('uitreeindex', 1)
  71. .with('classname', 'TextView')
  72. .with('resource-id', 'android:id/text1')
  73. .with('text', 'Modem Settings')
  74.  
  75. $ruiObj.click
  76.  
  77. waitsecond(2)
  78. end
  79.  
  80. tcase << TestAction.new(:swipeDown_13) do
  81. swipe_vertical 500
  82.  
  83. waitsecond(2)
  84. end
  85.  
  86. tcase << TestAction.new(:TextView_Text1_9) do
  87. $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', 12767364).with('textdescid', 1760273017).with('uniqueparentid', 0).with('classresourceid', 490068035)
  88. .with('uitreeindex', 6)
  89. .with('classname', 'TextView')
  90. .with('resource-id', 'android:id/text1')
  91. .with('text', 'RAT Selection')
  92.  
  93. $ruiObj.click
  94.  
  95. waitsecond(2)
  96. end
  97.  
  98. tcase << TestAction.new(:TextView_Text1_15) do
  99. $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', -552066504).with('textdescid', -91161493).with('uniqueparentid', 0).with('classresourceid', 490068035)
  100. .with('uitreeindex', 7)
  101. .with('classname', 'TextView')
  102. .with('resource-id', 'android:id/text1')
  103. .with('text', 'GSM only')
  104.  
  105. $ruiObj.click
  106.  
  107. waitsecond(2)
  108. end
  109.  
  110. tcase << TestAction.new(:Button_Button1_17) do
  111. $ruiObj = RUIObject.new.with('objectid', 2089308220).with('selfid', -1318451484).with('textdescid', 1664978912).with('uniqueparentid', 0)
  112. .with('uitreeindex', 1)
  113. .with('classname', 'Button')
  114. .with('resource-id', 'android:id/button1')
  115. .with('text', 'OK')
  116.  
  117. $ruiObj.click
  118.  
  119. waitsecond(2)
  120. end
  121.  
  122. tcase.run(loopTime)
  123.  
  124. end
  125.  
  126. def self.1X_VoLTE(loopTime)
  127.  
  128. tcase = TestCase.new("1X_VoLTE")
  129.  
  130. tcase << TestAction.new(:gotoApp_1) do
  131. gotoApp('Phone')
  132.  
  133. waitsecond(2)
  134. end
  135.  
  136. tcase << TestAction.new(:EditText_Digits_3) do
  137. $ruiObj = RUIObject.new.with('objectid', 477485968).with('selfid', -1326421482).with('textdescid', 1917163152).with('uniqueparentid', 0)
  138. .with('uitreeindex', 8)
  139. .with('classname', 'EditText')
  140. .with('resource-id', 'com.android.contacts:id/digits')
  141.  
  142. $ruiObj.inputtext('*#546368#*901#')
  143.  
  144. waitsecond(2)
  145. end
  146.  
  147. tcase << TestAction.new(:TextView_Title_5) do
  148. $ruiObj = RUIObject.new.with('objectid', 684902757).with('selfid', 538152793).with('textdescid', -1915478867).with('uniqueparentid', 0).with('classresourceid', 490183159)
  149. .with('uitreeindex', 4)
  150. .with('classname', 'TextView')
  151. .with('resource-id', 'android:id/title')
  152. .with('text', 'Field Test')
  153.  
  154. $ruiObj.click
  155.  
  156. waitsecond(2)
  157. end
  158.  
  159. tcase << TestAction.new(:TextView_Text1_7) do
  160. $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', -141259386).with('textdescid', -734720867).with('uniqueparentid', 0).with('classresourceid', 490068035)
  161. .with('uitreeindex', 1)
  162. .with('classname', 'TextView')
  163. .with('resource-id', 'android:id/text1')
  164. .with('text', 'Modem Settings')
  165.  
  166. $ruiObj.click
  167.  
  168. waitsecond(2)
  169. end
  170.  
  171. tcase << TestAction.new(:swipeDown_13) do
  172. swipe_vertical 500
  173.  
  174. waitsecond(2)
  175. end
  176.  
  177. tcase << TestAction.new(:TextView_Text1_9) do
  178. $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', 12767364).with('textdescid', 1760273017).with('uniqueparentid', 0).with('classresourceid', 490068035)
  179. .with('uitreeindex', 6)
  180. .with('classname', 'TextView')
  181. .with('resource-id', 'android:id/text1')
  182. .with('text', 'RAT Selection')
  183.  
  184. $ruiObj.click
  185.  
  186. waitsecond(2)
  187. end
  188.  
  189. tcase << TestAction.new(:TextView_Text1_2) do
  190. $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', 228129265).with('textdescid', -1674896430).with('uniqueparentid', 0).with('classresourceid', 490068035)
  191. .with('uitreeindex', 4)
  192. .with('classname', 'TextView')
  193. .with('resource-id', 'android:id/text1')
  194. .with('text', 'LTE GSM')
  195.  
  196. $ruiObj.click
  197.  
  198. waitsecond(2)
  199. end
  200.  
  201. tcase << TestAction.new(:Button_Button1_17) do
  202. $ruiObj = RUIObject.new.with('objectid', 2089308220).with('selfid', -1318451484).with('textdescid', 1664978912).with('uniqueparentid', 0)
  203. .with('uitreeindex', 1)
  204. .with('classname', 'Button')
  205. .with('resource-id', 'android:id/button1')
  206. .with('text', 'OK')
  207.  
  208. $ruiObj.click
  209.  
  210. waitsecond(2)
  211. end
  212.  
  213. tcase << TestAction.new(:pressHome_4) do
  214. pressHome
  215.  
  216. waitsecond(2)
  217. end
  218.  
  219. tcase << TestAction.new(:gotoApp_6) do
  220. gotoApp('Settings')
  221.  
  222. waitsecond(2)
  223. end
  224.  
  225. tcase << TestAction.new(:TextView_Title_8) do
  226. $ruiObj = RUIObject.new.with('objectid', -487328458).with('selfid', -590333345).with('textdescid', 1517398520).with('uniqueparentid', 0).with('classresourceid', 490183159)
  227. .with('uitreeindex', 28)
  228. .with('classname', 'TextView')
  229. .with('resource-id', 'android:id/title')
  230. .with('text', 'Call')
  231.  
  232. $ruiObj.click
  233.  
  234. waitsecond(2)
  235. end
  236.  
  237. tcase << TestAction.new(:Switch_Switchwidget_12) do
  238. $ruiObj = RUIObject.new.with('objectid', -1351004236).with('selfid', -472628224).with('textdescid', 1068541676).with('uniqueparentid', 0).with('classresourceid', 1594664046)
  239. .with('uitreeindex', 5)
  240. .with('classname', 'Switch')
  241. .with('resource-id', 'com.android.phone:id/switchWidget')
  242.  
  243. $ruiObj.click
  244.  
  245. waitsecond(2)
  246. end
  247.  
  248. tcase << TestAction.new(:pressHome_14) do
  249. pressHome
  250.  
  251. waitsecond(2)
  252. end
  253.  
  254. tcase.run(loopTime)
  255.  
  256. end
  257.  
  258. def self.Airplane_mode(loopTime)
  259.  
  260. tcase = TestCase.new("Airplane_mode")
  261.  
  262. tcase << TestAction.new(:gotoApp_1) do
  263. gotoApp('Settings')
  264.  
  265. waitsecond(2)
  266. end
  267.  
  268. tcase << TestAction.new(:Switch_Easyswitchwidget_3) do
  269. $ruiObj = RUIObject.new.with('objectid', -1833586242).with('selfid', 1873612220).with('textdescid', -1006598622).with('uniqueparentid', 0).with('classresourceid', -1846730710)
  270. .with('uitreeindex', 11)
  271. .with('pretext', 'Airplane mode')
  272. .with('classname', 'Switch')
  273. .with('resource-id', 'com.lge.settings.easy:id/easySwitchWidget')
  274.  
  275. $ruiObj.click
  276.  
  277. waitsecond(2)
  278. end
  279.  
  280. tcase << TestAction.new(:Button_Button1_11) do
  281. $ruiObj = RUIObject.new.with('objectid', -1752023654).with('selfid', -1318451484).with('textdescid', -491413954).with('uniqueparentid', 0)
  282. .with('uitreeindex', 3)
  283. .with('classname', 'Button')
  284. .with('resource-id', 'android:id/button1')
  285. .with('text', 'OK')
  286.  
  287. $ruiObj.click
  288.  
  289. waitsecond(2)
  290. end
  291.  
  292. tcase << TestAction.new(:pressBack_5) do
  293. pressBack
  294.  
  295. waitsecond(2)
  296. end
  297.  
  298. tcase << TestAction.new(:pressBack_7) do
  299. pressBack
  300.  
  301. waitsecond(2)
  302. end
  303.  
  304. tcase << TestAction.new(:pressHome_9) do
  305. pressHome
  306.  
  307. waitsecond(2)
  308. end
  309.  
  310. tcase.run(loopTime)
  311.  
  312. end
  313.  
  314. def self.VoLTE(loopTime)
  315.  
  316. tcase = TestCase.new("VoLTE")
  317.  
  318. tcase << TestAction.new(:gotoApp_1) do
  319. gotoApp('Phone')
  320.  
  321. waitsecond(2)
  322. end
  323.  
  324. tcase << TestAction.new(:EditText_Digits_3) do
  325. $ruiObj = RUIObject.new.with('objectid', 477485968).with('selfid', -1326421482).with('textdescid', 1917163152).with('uniqueparentid', 0)
  326. .with('uitreeindex', 8)
  327. .with('classname', 'EditText')
  328. .with('resource-id', 'com.android.contacts:id/digits')
  329.  
  330. $ruiObj.inputtext('*#546368#*901#')
  331.  
  332. waitsecond(2)
  333. end
  334.  
  335. tcase << TestAction.new(:TextView_Title_5) do
  336. $ruiObj = RUIObject.new.with('objectid', 684902757).with('selfid', 538152793).with('textdescid', -1915478867).with('uniqueparentid', 0).with('classresourceid', 490183159)
  337. .with('uitreeindex', 4)
  338. .with('classname', 'TextView')
  339. .with('resource-id', 'android:id/title')
  340. .with('text', 'Field Test')
  341.  
  342. $ruiObj.click
  343.  
  344. waitsecond(2)
  345. end
  346.  
  347. tcase << TestAction.new(:TextView_Text1_7) do
  348. $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', -141259386).with('textdescid', -734720867).with('uniqueparentid', 0).with('classresourceid', 490068035)
  349. .with('uitreeindex', 1)
  350. .with('classname', 'TextView')
  351. .with('resource-id', 'android:id/text1')
  352. .with('text', 'Modem Settings')
  353.  
  354. $ruiObj.click
  355.  
  356. waitsecond(2)
  357. end
  358.  
  359. tcase << TestAction.new(:swipeDown_13) do
  360. swipe_vertical 500
  361.  
  362. waitsecond(2)
  363. end
  364.  
  365. tcase << TestAction.new(:TextView_Text1_9) do
  366. $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', 12767364).with('textdescid', 1760273017).with('uniqueparentid', 0).with('classresourceid', 490068035)
  367. .with('uitreeindex', 6)
  368. .with('classname', 'TextView')
  369. .with('resource-id', 'android:id/text1')
  370. .with('text', 'RAT Selection')
  371.  
  372. $ruiObj.click
  373.  
  374. waitsecond(2)
  375. end
  376.  
  377. tcase << TestAction.new(:TextView_Text1_2) do
  378. $ruiObj = RUIObject.new.with('objectid', -483333610).with('selfid', 230521052).with('textdescid', -1600751033).with('uniqueparentid', 0).with('classresourceid', 490068035)
  379. .with('uitreeindex', 2)
  380. .with('classname', 'TextView')
  381. .with('resource-id', 'android:id/text1')
  382. .with('text', 'LTE only')
  383.  
  384. $ruiObj.click
  385.  
  386. waitsecond(2)
  387. end
  388.  
  389. tcase << TestAction.new(:Button_Button1_4) do
  390. $ruiObj = RUIObject.new.with('objectid', 2089308220).with('selfid', -1318451484).with('textdescid', 1664978912).with('uniqueparentid', 0)
  391. .with('uitreeindex', 1)
  392. .with('classname', 'Button')
  393. .with('resource-id', 'android:id/button1')
  394. .with('text', 'OK')
  395.  
  396. $ruiObj.click
  397.  
  398. waitsecond(2)
  399. end
  400.  
  401. tcase << TestAction.new(:pressHome_2) do
  402. pressHome
  403.  
  404. waitsecond(2)
  405. end
  406.  
  407. tcase << TestAction.new(:gotoApp_4) do
  408. gotoApp('Settings')
  409.  
  410. waitsecond(2)
  411. end
  412.  
  413. tcase << TestAction.new(:TextView_Title_6) do
  414. $ruiObj = RUIObject.new.with('objectid', -487328458).with('selfid', -590333345).with('textdescid', 1517398520).with('uniqueparentid', 0).with('classresourceid', 490183159)
  415. .with('uitreeindex', 28)
  416. .with('classname', 'TextView')
  417. .with('resource-id', 'android:id/title')
  418. .with('text', 'Call')
  419.  
  420. $ruiObj.click
  421.  
  422. waitsecond(2)
  423. end
  424.  
  425. tcase << TestAction.new(:Switch_Switchwidget_12) do
  426. $ruiObj = RUIObject.new.with('objectid', -1351004236).with('selfid', -472628224).with('textdescid', 1068541676).with('uniqueparentid', 0).with('classresourceid', 1594664046)
  427. .with('uitreeindex', 5)
  428. .with('classname', 'Switch')
  429. .with('resource-id', 'com.android.phone:id/switchWidget')
  430.  
  431. $ruiObj.click
  432.  
  433. waitsecond(2)
  434. end
  435.  
  436. tcase.run(loopTime)
  437.  
  438. end
  439.  
  440. def self.VoWiFi_off(loopTime)
  441.  
  442. tcase = TestCase.new("VoWiFi_off")
  443.  
  444. tcase << TestAction.new(:gotoApp_11) do
  445. gotoApp('Settings')
  446.  
  447. waitsecond(2)
  448. end
  449.  
  450. tcase << TestAction.new(:TextView_Title_13) do
  451. $ruiObj = RUIObject.new.with('objectid', -487328458).with('selfid', -590333345).with('textdescid', 1517398520).with('uniqueparentid', 0).with('classresourceid', 490183159)
  452. .with('uitreeindex', 28)
  453. .with('classname', 'TextView')
  454. .with('resource-id', 'android:id/title')
  455. .with('text', 'Call')
  456.  
  457. $ruiObj.click
  458.  
  459. waitsecond(2)
  460. end
  461.  
  462. tcase << TestAction.new(:TextView_Summary_18) do
  463. $ruiObj = RUIObject.new.with('objectid', -1552058251).with('selfid', -693239925).with('textdescid', 1624146713).with('uniqueparentid', 0).with('classresourceid', -1930775675)
  464. .with('uitreeindex', 7)
  465. .with('classname', 'TextView')
  466. .with('resource-id', 'android:id/summary')
  467. .with('text', 'Disabled')
  468.  
  469. $ruiObj.isNotExist
  470. ifFailJumpTo(:pressBack_22)
  471.  
  472. waitsecond(2)
  473. end
  474.  
  475. tcase << TestAction.new(:Switch_Switchwidget_20) do
  476. $ruiObj = RUIObject.new.with('objectid', -1747487326).with('selfid', -1269964819).with('textdescid', 1662467774).with('uniqueparentid', 0).with('classresourceid', 1136742875)
  477. .with('uitreeindex', 9)
  478. .with('classname', 'Switch')
  479. .with('resource-id', 'android:id/switchWidget')
  480.  
  481. $ruiObj.click
  482.  
  483. waitsecond(2)
  484. end
  485.  
  486. tcase << TestAction.new(:pressBack_22) do
  487. pressBack
  488.  
  489. waitsecond(2)
  490. end
  491.  
  492. tcase << TestAction.new(:pressBack_24) do
  493. pressBack
  494.  
  495. waitsecond(2)
  496. end
  497.  
  498. tcase << TestAction.new(:pressHome_26) do
  499. pressHome
  500.  
  501. waitsecond(2)
  502. end
  503.  
  504. tcase.run(loopTime)
  505.  
  506. end
  507.  
  508. def self.VoWiFi_on(loopTime)
  509.  
  510. tcase = TestCase.new("VoWiFi_on")
  511.  
  512. tcase << TestAction.new(:gotoApp_11) do
  513. gotoApp('Settings')
  514.  
  515. waitsecond(2)
  516. end
  517.  
  518. tcase << TestAction.new(:TextView_Title_13) do
  519. $ruiObj = RUIObject.new.with('objectid', -487328458).with('selfid', -590333345).with('textdescid', 1517398520).with('uniqueparentid', 0).with('classresourceid', 490183159)
  520. .with('uitreeindex', 28)
  521. .with('classname', 'TextView')
  522. .with('resource-id', 'android:id/title')
  523. .with('text', 'Call')
  524.  
  525. $ruiObj.click
  526.  
  527. waitsecond(2)
  528. end
  529.  
  530. tcase << TestAction.new(:TextView_Summary_18) do
  531. $ruiObj = RUIObject.new.with('objectid', -1552058251).with('selfid', -693239925).with('textdescid', 1624146713).with('uniqueparentid', 0).with('classresourceid', -1930775675)
  532. .with('uitreeindex', 7)
  533. .with('classname', 'TextView')
  534. .with('resource-id', 'android:id/summary')
  535. .with('text', 'Disabled')
  536.  
  537. $ruiObj.isExist
  538. ifFailJumpTo(:pressBack_22)
  539.  
  540. waitsecond(2)
  541. end
  542.  
  543. tcase << TestAction.new(:Switch_Switchwidget_20) do
  544. $ruiObj = RUIObject.new.with('objectid', -1747487326).with('selfid', -1269964819).with('textdescid', 1662467774).with('uniqueparentid', 0).with('classresourceid', 1136742875)
  545. .with('uitreeindex', 9)
  546. .with('classname', 'Switch')
  547. .with('resource-id', 'android:id/switchWidget')
  548.  
  549. $ruiObj.click
  550.  
  551. waitsecond(2)
  552. end
  553.  
  554. tcase << TestAction.new(:pressBack_22) do
  555. pressBack
  556.  
  557. waitsecond(2)
  558. end
  559.  
  560. tcase << TestAction.new(:pressBack_24) do
  561. pressBack
  562.  
  563. waitsecond(2)
  564. end
  565.  
  566. tcase << TestAction.new(:pressHome_26) do
  567. pressHome
  568.  
  569. waitsecond(2)
  570. end
  571.  
  572. tcase.run(loopTime)
  573.  
  574. end
  575.  
  576. def self.startTest(loopTime)
  577.  
  578. tcase = TestCase.new("startTest")
  579.  
  580. tcase.run(loopTime)
  581.  
  582. end
  583.  
  584. def self.mainLoop(loopTime)
  585.  
  586. WebSocketXServer.setAutoUpdate(false)
  587.  
  588. index = $mainResumeMainLoop
  589. $mainResumeMainLoop = 0
  590.  
  591. writelog("mainLoop::#{index}::Resume") if index > 0
  592.  
  593. while index < loopTime
  594.  
  595. $curMainLoopNum = index
  596.  
  597. $actionParamInput = "none"
  598. startTest 1
  599.  
  600. waitsecond(2)
  601.  
  602. $actionParamInput = "none"
  603. 1X 1
  604.  
  605. waitsecond(2)
  606.  
  607. $actionParamInput = "none"
  608. 1X_VoLTE 1
  609.  
  610. waitsecond(2)
  611.  
  612. $actionParamInput = "none"
  613. Airplane_mode 1
  614.  
  615. waitsecond(2)
  616.  
  617. $actionParamInput = "none"
  618. VoLTE 1
  619.  
  620. waitsecond(2)
  621.  
  622. $actionParamInput = "none"
  623. VoWiFi_off 1
  624.  
  625. waitsecond(2)
  626.  
  627. $actionParamInput = "none"
  628. VoWiFi_on 1
  629.  
  630. waitsecond(2)
  631.  
  632.  
  633. sendStatus("Done::mainLoop::Loop::#{index}")
  634.  
  635.  
  636. writelog("Finish::Loop::#{$curMainLoopNum}")
  637.  
  638.  
  639. saveLogFileToGist if $saveLogToGist
  640.  
  641. index += 1
  642.  
  643. end
  644.  
  645. $engineStatus = "Idle"
  646. resetStatus
  647. sendStatus("Finish::mainLoop::END")
  648.  
  649. end
  650.  
  651. def self.exception_handler
  652. puts "Module Exception Hanlder..."
  653. end
  654.  
  655. def self.run(loop)
  656. mainLoop loop
  657. end
  658.  
  659. end
  660.  
  661. $exceptionPackageNameList = []
  662. $exceptionPackageNameList_exclude = []
  663.  
  664. def exception_handler
  665. H901_E911.exception_handler
  666. end
  667.  
  668. $curProjectLogFile = $useLastLogFile
  669.  
  670. $curProjectLogFile = "H901_E911_#{getTimeStamp}.log" if $useLastLogFile.nil?
  671.  
  672. $useLastLogFile = nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement