Advertisement
Guest User

Untitled

a guest
Feb 5th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 46.96 KB | None | 0 0
  1.  
  2. loadTestDB
  3.  
  4. module H1_TNTS_Concurrency
  5.  
  6. def self.Browser(loopTime)
  7.  
  8. tcase = TestCase.new("Browser")
  9.  
  10. tcase << TestAction.new(:gotoApp_7) do
  11. gotoApp('Chrome')
  12.  
  13. waitsecond(1)
  14. end
  15.  
  16. tcase << TestAction.new(:scriptAction_2) do
  17. logStartTest("Browser")
  18. end
  19.  
  20. tcase << TestAction.new(:clickXY_1096_204_2) do
  21. click(1096,204)
  22.  
  23. waitsecond(1)
  24. end
  25.  
  26. tcase << TestAction.new(:EditText_UrlBar_2) do
  27. $ruiObj = RUIObject.new.with('objectid', 882195433).with('selfid', 613381324).with('textdescid', 1578254679).with('uniqueparentid', 0)
  28. .with('uitreeindex', 215)
  29. .with('classname', 'EditText')
  30. .with('resource-id', 'com.android.chrome:id/url_bar')
  31.  
  32. $ruiObj.inputtext('m.naver.com')
  33.  
  34. waitsecond(1)
  35. end
  36.  
  37. tcase << TestAction.new(:pressEnter_15) do
  38. pressEnter
  39.  
  40. waitsecond(4)
  41. end
  42.  
  43. tcase << TestAction.new(:clickXY_1112_204_2) do
  44. click(1112,204)
  45.  
  46. waitsecond(2)
  47. end
  48.  
  49. tcase << TestAction.new(:EditText_UrlBar_2_1) do
  50. $ruiObj = RUIObject.new.with('objectid', 882195433).with('selfid', 613381324).with('textdescid', 1578254679).with('uniqueparentid', 0)
  51. .with('uitreeindex', 215)
  52. .with('classname', 'EditText')
  53. .with('resource-id', 'com.android.chrome:id/url_bar')
  54.  
  55. $ruiObj.inputtext('www.google.com')
  56.  
  57. waitsecond(1)
  58. end
  59.  
  60. tcase << TestAction.new(:pressEnter_17) do
  61. pressEnter
  62.  
  63. waitsecond(4)
  64. end
  65.  
  66. tcase << TestAction.new(:scriptAction_1_1) do
  67. $reload = RUIObject.new.with('objectid', -1298956826).with('selfid', 1403544531).with('textdescid', 1877548115).with('uniqueparentid', 0)
  68. .with('uitreeindex', 4)
  69. .with('classname', 'Button')
  70. .with('resource-id', 'reload-button')
  71. .with('content-desc', 'RELOAD').exists?
  72.  
  73. $progressBar = RUIObject.new.with('objectid', 1158061653).with('selfid', 1366906829).with('textdescid', 1540172907).with('uniqueparentid', 0)
  74. .with('uitreeindex', 18)
  75. .with('classname', 'ImageView')
  76. .with('resource-id', 'com.android.chrome:id/progress').exists?
  77.  
  78. if ($progressBar || $reload) == true
  79. $myTestResult = false
  80. else
  81. $myTestResult = true
  82. end
  83. if $myTestResult == false
  84. $myFailReason = "Page not loaded."
  85. end
  86. logStopTest("Browser")
  87. end
  88.  
  89. tcase << TestAction.new(:pressBack_11) do
  90. pressBack
  91. end
  92.  
  93. tcase << TestAction.new(:pressBack_12) do
  94. pressBack
  95. end
  96.  
  97. tcase << TestAction.new(:pressHome_13) do
  98. pressHome
  99. end
  100.  
  101. tcase.run(loopTime)
  102.  
  103. end
  104.  
  105. def self.Camera(loopTime)
  106.  
  107. tcase = TestCase.new("Camera")
  108.  
  109. tcase << TestAction.new(:gotoApp_1) do
  110. gotoApp('Camera')
  111.  
  112. waitsecond(2)
  113. end
  114.  
  115. tcase << TestAction.new(:scriptAction_2) do
  116. logStartTest("Camera")
  117. end
  118.  
  119. tcase << TestAction.new(:Button_CancelButton_2) do
  120. $ruiObj = RUIObject.new.with('objectid', 1810541803).with('selfid', -1673499114).with('textdescid', -340525654).with('uniqueparentid', 0)
  121. .with('uitreeindex', 20)
  122. .with('classname', 'Button')
  123. .with('resource-id', 'com.lge.camera:id/cancel_button')
  124. .with('text', 'No')
  125.  
  126. $ruiObj.click
  127. end
  128.  
  129. tcase << TestAction.new(:ImageButton_QuickButtonMode_4) do
  130. $ruiObj = RUIObject.new.with('objectid', -1346945250).with('selfid', -244088842).with('textdescid', -393452279).with('uniqueparentid', 0)
  131. .with('uitreeindex', 5)
  132. .with('classname', 'ImageButton')
  133. .with('resource-id', 'com.lge.camera:id/quick_button_mode')
  134. .with('content-desc', 'Mode.')
  135.  
  136. $ruiObj.click
  137.  
  138. waitsecond(1)
  139. end
  140.  
  141. tcase << TestAction.new(:ImageButton_ModeMenuItemIcon_6) do
  142. $ruiObj = RUIObject.new.with('objectid', -314028000).with('selfid', -710823836).with('textdescid', -1144933376).with('uniqueparentid', 0)
  143. .with('uitreeindex', 17)
  144. .with('classname', 'ImageButton')
  145. .with('resource-id', 'com.lge.camera:id/mode_menu_item_icon')
  146.  
  147. $ruiObj.click
  148.  
  149. waitsecond(2)
  150. end
  151.  
  152. tcase << TestAction.new(:ImageButton_ShutterBottomComp_4) do
  153. $ruiObj = RUIObject.new.with('objectid', -216722415).with('selfid', -92772729).with('textdescid', 1720830782).with('uniqueparentid', 0)
  154. .with('uitreeindex', 5)
  155. .with('classname', 'ImageButton')
  156. .with('resource-id', 'com.lge.camera:id/shutter_bottom_comp')
  157. .with('content-desc', 'Shutter')
  158.  
  159. $ruiObj.isExist
  160.  
  161. waitsecond(1)
  162. end
  163.  
  164. tcase << TestAction.new(:ImageButton_ShutterBottomComp_4_1) do
  165. $ruiObj = RUIObject.new.with('objectid', -216722415).with('selfid', -92772729).with('textdescid', 1720830782).with('uniqueparentid', 0)
  166. .with('uitreeindex', 5)
  167. .with('classname', 'ImageButton')
  168. .with('resource-id', 'com.lge.camera:id/shutter_bottom_comp')
  169. .with('content-desc', 'Shutter')
  170.  
  171. $ruiObj.click
  172.  
  173. waitsecond(1)
  174. end
  175.  
  176. tcase << TestAction.new(:scriptAction_2_1) do
  177. $myTestResult = checkLastExistResult
  178.  
  179. if $myTestResult == false
  180. $myFailReason = "End button not found"
  181. end
  182.  
  183. logStopTest("Camera")
  184. end
  185.  
  186. tcase << TestAction.new(:pressBack_5) do
  187. pressBack
  188. end
  189.  
  190. tcase << TestAction.new(:pressBack_6) do
  191. pressBack
  192. end
  193.  
  194. tcase << TestAction.new(:pressHome_7) do
  195. pressHome
  196. end
  197.  
  198. tcase.run(loopTime)
  199.  
  200. end
  201.  
  202. def self.Data(loopTime)
  203.  
  204. tcase = TestCase.new("Data")
  205.  
  206. tcase << TestAction.new(:scriptAction_2) do
  207.  
  208. end
  209.  
  210. tcase << TestAction.new(:gotoApp_2) do
  211. gotoApp('AndFTP')
  212. end
  213.  
  214. tcase << TestAction.new(:home_check) do
  215. $ruiObj = RUIObject.new.with('objectid', 1579875351).with('selfid', -1965414104).with('textdescid', 1731495657).with('uniqueparentid', 0)
  216. .with('uitreeindex', 7)
  217. .with('classname', 'ImageView')
  218. .with('resource-id', 'lysesoft.andftp:id/cell_icon_image')
  219.  
  220. $ruiObj.isNotExist
  221. ifFailJumpTo(:home_click)
  222.  
  223. waitsecond(4)
  224. end
  225.  
  226. tcase << TestAction.new(:ImageView_Home_9) do
  227. $ruiObj = RUIObject.new.with('objectid', -987150073).with('selfid', -1580646008).with('textdescid', -536881159).with('uniqueparentid', 0)
  228. .with('uitreeindex', 1)
  229. .with('classname', 'ImageView')
  230. .with('resource-id', 'android:id/home')
  231.  
  232. $ruiObj.click
  233.  
  234. waitsecond(2)
  235. end
  236.  
  237. tcase << TestAction.new(:home_check_again) do
  238. $ruiObj = RUIObject.new.with('objectid', 1579875351).with('selfid', -1965414104).with('textdescid', 1731495657).with('uniqueparentid', 0)
  239. .with('uitreeindex', 7)
  240. .with('classname', 'ImageView')
  241. .with('resource-id', 'lysesoft.andftp:id/cell_icon_image')
  242.  
  243. $ruiObj.isExist
  244. ifFailJumpTo(:gotoApp_2)
  245.  
  246. waitsecond(2)
  247. end
  248.  
  249. tcase << TestAction.new(:home_click) do
  250. $ruiObj = RUIObject.new.with('objectid', 1579875351).with('selfid', -1965414104).with('textdescid', 1731495657).with('uniqueparentid', 0)
  251. .with('uitreeindex', 7)
  252. .with('classname', 'ImageView')
  253. .with('resource-id', 'lysesoft.andftp:id/cell_icon_image')
  254.  
  255. $ruiObj.click
  256.  
  257. waitsecond(8)
  258. end
  259.  
  260. tcase << TestAction.new(:TextView_Device_4) do
  261. $ruiObj = RUIObject.new.with('objectid', -1040420566).with('selfid', -1121792188).with('textdescid', 1884807160).with('uniqueparentid', 0)
  262. .with('uitreeindex', 2)
  263. .with('classname', 'TextView')
  264. .with('content-desc', 'Device file browser')
  265.  
  266. $ruiObj.click
  267.  
  268. waitsecond(2)
  269. end
  270.  
  271. tcase << TestAction.new(:TextView_BrowserItemName_13) do
  272. $ruiObj = RUIObject.new.with('objectid', 607501065).with('selfid', 459470620).with('textdescid', -839577675).with('uniqueparentid', 0).with('classresourceid', -324157026)
  273. .with('uitreeindex', 18)
  274. .with('classname', 'TextView')
  275. .with('resource-id', 'lysesoft.andftp:id/browser_item_name')
  276. .with('text', '01 Concurrency')
  277.  
  278. $ruiObj.click
  279.  
  280. waitsecond(2)
  281. end
  282.  
  283. tcase << TestAction.new(:clickXY_388_616_10) do
  284. click(388,616)
  285.  
  286. waitsecond(2)
  287. end
  288.  
  289. tcase << TestAction.new(:TextView_Upload_2) do
  290. $ruiObj = RUIObject.new.with('objectid', -1040420566).with('selfid', -132299379).with('textdescid', 572528663).with('uniqueparentid', 0)
  291. .with('uitreeindex', 3)
  292. .with('classname', 'TextView')
  293. .with('content-desc', 'Upload')
  294.  
  295. $ruiObj.click
  296.  
  297. waitsecond(2)
  298. end
  299.  
  300. tcase << TestAction.new(:Button_Button1_8) do
  301. $ruiObj = RUIObject.new.with('objectid', 415387334).with('selfid', -1318451484).with('textdescid', 1038170474).with('uniqueparentid', 0)
  302. .with('uitreeindex', 5)
  303. .with('classname', 'Button')
  304. .with('resource-id', 'android:id/button1')
  305. .with('text', 'OK')
  306.  
  307. $ruiObj.click
  308.  
  309. waitsecond(4)
  310. end
  311.  
  312. tcase << TestAction.new(:Button_Button1_2) do
  313. $ruiObj = RUIObject.new.with('objectid', 415387334).with('selfid', -1318451484).with('textdescid', 1038170474).with('uniqueparentid', 0)
  314. .with('uitreeindex', 7)
  315. .with('classname', 'Button')
  316. .with('resource-id', 'android:id/button1')
  317. .with('text', 'OK')
  318.  
  319. $ruiObj.click
  320.  
  321. waitsecond(2)
  322. end
  323.  
  324. tcase << TestAction.new(:pressHome_9) do
  325. pressHome
  326. end
  327.  
  328. tcase << TestAction.new(:scriptAction_1) do
  329. logStopTest("Data")
  330. end
  331.  
  332. tcase.run(loopTime)
  333.  
  334. end
  335.  
  336. def self.DataEnd(loopTime)
  337.  
  338. tcase = TestCase.new("DataEnd")
  339.  
  340. tcase << TestAction.new(:gotoApp_2_1) do
  341. gotoApp('AndFTP')
  342. end
  343.  
  344. tcase << TestAction.new(:Button_ProgressCancel_2) do
  345. $ruiObj = RUIObject.new.with('objectid', -646559864).with('selfid', -1723240818).with('textdescid', 1120146478).with('uniqueparentid', 0)
  346. .with('uitreeindex', 5)
  347. .with('classname', 'Button')
  348. .with('resource-id', 'lysesoft.andftp:id/progress_cancel')
  349. .with('text', 'Cancel')
  350.  
  351. $ruiObj.click
  352.  
  353. waitsecond(2)
  354. end
  355.  
  356. tcase << TestAction.new(:Button_ProgressSelect_4) do
  357. $ruiObj = RUIObject.new.with('objectid', -184857078).with('selfid', 1303670098).with('textdescid', 1262548654).with('uniqueparentid', 0)
  358. .with('uitreeindex', 4)
  359. .with('classname', 'Button')
  360. .with('resource-id', 'lysesoft.andftp:id/progress_select')
  361. .with('text', 'OK')
  362.  
  363. $ruiObj.click
  364.  
  365. waitsecond(2)
  366. end
  367.  
  368. tcase << TestAction.new(:pressBack_3) do
  369. pressBack
  370. end
  371.  
  372. tcase << TestAction.new(:pressBack_5) do
  373. pressBack
  374. end
  375.  
  376. tcase << TestAction.new(:pressHome_9) do
  377. pressHome
  378. end
  379.  
  380. tcase << TestAction.new(:scriptAction_1_1) do
  381. logStopTest("DataEnd")
  382. end
  383.  
  384. tcase.run(loopTime)
  385.  
  386. end
  387.  
  388. def self.Emails(loopTime)
  389.  
  390. tcase = TestCase.new("Emails")
  391.  
  392. tcase << TestAction.new(:gotoApp_1) do
  393. gotoApp('Gmail')
  394. end
  395.  
  396. tcase << TestAction.new(:scriptAction_2) do
  397. logStartTest("Emails")
  398. end
  399.  
  400. tcase << TestAction.new(:ImageButton_ComposeButton_4) do
  401. $ruiObj = RUIObject.new.with('objectid', 2010391035).with('selfid', 1808564263).with('textdescid', -481574643).with('uniqueparentid', 0)
  402. .with('uitreeindex', 24)
  403. .with('pretext', 'Primary')
  404. .with('classname', 'ImageButton')
  405. .with('resource-id', 'com.google.android.gm:id/compose_button')
  406. .with('content-desc', 'Compose')
  407.  
  408. $ruiObj.click
  409.  
  410. waitsecond(2)
  411. end
  412.  
  413. tcase << TestAction.new(:MultiAutoCompleteTextView_To_2) do
  414. $ruiObj = RUIObject.new.with('objectid', 1412494739).with('selfid', -538836202).with('textdescid', -639413688).with('uniqueparentid', 0).with('classresourceid', 1488875515)
  415. .with('uitreeindex', 8)
  416. .with('classname', 'MultiAutoCompleteTextView')
  417. .with('resource-id', 'com.google.android.gm:id/to')
  418. .with('content-desc', 'To')
  419.  
  420. $ruiObj.inputtext('dvgats1@yahoo.com')
  421.  
  422. waitsecond(2)
  423. end
  424.  
  425. tcase << TestAction.new(:pressEnter_2) do
  426. pressEnter
  427.  
  428. waitsecond(2)
  429. end
  430.  
  431. tcase << TestAction.new(:EditText_Subject_3) do
  432. $ruiObj = RUIObject.new.with('objectid', -1492734634).with('selfid', -477614756).with('textdescid', 969866634).with('uniqueparentid', 0).with('classresourceid', 927865352)
  433. .with('uitreeindex', 10)
  434. .with('classname', 'EditText')
  435. .with('resource-id', 'com.google.android.gm:id/subject')
  436.  
  437. $ruiObj.inputtext('Concurrency Test')
  438.  
  439. waitsecond(2)
  440. end
  441.  
  442. tcase << TestAction.new(:EditText_Body_5) do
  443. $ruiObj = RUIObject.new.with('objectid', -472419783).with('selfid', 132829042).with('textdescid', -1760111353).with('uniqueparentid', 0).with('classresourceid', 52429382)
  444. .with('uitreeindex', 11)
  445. .with('classname', 'EditText')
  446. .with('resource-id', 'com.google.android.gm:id/body')
  447.  
  448. $ruiObj.inputtext('This is concurrency tests sending email during call.')
  449.  
  450. waitsecond(2)
  451. end
  452.  
  453. tcase << TestAction.new(:TextView_Send_6) do
  454. $ruiObj = RUIObject.new.with('objectid', 1442003251).with('selfid', 2103341243).with('textdescid', -1481441995).with('uniqueparentid', 0)
  455. .with('uitreeindex', 3)
  456. .with('classname', 'TextView')
  457. .with('resource-id', 'com.google.android.gm:id/send')
  458. .with('content-desc', 'Send')
  459.  
  460. $ruiObj.isExist
  461.  
  462. waitsecond(2)
  463. end
  464.  
  465. tcase << TestAction.new(:TextView_Send_6_1) do
  466. $ruiObj = RUIObject.new.with('objectid', 1442003251).with('selfid', 2103341243).with('textdescid', -1481441995).with('uniqueparentid', 0)
  467. .with('uitreeindex', 3)
  468. .with('classname', 'TextView')
  469. .with('resource-id', 'com.google.android.gm:id/send')
  470. .with('content-desc', 'Send')
  471.  
  472. $ruiObj.click
  473.  
  474. waitsecond(2)
  475. end
  476.  
  477. tcase << TestAction.new(:scriptAction_6) do
  478. logStopTest("Emails")
  479. end
  480.  
  481. tcase << TestAction.new(:pressBack_7) do
  482. pressBack
  483. end
  484.  
  485. tcase << TestAction.new(:pressBack_8) do
  486. pressBack
  487. end
  488.  
  489. tcase << TestAction.new(:pressHome_9) do
  490. pressHome
  491. end
  492.  
  493. tcase.run(loopTime)
  494.  
  495. end
  496.  
  497. def self.GPS(loopTime)
  498.  
  499. tcase = TestCase.new("GPS")
  500.  
  501. tcase << TestAction.new(:gotoApp_1) do
  502. gotoApp('Maps')
  503.  
  504. waitsecond(2)
  505. end
  506.  
  507. tcase << TestAction.new(:scriptAction_2) do
  508. logStartTest("GPS")
  509. end
  510.  
  511. tcase << TestAction.new(:TextView_Accept_2) do
  512. $ruiObj = RUIObject.new.with('objectid', -2142217036).with('selfid', -411926495).with('textdescid', -336996923).with('uniqueparentid', 0).with('classresourceid', -938935918)
  513. .with('uitreeindex', 3)
  514. .with('classname', 'TextView')
  515. .with('text', 'Accept continue')
  516.  
  517. $ruiObj.click
  518. noFailCheck
  519.  
  520. waitsecond(2)
  521. end
  522.  
  523. tcase << TestAction.new(:Button_Skip_3) do
  524. $ruiObj = RUIObject.new.with('objectid', 1318191317).with('selfid', 343772849).with('textdescid', -671073450).with('uniqueparentid', 0).with('classresourceid', 2001146706)
  525. .with('uitreeindex', 4)
  526. .with('classname', 'Button')
  527. .with('text', 'Skip')
  528.  
  529. $ruiObj.click
  530. noFailCheck
  531.  
  532. waitsecond(2)
  533. end
  534.  
  535. tcase << TestAction.new(:ImageView_Clear_2) do
  536. $ruiObj = RUIObject.new.with('objectid', 1493645968).with('selfid', 59009363).with('textdescid', -602195619).with('uniqueparentid', 0)
  537. .with('uitreeindex', 10)
  538. .with('classname', 'ImageView')
  539. .with('content-desc', 'Clear')
  540.  
  541. $ruiObj.click
  542. noFailCheck
  543.  
  544. waitsecond(2)
  545. end
  546.  
  547. tcase << TestAction.new(:clickXY_1092_228_4) do
  548. click(1092,228)
  549.  
  550. waitsecond(2)
  551. end
  552.  
  553. tcase << TestAction.new(:EditText_SearchOmniboxEditText_6) do
  554. $ruiObj = RUIObject.new.with('objectid', 1175672329).with('selfid', 1989833907).with('textdescid', 2086103863).with('uniqueparentid', 0)
  555. .with('uitreeindex', 14)
  556. .with('classname', 'EditText')
  557. .with('resource-id', 'com.google.android.apps.gmm:id/search_omnibox_edit_text')
  558.  
  559. $ruiObj.inputtext('3225 N Harbor Dr')
  560.  
  561. waitsecond(2)
  562. end
  563.  
  564. tcase << TestAction.new(:pressEnter_2) do
  565. pressEnter
  566.  
  567. waitsecond(2)
  568. end
  569.  
  570. tcase << TestAction.new(:clickXY_1252_2024_4) do
  571. click(1252,2024)
  572.  
  573. waitsecond(2)
  574. end
  575.  
  576. tcase << TestAction.new(:clickXY_1264_2008_6) do
  577. click(1264,2008)
  578.  
  579. waitsecond(2)
  580. end
  581.  
  582. tcase << TestAction.new(:Button_Button1_2) do
  583. $ruiObj = RUIObject.new.with('objectid', -185981439).with('selfid', 2077687487).with('textdescid', 1763664120).with('uniqueparentid', 0)
  584. .with('uitreeindex', 6)
  585. .with('classname', 'Button')
  586. .with('resource-id', 'android:id/button1')
  587. .with('text', 'Yes')
  588.  
  589. $ruiObj.click
  590.  
  591. waitsecond(1)
  592. end
  593.  
  594. tcase << TestAction.new(:Button_Button1_8) do
  595. $ruiObj = RUIObject.new.with('objectid', -111119685).with('selfid', 924899888).with('textdescid', 2046338963).with('uniqueparentid', 0)
  596. .with('uitreeindex', 4)
  597. .with('classname', 'Button')
  598. .with('resource-id', 'android:id/button1')
  599. .with('text', 'Accept')
  600.  
  601. $ruiObj.click
  602. noFailCheck
  603.  
  604. waitsecond(2)
  605. end
  606.  
  607. tcase << TestAction.new(:ImageView_Close_9) do
  608. $ruiObj = RUIObject.new.with('objectid', 500839813).with('selfid', 1990642820).with('textdescid', 903691479).with('uniqueparentid', 0)
  609. .with('uitreeindex', 0)
  610. .with('classname', 'ImageView')
  611. .with('content-desc', 'Close navigation')
  612.  
  613. $ruiObj.click
  614. noFailCheck
  615.  
  616. waitsecond(2)
  617. end
  618.  
  619. tcase << TestAction.new(:scriptAction_4) do
  620. logStopTest("GPS")
  621. end
  622.  
  623. tcase << TestAction.new(:pressBack_10) do
  624. pressBack
  625. end
  626.  
  627. tcase << TestAction.new(:pressBack_11) do
  628. pressBack
  629. end
  630.  
  631. tcase << TestAction.new(:pressHome_12) do
  632. pressHome
  633. end
  634.  
  635. tcase.run(loopTime)
  636.  
  637. end
  638.  
  639. def self.MMS(loopTime)
  640.  
  641. tcase = TestCase.new("MMS")
  642.  
  643. tcase << TestAction.new(:gotoApp_1) do
  644. gotoApp('Messaging')
  645.  
  646. waitsecond(1)
  647. end
  648.  
  649. tcase << TestAction.new(:scriptAction_6) do
  650. logStartTest("MMS")
  651. end
  652.  
  653. tcase << TestAction.new(:ImageView_Img1_2) do
  654. $ruiObj = RUIObject.new.with('objectid', 160312923).with('selfid', 468961841).with('textdescid', 339488965).with('uniqueparentid', 0)
  655. .with('uitreeindex', 5)
  656. .with('classname', 'ImageView')
  657. .with('resource-id', 'com.android.mms:id/img1')
  658. .with('content-desc', 'Compose button')
  659.  
  660. $ruiObj.click
  661.  
  662. waitsecond(1)
  663. end
  664.  
  665. tcase << TestAction.new(:ImageButton_Contacts_2) do
  666. $ruiObj = RUIObject.new.with('objectid', -2124182915).with('selfid', -358910880).with('textdescid', 1935590710).with('uniqueparentid', 0)
  667. .with('uitreeindex', 1)
  668. .with('classname', 'ImageButton')
  669. .with('content-desc', 'Contacts')
  670.  
  671. $ruiObj.click
  672.  
  673. waitsecond(1)
  674. end
  675.  
  676. tcase << TestAction.new(:MultiAutoCompleteTextView_2) do
  677. $ruiObj = RUIObject.new.with('objectid', 784817492).with('selfid', -1346021293).with('textdescid', -1440461492).with('uniqueparentid', 0).with('classresourceid', -1346021293)
  678. .with('uitreeindex', 0)
  679. .with('classname', 'MultiAutoCompleteTextView')
  680.  
  681. $ruiObj.inputtext('A01')
  682.  
  683. waitsecond(1)
  684. end
  685.  
  686. tcase << TestAction.new(:clickXY_316_388_4) do
  687. click(316,388)
  688.  
  689. waitsecond(1)
  690. end
  691.  
  692. tcase << TestAction.new(:EditText_4) do
  693. $ruiObj = RUIObject.new.with('objectid', 188001303).with('selfid', 1666676343).with('textdescid', 1533073129).with('uniqueparentid', 0).with('classresourceid', 1666676343)
  694. .with('uitreeindex', 5)
  695. .with('classname', 'EditText')
  696.  
  697. $ruiObj.click
  698.  
  699. waitsecond(1)
  700. end
  701.  
  702. tcase << TestAction.new(:EditText_4_1) do
  703. $ruiObj = RUIObject.new.with('objectid', 188001303).with('selfid', 1666676343).with('textdescid', 1533073129).with('uniqueparentid', 0).with('classresourceid', 1666676343)
  704. .with('uitreeindex', 5)
  705. .with('classname', 'EditText')
  706.  
  707. $ruiObj.inputtext('Testing "Concurrency tests"')
  708.  
  709. waitsecond(1)
  710. end
  711.  
  712. tcase << TestAction.new(:ImageButton_AttachbuttonRight_4) do
  713. $ruiObj = RUIObject.new.with('objectid', 874172794).with('selfid', -1211001229).with('textdescid', -704319221).with('uniqueparentid', 0)
  714. .with('uitreeindex', 13)
  715. .with('pretext', 'Nov 17 912 PM')
  716. .with('classname', 'ImageButton')
  717. .with('resource-id', 'com.android.mms:id/attachButton_right')
  718. .with('content-desc', 'Attach')
  719.  
  720. $ruiObj.click
  721.  
  722. waitsecond(1)
  723. end
  724.  
  725. tcase << TestAction.new(:TextView_Text1_3) do
  726. $ruiObj = RUIObject.new.with('objectid', -786651428).with('selfid', -1538867418).with('textdescid', 1602617353).with('uniqueparentid', 0).with('classresourceid', -1838901301)
  727. .with('uitreeindex', 2)
  728. .with('classname', 'TextView')
  729. .with('resource-id', 'com.android.mms:id/text1')
  730. .with('text', 'Image')
  731.  
  732. $ruiObj.click
  733.  
  734. waitsecond(4)
  735. end
  736.  
  737. tcase << TestAction.new(:Button_PermissionAllowButton_2) do
  738. $ruiObj = RUIObject.new.with('objectid', 973397371).with('selfid', 1444367499).with('textdescid', -1740624804).with('uniqueparentid', 0)
  739. .with('uitreeindex', 3)
  740. .with('classname', 'Button')
  741. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  742. .with('text', 'Allow')
  743.  
  744. $ruiObj.click
  745. end
  746.  
  747. tcase << TestAction.new(:clickXY_224_664_6) do
  748. click(224,664)
  749.  
  750. waitsecond(4)
  751. end
  752.  
  753. tcase << TestAction.new(:Button_SendButton_7) do
  754. $ruiObj = RUIObject.new.with('objectid', -1077299784).with('selfid', -721945045).with('textdescid', 214167495).with('uniqueparentid', 0)
  755. .with('uitreeindex', 10)
  756. .with('classname', 'Button')
  757. .with('resource-id', 'com.android.mms:id/send_button')
  758. .with('text', 'Send
  759. MMS')
  760.  
  761. $ruiObj.click
  762.  
  763. waitsecond(1)
  764. end
  765.  
  766. tcase << TestAction.new(:scriptAction_8) do
  767. logStopTest("MMS")
  768. end
  769.  
  770. tcase << TestAction.new(:pressBack_10) do
  771. pressBack
  772. end
  773.  
  774. tcase << TestAction.new(:pressBack_11) do
  775. pressBack
  776. end
  777.  
  778. tcase << TestAction.new(:pressHome_12) do
  779. pressHome
  780. end
  781.  
  782. tcase.run(loopTime)
  783.  
  784. end
  785.  
  786. def self.Multimedia(loopTime)
  787.  
  788. tcase = TestCase.new("Multimedia")
  789.  
  790. tcase << TestAction.new(:gotoApp_1) do
  791. gotoApp('Gallery')
  792.  
  793. waitsecond(1)
  794. end
  795.  
  796. tcase << TestAction.new(:scriptAction_2) do
  797. logStartTest("Multimedia")
  798. end
  799.  
  800. tcase << TestAction.new(:ImageButton_Open_1) do
  801. $ruiObj = RUIObject.new.with('objectid', 1547446343).with('selfid', 1589392844).with('textdescid', -1415314368).with('uniqueparentid', 0)
  802. .with('uitreeindex', 0)
  803. .with('classname', 'ImageButton')
  804. .with('content-desc', 'Open navigation drawer')
  805.  
  806. $ruiObj.click
  807. noFailCheck
  808.  
  809. waitsecond(1)
  810. end
  811.  
  812. tcase << TestAction.new(:CheckedTextView_DrawerItem_2) do
  813. $ruiObj = RUIObject.new.with('objectid', -401550358).with('selfid', 229733217).with('textdescid', 1081503090).with('uniqueparentid', 0).with('classresourceid', 396870609)
  814. .with('uitreeindex', 4)
  815. .with('classname', 'CheckedTextView')
  816. .with('resource-id', 'com.android.gallery3d:id/drawer_item')
  817. .with('text', 'Videos')
  818.  
  819. $ruiObj.click
  820.  
  821. waitsecond(1)
  822. end
  823.  
  824. tcase << TestAction.new(:clickXY_492_388_6) do
  825. click(492,388)
  826.  
  827. waitsecond(1)
  828. end
  829.  
  830. tcase << TestAction.new(:clickXY_492_388_6_1) do
  831. click(492,388)
  832.  
  833. waitsecond(1)
  834. end
  835.  
  836. tcase << TestAction.new(:TextView_Alwaysusetext_5) do
  837. $ruiObj = RUIObject.new.with('objectid', -722377990).with('selfid', -1976941555).with('textdescid', -2025483539).with('uniqueparentid', 0).with('classresourceid', 1039916726)
  838. .with('uitreeindex', 6)
  839. .with('classname', 'TextView')
  840. .with('resource-id', 'com.lge:id/alwaysUseText')
  841. .with('text', 'Use as default app')
  842.  
  843. $ruiObj.click
  844. end
  845.  
  846. tcase << TestAction.new(:TextView_ResolverText_2) do
  847. $ruiObj = RUIObject.new.with('objectid', -686048727).with('selfid', 1334281818).with('textdescid', 2007893244).with('uniqueparentid', 0).with('classresourceid', -472389065)
  848. .with('uitreeindex', 2)
  849. .with('classname', 'TextView')
  850. .with('resource-id', 'com.lge:id/resolver_text')
  851. .with('text', 'Video')
  852.  
  853. $ruiObj.click
  854. end
  855.  
  856. tcase << TestAction.new(:Button_AllowButton_4) do
  857. $ruiObj = RUIObject.new.with('objectid', -1049422851).with('selfid', -808516471).with('textdescid', -374437087).with('uniqueparentid', 0).with('classresourceid', 771022871)
  858. .with('uitreeindex', 8)
  859. .with('classname', 'Button')
  860. .with('resource-id', 'com.lge:id/allow_button')
  861. .with('text', 'OK')
  862.  
  863. $ruiObj.click
  864. end
  865.  
  866. tcase << TestAction.new(:Button_PermissionAllowButton_9) do
  867. $ruiObj = RUIObject.new.with('objectid', 973397371).with('selfid', 1444367499).with('textdescid', -1740624804).with('uniqueparentid', 0)
  868. .with('uitreeindex', 3)
  869. .with('classname', 'Button')
  870. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  871. .with('text', 'Allow')
  872.  
  873. $ruiObj.click
  874.  
  875. waitsecond(32)
  876. end
  877.  
  878. tcase << TestAction.new(:scriptAction_4) do
  879. logStopTest("Multimedia")
  880. end
  881.  
  882. tcase << TestAction.new(:pressBack_4) do
  883. pressBack
  884. end
  885.  
  886. tcase << TestAction.new(:pressBack_5) do
  887. pressBack
  888. end
  889.  
  890. tcase << TestAction.new(:pressHome_6) do
  891. pressHome
  892. end
  893.  
  894. tcase.run(loopTime)
  895.  
  896. end
  897.  
  898. def self.SMS(loopTime)
  899.  
  900. tcase = TestCase.new("SMS")
  901.  
  902. tcase << TestAction.new(:gotoApp_1) do
  903. gotoApp('Messaging')
  904. end
  905.  
  906. tcase << TestAction.new(:scriptAction_2) do
  907. logStartTest("SMS")
  908. end
  909.  
  910. tcase << TestAction.new(:ImageView_Img1_2) do
  911. $ruiObj = RUIObject.new.with('objectid', 160312923).with('selfid', 468961841).with('textdescid', 339488965).with('uniqueparentid', 0)
  912. .with('uitreeindex', 6)
  913. .with('classname', 'ImageView')
  914. .with('resource-id', 'com.android.mms:id/img1')
  915. .with('content-desc', 'Compose button')
  916.  
  917. $ruiObj.click
  918.  
  919. waitsecond(1)
  920. end
  921.  
  922. tcase << TestAction.new(:MultiAutoCompleteTextView_3) do
  923. $ruiObj = RUIObject.new.with('objectid', 784817492).with('selfid', -1346021293).with('textdescid', -1440461492).with('uniqueparentid', 0).with('classresourceid', -1346021293)
  924. .with('uitreeindex', 0)
  925. .with('classname', 'MultiAutoCompleteTextView')
  926.  
  927. $ruiObj.inputtext('A01 a01')
  928.  
  929. waitsecond(1)
  930. end
  931.  
  932. tcase << TestAction.new(:clickXY_232_380_5) do
  933. click(232,380)
  934.  
  935. waitsecond(1)
  936. end
  937.  
  938. tcase << TestAction.new(:EditText_4) do
  939. $ruiObj = RUIObject.new.with('objectid', 188001303).with('selfid', 1666676343).with('textdescid', 1533073129).with('uniqueparentid', 0).with('classresourceid', 1666676343)
  940. .with('uitreeindex', 10)
  941. .with('classname', 'EditText')
  942.  
  943. $ruiObj.click
  944.  
  945. waitsecond(1)
  946. end
  947.  
  948. tcase << TestAction.new(:EditText_Enter_8) do
  949. $ruiObj = RUIObject.new.with('objectid', -158768307).with('selfid', -454502120).with('textdescid', -842188788).with('uniqueparentid', 0).with('classresourceid', 1666676343)
  950. .with('uitreeindex', 10)
  951. .with('classname', 'EditText')
  952. .with('content-desc', 'Enter message')
  953.  
  954. $ruiObj.inputtext('Testing "Concurrency tests"')
  955. noFailCheck
  956.  
  957. waitsecond(1)
  958. end
  959.  
  960. tcase << TestAction.new(:Button_SendButton_6) do
  961. $ruiObj = RUIObject.new.with('objectid', -1077299784).with('selfid', -817858366).with('textdescid', 231002384).with('uniqueparentid', 0)
  962. .with('uitreeindex', 13)
  963. .with('classname', 'Button')
  964. .with('resource-id', 'com.android.mms:id/send_button')
  965. .with('text', 'Send')
  966.  
  967. $ruiObj.click
  968.  
  969. waitsecond(1)
  970. end
  971.  
  972. tcase << TestAction.new(:scriptAction_2_1) do
  973. logStopTest("SMS")
  974. end
  975.  
  976. tcase << TestAction.new(:pressBack_10) do
  977. pressBack
  978. end
  979.  
  980. tcase << TestAction.new(:pressBack_11) do
  981. pressBack
  982. end
  983.  
  984. tcase << TestAction.new(:pressHome_12) do
  985. pressHome
  986. end
  987.  
  988. tcase.run(loopTime)
  989.  
  990. end
  991.  
  992. def self.Video(loopTime)
  993.  
  994. tcase = TestCase.new("Video")
  995.  
  996. tcase << TestAction.new(:gotoApp_1) do
  997. gotoApp('Camera')
  998.  
  999. waitsecond(1)
  1000. end
  1001.  
  1002. tcase << TestAction.new(:scriptAction_2) do
  1003. logStartTest("Video")
  1004. end
  1005.  
  1006. tcase << TestAction.new(:ImageButton_QuickButtonCleanView_2) do
  1007. $ruiObj = RUIObject.new.with('objectid', 2094475324).with('selfid', -1659256094).with('textdescid', 1888606697).with('uniqueparentid', 0)
  1008. .with('uitreeindex', 4)
  1009. .with('classname', 'ImageButton')
  1010. .with('resource-id', 'com.lge.camera:id/quick_button_clean_view')
  1011. .with('content-desc', 'View')
  1012.  
  1013. $ruiObj.click
  1014. noFailCheck
  1015.  
  1016. waitsecond(1)
  1017. end
  1018.  
  1019. tcase << TestAction.new(:ImageButton_QuickNormalImageView_3) do
  1020. $ruiObj = RUIObject.new.with('objectid', -1828351537).with('selfid', -62449628).with('textdescid', -1345909955).with('uniqueparentid', 0)
  1021. .with('uitreeindex', 6)
  1022. .with('classname', 'ImageButton')
  1023. .with('resource-id', 'com.lge.camera:id/quick_normal_image_view')
  1024. .with('content-desc', 'Basic')
  1025.  
  1026. $ruiObj.click
  1027. noFailCheck
  1028.  
  1029. waitsecond(1)
  1030. end
  1031.  
  1032. tcase << TestAction.new(:ImageButton_ShutterTopComp_2) do
  1033. $ruiObj = RUIObject.new.with('objectid', -1799776401).with('selfid', -1818636331).with('textdescid', -839551902).with('uniqueparentid', 0)
  1034. .with('uitreeindex', 8)
  1035. .with('classname', 'ImageButton')
  1036. .with('resource-id', 'com.lge.camera:id/shutter_top_comp')
  1037. .with('content-desc', 'Start recording')
  1038.  
  1039. $ruiObj.click
  1040. noFailCheck
  1041.  
  1042. waitsecond(4)
  1043. end
  1044.  
  1045. tcase << TestAction.new(:ImageButton_ShutterTopComp_4) do
  1046. $ruiObj = RUIObject.new.with('objectid', -1799776401).with('selfid', -1930433243).with('textdescid', 415097668).with('uniqueparentid', 0)
  1047. .with('uitreeindex', 4)
  1048. .with('classname', 'ImageButton')
  1049. .with('resource-id', 'com.lge.camera:id/shutter_top_comp')
  1050. .with('content-desc', 'Stop recording')
  1051.  
  1052. $ruiObj.click
  1053. noFailCheck
  1054.  
  1055. waitsecond(1)
  1056. end
  1057.  
  1058. tcase << TestAction.new(:scriptAction_2_1) do
  1059. logStopTest("Video")
  1060. end
  1061.  
  1062. tcase << TestAction.new(:pressBack_5) do
  1063. pressBack
  1064. end
  1065.  
  1066. tcase << TestAction.new(:pressBack_6) do
  1067. pressBack
  1068. end
  1069.  
  1070. tcase << TestAction.new(:pressHome_7) do
  1071. pressHome
  1072. end
  1073.  
  1074. tcase.run(loopTime)
  1075.  
  1076. end
  1077.  
  1078. def self.Voice(loopTime)
  1079.  
  1080. tcase = TestCase.new("Voice")
  1081.  
  1082. tcase << TestAction.new(:pressHome_1) do
  1083. pressHome
  1084. end
  1085.  
  1086. tcase << TestAction.new(:scriptAction_2) do
  1087. logStartTest("Voice")
  1088. end
  1089.  
  1090. tcase << TestAction.new(:scriptAction_4) do
  1091.  
  1092. UiDevice.getInstance.openNotification()
  1093.  
  1094. waitsecond(1)
  1095. end
  1096.  
  1097. tcase << TestAction.new(:clickXY_1080_632_2) do
  1098. click(1080,632)
  1099.  
  1100. waitsecond(1)
  1101. end
  1102.  
  1103. tcase << TestAction.new(:gotoApp_2) do
  1104. gotoApp('Phone')
  1105.  
  1106. waitsecond(4)
  1107. end
  1108.  
  1109. tcase << TestAction.new(:Button_Endbutton_9) do
  1110. $ruiObj = RUIObject.new.with('objectid', -1046212790).with('selfid', 1277076029).with('textdescid', -1112021541).with('uniqueparentid', 0)
  1111. .with('uitreeindex', 8)
  1112. .with('classname', 'Button')
  1113. .with('resource-id', 'com.android.incallui:id/endButton')
  1114. .with('text', 'End')
  1115.  
  1116. $ruiObj.click
  1117.  
  1118. waitsecond(1)
  1119. end
  1120.  
  1121. tcase << TestAction.new(:TextView_Tabtext_2) do
  1122. $ruiObj = RUIObject.new.with('objectid', -66640566).with('selfid', 566119687).with('textdescid', 1718553658).with('uniqueparentid', 0)
  1123. .with('uitreeindex', 2)
  1124. .with('classname', 'TextView')
  1125. .with('resource-id', 'com.android.contacts:id/tabText')
  1126. .with('text', 'Dial')
  1127.  
  1128. $ruiObj.click
  1129.  
  1130. waitsecond(1)
  1131. end
  1132.  
  1133. tcase << TestAction.new(:ImageButton_Btndelete_2) do
  1134. $ruiObj = RUIObject.new.with('objectid', 1208458233).with('selfid', 194799554).with('textdescid', -91453704).with('uniqueparentid', 0)
  1135. .with('uitreeindex', 31)
  1136. .with('classname', 'ImageButton')
  1137. .with('resource-id', 'com.android.contacts:id/btnDelete')
  1138. .with('content-desc', 'Backspace')
  1139.  
  1140. $ruiObj.longClick
  1141.  
  1142. waitsecond(1)
  1143. end
  1144.  
  1145. tcase << TestAction.new(:EditText_Digits_2) do
  1146. $ruiObj = RUIObject.new.with('objectid', 1211786433).with('selfid', -1326421482).with('textdescid', -1089326209).with('uniqueparentid', 0)
  1147. .with('uitreeindex', 8)
  1148. .with('classname', 'EditText')
  1149. .with('resource-id', 'com.android.contacts:id/digits')
  1150.  
  1151. $ruiObj.inputtext('18003310500')
  1152.  
  1153. waitsecond(1)
  1154. end
  1155.  
  1156. tcase << TestAction.new(:ImageButton_Btnlogscall_7) do
  1157. $ruiObj = RUIObject.new.with('objectid', -1934426254).with('selfid', -2053967649).with('textdescid', -911487124).with('uniqueparentid', 0)
  1158. .with('uitreeindex', 25)
  1159. .with('pretext', '2')
  1160. .with('classname', 'ImageButton')
  1161. .with('resource-id', 'com.android.contacts:id/btnLogsCall')
  1162. .with('content-desc', 'Call')
  1163.  
  1164. $ruiObj.click
  1165.  
  1166. waitsecond(1)
  1167. end
  1168.  
  1169. tcase << TestAction.new(:scriptAction_2_1) do
  1170. logStopTest("Voice")
  1171. end
  1172.  
  1173. tcase.run(loopTime)
  1174.  
  1175. end
  1176.  
  1177. def self.VoiceRecord(loopTime)
  1178.  
  1179. tcase = TestCase.new("VoiceRecord")
  1180.  
  1181. tcase << TestAction.new(:gotoApp_1) do
  1182. gotoApp('Tools')
  1183. end
  1184.  
  1185. tcase << TestAction.new(:scriptAction_2_1) do
  1186. logStartTest("Voice")
  1187. end
  1188.  
  1189. tcase << TestAction.new(:TextView_Voice_2) do
  1190. $ruiObj = RUIObject.new.with('objectid', -665293804).with('selfid', -1818622386).with('textdescid', -1786248436).with('uniqueparentid', 0)
  1191. .with('uitreeindex', 4)
  1192. .with('classname', 'TextView')
  1193. .with('content-desc', 'Voice Recorder')
  1194. .with('text', 'Voice Recorder')
  1195.  
  1196. $ruiObj.click
  1197.  
  1198. waitsecond(1)
  1199. end
  1200.  
  1201. tcase << TestAction.new(:Button_ButtonAccept_4) do
  1202. $ruiObj = RUIObject.new.with('objectid', -1893332536).with('selfid', -555982152).with('textdescid', 1605427616).with('uniqueparentid', 0)
  1203. .with('uitreeindex', 8)
  1204. .with('classname', 'Button')
  1205. .with('resource-id', 'com.lge:id/button_accept')
  1206. .with('text', 'Accept')
  1207.  
  1208. $ruiObj.click
  1209. end
  1210.  
  1211. tcase << TestAction.new(:Button_Recordbutton_5) do
  1212. $ruiObj = RUIObject.new.with('objectid', 1732501589).with('selfid', 570253989).with('textdescid', -801139812).with('uniqueparentid', 0)
  1213. .with('uitreeindex', 15)
  1214. .with('classname', 'Button')
  1215. .with('resource-id', 'com.lge.voicerecorder:id/recordButton')
  1216. .with('content-desc', 'Record')
  1217.  
  1218. $ruiObj.click
  1219. end
  1220.  
  1221. tcase << TestAction.new(:wait12second_2) do
  1222. waitsecond(12)
  1223. end
  1224.  
  1225. tcase << TestAction.new(:ImageView_Stopimage_10) do
  1226. $ruiObj = RUIObject.new.with('objectid', 1366997146).with('selfid', 670796736).with('textdescid', -572761402).with('uniqueparentid', 0)
  1227. .with('uitreeindex', 18)
  1228. .with('classname', 'ImageView')
  1229. .with('resource-id', 'com.lge.voicerecorder:id/stopImage')
  1230.  
  1231. $ruiObj.click
  1232.  
  1233. waitsecond(1)
  1234. end
  1235.  
  1236. tcase << TestAction.new(:Button_Playbutton_13) do
  1237. $ruiObj = RUIObject.new.with('objectid', 1279473370).with('selfid', -1475026465).with('textdescid', 318711386).with('uniqueparentid', 0)
  1238. .with('uitreeindex', 19)
  1239. .with('classname', 'Button')
  1240. .with('resource-id', 'com.lge.voicerecorder:id/playButton')
  1241. .with('content-desc', 'Play')
  1242.  
  1243. $ruiObj.click
  1244.  
  1245. waitsecond(1)
  1246. end
  1247.  
  1248. tcase << TestAction.new(:wait12second_8) do
  1249. waitsecond(12)
  1250. end
  1251.  
  1252. tcase << TestAction.new(:TextView_Delete_15) do
  1253. $ruiObj = RUIObject.new.with('objectid', -1857314789).with('selfid', 1644806947).with('textdescid', 449535344).with('uniqueparentid', 0)
  1254. .with('uitreeindex', 3)
  1255. .with('classname', 'TextView')
  1256. .with('content-desc', 'Delete')
  1257.  
  1258. $ruiObj.click
  1259.  
  1260. waitsecond(1)
  1261. end
  1262.  
  1263. tcase << TestAction.new(:TextView_Customtitle_18) do
  1264. $ruiObj = RUIObject.new.with('objectid', -588258928).with('selfid', 1550783101).with('textdescid', -1546678125).with('uniqueparentid', 0)
  1265. .with('uitreeindex', 1)
  1266. .with('classname', 'TextView')
  1267. .with('resource-id', 'com.lge.voicerecorder:id/customtitle')
  1268. .with('text', 'Select all')
  1269.  
  1270. $ruiObj.click
  1271. end
  1272.  
  1273. tcase << TestAction.new(:Button_Listdeletebutton_21) do
  1274. $ruiObj = RUIObject.new.with('objectid', -73263271).with('selfid', -1086917555).with('textdescid', -1490152978).with('uniqueparentid', 0)
  1275. .with('uitreeindex', 9)
  1276. .with('classname', 'Button')
  1277. .with('resource-id', 'com.lge.voicerecorder:id/listDeleteButton')
  1278. .with('text', 'Delete')
  1279.  
  1280. $ruiObj.click
  1281. end
  1282.  
  1283. tcase << TestAction.new(:Button_Button1_18) do
  1284. $ruiObj = RUIObject.new.with('objectid', 1555335400).with('selfid', 1012902611).with('textdescid', -579238787).with('uniqueparentid', 0)
  1285. .with('uitreeindex', 2)
  1286. .with('classname', 'Button')
  1287. .with('resource-id', 'android:id/button1')
  1288. .with('text', 'Delete')
  1289.  
  1290. $ruiObj.click
  1291.  
  1292. waitsecond(1)
  1293. end
  1294.  
  1295. tcase << TestAction.new(:scriptAction_2_1_1) do
  1296. logStopTest("VoiceRecord")
  1297. end
  1298.  
  1299. tcase << TestAction.new(:pressBack_16) do
  1300. pressBack
  1301.  
  1302. waitsecond(1)
  1303. end
  1304.  
  1305. tcase << TestAction.new(:pressBack_19) do
  1306. pressBack
  1307.  
  1308. waitsecond(1)
  1309. end
  1310.  
  1311. tcase << TestAction.new(:pressHome_20) do
  1312. pressHome
  1313.  
  1314. waitsecond(1)
  1315. end
  1316.  
  1317. tcase.run(loopTime)
  1318.  
  1319. end
  1320.  
  1321. def self.Youtube(loopTime)
  1322.  
  1323. tcase = TestCase.new("Youtube")
  1324.  
  1325. tcase << TestAction.new(:gotoApp_1) do
  1326. gotoApp('YouTube')
  1327.  
  1328. waitsecond(1)
  1329. end
  1330.  
  1331. tcase << TestAction.new(:scriptAction_2) do
  1332. logStartTest("Youtube")
  1333. end
  1334.  
  1335. tcase << TestAction.new(:TextView_DoneButton_2) do
  1336. $ruiObj = RUIObject.new.with('objectid', -1205593873).with('selfid', -1917900695).with('textdescid', 1076943437).with('uniqueparentid', 0)
  1337. .with('uitreeindex', 2)
  1338. .with('classname', 'TextView')
  1339. .with('resource-id', 'com.google.android.youtube:id/done_button')
  1340. .with('text', 'Done')
  1341.  
  1342. $ruiObj.click
  1343.  
  1344. waitsecond(4)
  1345. end
  1346.  
  1347. tcase << TestAction.new(:clickXY_700_1256_7) do
  1348. click(700,1256)
  1349.  
  1350. waitsecond(8)
  1351. end
  1352.  
  1353. tcase << TestAction.new(:scriptAction_2_1) do
  1354. logStopTest("Youtube")
  1355. end
  1356.  
  1357. tcase << TestAction.new(:pressBack_5) do
  1358. pressBack
  1359. end
  1360.  
  1361. tcase << TestAction.new(:pressBack_6) do
  1362. pressBack
  1363. end
  1364.  
  1365. tcase << TestAction.new(:pressHome_7) do
  1366. pressHome
  1367. end
  1368.  
  1369. tcase.run(loopTime)
  1370.  
  1371. end
  1372.  
  1373. def self.endcall(loopTime)
  1374.  
  1375. tcase = TestCase.new("endcall")
  1376.  
  1377. tcase << TestAction.new(:scriptAction_3) do
  1378.  
  1379. UiDevice.getInstance.openNotification()
  1380.  
  1381. waitsecond(2)
  1382. end
  1383.  
  1384. tcase << TestAction.new(:swipeDown_2) do
  1385. swipe_vertical 500
  1386.  
  1387. waitsecond(2)
  1388. end
  1389.  
  1390. tcase << TestAction.new(:clickXY_1136_628_1) do
  1391. click(1136,628)
  1392.  
  1393. waitsecond(2)
  1394. end
  1395.  
  1396. tcase.run(loopTime)
  1397.  
  1398. end
  1399.  
  1400. def self.ltecall_ExpHandler(loopTime)
  1401.  
  1402. tcase = TestCase.new("ltecall_ExpHandler")
  1403.  
  1404. tcase << TestAction.new(:wait1second_1) do
  1405. waitsecond(1)
  1406. end
  1407.  
  1408. tcase << TestAction.new(:scriptAction_2) do
  1409. puts "Detected Incomming Call"
  1410. $UIDev.swipe(200,$UIDev.getDisplayHeight-300,$UIDev.getDisplayWidth-50,$UIDev.getDisplayHeight-300,10)
  1411.  
  1412. waitsecond(2)
  1413. end
  1414.  
  1415. tcase << TestAction.new(:wait2second_3) do
  1416. waitsecond(2)
  1417. end
  1418.  
  1419. tcase.run(loopTime)
  1420.  
  1421. end
  1422.  
  1423. def self.startTest(loopTime)
  1424.  
  1425. tcase = TestCase.new("startTest")
  1426.  
  1427. tcase << TestAction.new(:pressBack_1) do
  1428. pressBack
  1429. end
  1430.  
  1431. tcase << TestAction.new(:pressBack_2) do
  1432. pressBack
  1433. end
  1434.  
  1435. tcase << TestAction.new(:pressHome_3) do
  1436. pressHome
  1437. end
  1438.  
  1439. tcase.run(loopTime)
  1440.  
  1441. end
  1442.  
  1443. def self.wifi(loopTime)
  1444.  
  1445. tcase = TestCase.new("wifi")
  1446.  
  1447. tcase << TestAction.new(:gotoApp_1) do
  1448. gotoApp('Settings')
  1449. end
  1450.  
  1451. tcase << TestAction.new(:TextView_Title_25) do
  1452. $ruiObj = RUIObject.new.with('objectid', 773617948).with('selfid', -2078686330).with('textdescid', 405839511).with('uniqueparentid', 0)
  1453. .with('uitreeindex', 3)
  1454. .with('classname', 'TextView')
  1455. .with('resource-id', 'android:id/title')
  1456. .with('text', 'Networks')
  1457.  
  1458. $ruiObj.click
  1459.  
  1460. waitsecond(1)
  1461. end
  1462.  
  1463. tcase << TestAction.new(:TextView_Title_2) do
  1464. $ruiObj = RUIObject.new.with('objectid', 2008023572).with('selfid', -589731018).with('textdescid', 498664031).with('uniqueparentid', 0).with('classresourceid', 490183159)
  1465. .with('uitreeindex', 9)
  1466. .with('classname', 'TextView')
  1467. .with('resource-id', 'android:id/title')
  1468. .with('text', 'WiFi')
  1469.  
  1470. $ruiObj.click
  1471.  
  1472. waitsecond(1)
  1473. end
  1474.  
  1475. tcase << TestAction.new(:TextView_Title_6_1) do
  1476. $ruiObj = RUIObject.new.with('objectid', 274971481).with('selfid', -71636208).with('textdescid', 341957782).with('uniqueparentid', 0).with('classresourceid', 490183159)
  1477. .with('uitreeindex', 6)
  1478. .with('classname', 'TextView')
  1479. .with('resource-id', 'android:id/title')
  1480. .with('text', 'QCTCOMP')
  1481.  
  1482. $ruiObj.isNotExist
  1483. ifFailJumpTo(:TextView_Title_6)
  1484.  
  1485. waitsecond(1)
  1486. end
  1487.  
  1488. tcase << TestAction.new(:Switch_OFF_2) do
  1489. $ruiObj = RUIObject.new.with('objectid', 1178284996).with('selfid', -533646533).with('textdescid', -1104515187).with('uniqueparentid', 0)
  1490. .with('uitreeindex', 2)
  1491. .with('classname', 'Switch')
  1492. .with('text', 'OFF')
  1493.  
  1494. $ruiObj.click
  1495.  
  1496. waitsecond(2)
  1497. end
  1498.  
  1499. tcase << TestAction.new(:TextView_Title_6) do
  1500. $ruiObj = RUIObject.new.with('objectid', 274971481).with('selfid', -71636208).with('textdescid', 341957782).with('uniqueparentid', 0).with('classresourceid', 490183159)
  1501. .with('uitreeindex', 6)
  1502. .with('classname', 'TextView')
  1503. .with('resource-id', 'android:id/title')
  1504. .with('text', 'QCTCOMP')
  1505.  
  1506. $ruiObj.click
  1507.  
  1508. waitsecond(1)
  1509. end
  1510.  
  1511. tcase << TestAction.new(:EditText_Password_4) do
  1512. $ruiObj = RUIObject.new.with('objectid', -976316462).with('selfid', -2120332491).with('textdescid', -201039218).with('uniqueparentid', 0).with('classresourceid', -714852383)
  1513. .with('uitreeindex', 2)
  1514. .with('classname', 'EditText')
  1515. .with('resource-id', 'com.lge.wifisettings:id/password')
  1516.  
  1517. $ruiObj.inputtext('12abcdef34')
  1518.  
  1519. waitsecond(1)
  1520. end
  1521.  
  1522. tcase << TestAction.new(:Button_Button1_8) do
  1523. $ruiObj = RUIObject.new.with('objectid', 972638584).with('selfid', 736098498).with('textdescid', -870791618).with('uniqueparentid', 0)
  1524. .with('uitreeindex', 7)
  1525. .with('classname', 'Button')
  1526. .with('resource-id', 'android:id/button1')
  1527. .with('text', 'Connect')
  1528.  
  1529. $ruiObj.click
  1530.  
  1531. waitsecond(1)
  1532. end
  1533.  
  1534. tcase << TestAction.new(:pressBack_12) do
  1535. pressBack
  1536. end
  1537.  
  1538. tcase << TestAction.new(:pressBack_13) do
  1539. pressBack
  1540. end
  1541.  
  1542. tcase << TestAction.new(:pressHome_14) do
  1543. pressHome
  1544. end
  1545.  
  1546. tcase.run(loopTime)
  1547.  
  1548. end
  1549.  
  1550. def self.wifiOff(loopTime)
  1551.  
  1552. tcase = TestCase.new("wifiOff")
  1553.  
  1554. tcase << TestAction.new(:gotoApp_1) do
  1555. gotoApp('Settings')
  1556. end
  1557.  
  1558. tcase << TestAction.new(:TextView_Title_21) do
  1559. $ruiObj = RUIObject.new.with('objectid', 773617948).with('selfid', -2078686330).with('textdescid', 405839511).with('uniqueparentid', 0)
  1560. .with('uitreeindex', 3)
  1561. .with('classname', 'TextView')
  1562. .with('resource-id', 'android:id/title')
  1563. .with('text', 'Networks')
  1564.  
  1565. $ruiObj.click
  1566.  
  1567. waitsecond(1)
  1568. end
  1569.  
  1570. tcase << TestAction.new(:TextView_Title_2) do
  1571. $ruiObj = RUIObject.new.with('objectid', 2008023572).with('selfid', -589731018).with('textdescid', 498664031).with('uniqueparentid', 0).with('classresourceid', 490183159)
  1572. .with('uitreeindex', 9)
  1573. .with('classname', 'TextView')
  1574. .with('resource-id', 'android:id/title')
  1575. .with('text', 'WiFi')
  1576.  
  1577. $ruiObj.click
  1578.  
  1579. waitsecond(1)
  1580. end
  1581.  
  1582. tcase << TestAction.new(:TextView_Title_6_1) do
  1583. $ruiObj = RUIObject.new.with('objectid', 274971481).with('selfid', -71636208).with('textdescid', 341957782).with('uniqueparentid', 0).with('classresourceid', 490183159)
  1584. .with('uitreeindex', 6)
  1585. .with('classname', 'TextView')
  1586. .with('resource-id', 'android:id/title')
  1587. .with('text', 'QCTCOMP')
  1588.  
  1589. $ruiObj.isExist
  1590. ifFailJumpTo(:pressBack_12)
  1591.  
  1592. waitsecond(1)
  1593. end
  1594.  
  1595. tcase << TestAction.new(:Switch_ON_4) do
  1596. $ruiObj = RUIObject.new.with('objectid', 1178284996).with('selfid', 1645353587).with('textdescid', -1975291963).with('uniqueparentid', 0)
  1597. .with('uitreeindex', 2)
  1598. .with('classname', 'Switch')
  1599. .with('text', 'ON')
  1600.  
  1601. $ruiObj.click
  1602.  
  1603. waitsecond(1)
  1604. end
  1605.  
  1606. tcase << TestAction.new(:pressBack_12) do
  1607. pressBack
  1608. end
  1609.  
  1610. tcase << TestAction.new(:pressBack_13) do
  1611. pressBack
  1612. end
  1613.  
  1614. tcase << TestAction.new(:pressHome_14) do
  1615. pressHome
  1616. end
  1617.  
  1618. tcase.run(loopTime)
  1619.  
  1620. end
  1621.  
  1622. def self.mainLoop(loopTime)
  1623.  
  1624. WebSocketXServer.setAutoUpdate(false)
  1625.  
  1626. index = $mainResumeMainLoop
  1627. $mainResumeMainLoop = 0
  1628.  
  1629. writelog("mainLoop::#{index}::Resume") if index > 0
  1630.  
  1631. while index < loopTime
  1632.  
  1633. $curMainLoopNum = index
  1634.  
  1635. $actionParamInput = "none"
  1636. startTest 1
  1637.  
  1638. $POWERLOG = true
  1639.  
  1640. $actionParamInput = "none"
  1641. Voice 1
  1642.  
  1643. $actionParamInput = "none"
  1644. Browser 1
  1645.  
  1646. $actionParamInput = "none"
  1647. Youtube 1
  1648.  
  1649. $actionParamInput = "none"
  1650. Voice 1
  1651.  
  1652. $actionParamInput = "none"
  1653. Emails 1
  1654.  
  1655. $actionParamInput = "none"
  1656. Voice 1
  1657.  
  1658. $actionParamInput = "none"
  1659. SMS 1
  1660.  
  1661. $actionParamInput = "none"
  1662. MMS 1
  1663.  
  1664. $actionParamInput = "none"
  1665. Voice 1
  1666.  
  1667. $actionParamInput = "none"
  1668. GPS 1
  1669.  
  1670. $actionParamInput = "none"
  1671. Voice 1
  1672.  
  1673. $actionParamInput = "none"
  1674. Camera 1
  1675.  
  1676. $actionParamInput = "none"
  1677. Video 1
  1678.  
  1679.  
  1680. if rand(100) < 0
  1681.  
  1682. $actionParamInput = "none"
  1683. wifi 1
  1684.  
  1685. end
  1686.  
  1687.  
  1688. $actionParamInput = "none"
  1689. Data 1
  1690.  
  1691. $actionParamInput = "none"
  1692. Browser 1
  1693.  
  1694. $actionParamInput = "none"
  1695. Youtube 1
  1696.  
  1697. $actionParamInput = "none"
  1698. Emails 1
  1699.  
  1700. $actionParamInput = "none"
  1701. SMS 1
  1702.  
  1703. $actionParamInput = "none"
  1704. MMS 1
  1705.  
  1706. $actionParamInput = "none"
  1707. Camera 1
  1708.  
  1709. $actionParamInput = "none"
  1710. Video 1
  1711.  
  1712. $actionParamInput = "none"
  1713. Multimedia 1
  1714.  
  1715. $actionParamInput = "none"
  1716. DataEnd 1
  1717.  
  1718. $actionParamInput = "none"
  1719. Voice 1
  1720.  
  1721. $actionParamInput = "none"
  1722. Data 1
  1723.  
  1724. $actionParamInput = "none"
  1725. Camera 1
  1726.  
  1727. $actionParamInput = "none"
  1728. Video 1
  1729.  
  1730. $actionParamInput = "none"
  1731. Multimedia 1
  1732.  
  1733. $actionParamInput = "none"
  1734. DataEnd 1
  1735.  
  1736.  
  1737. if rand(100) < 0
  1738.  
  1739. $actionParamInput = "none"
  1740. wifiOff 1
  1741.  
  1742. end
  1743.  
  1744.  
  1745. $actionParamInput = "none"
  1746. VoiceRecord 5
  1747.  
  1748.  
  1749. sendStatus("Done::mainLoop::Loop::#{index}")
  1750.  
  1751.  
  1752. writelog("Finish::Loop::#{$curMainLoopNum}")
  1753.  
  1754.  
  1755. saveLogFileToGist if $saveLogToGist
  1756.  
  1757. index += 1
  1758.  
  1759. end
  1760.  
  1761. $engineStatus = "Idle"
  1762. resetStatus
  1763. sendStatus("Finish::mainLoop::END")
  1764.  
  1765. end
  1766.  
  1767. def self.exception_handler
  1768. puts "Module Exception Hanlder..."
  1769. if ($lastPackageName == "ltecall")
  1770. ltecall_ExpHandler(1)
  1771. end
  1772. end
  1773.  
  1774. def self.run(loop)
  1775. mainLoop loop
  1776. end
  1777.  
  1778. end
  1779.  
  1780. $exceptionPackageNameList = []
  1781. $exceptionPackageNameList_exclude = []
  1782. $exceptionPackageNameList << "ltecall"
  1783.  
  1784. def exception_handler
  1785. H1_TNTS_Concurrency.exception_handler
  1786. end
  1787.  
  1788. $curProjectLogFile = $useLastLogFile
  1789.  
  1790. $curProjectLogFile = "H1_TNTS_Concurrency_#{getTimeStamp}.log" if $useLastLogFile.nil?
  1791.  
  1792. $useLastLogFile = nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement