Advertisement
Guest User

Untitled

a guest
Aug 31st, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 154.65 KB | None | 0 0
  1.  
  2. loadTestDB
  3.  
  4. module N3_MTBF
  5.  
  6. def self.MenuNavigation_05_01_09_01(loopTime)
  7.  
  8. tcase = TestCase.new("MenuNavigation_05_01_09_01")
  9.  
  10. tcase << TestAction.new(:pressHome_1) do
  11. pressHome
  12. end
  13.  
  14. tcase << TestAction.new(:scriptAction_off) do
  15. $ignoreDefaultExpHandler = true
  16.  
  17. waitsecond(2)
  18. end
  19.  
  20. tcase << TestAction.new(:scriptAction_StartTestLog) do
  21. logStartTest("05_01_09_01_Menu_Navigation")
  22.  
  23.  
  24. waitsecond(2)
  25. end
  26.  
  27. tcase << TestAction.new(:scriptAction_resetCounter) do
  28. $appCounter = 0
  29.  
  30. waitsecond(2)
  31. end
  32.  
  33. tcase << TestAction.new(:scriptAction_loop) do
  34.  
  35. until $appCounter > 26
  36. $appCounter += 1
  37. gotoApp(db('NavApp')[$appCounter-1])
  38. waitsecond(2)
  39. pressHome
  40. end
  41.  
  42. waitsecond(2)
  43. end
  44.  
  45. tcase << TestAction.new(:scriptAction_StopLogTest) do
  46. if $appCounter == 26
  47. $myTestResult = true
  48. else
  49. $myTestRsult = false
  50. $myFailReason = "Failed"
  51. end
  52. logStopTest("05_01_09_01_Menu_Navigation")
  53.  
  54. waitsecond(2)
  55. end
  56.  
  57. tcase.run(loopTime)
  58.  
  59. end
  60.  
  61. def self.Messaging_05_01_02_03(loopTime)
  62.  
  63. tcase = TestCase.new("Messaging_05_01_02_03")
  64.  
  65. tcase << TestAction.new(:scriptAction_28) do
  66. logStartTest("Messaging_05_01_02_03")
  67. end
  68.  
  69. tcase << TestAction.new(:gotoApp_2) do
  70. gotoApp('Messenger')
  71. end
  72.  
  73. tcase << TestAction.new(:ImageView_StartNewConversationButton_2) do
  74. $ruiObj = RUIObject.new.with('objectid', -274740130).with('selfid', 916878134).with('textdescid', -2118059933).with('uniqueparentid', 0)
  75. .with('uitreeindex', 6)
  76. .with('classname', 'ImageView')
  77. .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
  78. .with('content-desc', 'Start new conversation')
  79.  
  80. $ruiObj.click
  81.  
  82. waitsecond(1)
  83. end
  84.  
  85. tcase << TestAction.new(:MultiAutoCompleteTextView_RecipientTextView_4) do
  86. $ruiObj = RUIObject.new.with('objectid', -1115682772).with('selfid', 1163803387).with('textdescid', -226427532).with('uniqueparentid', 0).with('classresourceid', 461007471)
  87. .with('uitreeindex', 1)
  88. .with('classname', 'MultiAutoCompleteTextView')
  89. .with('resource-id', 'com.google.android.apps.messaging:id/recipient_text_view')
  90.  
  91. $ruiObj.inputtext('A01')
  92.  
  93. waitsecond(1)
  94. end
  95.  
  96. tcase << TestAction.new(:clickXY_315_513_2) do
  97. click(315,513)
  98.  
  99. waitsecond(1)
  100. end
  101.  
  102. tcase << TestAction.new(:EditText_ComposeMessageText_8) do
  103. $ruiObj = RUIObject.new.with('objectid', 1578981159).with('selfid', -1932318364).with('textdescid', 1703775705).with('uniqueparentid', 0)
  104. .with('uitreeindex', 5)
  105. .with('classname', 'EditText')
  106. .with('resource-id', 'com.google.android.apps.messaging:id/compose_message_text')
  107.  
  108. $ruiObj.click
  109.  
  110. waitsecond(1)
  111. end
  112.  
  113. tcase << TestAction.new(:scriptAction_141_1) do
  114. $ruiObj.inputtext('Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzaaaaaaaaaabbbbbbbbbbcccccccccc')
  115.  
  116. waitsecond(1)
  117. end
  118.  
  119. tcase << TestAction.new(:ImageButton_SendMessageButton_17) do
  120. $ruiObj = RUIObject.new.with('objectid', -1329122643).with('selfid', -1857249780).with('textdescid', 1740568962).with('uniqueparentid', 0)
  121. .with('uitreeindex', 9)
  122. .with('classname', 'ImageButton')
  123. .with('resource-id', 'com.google.android.apps.messaging:id/send_message_button')
  124. .with('content-desc', 'Send Message')
  125.  
  126. $ruiObj.click
  127.  
  128. waitsecond(1)
  129. end
  130.  
  131. tcase << TestAction.new(:pressBack_5) do
  132. pressBack
  133. end
  134.  
  135. tcase << TestAction.new(:pressBack_6) do
  136. pressBack
  137. end
  138.  
  139. tcase << TestAction.new(:clickXY_344_384_2) do
  140. click(344,384)
  141.  
  142. waitsecond(1)
  143. end
  144.  
  145. tcase << TestAction.new(:ImageView_More_19) do
  146. $ruiObj = RUIObject.new.with('objectid', -1276401870).with('selfid', 328478669).with('textdescid', -2023409951).with('uniqueparentid', 0)
  147. .with('uitreeindex', 17)
  148. .with('classname', 'ImageView')
  149. .with('content-desc', 'More options')
  150.  
  151. $ruiObj.click
  152.  
  153. waitsecond(1)
  154. end
  155.  
  156. tcase << TestAction.new(:TextView_Title_21) do
  157. $ruiObj = RUIObject.new.with('objectid', -1362741768).with('selfid', 1635205580).with('textdescid', 299180429).with('uniqueparentid', 0).with('classresourceid', -128793897)
  158. .with('uitreeindex', 4)
  159. .with('classname', 'TextView')
  160. .with('resource-id', 'com.google.android.apps.messaging:id/title')
  161. .with('text', 'Delete')
  162.  
  163. $ruiObj.click
  164.  
  165. waitsecond(1)
  166. end
  167.  
  168. tcase << TestAction.new(:Button_Button1_23) do
  169. $ruiObj = RUIObject.new.with('objectid', -49953928).with('selfid', 1012902611).with('textdescid', -2073088243).with('uniqueparentid', 0)
  170. .with('uitreeindex', 2)
  171. .with('classname', 'Button')
  172. .with('resource-id', 'android:id/button1')
  173. .with('text', 'Delete')
  174.  
  175. $ruiObj.click
  176.  
  177. waitsecond(1)
  178. end
  179.  
  180. tcase << TestAction.new(:ImageView_StartNewConversationButton_25) do
  181. $ruiObj = RUIObject.new.with('objectid', -274740130).with('selfid', 916878134).with('textdescid', -2118059933).with('uniqueparentid', 0)
  182. .with('uitreeindex', 6)
  183. .with('classname', 'ImageView')
  184. .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
  185. .with('content-desc', 'Start new conversation')
  186.  
  187. $ruiObj.isExist
  188.  
  189. waitsecond(1)
  190. end
  191.  
  192. tcase << TestAction.new(:scriptAction_30) do
  193. $myTestResult = checkLastExistResult
  194.  
  195. if $myTestResult == false
  196. $myFailReason = "Message not sent"
  197. end
  198. logStopTest("Messaging_05_01_02_03")
  199. end
  200.  
  201. tcase << TestAction.new(:pressBack_53) do
  202. pressBack
  203.  
  204. waitsecond(1)
  205. end
  206.  
  207. tcase << TestAction.new(:pressBack_26) do
  208. pressBack
  209.  
  210. waitsecond(1)
  211. end
  212.  
  213. tcase.run(loopTime)
  214.  
  215. end
  216.  
  217. def self.MultiMedia_05_01_07_01(loopTime)
  218.  
  219. tcase = TestCase.new("MultiMedia_05_01_07_01")
  220.  
  221. tcase << TestAction.new(:scriptAction_1) do
  222. logStartTest("05_01_07_01_MultiMedia")
  223. end
  224.  
  225. tcase << TestAction.new(:gotoApp_1) do
  226. gotoApp('Camera')
  227. end
  228.  
  229. tcase << TestAction.new(:Button_PermissionAllowButton_2) do
  230. $ruiObj = RUIObject.new.with('objectid', 308455030).with('selfid', 1444367499).with('textdescid', -770153727).with('uniqueparentid', 0)
  231. .with('uitreeindex', 3)
  232. .with('classname', 'Button')
  233. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  234. .with('text', 'Allow')
  235.  
  236. $ruiObj.click
  237.  
  238. waitsecond(1)
  239. end
  240.  
  241. tcase << TestAction.new(:Button_ConfirmButton_4) do
  242. $ruiObj = RUIObject.new.with('objectid', -1187921382).with('selfid', -1055162259).with('textdescid', 1673606663).with('uniqueparentid', 0)
  243. .with('uitreeindex', 3)
  244. .with('classname', 'Button')
  245. .with('resource-id', 'com.android.camera2:id/confirm_button')
  246. .with('text', 'NEXT')
  247.  
  248. $ruiObj.click
  249.  
  250. waitsecond(4)
  251. end
  252.  
  253. tcase << TestAction.new(:swipeLeft_2) do
  254. swipe_horizontal_back 50
  255.  
  256. waitsecond(2)
  257. end
  258.  
  259. tcase << TestAction.new(:TextView_SelectorText_4) do
  260. $ruiObj = RUIObject.new.with('objectid', -1418579728).with('selfid', 361169431).with('textdescid', -1051676587).with('uniqueparentid', 0)
  261. .with('uitreeindex', 4)
  262. .with('classname', 'TextView')
  263. .with('resource-id', 'com.android.camera2:id/selector_text')
  264. .with('text', 'Video')
  265.  
  266. $ruiObj.click
  267.  
  268. waitsecond(2)
  269. end
  270.  
  271. tcase << TestAction.new(:ImageView_ShutterButton_11) do
  272. $ruiObj = RUIObject.new.with('objectid', -1444537032).with('selfid', 111453042).with('textdescid', 1162006437).with('uniqueparentid', 0)
  273. .with('uitreeindex', 1)
  274. .with('classname', 'ImageView')
  275. .with('resource-id', 'com.android.camera2:id/shutter_button')
  276. .with('content-desc', 'Shutter')
  277.  
  278. $ruiObj.click
  279.  
  280. waitsecond(2)
  281. end
  282.  
  283. tcase << TestAction.new(:wait30second_14) do
  284. waitsecond(30)
  285. end
  286.  
  287. tcase << TestAction.new(:ImageView_ShutterButton_StopRec) do
  288. $ruiObj = RUIObject.new.with('objectid', -1444537032).with('selfid', 111453042).with('textdescid', 1162006437).with('uniqueparentid', 0)
  289. .with('uitreeindex', 1)
  290. .with('classname', 'ImageView')
  291. .with('resource-id', 'com.android.camera2:id/shutter_button')
  292. .with('content-desc', 'Shutter')
  293.  
  294. $ruiObj.click
  295.  
  296. waitsecond(2)
  297. end
  298.  
  299. tcase << TestAction.new(:swipeRight_3) do
  300. swipe_horizontal 50
  301.  
  302. waitsecond(2)
  303. end
  304.  
  305. tcase << TestAction.new(:ImageView_PlayButton_4) do
  306. $ruiObj = RUIObject.new.with('objectid', -1073029866).with('selfid', 2111760943).with('textdescid', 658172825).with('uniqueparentid', 0)
  307. .with('uitreeindex', 2)
  308. .with('classname', 'ImageView')
  309. .with('resource-id', 'com.android.camera2:id/play_button')
  310. .with('content-desc', 'Play Video')
  311.  
  312. $ruiObj.isExist
  313.  
  314. waitsecond(2)
  315. end
  316.  
  317. tcase << TestAction.new(:scriptAction_5) do
  318. $myTestResult = checkLastExistResult
  319.  
  320. if $myTestResult == false
  321. $myFailReason == "Video does not exist"
  322. end
  323. logStopTest("05_01_07_01_MultiMedia")
  324. end
  325.  
  326. tcase << TestAction.new(:pressBack_6) do
  327. pressBack
  328. end
  329.  
  330. tcase << TestAction.new(:pressBack_7) do
  331. pressBack
  332. end
  333.  
  334. tcase << TestAction.new(:pressHome_8) do
  335. pressHome
  336. end
  337.  
  338. tcase.run(loopTime)
  339.  
  340. end
  341.  
  342. def self.MultiMedia_05_01_07_02(loopTime)
  343.  
  344. tcase = TestCase.new("MultiMedia_05_01_07_02")
  345.  
  346. tcase << TestAction.new(:scriptAction_1) do
  347. logStartTest("05_01_07_02_MultiMedia")
  348. end
  349.  
  350. tcase << TestAction.new(:gotoApp_1) do
  351. gotoApp('Camera')
  352.  
  353. waitsecond(2)
  354. end
  355.  
  356. tcase << TestAction.new(:swipeRight_1) do
  357. swipe_horizontal 50
  358.  
  359. waitsecond(2)
  360. end
  361.  
  362. tcase << TestAction.new(:ImageView_PlayButton_3) do
  363. $ruiObj = RUIObject.new.with('objectid', -1073029866).with('selfid', 2111760943).with('textdescid', 658172825).with('uniqueparentid', 0)
  364. .with('uitreeindex', 2)
  365. .with('classname', 'ImageView')
  366. .with('resource-id', 'com.android.camera2:id/play_button')
  367. .with('content-desc', 'Play Video')
  368.  
  369. $ruiObj.click
  370.  
  371. waitsecond(2)
  372. end
  373.  
  374. tcase << TestAction.new(:wait32second_4) do
  375. waitsecond(32)
  376. end
  377.  
  378. tcase << TestAction.new(:clickXY_789_1272_4) do
  379. click(789,1272)
  380.  
  381. waitsecond(1)
  382. end
  383.  
  384. tcase << TestAction.new(:ImageButton_PhotosVideoplayerPauseButton_6) do
  385. $ruiObj = RUIObject.new.with('objectid', -587577221).with('selfid', -1751474194).with('textdescid', -1872164212).with('uniqueparentid', 0)
  386. .with('uitreeindex', 1)
  387. .with('classname', 'ImageButton')
  388. .with('resource-id', 'com.google.android.apps.photos:id/photos_videoplayer_pause_button')
  389. .with('content-desc', 'Pause video')
  390.  
  391. $ruiObj.isExist
  392.  
  393. waitsecond(1)
  394. end
  395.  
  396. tcase << TestAction.new(:scriptAction_7) do
  397. $myTestResult = checkLastExistResult
  398.  
  399. if $myTestResult == false
  400. $myFailReason == "Video did not play successfuly"
  401. end
  402. logStopTest("05_01_07_02_MultiMedia")
  403. end
  404.  
  405. tcase << TestAction.new(:pressBack_8) do
  406. pressBack
  407. end
  408.  
  409. tcase << TestAction.new(:pressBack_9) do
  410. pressBack
  411. end
  412.  
  413. tcase << TestAction.new(:pressHome_10) do
  414. pressHome
  415. end
  416.  
  417. tcase.run(loopTime)
  418.  
  419. end
  420.  
  421. def self.MultiMedia_05_01_07_03(loopTime)
  422.  
  423. tcase = TestCase.new("MultiMedia_05_01_07_03")
  424.  
  425. tcase << TestAction.new(:scriptAction_1) do
  426. logStartTest("05_01_07_03_MultiMedia")
  427. end
  428.  
  429. tcase << TestAction.new(:gotoApp_1) do
  430. gotoApp('Camera')
  431.  
  432. waitsecond(2)
  433. end
  434.  
  435. tcase << TestAction.new(:swipeRight_1) do
  436. swipe_horizontal 50
  437.  
  438. waitsecond(2)
  439. end
  440.  
  441. tcase << TestAction.new(:ImageButton_FilmstripBottomControlDelete_2) do
  442. $ruiObj = RUIObject.new.with('objectid', -412917821).with('selfid', 1499646221).with('textdescid', -903038264).with('uniqueparentid', 0)
  443. .with('uitreeindex', 5)
  444. .with('classname', 'ImageButton')
  445. .with('resource-id', 'com.android.camera2:id/filmstrip_bottom_control_delete')
  446. .with('content-desc', 'Delete')
  447.  
  448. $ruiObj.isExist
  449.  
  450. waitsecond(1)
  451. end
  452.  
  453. tcase << TestAction.new(:ImageButton_FilmstripBottomControlDelete_3) do
  454. $ruiObj = RUIObject.new.with('objectid', -412917821).with('selfid', 1499646221).with('textdescid', -903038264).with('uniqueparentid', 0)
  455. .with('uitreeindex', 5)
  456. .with('classname', 'ImageButton')
  457. .with('resource-id', 'com.android.camera2:id/filmstrip_bottom_control_delete')
  458. .with('content-desc', 'Delete')
  459.  
  460. $ruiObj.click
  461.  
  462. waitsecond(1)
  463. end
  464.  
  465. tcase << TestAction.new(:scriptAction_4) do
  466. $myTestResult = checkLastExistResult
  467.  
  468. if $myTestResult == false
  469. $myFailReason == "Video fail to delete"
  470. end
  471. logStopTest("05_01_07_03_MultiMedia")
  472. end
  473.  
  474. tcase << TestAction.new(:pressBack_5) do
  475. pressBack
  476. end
  477.  
  478. tcase << TestAction.new(:pressBack_6) do
  479. pressBack
  480. end
  481.  
  482. tcase << TestAction.new(:pressHome_7) do
  483. pressHome
  484. end
  485.  
  486. tcase.run(loopTime)
  487.  
  488. end
  489.  
  490. def self.MultiMedia_05_01_07_04(loopTime)
  491.  
  492. tcase = TestCase.new("MultiMedia_05_01_07_04")
  493.  
  494. tcase << TestAction.new(:scriptAction_1) do
  495. logStartTest("05_01_07_04_MultiMedia")
  496. end
  497.  
  498. tcase << TestAction.new(:gotoApp_1) do
  499. gotoApp('Camera')
  500. end
  501.  
  502. tcase << TestAction.new(:swipeLeft_1) do
  503. swipe_horizontal_back 50
  504.  
  505. waitsecond(1)
  506. end
  507.  
  508. tcase << TestAction.new(:TextView_SelectorText_Camera) do
  509. $ruiObj = RUIObject.new.with('objectid', -1418579728).with('selfid', 2055244041).with('textdescid', 1854346827).with('uniqueparentid', 0)
  510. .with('uitreeindex', 3)
  511. .with('classname', 'TextView')
  512. .with('resource-id', 'com.android.camera2:id/selector_text')
  513. .with('text', 'Camera')
  514.  
  515. $ruiObj.click
  516.  
  517. waitsecond(1)
  518. end
  519.  
  520. tcase << TestAction.new(:ImageView_ShutterButton_4) do
  521. $ruiObj = RUIObject.new.with('objectid', -1444537032).with('selfid', 111453042).with('textdescid', 1162006437).with('uniqueparentid', 0)
  522. .with('uitreeindex', 1)
  523. .with('classname', 'ImageView')
  524. .with('resource-id', 'com.android.camera2:id/shutter_button')
  525. .with('content-desc', 'Shutter')
  526.  
  527. $ruiObj.click
  528.  
  529. waitsecond(1)
  530. end
  531.  
  532. tcase << TestAction.new(:swipeRight_8) do
  533. swipe_horizontal 50
  534.  
  535. waitsecond(1)
  536. end
  537.  
  538. tcase << TestAction.new(:ImageButton_FilmstripBottomControlDelete_2) do
  539. $ruiObj = RUIObject.new.with('objectid', -412917821).with('selfid', 1499646221).with('textdescid', -903038264).with('uniqueparentid', 0)
  540. .with('uitreeindex', 4)
  541. .with('classname', 'ImageButton')
  542. .with('resource-id', 'com.android.camera2:id/filmstrip_bottom_control_delete')
  543. .with('content-desc', 'Delete')
  544.  
  545. $ruiObj.isExist
  546.  
  547. waitsecond(1)
  548. end
  549.  
  550. tcase << TestAction.new(:scriptAction_10) do
  551. $myTestResult = checkLastExistResult
  552.  
  553. if $myTestResult == false
  554. $myFailReason == "Take picture FAILED"
  555. end
  556. logStopTest("05_01_07_04_MultiMedia")
  557. end
  558.  
  559. tcase << TestAction.new(:pressBack_11) do
  560. pressBack
  561. end
  562.  
  563. tcase << TestAction.new(:pressBack_12) do
  564. pressBack
  565. end
  566.  
  567. tcase << TestAction.new(:pressHome_13) do
  568. pressHome
  569. end
  570.  
  571. tcase.run(loopTime)
  572.  
  573. end
  574.  
  575. def self.MultiMedia_05_01_07_05(loopTime)
  576.  
  577. tcase = TestCase.new("MultiMedia_05_01_07_05")
  578.  
  579. tcase << TestAction.new(:scriptAction_1) do
  580. logStartTest("05_01_07_05_MultiMedia")
  581. end
  582.  
  583. tcase << TestAction.new(:gotoApp_1) do
  584. gotoApp('Camera')
  585. end
  586.  
  587. tcase << TestAction.new(:swipeRight_4) do
  588. swipe_horizontal 50
  589.  
  590. waitsecond(1)
  591. end
  592.  
  593. tcase << TestAction.new(:ImageButton_FilmstripBottomControlDelete_2) do
  594. $ruiObj = RUIObject.new.with('objectid', -412917821).with('selfid', 1499646221).with('textdescid', -903038264).with('uniqueparentid', 0)
  595. .with('uitreeindex', 4)
  596. .with('classname', 'ImageButton')
  597. .with('resource-id', 'com.android.camera2:id/filmstrip_bottom_control_delete')
  598. .with('content-desc', 'Delete')
  599.  
  600. $ruiObj.isExist
  601.  
  602. waitsecond(1)
  603. end
  604.  
  605. tcase << TestAction.new(:scriptAction_8) do
  606. $myTestResult = checkLastExistResult
  607.  
  608. if $myTestResult == false
  609. $myFailReason == "Picutre not open"
  610. end
  611. logStopTest("05_01_07_05_MultiMedia")
  612. end
  613.  
  614. tcase << TestAction.new(:pressBack_9) do
  615. pressBack
  616. end
  617.  
  618. tcase << TestAction.new(:pressBack_10) do
  619. pressBack
  620. end
  621.  
  622. tcase << TestAction.new(:pressHome_11) do
  623. pressHome
  624. end
  625.  
  626. tcase.run(loopTime)
  627.  
  628. end
  629.  
  630. def self.MultiMedia_05_01_07_06(loopTime)
  631.  
  632. tcase = TestCase.new("MultiMedia_05_01_07_06")
  633.  
  634. tcase << TestAction.new(:scriptAction_1) do
  635. logStartTest("05_01_07_06_MultiMedia")
  636. end
  637.  
  638. tcase << TestAction.new(:gotoApp_1) do
  639. gotoApp('Camera')
  640.  
  641. waitsecond(2)
  642. end
  643.  
  644. tcase << TestAction.new(:swipeRight_4) do
  645. swipe_horizontal 50
  646.  
  647. waitsecond(1)
  648. end
  649.  
  650. tcase << TestAction.new(:ImageButton_FilmstripBottomControlDelete_2) do
  651. $ruiObj = RUIObject.new.with('objectid', -412917821).with('selfid', 1499646221).with('textdescid', -903038264).with('uniqueparentid', 0)
  652. .with('uitreeindex', 5)
  653. .with('classname', 'ImageButton')
  654. .with('resource-id', 'com.android.camera2:id/filmstrip_bottom_control_delete')
  655. .with('content-desc', 'Delete')
  656.  
  657. $ruiObj.click
  658.  
  659. waitsecond(1)
  660. end
  661.  
  662. tcase << TestAction.new(:TextView_CameraUndoDeletionButton_4) do
  663. $ruiObj = RUIObject.new.with('objectid', -1457329828).with('selfid', 350673501).with('textdescid', -1850027016).with('uniqueparentid', 0)
  664. .with('uitreeindex', 4)
  665. .with('classname', 'TextView')
  666. .with('resource-id', 'com.android.camera2:id/camera_undo_deletion_button')
  667. .with('text', 'UNDO')
  668.  
  669. $ruiObj.isExist
  670.  
  671. waitsecond(1)
  672. end
  673.  
  674. tcase << TestAction.new(:scriptAction_5) do
  675. $myTestResult = checkLastExistResult
  676.  
  677. if $myTestResult == false
  678. $myFailReason == "Picture is not found"
  679. end
  680. logStopTest("05_01_07_06_MultiMedia")
  681. end
  682.  
  683. tcase << TestAction.new(:pressBack_6) do
  684. pressBack
  685. end
  686.  
  687. tcase << TestAction.new(:pressBack_7) do
  688. pressBack
  689. end
  690.  
  691. tcase << TestAction.new(:pressHome_8) do
  692. pressHome
  693. end
  694.  
  695. tcase.run(loopTime)
  696.  
  697. end
  698.  
  699. def self.MultiMedia_05_01_07_10(loopTime)
  700.  
  701. tcase = TestCase.new("MultiMedia_05_01_07_10")
  702.  
  703. tcase << TestAction.new(:scriptAction_1) do
  704. logStartTest("05_01_07_10_MultiMedia")
  705. end
  706.  
  707. tcase << TestAction.new(:gotoApp_1) do
  708. gotoApp('YouTube')
  709.  
  710. waitsecond(4)
  711. end
  712.  
  713. tcase << TestAction.new(:ImageView_Thumbnail_3) do
  714. $ruiObj = RUIObject.new.with('objectid', 875683821).with('selfid', -2120336906).with('textdescid', 1376394707).with('uniqueparentid', 0)
  715. .with('uitreeindex', 10)
  716. .with('pretext', 'WATCH MORE')
  717. .with('classname', 'ImageView')
  718. .with('resource-id', 'com.google.android.youtube:id/thumbnail')
  719.  
  720. $ruiObj.select('Similiar').click
  721. end
  722.  
  723. tcase << TestAction.new(:wait10second_3) do
  724. waitsecond(10)
  725. end
  726.  
  727. tcase << TestAction.new(:TextView_SubscribeText_7) do
  728. $ruiObj = RUIObject.new.with('objectid', -1804126143).with('selfid', 636792720).with('textdescid', -1109859643).with('uniqueparentid', -309765969).with('classresourceid', -1336578208)
  729. .with('uitreeindex', 9)
  730. .with('classname', 'TextView')
  731. .with('resource-id', 'com.google.android.youtube:id/subscribe_text')
  732. .with('content-desc', 'Subscribe to this channel')
  733. .with('text', 'Subscribe')
  734.  
  735. $ruiObj.isExist
  736. end
  737.  
  738. tcase << TestAction.new(:scriptAction_9) do
  739. $myTestResult = checkLastExistResult
  740.  
  741. if $myTestResult == false
  742. $myFailReason == "Video Streaming does not work"
  743. end
  744. logStopTest("05_01_07_10_MultiMedia")
  745. end
  746.  
  747. tcase << TestAction.new(:pressBack_10) do
  748. pressBack
  749. end
  750.  
  751. tcase << TestAction.new(:pressBack_11) do
  752. pressBack
  753. end
  754.  
  755. tcase << TestAction.new(:pressHome_12) do
  756. pressHome
  757. end
  758.  
  759. tcase.run(loopTime)
  760.  
  761. end
  762.  
  763. def self.MultiTasking_05_01_08_01(loopTime)
  764.  
  765. tcase = TestCase.new("MultiTasking_05_01_08_01")
  766.  
  767. tcase << TestAction.new(:scriptAction_StartTest) do
  768. logStartTest("05_01_08_01_MultiTasking")
  769. end
  770.  
  771. tcase << TestAction.new(:gotoApp_1_1) do
  772. gotoApp('Contacts')
  773. end
  774.  
  775. tcase << TestAction.new(:TextView_MenuSearch_2) do
  776. $ruiObj = RUIObject.new.with('objectid', 1659045365).with('selfid', -439570021).with('textdescid', 660324755).with('uniqueparentid', 0)
  777. .with('uitreeindex', 1)
  778. .with('classname', 'TextView')
  779. .with('resource-id', 'com.android.contacts:id/menu_search')
  780. .with('content-desc', 'Search')
  781.  
  782. $ruiObj.click
  783.  
  784. waitsecond(1)
  785. end
  786.  
  787. tcase << TestAction.new(:EditText_SearchView_3_1) do
  788. $ruiObj = RUIObject.new.with('objectid', 255377705).with('selfid', -247474260).with('textdescid', -673225705).with('uniqueparentid', 0)
  789. .with('uitreeindex', 1)
  790. .with('classname', 'EditText')
  791. .with('resource-id', 'com.android.contacts:id/search_view')
  792.  
  793. $ruiObj.inputtext('A01 a01')
  794.  
  795. waitsecond(1)
  796. end
  797.  
  798. tcase << TestAction.new(:TextView_ClivNameTextview_8_1) do
  799. $ruiObj = RUIObject.new.with('objectid', -1210856875).with('selfid', 1607638428).with('textdescid', -1633378553).with('uniqueparentid', 0).with('classresourceid', -744251330)
  800. .with('uitreeindex', 9)
  801. .with('classname', 'TextView')
  802. .with('resource-id', 'com.android.contacts:id/cliv_name_textview')
  803. .with('text', 'A01 a01')
  804.  
  805. $ruiObj.click
  806.  
  807. waitsecond(1)
  808. end
  809.  
  810. tcase << TestAction.new(:ImageView_Icon_2) do
  811. $ruiObj = RUIObject.new.with('objectid', -293488011).with('selfid', -864261134).with('textdescid', -508193717).with('uniqueparentid', 0).with('classresourceid', -619883284)
  812. .with('uitreeindex', 4)
  813. .with('classname', 'ImageView')
  814. .with('resource-id', 'com.android.contacts:id/icon')
  815.  
  816. $ruiObj.select('Similiar').click
  817.  
  818. waitsecond(1)
  819. end
  820.  
  821. tcase << TestAction.new(:wait8second_31) do
  822. waitsecond(8)
  823. end
  824.  
  825. tcase << TestAction.new(:scriptAction_BTAnswerCall) do
  826. sendBTCmd('answerCall')
  827.  
  828. waitsecond(4)
  829. end
  830.  
  831. tcase << TestAction.new(:scriptAction_LogStopTest) do
  832. $myTestResult = checkLastBTCmdResult
  833. if $myTestResult == false
  834. $myFailReason = "Call not come to other dev"
  835. end
  836. logStopTest("05_01_08_01_MultiTasking")
  837.  
  838. end
  839.  
  840. tcase.run(loopTime)
  841.  
  842. end
  843.  
  844. def self.MultiTasking_05_01_08_02(loopTime)
  845.  
  846. tcase = TestCase.new("MultiTasking_05_01_08_02")
  847.  
  848. tcase << TestAction.new(:scriptAction_StartTestLog) do
  849. logStartTest("05_01_08_02_MultiTasking")
  850. end
  851.  
  852. tcase << TestAction.new(:gotoApp_1_1) do
  853. gotoApp('Contacts')
  854.  
  855. waitsecond(2)
  856. end
  857.  
  858. tcase << TestAction.new(:gotoApp_1_2) do
  859. gotoApp('Messenger')
  860.  
  861. waitsecond(2)
  862. end
  863.  
  864. tcase << TestAction.new(:gotoApp_1_3) do
  865. gotoApp('Phone')
  866.  
  867. waitsecond(2)
  868. end
  869.  
  870. tcase << TestAction.new(:gotoApp_1_4) do
  871. gotoApp('Play Store')
  872.  
  873. waitsecond(2)
  874. end
  875.  
  876. tcase << TestAction.new(:gotoApp_2) do
  877. gotoApp('Camera')
  878.  
  879. waitsecond(2)
  880. end
  881.  
  882. tcase << TestAction.new(:gotoApp_1_5_1) do
  883. gotoApp('Chrome')
  884.  
  885. waitsecond(2)
  886. end
  887.  
  888. tcase << TestAction.new(:ImageButton_DocumentMenuButton_5) do
  889. $ruiObj = RUIObject.new.with('objectid', -1808270022).with('selfid', -336731118).with('textdescid', -1833889831).with('uniqueparentid', 0)
  890. .with('uitreeindex', 3)
  891. .with('classname', 'ImageButton')
  892. .with('resource-id', 'com.android.chrome:id/document_menu_button')
  893. .with('content-desc', 'More options')
  894.  
  895. $ruiObj.isExist
  896.  
  897. waitsecond(1)
  898. end
  899.  
  900. tcase << TestAction.new(:scriptAction_LogStopTest) do
  901. $myTestResult = checkLastExistResult
  902. if $myTestResult == false
  903. $myFailReason = "Apps not loaded"
  904. end
  905. logStopTest("05_01_08_02_MultiTasking")
  906. end
  907.  
  908. tcase << TestAction.new(:pressBack_6) do
  909. pressBack
  910. end
  911.  
  912. tcase << TestAction.new(:pressBack_7) do
  913. pressBack
  914. end
  915.  
  916. tcase.run(loopTime)
  917.  
  918. end
  919.  
  920. def self.MultiTasking_05_01_08_03(loopTime)
  921.  
  922. tcase = TestCase.new("MultiTasking_05_01_08_03")
  923.  
  924. tcase << TestAction.new(:scriptAction_StartTestLog) do
  925. logStartTest("05_01_08_03_MultiTasking")
  926. end
  927.  
  928. tcase << TestAction.new(:gotoApp_1_1) do
  929. gotoApp('Phone')
  930. end
  931.  
  932. tcase << TestAction.new(:TextView_Text_12) do
  933. $ruiObj = RUIObject.new.with('objectid', 277925862).with('selfid', 938939901).with('textdescid', -793529845).with('uniqueparentid', 0).with('classresourceid', -526721384)
  934. .with('uitreeindex', 3)
  935. .with('classname', 'TextView')
  936. .with('resource-id', 'com.android.dialer:id/text')
  937. .with('text', 'Return to call in progress')
  938.  
  939. $ruiObj.click
  940.  
  941. waitsecond(1)
  942. end
  943.  
  944. tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_13) do
  945. $ruiObj = RUIObject.new.with('objectid', 1693952669).with('selfid', 1448123190).with('textdescid', 751911782).with('uniqueparentid', 0)
  946. .with('uitreeindex', 10)
  947. .with('pretext', '0352')
  948. .with('classname', 'ImageButton')
  949. .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
  950. .with('content-desc', 'End Call')
  951.  
  952. $ruiObj.isExist
  953.  
  954. waitsecond(1)
  955. end
  956.  
  957. tcase << TestAction.new(:scriptAction_LogStopTest) do
  958. $myTestResult = checkLastExistResult
  959.  
  960. if $myTestResult == false
  961. $myFailReason = "End button not found"
  962. end
  963. logStopTest("05_01_08_03_MultiTasking")
  964. end
  965.  
  966. tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_18) do
  967. $ruiObj = RUIObject.new.with('objectid', 1693952669).with('selfid', 1448123190).with('textdescid', 751911782).with('uniqueparentid', 0)
  968. .with('uitreeindex', 10)
  969. .with('classname', 'ImageButton')
  970. .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
  971. .with('content-desc', 'End Call')
  972.  
  973. $ruiObj.click
  974.  
  975. waitsecond(1)
  976. end
  977.  
  978. tcase << TestAction.new(:pressHome_20) do
  979. pressHome
  980. end
  981.  
  982. tcase.run(loopTime)
  983.  
  984. end
  985.  
  986. def self.MultiTasking_05_01_08_04(loopTime)
  987.  
  988. tcase = TestCase.new("MultiTasking_05_01_08_04")
  989.  
  990. tcase << TestAction.new(:scriptAction_StartTestLog) do
  991. logStartTest("05_01_08_04_MultiTasking")
  992. end
  993.  
  994. tcase << TestAction.new(:gotoApp_1_1) do
  995. gotoApp('Chrome')
  996. end
  997.  
  998. tcase << TestAction.new(:Button_TermsAccept_5) do
  999. $ruiObj = RUIObject.new.with('objectid', 1131623741).with('selfid', 659232449).with('textdescid', -1120600562).with('uniqueparentid', 0)
  1000. .with('uitreeindex', 4)
  1001. .with('classname', 'Button')
  1002. .with('resource-id', 'com.android.chrome:id/terms_accept')
  1003. .with('text', 'Accept continue')
  1004.  
  1005. $ruiObj.click
  1006. end
  1007.  
  1008. tcase << TestAction.new(:Button_PositiveButton_6) do
  1009. $ruiObj = RUIObject.new.with('objectid', -1302979962).with('selfid', 780691289).with('textdescid', 1735628115).with('uniqueparentid', 0)
  1010. .with('uitreeindex', 5)
  1011. .with('classname', 'Button')
  1012. .with('resource-id', 'com.android.chrome:id/positive_button')
  1013. .with('text', 'Next')
  1014.  
  1015. $ruiObj.click
  1016. end
  1017.  
  1018. tcase << TestAction.new(:Button_PositiveButton_7) do
  1019. $ruiObj = RUIObject.new.with('objectid', -953817212).with('selfid', 780402664).with('textdescid', 1478534434).with('uniqueparentid', 0)
  1020. .with('uitreeindex', 7)
  1021. .with('classname', 'Button')
  1022. .with('resource-id', 'com.android.chrome:id/positive_button')
  1023. .with('text', 'Done')
  1024.  
  1025. $ruiObj.click
  1026. end
  1027.  
  1028. tcase << TestAction.new(:EditText_UrlBar_8) do
  1029. $ruiObj = RUIObject.new.with('objectid', 882195433).with('selfid', 613381324).with('textdescid', 1578254679).with('uniqueparentid', 0)
  1030. .with('uitreeindex', 7)
  1031. .with('classname', 'EditText')
  1032. .with('resource-id', 'com.android.chrome:id/url_bar')
  1033.  
  1034. $ruiObj.inputtext('www.att.com')
  1035.  
  1036. waitsecond(1)
  1037. end
  1038.  
  1039. tcase << TestAction.new(:pressEnter_5_1) do
  1040. pressEnter
  1041.  
  1042. waitsecond(4)
  1043. end
  1044.  
  1045. tcase << TestAction.new(:wait2second_2) do
  1046. waitsecond(2)
  1047. end
  1048.  
  1049. tcase << TestAction.new(:scriptAction_LogStopTest) do
  1050. $reload = RUIObject.new.with('objectid', -1485276626).with('selfid', 131798869).with('textdescid', -1148751605).with('uniqueparentid', -932380963)
  1051. .with('uitreeindex', 1)
  1052. .with('classname', 'Button')
  1053. .with('content-desc', 'RELOAD').exists?
  1054.  
  1055. $progressBar = RUIObject.new.with('objectid', 460148827).with('selfid', -703099949).with('textdescid', 1379711781).with('uniqueparentid', 0)
  1056. .with('uitreeindex', 4)
  1057. .with('pretext', 'Block')
  1058. .with('classname', 'ProgressBar')
  1059. .with('resource-id', 'com.android.chrome:id/progress').exists?
  1060.  
  1061. if ($progressBar or $reload) == true
  1062. $myTestResult = false
  1063. else
  1064. $myTestResult = true
  1065. end
  1066. if $myTestResult == false
  1067. $myFailReason = "Browser is not starting"
  1068. end
  1069. logStopTest("05_01_08_04_MultiTasking")
  1070. end
  1071.  
  1072. tcase << TestAction.new(:pressHome_1) do
  1073. pressHome
  1074. end
  1075.  
  1076. tcase.run(loopTime)
  1077.  
  1078. end
  1079.  
  1080. def self.MultiTasking_05_01_08_05(loopTime)
  1081.  
  1082. tcase = TestCase.new("MultiTasking_05_01_08_05")
  1083.  
  1084. tcase << TestAction.new(:scriptAction_StartTestLog) do
  1085. logStartTest("05_01_08_05_MultiTasking")
  1086. end
  1087.  
  1088. tcase << TestAction.new(:gotoApp_1_1) do
  1089. gotoApp('Contacts')
  1090.  
  1091. waitsecond(2)
  1092. end
  1093.  
  1094. tcase << TestAction.new(:gotoApp_1_2) do
  1095. gotoApp('Messenger')
  1096.  
  1097. waitsecond(2)
  1098. end
  1099.  
  1100. tcase << TestAction.new(:gotoApp_1_3) do
  1101. gotoApp('Phone')
  1102.  
  1103. waitsecond(2)
  1104. end
  1105.  
  1106. tcase << TestAction.new(:gotoApp_1_4) do
  1107. gotoApp('Play Store')
  1108.  
  1109. waitsecond(2)
  1110. end
  1111.  
  1112. tcase << TestAction.new(:gotoApp_2) do
  1113. gotoApp('Camera')
  1114.  
  1115. waitsecond(2)
  1116. end
  1117.  
  1118. tcase << TestAction.new(:gotoApp_1_5) do
  1119. gotoApp('Chrome')
  1120.  
  1121. waitsecond(2)
  1122. end
  1123.  
  1124. tcase << TestAction.new(:ImageButton_DocumentMenuButton_2) do
  1125. $ruiObj = RUIObject.new.with('objectid', -1808270022).with('selfid', -336731118).with('textdescid', -1833889831).with('uniqueparentid', 0)
  1126. .with('uitreeindex', 3)
  1127. .with('classname', 'ImageButton')
  1128. .with('resource-id', 'com.android.chrome:id/document_menu_button')
  1129. .with('content-desc', 'More options')
  1130.  
  1131. $ruiObj.isExist
  1132.  
  1133. waitsecond(1)
  1134. end
  1135.  
  1136. tcase << TestAction.new(:scriptAction_LogStopTest) do
  1137. $myTestResult = checkLastExistResult
  1138. if $myTestResult == false
  1139. $myFailReason = "End button not found"
  1140. end
  1141. logStopTest("05_01_08_05_MultiTasking")
  1142. end
  1143.  
  1144. tcase << TestAction.new(:pressBack_3) do
  1145. pressBack
  1146. end
  1147.  
  1148. tcase << TestAction.new(:pressBack_4) do
  1149. pressBack
  1150. end
  1151.  
  1152. tcase.run(loopTime)
  1153.  
  1154. end
  1155.  
  1156. def self.MultiTasking_05_01_08_06(loopTime)
  1157.  
  1158. tcase = TestCase.new("MultiTasking_05_01_08_06")
  1159.  
  1160. tcase << TestAction.new(:scriptAction_StartTestLog) do
  1161. logStartTest("05_01_08_06_MultiTasking")
  1162. end
  1163.  
  1164. tcase << TestAction.new(:gotoApp_1_1) do
  1165. gotoApp('Chrome')
  1166. end
  1167.  
  1168. tcase << TestAction.new(:ImageButton_DocumentMenuButton_2) do
  1169. $ruiObj = RUIObject.new.with('objectid', -1808270022).with('selfid', -336731118).with('textdescid', -1833889831).with('uniqueparentid', 0)
  1170. .with('uitreeindex', 3)
  1171. .with('classname', 'ImageButton')
  1172. .with('resource-id', 'com.android.chrome:id/document_menu_button')
  1173. .with('content-desc', 'More options')
  1174.  
  1175. $ruiObj.isExist
  1176.  
  1177. waitsecond(1)
  1178. end
  1179.  
  1180. tcase << TestAction.new(:scriptAction_LogStopTest) do
  1181. $myTestResult = checkLastExistResult
  1182.  
  1183. if $myTestResult == false
  1184. $myFailReason = "End button not found"
  1185. end
  1186. logStopTest("05_01_08_06_MultiTasking")
  1187. end
  1188.  
  1189. tcase << TestAction.new(:pressHome_1) do
  1190. pressHome
  1191. end
  1192.  
  1193. tcase.run(loopTime)
  1194.  
  1195. end
  1196.  
  1197. def self.mainLoop(loopTime)
  1198.  
  1199. $gistToken = "2dd76a146387a5d2d6aebd2baa4f89a7f0f27664"
  1200.  
  1201. WebSocketXServer.setAutoUpdate(false)
  1202.  
  1203. index = $mainResumeMainLoop
  1204. $mainResumeMainLoop = 0
  1205.  
  1206. writelog("mainLoop::#{index}::Resume") if index > 0
  1207.  
  1208. while index < loopTime
  1209.  
  1210. $curMainLoopNum = index
  1211.  
  1212. $saveLogToGist = true
  1213.  
  1214. $actionParamInput = "none"
  1215. Telephony_05_01_01_01 80
  1216.  
  1217. $actionParamInput = "none"
  1218. Telephony_05_01_01_03 80
  1219.  
  1220. $actionParamInput = "none"
  1221. Telephony_05_01_01_05 100
  1222.  
  1223. $actionParamInput = "none"
  1224. Telephony_05_01_01_07 20
  1225.  
  1226. $actionParamInput = "none"
  1227. Telephony_05_01_01_06 20
  1228.  
  1229.  
  1230. if rand(100) < 0
  1231.  
  1232. for mode in db('ModemMode')
  1233. puts "Change to #{mode}"
  1234. if mode == 'LTE'
  1235. writelog("Messaging_05_01_02_03_LTE")
  1236. change_LTE 1
  1237. Messaging_05_01_02_03 30
  1238. elsif mode == '3G'
  1239. writelog("Messaging_05_01_02_03_3G")
  1240. change_3G 1
  1241. Messaging_05_01_02_03 20
  1242. end
  1243.  
  1244. end
  1245.  
  1246. end
  1247.  
  1248.  
  1249. $actionParamInput = "none"
  1250. Messaging_05_01_02_03 50
  1251.  
  1252.  
  1253. if rand(100) < 0
  1254.  
  1255. for mode in db('ModemMode')
  1256. puts "Change to #{mode}"
  1257. if mode == 'LTE'
  1258. writelog("Messaging_05_01_02_05_LTE")
  1259. change_LTE 1
  1260. Messaging_05_01_02_05 30
  1261. elsif mode == '3G'
  1262. writelog("Messaging_05_01_02_05_3G")
  1263. change_3G 1
  1264. Messaging_05_01_02_05 20
  1265. end
  1266.  
  1267. end
  1268.  
  1269. end
  1270.  
  1271.  
  1272. $actionParamInput = "none"
  1273. Messaging_05_01_02_05 50
  1274.  
  1275.  
  1276. if rand(100) < 0
  1277.  
  1278. for mode in db('ModemMode')
  1279. puts "Change to #{mode}"
  1280. if mode == 'LTE'
  1281. writelog("Messaging_05_01_02_06_LTE")
  1282. change_LTE 1
  1283. Messaging_05_01_02_06 30
  1284. elsif mode == '3G'
  1285. writelog("Messaging_05_01_02_06_3G")
  1286. change_3G 1
  1287. Messaging_05_01_02_06 20
  1288. end
  1289.  
  1290. end
  1291.  
  1292. end
  1293.  
  1294.  
  1295. $actionParamInput = "none"
  1296. Messaging_05_01_02_06 50
  1297.  
  1298.  
  1299. if rand(100) < 0
  1300.  
  1301. for mode in db('ModemMode')
  1302. puts "Change to #{mode}"
  1303. if mode == 'LTE'
  1304. writelog("Email_05_01_03_01_LTE")
  1305. change_LTE 1
  1306. Email_05_01_03_01 30
  1307. elsif mode == '3G'
  1308. writelog("Email_05_01_03_01_3G")
  1309. change_3G 1
  1310. Email_05_01_03_01 20
  1311. end
  1312.  
  1313. end
  1314.  
  1315. end
  1316.  
  1317.  
  1318. $actionParamInput = "none"
  1319. Email_05_01_03_01 50
  1320.  
  1321.  
  1322. if rand(100) < 0
  1323.  
  1324. for mode in db('ModemMode')
  1325. puts "Change to #{mode}"
  1326. if mode == 'LTE'
  1327. writelog("Email_05_01_03_02_LTE")
  1328. change_LTE 1
  1329. Email_05_01_03_02 30
  1330. elsif mode == '3G'
  1331. writelog("Email_05_01_03_02_3G")
  1332. change_3G 1
  1333. Email_05_01_03_02 20
  1334. end
  1335.  
  1336. end
  1337.  
  1338. end
  1339.  
  1340.  
  1341. $actionParamInput = "none"
  1342. Email_05_01_03_02 50
  1343.  
  1344. $actionParamInput = "none"
  1345. Email_05_01_03_03 50
  1346.  
  1347.  
  1348. if rand(100) < 0
  1349.  
  1350. for mode in db('ModemMode')
  1351. puts "Change to #{mode}"
  1352. if mode == 'LTE'
  1353. writelog("Browser_05_01_04_01_LTE")
  1354. change_LTE 1
  1355. Browser_05_01_04_01 30
  1356. elsif mode == '3G'
  1357. writelog("Browser_05_01_04_01_3G")
  1358. change_3G 1
  1359. Browser_05_01_04_01 20
  1360. end
  1361.  
  1362. end
  1363.  
  1364. end
  1365.  
  1366.  
  1367. $actionParamInput = "none"
  1368. Browser_05_01_04_01 50
  1369.  
  1370.  
  1371. if rand(100) < 0
  1372.  
  1373. for mode in db('ModemMode')
  1374. puts "Change to #{mode}"
  1375. if mode == 'LTE'
  1376. writelog("Browser_05_01_04_02_LTE")
  1377. change_LTE 1
  1378. Browser_05_01_04_02 30
  1379. elsif mode == '3G'
  1380. writelog("Browser_05_01_04_02_3G")
  1381. change_3G 1
  1382. Browser_05_01_04_02 20
  1383. end
  1384.  
  1385. end
  1386.  
  1387. end
  1388.  
  1389.  
  1390. $actionParamInput = "none"
  1391. Browser_05_01_04_02 50
  1392.  
  1393.  
  1394. if rand(100) < 0
  1395.  
  1396. for mode in db('ModemMode')
  1397. puts "Change to #{mode}"
  1398. if mode == 'LTE'
  1399. writelog("Browser_05_01_04_03_LTE")
  1400. change_LTE 1
  1401. Browser_05_01_04_03 6
  1402. elsif mode == '3G'
  1403. writelog("Browser_05_01_04_03_3G")
  1404. change_3G 1
  1405. Browser_05_01_04_03 4
  1406. end
  1407.  
  1408. end
  1409.  
  1410. end
  1411.  
  1412.  
  1413. $actionParamInput = "none"
  1414. Browser_05_01_04_03 10
  1415.  
  1416. $actionParamInput = "none"
  1417. StoreFrontDownload_05_01_05_01 20
  1418.  
  1419. $actionParamInput = "none"
  1420. StoreFrontDownload_05_01_05_02 10
  1421.  
  1422. $actionParamInput = "none"
  1423. StoreFrontDownload_05_01_05_04 1
  1424.  
  1425. $actionParamInput = "none"
  1426. StoreFrontDownload_05_01_05_05 10
  1427.  
  1428. $actionParamInput = "none"
  1429. StoreFrontDownload_05_01_05_06 10
  1430.  
  1431. $actionParamInput = "none"
  1432. StoreFrontDownload_05_01_05_07 1
  1433.  
  1434. $lNumIndex = 0
  1435.  
  1436. $actionParamInput = "none"
  1437. PIM_05_01_06_01 5
  1438.  
  1439. $actionParamInput = "none"
  1440. PIM_05_01_06_02 1
  1441.  
  1442. $lNumIndex = 0
  1443.  
  1444. $actionParamInput = "none"
  1445. PIM_05_01_06_03 5
  1446.  
  1447. $actionParamInput = "none"
  1448. PIM_05_01_06_04 1
  1449.  
  1450. $actionParamInput = "none"
  1451. MultiMedia_05_01_07_01 1
  1452.  
  1453. $actionParamInput = "none"
  1454. MultiMedia_05_01_07_02 1
  1455.  
  1456. $actionParamInput = "none"
  1457. MultiMedia_05_01_07_03 1
  1458.  
  1459. $actionParamInput = "none"
  1460. MultiMedia_05_01_07_04 20
  1461.  
  1462. $actionParamInput = "none"
  1463. MultiMedia_05_01_07_05 20
  1464.  
  1465. $actionParamInput = "none"
  1466. MultiMedia_05_01_07_06 20
  1467.  
  1468. $actionParamInput = "none"
  1469. MultiMedia_05_01_07_10 10
  1470.  
  1471. $actionParamInput = "none"
  1472. MultiTasking_05_01_08_01 1
  1473.  
  1474. $actionParamInput = "none"
  1475. MultiTasking_05_01_08_02 50
  1476.  
  1477. $actionParamInput = "none"
  1478. MultiTasking_05_01_08_03 1
  1479.  
  1480. $actionParamInput = "none"
  1481. MultiTasking_05_01_08_04 1
  1482.  
  1483. $actionParamInput = "none"
  1484. MultiTasking_05_01_08_05 50
  1485.  
  1486. $actionParamInput = "none"
  1487. MultiTasking_05_01_08_06 1
  1488.  
  1489. $actionParamInput = "none"
  1490. MenuNavigation_05_01_09_01 1
  1491.  
  1492. $actionParamInput = "none"
  1493. WiFi_05_01_10_01 20
  1494.  
  1495. $actionParamInput = "none"
  1496. WiFi_05_01_10_02 20
  1497.  
  1498. $actionParamInput = "none"
  1499. NFC_05_01_11_01 20
  1500.  
  1501. $actionParamInput = "none"
  1502. VoLTE_Telephony_05_01_12_01 100
  1503.  
  1504. $actionParamInput = "none"
  1505. VoLTE_Telephony_05_01_12_02 100
  1506.  
  1507. $actionParamInput = "none"
  1508. VoLTE_Telephony_05_01_12_03 100
  1509.  
  1510.  
  1511. sendStatus("Done::mainLoop::Loop::#{index}")
  1512.  
  1513.  
  1514. writelog("Finish::Loop::#{$curMainLoopNum}")
  1515.  
  1516.  
  1517. saveLogFileToGist if $saveLogToGist
  1518.  
  1519. index += 1
  1520.  
  1521. end
  1522.  
  1523. $engineStatus = "Idle"
  1524. resetStatus
  1525. sendStatus("Finish::mainLoop::END")
  1526.  
  1527. end
  1528.  
  1529. def self.NFC_05_01_11_01(loopTime)
  1530.  
  1531. tcase = TestCase.new("NFC_05_01_11_01")
  1532.  
  1533. tcase << TestAction.new(:gotoApp_2_1) do
  1534. gotoApp('Settings')
  1535.  
  1536. waitsecond(2)
  1537. end
  1538.  
  1539. tcase << TestAction.new(:scriptAction_StartTestLog) do
  1540. logStartTest("05_01_11_01_NFC")
  1541.  
  1542. waitsecond(2)
  1543. end
  1544.  
  1545. tcase << TestAction.new(:TextView_Title_5) do
  1546. $ruiObj = RUIObject.new.with('objectid', 1287569942).with('selfid', 1719763922).with('textdescid', -2047169343).with('uniqueparentid', 0).with('classresourceid', 1368752647)
  1547. .with('uitreeindex', 10)
  1548. .with('classname', 'TextView')
  1549. .with('resource-id', 'com.android.settings:id/title')
  1550. .with('text', 'More')
  1551.  
  1552. $ruiObj.click
  1553. noFailCheck
  1554.  
  1555. waitsecond(2)
  1556. end
  1557.  
  1558. tcase << TestAction.new(:TextView_Summary_4) do
  1559. $ruiObj = RUIObject.new.with('objectid', 1704199271).with('selfid', 659735872).with('textdescid', -890658038).with('uniqueparentid', 0).with('classresourceid', -1930775675)
  1560. .with('uitreeindex', 5)
  1561. .with('classname', 'TextView')
  1562. .with('resource-id', 'android:id/summary')
  1563. .with('text', 'Allow data exchange when the phone touches another device')
  1564.  
  1565. $ruiObj.click
  1566. noFailCheck
  1567.  
  1568. waitsecond(2)
  1569. end
  1570.  
  1571. tcase << TestAction.new(:TextView_Summary_5) do
  1572. $ruiObj = RUIObject.new.with('objectid', 1704199271).with('selfid', 659735872).with('textdescid', -890658038).with('uniqueparentid', 0).with('classresourceid', -1930775675)
  1573. .with('uitreeindex', 5)
  1574. .with('classname', 'TextView')
  1575. .with('resource-id', 'android:id/summary')
  1576. .with('text', 'Allow data exchange when the phone touches another device')
  1577.  
  1578. $ruiObj.click
  1579. noFailCheck
  1580.  
  1581. waitsecond(2)
  1582. end
  1583.  
  1584. tcase << TestAction.new(:Switch_Switchwidget_6) do
  1585. $ruiObj = RUIObject.new.with('objectid', -1244030269).with('selfid', 339668546).with('textdescid', 582979566).with('uniqueparentid', 0).with('classresourceid', 1136742875)
  1586. .with('uitreeindex', 6)
  1587. .with('classname', 'Switch')
  1588. .with('resource-id', 'android:id/switchWidget')
  1589. .with('text', 'OFF')
  1590.  
  1591. $ruiObj.isExist
  1592.  
  1593. waitsecond(2)
  1594. end
  1595.  
  1596. tcase << TestAction.new(:pressBack_7) do
  1597. pressBack
  1598.  
  1599. waitsecond(2)
  1600. end
  1601.  
  1602. tcase << TestAction.new(:pressBack_8) do
  1603. pressBack
  1604.  
  1605. waitsecond(2)
  1606. end
  1607.  
  1608. tcase << TestAction.new(:scriptAction_LogStopTest) do
  1609. $myTestResult = checkLastExistResult
  1610.  
  1611. if $myTestResult == false
  1612. $myFailReason = "End button not found"
  1613. end
  1614. logStopTest("05_01_11_01_NFC")
  1615.  
  1616. waitsecond(2)
  1617. end
  1618.  
  1619. tcase << TestAction.new(:pressBack_10) do
  1620. pressBack
  1621.  
  1622. waitsecond(2)
  1623. end
  1624.  
  1625. tcase.run(loopTime)
  1626.  
  1627. end
  1628.  
  1629. def self.PIM_05_01_06_01(loopTime)
  1630.  
  1631. tcase = TestCase.new("PIM_05_01_06_01")
  1632.  
  1633. tcase << TestAction.new(:scriptAction_StartTestLog) do
  1634. logStartTest("05_01_06_01_PIM")
  1635. end
  1636.  
  1637. tcase << TestAction.new(:gotoApp_4) do
  1638. gotoApp('Calendar')
  1639. end
  1640.  
  1641. tcase << TestAction.new(:ImageView_RightArrow_2) do
  1642. $ruiObj = RUIObject.new.with('objectid', 120576481).with('selfid', -773553589).with('textdescid', -1353191203).with('uniqueparentid', 0)
  1643. .with('uitreeindex', 4)
  1644. .with('classname', 'ImageView')
  1645. .with('resource-id', 'com.google.android.calendar:id/right_arrow')
  1646. .with('content-desc', 'next page')
  1647.  
  1648. $ruiObj.click
  1649. end
  1650.  
  1651. tcase << TestAction.new(:ImageView_RightArrow_4) do
  1652. $ruiObj = RUIObject.new.with('objectid', 120576481).with('selfid', -773553589).with('textdescid', -1353191203).with('uniqueparentid', 0)
  1653. .with('uitreeindex', 5)
  1654. .with('classname', 'ImageView')
  1655. .with('resource-id', 'com.google.android.calendar:id/right_arrow')
  1656. .with('content-desc', 'next page')
  1657.  
  1658. $ruiObj.click
  1659. end
  1660.  
  1661. tcase << TestAction.new(:ImageView_RightArrow_6) do
  1662. $ruiObj = RUIObject.new.with('objectid', 120576481).with('selfid', -773553589).with('textdescid', -1353191203).with('uniqueparentid', 0)
  1663. .with('uitreeindex', 4)
  1664. .with('classname', 'ImageView')
  1665. .with('resource-id', 'com.google.android.calendar:id/right_arrow')
  1666. .with('content-desc', 'next page')
  1667.  
  1668. $ruiObj.click
  1669. end
  1670.  
  1671. tcase << TestAction.new(:Button_DoneButton_8) do
  1672. $ruiObj = RUIObject.new.with('objectid', -530367081).with('selfid', -1798297218).with('textdescid', -319241591).with('uniqueparentid', 0)
  1673. .with('uitreeindex', 4)
  1674. .with('classname', 'Button')
  1675. .with('resource-id', 'com.google.android.calendar:id/done_button')
  1676. .with('content-desc', 'Got it')
  1677. .with('text', 'Got it')
  1678.  
  1679. $ruiObj.click
  1680. end
  1681.  
  1682. tcase << TestAction.new(:TextView_ActionToday_29) do
  1683. $ruiObj = RUIObject.new.with('objectid', 528783273).with('selfid', 751135543).with('textdescid', 225813207).with('uniqueparentid', -1270233744)
  1684. .with('uitreeindex', 4)
  1685. .with('classname', 'TextView')
  1686. .with('resource-id', 'com.google.android.calendar:id/action_today')
  1687. .with('content-desc', 'Jump to Today')
  1688.  
  1689. $ruiObj.click
  1690.  
  1691. waitsecond(1)
  1692. end
  1693.  
  1694. tcase << TestAction.new(:ImageButton_AddEventButton_4) do
  1695. $ruiObj = RUIObject.new.with('objectid', -557924199).with('selfid', 1055916483).with('textdescid', -1000414339).with('uniqueparentid', -1270233744)
  1696. .with('uitreeindex', 17)
  1697. .with('classname', 'ImageButton')
  1698. .with('resource-id', 'com.google.android.calendar:id/add_event_button')
  1699. .with('content-desc', 'Create new event')
  1700.  
  1701. $ruiObj.click
  1702.  
  1703. waitsecond(1)
  1704. end
  1705.  
  1706. tcase << TestAction.new(:Button_PermissionDenyButton_2_1) do
  1707. $ruiObj = RUIObject.new.with('objectid', -1413390985).with('selfid', 1927735163).with('textdescid', -1944711285).with('uniqueparentid', 0)
  1708. .with('uitreeindex', 2)
  1709. .with('classname', 'Button')
  1710. .with('resource-id', 'com.android.packageinstaller:id/permission_deny_button')
  1711. .with('text', 'Deny')
  1712.  
  1713. $ruiObj.click
  1714.  
  1715. waitsecond(1)
  1716. end
  1717.  
  1718. tcase << TestAction.new(:EditText_Input_4) do
  1719. $ruiObj = RUIObject.new.with('objectid', 643796938).with('selfid', 33055906).with('textdescid', -1517131370).with('uniqueparentid', 0).with('classresourceid', -228582578)
  1720. .with('uitreeindex', 4)
  1721. .with('classname', 'EditText')
  1722. .with('resource-id', 'com.google.android.calendar:id/input')
  1723.  
  1724. $ruiObj.click
  1725.  
  1726. waitsecond(1)
  1727. end
  1728.  
  1729. tcase << TestAction.new(:scriptAction_10) do
  1730. $ruiObj = RUIObject.new.with('objectid', 643796938).with('selfid', 33055906).with('textdescid', -1517131370).with('uniqueparentid', 0).with('classresourceid', -228582578)
  1731. .with('uitreeindex', 4)
  1732. .with('classname', 'EditText')
  1733. .with('resource-id', 'com.google.android.calendar:id/input')
  1734.  
  1735. $lNumIndex = 0 if !$lNumIndex or ($lNumIndex>5)
  1736.  
  1737. $lNumIndex += 1
  1738.  
  1739. puts "test num::" + $lNumIndex.to_s
  1740.  
  1741. $ruiObj.inputtext("Event #{$lNumIndex.to_s}")
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751. waitsecond(1)
  1752. end
  1753.  
  1754. tcase << TestAction.new(:clickXY_996_1674_3) do
  1755. click(996,1674)
  1756.  
  1757. waitsecond(1)
  1758. end
  1759.  
  1760. tcase << TestAction.new(:TextView_Save_15) do
  1761. $ruiObj = RUIObject.new.with('objectid', 622720990).with('selfid', 1984463047).with('textdescid', 1502260065).with('uniqueparentid', 0)
  1762. .with('uitreeindex', 3)
  1763. .with('classname', 'TextView')
  1764. .with('resource-id', 'com.google.android.calendar:id/save')
  1765. .with('text', 'Save')
  1766.  
  1767. $ruiObj.click
  1768.  
  1769. waitsecond(1)
  1770. end
  1771.  
  1772. tcase << TestAction.new(:TextView_ActionToday_7) do
  1773. $ruiObj = RUIObject.new.with('objectid', 528783273).with('selfid', 751135543).with('textdescid', 225813207).with('uniqueparentid', 0)
  1774. .with('uitreeindex', 4)
  1775. .with('classname', 'TextView')
  1776. .with('resource-id', 'com.google.android.calendar:id/action_today')
  1777. .with('content-desc', 'Jump to Today')
  1778.  
  1779. $ruiObj.click
  1780.  
  1781. waitsecond(1)
  1782. end
  1783.  
  1784. tcase << TestAction.new(:ImageButton_AddEventButton_9) do
  1785. $ruiObj = RUIObject.new.with('objectid', -557924199).with('selfid', 1055916483).with('textdescid', -1000414339).with('uniqueparentid', 0)
  1786. .with('uitreeindex', 11)
  1787. .with('classname', 'ImageButton')
  1788. .with('resource-id', 'com.google.android.calendar:id/add_event_button')
  1789. .with('content-desc', 'Create new event')
  1790.  
  1791. $ruiObj.isExist
  1792.  
  1793. waitsecond(1)
  1794. end
  1795.  
  1796. tcase << TestAction.new(:scriptAction_2) do
  1797. $lNumIndex = 0 if $lNumIndex >= 5
  1798. end
  1799.  
  1800. tcase << TestAction.new(:pressBack_30) do
  1801. pressBack
  1802. end
  1803.  
  1804. tcase << TestAction.new(:scriptAction_LogStopTest) do
  1805. $myTestResult = checkLastExistResult
  1806.  
  1807. if $myTestResult == false
  1808. $myFailReason = "End button not found"
  1809. end
  1810. logStopTest("05_01_06_01_PIM")
  1811. end
  1812.  
  1813. tcase << TestAction.new(:pressBack_10) do
  1814. pressBack
  1815. end
  1816.  
  1817. tcase << TestAction.new(:pressBack_2) do
  1818. pressBack
  1819. end
  1820.  
  1821. tcase.run(loopTime)
  1822.  
  1823. end
  1824.  
  1825. def self.PIM_05_01_06_02(loopTime)
  1826.  
  1827. tcase = TestCase.new("PIM_05_01_06_02")
  1828.  
  1829. tcase << TestAction.new(:gotoApp_2) do
  1830. gotoApp('Clock')
  1831. end
  1832.  
  1833. tcase << TestAction.new(:scriptAction_StartTestLog) do
  1834. logStartTest("05_01_06_02_PIM")
  1835. end
  1836.  
  1837. tcase << TestAction.new(:ImageView_Alarm_2) do
  1838. $ruiObj = RUIObject.new.with('objectid', -989130666).with('selfid', 1648079).with('textdescid', -932529113).with('uniqueparentid', 0)
  1839. .with('uitreeindex', 0)
  1840. .with('classname', 'ImageView')
  1841. .with('content-desc', 'Alarm')
  1842.  
  1843. $ruiObj.click
  1844.  
  1845. waitsecond(1)
  1846. end
  1847.  
  1848. tcase << TestAction.new(:TextView_Tomorrowlabel_6) do
  1849. $ruiObj = RUIObject.new.with('objectid', 334182653).with('selfid', -892048669).with('textdescid', 461112888).with('uniqueparentid', 0).with('classresourceid', 1094670868)
  1850. .with('uitreeindex', 16)
  1851. .with('classname', 'TextView')
  1852. .with('resource-id', 'com.android.deskclock:id/tomorrowLabel')
  1853. .with('text', 'Tomorrow')
  1854.  
  1855. $ruiObj.click
  1856. noFailCheck
  1857.  
  1858. waitsecond(1)
  1859. end
  1860.  
  1861. tcase << TestAction.new(:swipeDown_8) do
  1862. swipe_vertical 500
  1863.  
  1864. waitsecond(1)
  1865. end
  1866.  
  1867. tcase << TestAction.new(:ImageButton_Delete_10) do
  1868. $ruiObj = RUIObject.new.with('objectid', -2007993746).with('selfid', -691879837).with('textdescid', -169857874).with('uniqueparentid', 0).with('classresourceid', -1515260703)
  1869. .with('uitreeindex', 16)
  1870. .with('classname', 'ImageButton')
  1871. .with('resource-id', 'com.android.deskclock:id/delete')
  1872. .with('content-desc', 'Delete alarm')
  1873.  
  1874. $ruiObj.click
  1875. noFailCheck
  1876.  
  1877. waitsecond(1)
  1878. end
  1879.  
  1880. tcase << TestAction.new(:ImageButton_Fab_2) do
  1881. $ruiObj = RUIObject.new.with('objectid', -1036814733).with('selfid', -1627154305).with('textdescid', 2021246789).with('uniqueparentid', 0)
  1882. .with('uitreeindex', 9)
  1883. .with('classname', 'ImageButton')
  1884. .with('resource-id', 'com.android.deskclock:id/fab')
  1885. .with('content-desc', 'Add alarm')
  1886.  
  1887. $ruiObj.click
  1888. noFailCheck
  1889.  
  1890. waitsecond(1)
  1891. end
  1892.  
  1893. tcase << TestAction.new(:Button_Button1_3) do
  1894. $ruiObj = RUIObject.new.with('objectid', -814134535).with('selfid', -1318451484).with('textdescid', -1953962979).with('uniqueparentid', 0)
  1895. .with('uitreeindex', 19)
  1896. .with('classname', 'Button')
  1897. .with('resource-id', 'android:id/button1')
  1898. .with('text', 'OK')
  1899.  
  1900. $ruiObj.click
  1901. noFailCheck
  1902.  
  1903. waitsecond(1)
  1904. end
  1905.  
  1906. tcase << TestAction.new(:ImageButton_Delete_2) do
  1907. $ruiObj = RUIObject.new.with('objectid', -2007993746).with('selfid', -691879837).with('textdescid', -169857874).with('uniqueparentid', 0).with('classresourceid', -1515260703)
  1908. .with('uitreeindex', 16)
  1909. .with('classname', 'ImageButton')
  1910. .with('resource-id', 'com.android.deskclock:id/delete')
  1911. .with('content-desc', 'Delete alarm')
  1912.  
  1913. $ruiObj.isExist
  1914.  
  1915. waitsecond(1)
  1916. end
  1917.  
  1918. tcase << TestAction.new(:pressBack_5) do
  1919. pressBack
  1920. end
  1921.  
  1922. tcase << TestAction.new(:scriptAction_LogStopTest) do
  1923. $myTestResult = checkLastExistResult
  1924.  
  1925. if $myTestResult == false
  1926. $myFailReason = "End button not found"
  1927. end
  1928. logStopTest("05_01_06_02_PIM")
  1929. end
  1930.  
  1931. tcase << TestAction.new(:pressBack_7) do
  1932. pressBack
  1933. end
  1934.  
  1935. tcase.run(loopTime)
  1936.  
  1937. end
  1938.  
  1939. def self.PIM_05_01_06_03(loopTime)
  1940.  
  1941. tcase = TestCase.new("PIM_05_01_06_03")
  1942.  
  1943. tcase << TestAction.new(:scriptAction_StartTestLog) do
  1944. logStartTest("05_01_06_03_PIM")
  1945.  
  1946. waitsecond(2)
  1947. end
  1948.  
  1949. tcase << TestAction.new(:gotoApp_2) do
  1950. gotoApp('Calendar')
  1951.  
  1952. waitsecond(2)
  1953. end
  1954.  
  1955. tcase << TestAction.new(:View_July_1) do
  1956. $lNumIndex = 0 if !$lNumIndex or ($lNumIndex>5)
  1957.  
  1958. $lNumIndex += 1
  1959.  
  1960. puts "test num::" + $lNumIndex.to_s
  1961.  
  1962.  
  1963. $ruiObj = RUIObject.new.with('objectid', 377102742).with('selfid', 2028807658).with('textdescid', 549625083).with('uniqueparentid', 0)
  1964. .with('classname', 'android.view.View')
  1965. .with('content-desc', "Event #{$lNumIndex.to_s}")
  1966.  
  1967. $ruiObj.click
  1968.  
  1969. waitsecond(2)
  1970. end
  1971.  
  1972. tcase << TestAction.new(:ImageView_InfoActionEditHit_8) do
  1973. $ruiObj = RUIObject.new.with('objectid', 380027987).with('selfid', -1403720607).with('textdescid', 1865331735).with('uniqueparentid', 0)
  1974. .with('uitreeindex', 6)
  1975. .with('classname', 'ImageView')
  1976. .with('resource-id', 'com.google.android.calendar:id/info_action_edit_hit')
  1977. .with('content-desc', 'Edit')
  1978.  
  1979. $ruiObj.click
  1980.  
  1981. waitsecond(4)
  1982. end
  1983.  
  1984. tcase << TestAction.new(:Button_Delete_3) do
  1985. $ruiObj = RUIObject.new.with('objectid', 2104812391).with('selfid', 372889832).with('textdescid', -1027791815).with('uniqueparentid', 0)
  1986. .with('uitreeindex', 27)
  1987. .with('classname', 'Button')
  1988. .with('resource-id', 'com.google.android.calendar:id/delete')
  1989. .with('content-desc', 'Delete')
  1990. .with('text', 'Delete')
  1991.  
  1992. $ruiObj.click
  1993.  
  1994. waitsecond(1)
  1995. end
  1996.  
  1997. tcase << TestAction.new(:Button_Button1_6) do
  1998. $ruiObj = RUIObject.new.with('objectid', 479367618).with('selfid', -1318451484).with('textdescid', -1986027930).with('uniqueparentid', 0)
  1999. .with('uitreeindex', 2)
  2000. .with('classname', 'Button')
  2001. .with('resource-id', 'android:id/button1')
  2002. .with('text', 'OK')
  2003.  
  2004. $ruiObj.click
  2005.  
  2006. waitsecond(1)
  2007. end
  2008.  
  2009. tcase << TestAction.new(:View_1100_5) do
  2010. $ruiObj = RUIObject.new.with('objectid', 377102742).with('selfid', 2028807658).with('textdescid', 549625083).with('uniqueparentid', 0)
  2011. .with('classname', 'android.view.View')
  2012. .with('content-desc', "Event #{$lNumIndex.to_s}")
  2013.  
  2014. $ruiObj.isNotExist
  2015.  
  2016. waitsecond(2)
  2017. end
  2018.  
  2019. tcase << TestAction.new(:scriptAction_2) do
  2020. $lNumIndex = 0 if $lNumIndex >= 5
  2021.  
  2022. waitsecond(2)
  2023. end
  2024.  
  2025. tcase << TestAction.new(:pressBack_7) do
  2026. pressBack
  2027.  
  2028. waitsecond(1)
  2029. end
  2030.  
  2031. tcase << TestAction.new(:scriptAction_LogStopTest) do
  2032. $myTestResult = checkLastExistResult
  2033.  
  2034. if $myTestResult == false
  2035. $myFailReason = "End button not found"
  2036. end
  2037. logStopTest("05_01_06_03_PIM")
  2038.  
  2039. waitsecond(2)
  2040. end
  2041.  
  2042. tcase << TestAction.new(:pressBack_9) do
  2043. pressBack
  2044.  
  2045. waitsecond(1)
  2046. end
  2047.  
  2048. tcase.run(loopTime)
  2049.  
  2050. end
  2051.  
  2052. def self.PIM_05_01_06_04(loopTime)
  2053.  
  2054. tcase = TestCase.new("PIM_05_01_06_04")
  2055.  
  2056. tcase << TestAction.new(:gotoApp_2) do
  2057. gotoApp('Clock')
  2058. end
  2059.  
  2060. tcase << TestAction.new(:scriptAction_StartTestLog) do
  2061. logStartTest("05_01_06_04_PIM")
  2062. end
  2063.  
  2064. tcase << TestAction.new(:ImageView_Alarm_6) do
  2065. $ruiObj = RUIObject.new.with('objectid', 1945401211).with('selfid', 1648079).with('textdescid', 1960914508).with('uniqueparentid', 0)
  2066. .with('uitreeindex', 5)
  2067. .with('classname', 'ImageView')
  2068. .with('content-desc', 'Alarm')
  2069.  
  2070. $ruiObj.click
  2071.  
  2072. waitsecond(1)
  2073. end
  2074.  
  2075. tcase << TestAction.new(:Switch_Onoff_7) do
  2076. $ruiObj = RUIObject.new.with('objectid', 753165747).with('selfid', 2073383840).with('textdescid', -1273753036).with('uniqueparentid', 0).with('classresourceid', -1611357869)
  2077. .with('uitreeindex', 9)
  2078. .with('classname', 'Switch')
  2079. .with('resource-id', 'com.android.deskclock:id/onoff')
  2080. .with('text', 'ON')
  2081.  
  2082. $ruiObj.isExist
  2083. noFailCheck
  2084.  
  2085. waitsecond(1)
  2086. end
  2087.  
  2088. tcase << TestAction.new(:TextView_Tomorrowlabel_8) do
  2089. $ruiObj = RUIObject.new.with('objectid', -54535908).with('selfid', -892048669).with('textdescid', 45763479).with('uniqueparentid', 0).with('classresourceid', 1094670868)
  2090. .with('uitreeindex', 10)
  2091. .with('classname', 'TextView')
  2092. .with('resource-id', 'com.android.deskclock:id/tomorrowLabel')
  2093. .with('text', 'Tomorrow')
  2094.  
  2095. $ruiObj.click
  2096. noFailCheck
  2097.  
  2098. waitsecond(1)
  2099. end
  2100.  
  2101. tcase << TestAction.new(:swipeDown_9) do
  2102. swipe_vertical 500
  2103.  
  2104. waitsecond(1)
  2105. end
  2106.  
  2107. tcase << TestAction.new(:ImageButton_Delete_12) do
  2108. $ruiObj = RUIObject.new.with('objectid', -156281843).with('selfid', -691879837).with('textdescid', -1923352273).with('uniqueparentid', 0).with('classresourceid', -1515260703)
  2109. .with('uitreeindex', 10)
  2110. .with('classname', 'ImageButton')
  2111. .with('resource-id', 'com.android.deskclock:id/delete')
  2112. .with('content-desc', 'Delete alarm')
  2113.  
  2114. $ruiObj.click
  2115. noFailCheck
  2116.  
  2117. waitsecond(1)
  2118. end
  2119.  
  2120. tcase << TestAction.new(:Switch_Onoff_13) do
  2121. $ruiObj = RUIObject.new.with('objectid', 753165747).with('selfid', 2073383840).with('textdescid', -1273753036).with('uniqueparentid', 0).with('classresourceid', -1611357869)
  2122. .with('uitreeindex', 5)
  2123. .with('classname', 'Switch')
  2124. .with('resource-id', 'com.android.deskclock:id/onoff')
  2125. .with('text', 'ON')
  2126.  
  2127. $ruiObj.isNotExist
  2128.  
  2129. waitsecond(1)
  2130. end
  2131.  
  2132. tcase << TestAction.new(:pressBack_15) do
  2133. pressBack
  2134. end
  2135.  
  2136. tcase << TestAction.new(:pressBack_16) do
  2137. pressBack
  2138. end
  2139.  
  2140. tcase << TestAction.new(:scriptAction_LogStopTest) do
  2141. $myTestResult = checkLastExistResult
  2142.  
  2143. if $myTestResult == false
  2144. $myFailReason = "End button not found"
  2145. end
  2146. logStopTest("05_01_06_04_PIM")
  2147. end
  2148.  
  2149. tcase.run(loopTime)
  2150.  
  2151. end
  2152.  
  2153. def self.StoreFrontDownload_05_01_05_01(loopTime)
  2154.  
  2155. tcase = TestCase.new("StoreFrontDownload_05_01_05_01")
  2156.  
  2157. tcase << TestAction.new(:scriptAction_1) do
  2158. logStartTest("05_01_05_01_StoreFrontDownload")
  2159. end
  2160.  
  2161. tcase << TestAction.new(:gotoApp_2) do
  2162. gotoApp('Play Store')
  2163.  
  2164. waitsecond(8)
  2165. end
  2166.  
  2167. tcase << TestAction.new(:ImageView_SearchBoxIdleText_4_1) do
  2168. $ruiObj = RUIObject.new.with('objectid', 1987043402).with('selfid', 88317888).with('textdescid', -133777698).with('uniqueparentid', 0)
  2169. .with('uitreeindex', 32)
  2170. .with('classname', 'ImageView')
  2171. .with('resource-id', 'com.android.vending:id/search_box_idle_text')
  2172. .with('content-desc', 'Search')
  2173.  
  2174. $ruiObj.isExist
  2175.  
  2176. waitsecond(1)
  2177. end
  2178.  
  2179. tcase << TestAction.new(:scriptAction_True_False) do
  2180. $myTestResult = checkLastExistResult
  2181.  
  2182. if $myTestResult == false
  2183. $myFailReason == "Store Front is not loaded"
  2184. end
  2185. logStopTest("05_01_05_01_StoreFrontDownload")
  2186. end
  2187.  
  2188. tcase << TestAction.new(:pressBack_7) do
  2189. pressBack
  2190. end
  2191.  
  2192. tcase << TestAction.new(:pressHome_2) do
  2193. pressHome
  2194. end
  2195.  
  2196. tcase.run(loopTime)
  2197.  
  2198. end
  2199.  
  2200. def self.StoreFrontDownload_05_01_05_02(loopTime)
  2201.  
  2202. tcase = TestCase.new("StoreFrontDownload_05_01_05_02")
  2203.  
  2204. tcase << TestAction.new(:scriptAction_1) do
  2205. logStartTest("05_01_05_02_StoreFrontDownload")
  2206. end
  2207.  
  2208. tcase << TestAction.new(:gotoApp_2) do
  2209. gotoApp('Play Store')
  2210.  
  2211. waitsecond(8)
  2212. end
  2213.  
  2214. tcase << TestAction.new(:ImageView_NavigationButton_Menu) do
  2215. $ruiObj = RUIObject.new.with('objectid', 231512643).with('selfid', -1588424753).with('textdescid', -544180676).with('uniqueparentid', 0)
  2216. .with('uitreeindex', 31)
  2217. .with('classname', 'ImageView')
  2218. .with('resource-id', 'com.android.vending:id/navigation_button')
  2219. .with('content-desc', 'Menu')
  2220.  
  2221. $ruiObj.isExist
  2222.  
  2223. waitsecond(1)
  2224. end
  2225.  
  2226. tcase << TestAction.new(:ImageView_SearchBoxIdleText_5) do
  2227. $ruiObj = RUIObject.new.with('objectid', 1987043402).with('selfid', 88317888).with('textdescid', -133777698).with('uniqueparentid', 0)
  2228. .with('uitreeindex', 32)
  2229. .with('classname', 'ImageView')
  2230. .with('resource-id', 'com.android.vending:id/search_box_idle_text')
  2231. .with('content-desc', 'Search')
  2232.  
  2233. $ruiObj.click
  2234.  
  2235. waitsecond(1)
  2236. end
  2237.  
  2238. tcase << TestAction.new(:EditText_SearchBoxTextInput_6) do
  2239. $ruiObj = RUIObject.new.with('objectid', 1660565057).with('selfid', 209465679).with('textdescid', -62090753).with('uniqueparentid', 0)
  2240. .with('uitreeindex', 32)
  2241. .with('classname', 'EditText')
  2242. .with('resource-id', 'com.android.vending:id/search_box_text_input')
  2243.  
  2244. $ruiObj.inputtext('ColorNote')
  2245.  
  2246. waitsecond(1)
  2247. end
  2248.  
  2249. tcase << TestAction.new(:pressEnter_2) do
  2250. pressEnter
  2251.  
  2252. waitsecond(4)
  2253. end
  2254.  
  2255. tcase << TestAction.new(:TextView_LiTitle_4) do
  2256. $ruiObj = RUIObject.new.with('objectid', 1456557201).with('selfid', -1969590474).with('textdescid', 83190698).with('uniqueparentid', 0)
  2257. .with('uitreeindex', 5)
  2258. .with('classname', 'TextView')
  2259. .with('resource-id', 'com.android.vending:id/li_title')
  2260. .with('content-desc', 'App: ColorNote Notepad Notes')
  2261. .with('text', 'ColorNote Notepad Notes')
  2262.  
  2263. $ruiObj.click
  2264.  
  2265. waitsecond(2)
  2266. end
  2267.  
  2268. tcase << TestAction.new(:Button_UninstallButton_UnInstall_exist) do
  2269. $ruiObj = RUIObject.new.with('objectid', -1388871150).with('selfid', -895718918).with('textdescid', -1334831508).with('uniqueparentid', 0)
  2270. .with('uitreeindex', 7)
  2271. .with('classname', 'Button')
  2272. .with('resource-id', 'com.android.vending:id/uninstall_button')
  2273. .with('text', 'UNINSTALL')
  2274.  
  2275. $ruiObj.isExist
  2276. ifFailJumpTo(:Button_BuyButton_1)
  2277.  
  2278. waitsecond(1)
  2279. end
  2280.  
  2281. tcase << TestAction.new(:Button_UninstallButton_UninstallCK_1) do
  2282. $ruiObj = RUIObject.new.with('objectid', -1388871150).with('selfid', -895718918).with('textdescid', -1334831508).with('uniqueparentid', 0)
  2283. .with('uitreeindex', 7)
  2284. .with('classname', 'Button')
  2285. .with('resource-id', 'com.android.vending:id/uninstall_button')
  2286. .with('text', 'UNINSTALL')
  2287.  
  2288. $ruiObj.click
  2289.  
  2290. waitsecond(1)
  2291. end
  2292.  
  2293. tcase << TestAction.new(:Button_Button1_Clk_OK) do
  2294. $ruiObj = RUIObject.new.with('objectid', 1379336962).with('selfid', -1318451484).with('textdescid', -1993773146).with('uniqueparentid', 0)
  2295. .with('uitreeindex', 2)
  2296. .with('classname', 'Button')
  2297. .with('resource-id', 'android:id/button1')
  2298. .with('text', 'OK')
  2299.  
  2300. $ruiObj.click
  2301.  
  2302. waitsecond(8)
  2303. end
  2304.  
  2305. tcase << TestAction.new(:Button_BuyButton_1) do
  2306. $ruiObj = RUIObject.new.with('objectid', 1237348910).with('selfid', -652886121).with('textdescid', 538738615).with('uniqueparentid', 0)
  2307. .with('uitreeindex', 7)
  2308. .with('classname', 'Button')
  2309. .with('resource-id', 'com.android.vending:id/buy_button')
  2310. .with('text', 'INSTALL')
  2311.  
  2312. $ruiObj.click
  2313.  
  2314. waitsecond(2)
  2315. end
  2316.  
  2317. tcase << TestAction.new(:TextView_ContinueButtonLabel_3_Press_Accept) do
  2318. $ruiObj = RUIObject.new.with('objectid', 1608355813).with('selfid', 961982222).with('textdescid', -287969571).with('uniqueparentid', 0)
  2319. .with('uitreeindex', 7)
  2320. .with('classname', 'TextView')
  2321. .with('resource-id', 'com.android.vending:id/continue_button_label')
  2322. .with('text', 'ACCEPT')
  2323.  
  2324. $ruiObj.click
  2325.  
  2326. waitsecond(8)
  2327. end
  2328.  
  2329. tcase << TestAction.new(:wait8second_6) do
  2330. waitsecond(8)
  2331. end
  2332.  
  2333. tcase << TestAction.new(:Button_UninstallButton_UninstallCK) do
  2334. $ruiObj = RUIObject.new.with('objectid', -1388871150).with('selfid', -895718918).with('textdescid', -1334831508).with('uniqueparentid', 0)
  2335. .with('uitreeindex', 7)
  2336. .with('classname', 'Button')
  2337. .with('resource-id', 'com.android.vending:id/uninstall_button')
  2338. .with('text', 'UNINSTALL')
  2339.  
  2340. $ruiObj.isExist
  2341.  
  2342. waitsecond(1)
  2343. end
  2344.  
  2345. tcase << TestAction.new(:scriptAction_CheckPass) do
  2346. $myTestResult = checkLastExistResult
  2347.  
  2348. if $myTestResult == false
  2349. $myFailReason == "Install Failed"
  2350. end
  2351. logStopTest("05_01_05_02_StoreFrontDownload")
  2352. end
  2353.  
  2354. tcase << TestAction.new(:pressBack_16) do
  2355. pressBack
  2356. end
  2357.  
  2358. tcase << TestAction.new(:pressBack_17) do
  2359. pressBack
  2360. end
  2361.  
  2362. tcase << TestAction.new(:pressHome_19) do
  2363. pressHome
  2364. end
  2365.  
  2366. tcase.run(loopTime)
  2367.  
  2368. end
  2369.  
  2370. def self.StoreFrontDownload_05_01_05_04(loopTime)
  2371.  
  2372. tcase = TestCase.new("StoreFrontDownload_05_01_05_04")
  2373.  
  2374. tcase << TestAction.new(:scriptAction_1) do
  2375. logStartTest("05_01_05_04_StoreFrontDownload")
  2376. end
  2377.  
  2378. tcase << TestAction.new(:gotoApp_2) do
  2379. gotoApp('Play Store')
  2380. end
  2381.  
  2382. tcase << TestAction.new(:TextView_LiTitle_APPS) do
  2383. $ruiObj = RUIObject.new.with('objectid', -1564107443).with('selfid', 1565542305).with('textdescid', 284184411).with('uniqueparentid', 0)
  2384. .with('uitreeindex', 2)
  2385. .with('classname', 'TextView')
  2386. .with('resource-id', 'com.android.vending:id/li_title')
  2387. .with('text', 'APPS')
  2388.  
  2389. $ruiObj.isExist
  2390.  
  2391. waitsecond(1)
  2392. end
  2393.  
  2394. tcase << TestAction.new(:pressBack_3) do
  2395. pressBack
  2396. end
  2397.  
  2398. tcase << TestAction.new(:scriptAction_True_False) do
  2399. $myTestResult = checkLastExistResult
  2400.  
  2401. if $myTestResult == false
  2402. $myFailReason == "Store Front cannot open and close"
  2403. end
  2404. logStopTest("05_01_05_04_StoreFrontDownload")
  2405. end
  2406.  
  2407. tcase << TestAction.new(:pressBack_2) do
  2408. pressBack
  2409. end
  2410.  
  2411. tcase << TestAction.new(:pressHome_3) do
  2412. pressHome
  2413. end
  2414.  
  2415. tcase.run(loopTime)
  2416.  
  2417. end
  2418.  
  2419. def self.StoreFrontDownload_05_01_05_05(loopTime)
  2420.  
  2421. tcase = TestCase.new("StoreFrontDownload_05_01_05_05")
  2422.  
  2423. tcase << TestAction.new(:scriptAction_1) do
  2424. logStartTest("05_01_05_05_StoreFrontDownload")
  2425. end
  2426.  
  2427. tcase << TestAction.new(:gotoApp_2) do
  2428. gotoApp('ColorNote')
  2429. end
  2430.  
  2431. tcase << TestAction.new(:TextView_EmptyText_AddNoteCK) do
  2432. $ruiObj = RUIObject.new.with('objectid', -1225710509).with('selfid', -126164144).with('textdescid', -1803056542).with('uniqueparentid', 0)
  2433. .with('uitreeindex', 6)
  2434. .with('classname', 'TextView')
  2435. .with('resource-id', 'com.socialnmobile.dictapps.notepad.color.note:id/empty_text')
  2436. .with('text', 'Add Note')
  2437.  
  2438. $ruiObj.isExist
  2439.  
  2440. waitsecond(1)
  2441. end
  2442.  
  2443. tcase << TestAction.new(:pressBack_4) do
  2444. pressBack
  2445. end
  2446.  
  2447. tcase << TestAction.new(:scriptAction_True_False) do
  2448. $myTestResult = checkLastExistResult
  2449.  
  2450. if $myTestResult == false
  2451. $myFailReason == "Store Front is not loaded"
  2452. end
  2453. logStopTest("05_01_05_05_StoreFrontDownload")
  2454. end
  2455.  
  2456. tcase << TestAction.new(:pressHome_1) do
  2457. pressHome
  2458. end
  2459.  
  2460. tcase.run(loopTime)
  2461.  
  2462. end
  2463.  
  2464. def self.StoreFrontDownload_05_01_05_06(loopTime)
  2465.  
  2466. tcase = TestCase.new("StoreFrontDownload_05_01_05_06")
  2467.  
  2468. tcase << TestAction.new(:scriptAction_1) do
  2469. logStartTest("05_01_05_06_StoreFrontDownload")
  2470. end
  2471.  
  2472. tcase << TestAction.new(:gotoApp_2) do
  2473. gotoApp('Play Store')
  2474.  
  2475. waitsecond(1)
  2476. end
  2477.  
  2478. tcase << TestAction.new(:ImageView_SearchBoxIdleText_12) do
  2479. $ruiObj = RUIObject.new.with('objectid', 1987043402).with('selfid', 88317888).with('textdescid', -133777698).with('uniqueparentid', 0)
  2480. .with('uitreeindex', 28)
  2481. .with('classname', 'ImageView')
  2482. .with('resource-id', 'com.android.vending:id/search_box_idle_text')
  2483. .with('content-desc', 'Search')
  2484.  
  2485. $ruiObj.click
  2486.  
  2487. waitsecond(1)
  2488. end
  2489.  
  2490. tcase << TestAction.new(:EditText_SearchBoxTextInput_13) do
  2491. $ruiObj = RUIObject.new.with('objectid', 1660565057).with('selfid', 209465679).with('textdescid', -62090753).with('uniqueparentid', 0)
  2492. .with('uitreeindex', 28)
  2493. .with('classname', 'EditText')
  2494. .with('resource-id', 'com.android.vending:id/search_box_text_input')
  2495.  
  2496. $ruiObj.inputtext('ColorNote')
  2497.  
  2498. waitsecond(1)
  2499. end
  2500.  
  2501. tcase << TestAction.new(:TextView_SuggestText_16) do
  2502. $ruiObj = RUIObject.new.with('objectid', 193809363).with('selfid', 208620854).with('textdescid', 1052874934).with('uniqueparentid', 0)
  2503. .with('uitreeindex', 32)
  2504. .with('classname', 'TextView')
  2505. .with('resource-id', 'com.android.vending:id/suggest_text')
  2506. .with('text', 'ColorNote Notepad Notes')
  2507.  
  2508. $ruiObj.click
  2509.  
  2510. waitsecond(1)
  2511. end
  2512.  
  2513. tcase << TestAction.new(:TextView_LiTitle_2) do
  2514. $ruiObj = RUIObject.new.with('objectid', 1456557201).with('selfid', -1969590474).with('textdescid', 83190698).with('uniqueparentid', 0)
  2515. .with('uitreeindex', 5)
  2516. .with('classname', 'TextView')
  2517. .with('resource-id', 'com.android.vending:id/li_title')
  2518. .with('content-desc', 'App: ColorNote Notepad Notes')
  2519. .with('text', 'ColorNote Notepad Notes')
  2520.  
  2521. $ruiObj.click
  2522.  
  2523. waitsecond(1)
  2524. end
  2525.  
  2526. tcase << TestAction.new(:Button_LaunchButton_18) do
  2527. $ruiObj = RUIObject.new.with('objectid', 515078971).with('selfid', 328139855).with('textdescid', 387228145).with('uniqueparentid', 0)
  2528. .with('uitreeindex', 8)
  2529. .with('classname', 'Button')
  2530. .with('resource-id', 'com.android.vending:id/launch_button')
  2531. .with('text', 'OPEN')
  2532.  
  2533. $ruiObj.click
  2534.  
  2535. waitsecond(1)
  2536. end
  2537.  
  2538. tcase << TestAction.new(:TextView_EmptyText_AddNoteCK) do
  2539. $ruiObj = RUIObject.new.with('objectid', -1225710509).with('selfid', -126164144).with('textdescid', -1803056542).with('uniqueparentid', 0)
  2540. .with('uitreeindex', 6)
  2541. .with('classname', 'TextView')
  2542. .with('resource-id', 'com.socialnmobile.dictapps.notepad.color.note:id/empty_text')
  2543. .with('text', 'Add Note')
  2544.  
  2545. $ruiObj.isExist
  2546.  
  2547. waitsecond(1)
  2548. end
  2549.  
  2550. tcase << TestAction.new(:pressBack_20) do
  2551. pressBack
  2552. end
  2553.  
  2554. tcase << TestAction.new(:scriptAction_22) do
  2555. $myTestResult = checkLastExistResult
  2556.  
  2557. if $myTestResult == false
  2558. $myFailReason == "Open DL app from Store Front Fail"
  2559. end
  2560. logStopTest("05_01_05_06_StoreFrontDownload")
  2561. end
  2562.  
  2563. tcase << TestAction.new(:pressBack_23) do
  2564. pressBack
  2565. end
  2566.  
  2567. tcase << TestAction.new(:pressBack_2) do
  2568. pressBack
  2569. end
  2570.  
  2571. tcase << TestAction.new(:pressHome_24) do
  2572. pressHome
  2573. end
  2574.  
  2575. tcase.run(loopTime)
  2576.  
  2577. end
  2578.  
  2579. def self.StoreFrontDownload_05_01_05_07(loopTime)
  2580.  
  2581. tcase = TestCase.new("StoreFrontDownload_05_01_05_07")
  2582.  
  2583. tcase << TestAction.new(:scriptAction_1) do
  2584. logStartTest("05_01_05_07_StoreFrontDownload")
  2585. end
  2586.  
  2587. tcase << TestAction.new(:gotoApp_2) do
  2588. gotoApp('Play Store')
  2589.  
  2590. waitsecond(1)
  2591. end
  2592.  
  2593. tcase << TestAction.new(:ImageView_SearchBoxIdleText_5) do
  2594. $ruiObj = RUIObject.new.with('objectid', 1987043402).with('selfid', 88317888).with('textdescid', -133777698).with('uniqueparentid', 0)
  2595. .with('uitreeindex', 32)
  2596. .with('classname', 'ImageView')
  2597. .with('resource-id', 'com.android.vending:id/search_box_idle_text')
  2598. .with('content-desc', 'Search')
  2599.  
  2600. $ruiObj.click
  2601.  
  2602. waitsecond(1)
  2603. end
  2604.  
  2605. tcase << TestAction.new(:EditText_SearchBoxTextInput_6) do
  2606. $ruiObj = RUIObject.new.with('objectid', 1660565057).with('selfid', 209465679).with('textdescid', -62090753).with('uniqueparentid', 0)
  2607. .with('uitreeindex', 32)
  2608. .with('classname', 'EditText')
  2609. .with('resource-id', 'com.android.vending:id/search_box_text_input')
  2610.  
  2611. $ruiObj.inputtext('ColorNote')
  2612.  
  2613. waitsecond(1)
  2614. end
  2615.  
  2616. tcase << TestAction.new(:TextView_SuggestText_7_Click_ColorNote) do
  2617. $ruiObj = RUIObject.new.with('objectid', 193809363).with('selfid', 208620854).with('textdescid', 1052874934).with('uniqueparentid', 0)
  2618. .with('uitreeindex', 36)
  2619. .with('classname', 'TextView')
  2620. .with('resource-id', 'com.android.vending:id/suggest_text')
  2621. .with('text', 'ColorNote Notepad Notes')
  2622.  
  2623. $ruiObj.click
  2624.  
  2625. waitsecond(1)
  2626. end
  2627.  
  2628. tcase << TestAction.new(:TextView_LiTitle_2) do
  2629. $ruiObj = RUIObject.new.with('objectid', 1456557201).with('selfid', -1969590474).with('textdescid', 83190698).with('uniqueparentid', 0)
  2630. .with('uitreeindex', 5)
  2631. .with('classname', 'TextView')
  2632. .with('resource-id', 'com.android.vending:id/li_title')
  2633. .with('content-desc', 'App: ColorNote Notepad Notes')
  2634. .with('text', 'ColorNote Notepad Notes')
  2635.  
  2636. $ruiObj.click
  2637.  
  2638. waitsecond(1)
  2639. end
  2640.  
  2641. tcase << TestAction.new(:Button_UninstallButton_15_pressed) do
  2642. $ruiObj = RUIObject.new.with('objectid', -1388871150).with('selfid', -895718918).with('textdescid', -1334831508).with('uniqueparentid', 0)
  2643. .with('uitreeindex', 7)
  2644. .with('classname', 'Button')
  2645. .with('resource-id', 'com.android.vending:id/uninstall_button')
  2646. .with('text', 'UNINSTALL')
  2647.  
  2648. $ruiObj.click
  2649.  
  2650. waitsecond(1)
  2651. end
  2652.  
  2653. tcase << TestAction.new(:Button_Button1_16_pressed_OK) do
  2654. $ruiObj = RUIObject.new.with('objectid', 1379336962).with('selfid', -1318451484).with('textdescid', -1993773146).with('uniqueparentid', 0)
  2655. .with('uitreeindex', 2)
  2656. .with('classname', 'Button')
  2657. .with('resource-id', 'android:id/button1')
  2658. .with('text', 'OK')
  2659.  
  2660. $ruiObj.click
  2661.  
  2662. waitsecond(8)
  2663. end
  2664.  
  2665. tcase << TestAction.new(:Button_BuyButton_18_Install) do
  2666. $ruiObj = RUIObject.new.with('objectid', 1237348910).with('selfid', -652886121).with('textdescid', 538738615).with('uniqueparentid', 0)
  2667. .with('uitreeindex', 7)
  2668. .with('classname', 'Button')
  2669. .with('resource-id', 'com.android.vending:id/buy_button')
  2670. .with('text', 'INSTALL')
  2671.  
  2672. $ruiObj.isExist
  2673.  
  2674. waitsecond(1)
  2675. end
  2676.  
  2677. tcase << TestAction.new(:scriptAction_CheckPass) do
  2678. $myTestResult = checkLastExistResult
  2679.  
  2680. if $myTestResult == false
  2681. $myFailReason == "Install Failed"
  2682. end
  2683. logStopTest("05_01_05_07_StoreFrontDownload")
  2684. end
  2685.  
  2686. tcase << TestAction.new(:pressBack_16) do
  2687. pressBack
  2688. end
  2689.  
  2690. tcase << TestAction.new(:pressBack_17) do
  2691. pressBack
  2692. end
  2693.  
  2694. tcase << TestAction.new(:pressHome_19) do
  2695. pressHome
  2696. end
  2697.  
  2698. tcase.run(loopTime)
  2699.  
  2700. end
  2701.  
  2702. def self.Telephony_05_01_01_06(loopTime)
  2703.  
  2704. tcase = TestCase.new("Telephony_05_01_01_06")
  2705.  
  2706. tcase << TestAction.new(:scriptAction_StartTestLog) do
  2707. logStartTest("05_01_01_06_Telephony")
  2708. end
  2709.  
  2710. tcase << TestAction.new(:gotoApp_3) do
  2711. gotoApp('Contacts')
  2712. end
  2713.  
  2714. tcase << TestAction.new(:TextView_MenuSearch_4) do
  2715. $ruiObj = RUIObject.new.with('objectid', 1551078554).with('selfid', -439570021).with('textdescid', 534830222).with('uniqueparentid', 0)
  2716. .with('uitreeindex', 1)
  2717. .with('classname', 'TextView')
  2718. .with('resource-id', 'com.android.contacts:id/menu_search')
  2719. .with('content-desc', 'Search')
  2720.  
  2721. $ruiObj.click
  2722.  
  2723. waitsecond(1)
  2724. end
  2725.  
  2726. tcase << TestAction.new(:EditText_SearchView_5) do
  2727. $ruiObj = RUIObject.new.with('objectid', 977615524).with('selfid', -247474260).with('textdescid', 241310204).with('uniqueparentid', 0)
  2728. .with('uitreeindex', 1)
  2729. .with('classname', 'EditText')
  2730. .with('resource-id', 'com.android.contacts:id/search_view')
  2731.  
  2732. $ruiObj.inputtext('tn tn')
  2733.  
  2734. waitsecond(1)
  2735. end
  2736.  
  2737. tcase << TestAction.new(:pressEnter_18) do
  2738. pressEnter
  2739.  
  2740. waitsecond(1)
  2741. end
  2742.  
  2743. tcase << TestAction.new(:TextView_ClivNameTextview_19) do
  2744. $ruiObj = RUIObject.new.with('objectid', -1210856875).with('selfid', 194238690).with('textdescid', -1180900197).with('uniqueparentid', 0).with('classresourceid', -744251330)
  2745. .with('uitreeindex', 5)
  2746. .with('classname', 'TextView')
  2747. .with('resource-id', 'com.android.contacts:id/cliv_name_textview')
  2748. .with('text', 'tn')
  2749.  
  2750. $ruiObj.select('ItemFirst').click
  2751.  
  2752. waitsecond(1)
  2753. end
  2754.  
  2755. tcase << TestAction.new(:TextView_LargeTitle_2) do
  2756. $ruiObj = RUIObject.new.with('objectid', -1985058549).with('selfid', -446575753).with('textdescid', -622639339).with('uniqueparentid', 0)
  2757. .with('uitreeindex', 18)
  2758. .with('classname', 'TextView')
  2759. .with('resource-id', 'com.android.contacts:id/large_title')
  2760. .with('text', 'Tn tn')
  2761.  
  2762. $ruiObj.isExist
  2763.  
  2764. waitsecond(1)
  2765. end
  2766.  
  2767. tcase << TestAction.new(:ImageButton_More_20) do
  2768. $ruiObj = RUIObject.new.with('objectid', 1530299704).with('selfid', 1290820192).with('textdescid', -357708773).with('uniqueparentid', 0)
  2769. .with('uitreeindex', 3)
  2770. .with('classname', 'ImageButton')
  2771. .with('content-desc', 'More options')
  2772.  
  2773. $ruiObj.click
  2774.  
  2775. waitsecond(1)
  2776. end
  2777.  
  2778. tcase << TestAction.new(:TextView_Title_21) do
  2779. $ruiObj = RUIObject.new.with('objectid', -1398759800).with('selfid', -342341268).with('textdescid', -918160867).with('uniqueparentid', 0).with('classresourceid', 490183159)
  2780. .with('uitreeindex', 0)
  2781. .with('classname', 'TextView')
  2782. .with('resource-id', 'android:id/title')
  2783. .with('text', 'Delete')
  2784.  
  2785. $ruiObj.click
  2786.  
  2787. waitsecond(1)
  2788. end
  2789.  
  2790. tcase << TestAction.new(:Button_Button1_22) do
  2791. $ruiObj = RUIObject.new.with('objectid', -195446968).with('selfid', -1318451484).with('textdescid', 917278956).with('uniqueparentid', 0)
  2792. .with('uitreeindex', 2)
  2793. .with('classname', 'Button')
  2794. .with('resource-id', 'android:id/button1')
  2795. .with('text', 'OK')
  2796.  
  2797. $ruiObj.isExist
  2798.  
  2799. waitsecond(1)
  2800. end
  2801.  
  2802. tcase << TestAction.new(:Button_Button1_22_1) do
  2803. $ruiObj = RUIObject.new.with('objectid', -195446968).with('selfid', -1318451484).with('textdescid', 917278956).with('uniqueparentid', 0)
  2804. .with('uitreeindex', 2)
  2805. .with('classname', 'Button')
  2806. .with('resource-id', 'android:id/button1')
  2807. .with('text', 'OK')
  2808.  
  2809. $ruiObj.click
  2810.  
  2811. waitsecond(1)
  2812. end
  2813.  
  2814. tcase << TestAction.new(:scriptAction_LogStopTest) do
  2815. $myTestResult = checkLastExistResult
  2816. if $myTestResult == false
  2817. $myFailReason = "End button not found"
  2818. end
  2819. logStopTest("05_01_01_06_Telephony")
  2820. end
  2821.  
  2822. tcase << TestAction.new(:pressBack_2) do
  2823. pressBack
  2824. end
  2825.  
  2826. tcase << TestAction.new(:pressBack_3) do
  2827. pressBack
  2828. end
  2829.  
  2830. tcase.run(loopTime)
  2831.  
  2832. end
  2833.  
  2834. def self.Telephony_05_01_01_07(loopTime)
  2835.  
  2836. tcase = TestCase.new("Telephony_05_01_01_07")
  2837.  
  2838. tcase << TestAction.new(:scriptAction_StartTestLog) do
  2839. logStartTest("05_01_01_07_Telephony")
  2840. end
  2841.  
  2842. tcase << TestAction.new(:gotoApp_3) do
  2843. gotoApp('Contacts')
  2844.  
  2845. waitsecond(1)
  2846. end
  2847.  
  2848. tcase << TestAction.new(:ImageButton_FloatingActionButton_4) do
  2849. $ruiObj = RUIObject.new.with('objectid', -767699037).with('selfid', 1968371911).with('textdescid', 1777597732).with('uniqueparentid', 0)
  2850. .with('uitreeindex', 22)
  2851. .with('classname', 'ImageButton')
  2852. .with('resource-id', 'com.android.contacts:id/floating_action_button')
  2853. .with('content-desc', 'add new contact')
  2854.  
  2855. $ruiObj.click
  2856.  
  2857. waitsecond(1)
  2858. end
  2859.  
  2860. tcase << TestAction.new(:clickXY_246_1098_2) do
  2861. click(246,1098)
  2862.  
  2863. waitsecond(1)
  2864. end
  2865.  
  2866. tcase << TestAction.new(:EditText_6) do
  2867. $ruiObj = RUIObject.new.with('objectid', -81050771).with('selfid', 1666676343).with('textdescid', 1782393427).with('uniqueparentid', 0).with('classresourceid', 1666676343)
  2868. .with('uitreeindex', 9)
  2869. .with('pretext', 'nalabqct01gmailcom?0')
  2870. .with('classname', 'EditText')
  2871.  
  2872. $ruiObj.inputtext('tn tn')
  2873.  
  2874. waitsecond(1)
  2875. end
  2876.  
  2877. tcase << TestAction.new(:TextView_MenuSave_10) do
  2878. $ruiObj = RUIObject.new.with('objectid', -921598295).with('selfid', -351480207).with('textdescid', -1293285452).with('uniqueparentid', 0)
  2879. .with('uitreeindex', 3)
  2880. .with('classname', 'TextView')
  2881. .with('resource-id', 'com.android.contacts:id/menu_save')
  2882. .with('content-desc', 'Save')
  2883.  
  2884. $ruiObj.isExist
  2885.  
  2886. waitsecond(1)
  2887. end
  2888.  
  2889. tcase << TestAction.new(:TextView_MenuSave_10_1) do
  2890. $ruiObj = RUIObject.new.with('objectid', -921598295).with('selfid', -351480207).with('textdescid', -1293285452).with('uniqueparentid', 0)
  2891. .with('uitreeindex', 3)
  2892. .with('classname', 'TextView')
  2893. .with('resource-id', 'com.android.contacts:id/menu_save')
  2894. .with('content-desc', 'Save')
  2895.  
  2896. $ruiObj.click
  2897.  
  2898. waitsecond(1)
  2899. end
  2900.  
  2901. tcase << TestAction.new(:scriptAction_LogStopTest) do
  2902. $myTestResult = checkLastExistResult
  2903. if $myTestResult == false
  2904. $myFailReason = "Contact is not saved"
  2905. end
  2906. logStopTest("05_01_01_07_Telephony")
  2907. end
  2908.  
  2909. tcase << TestAction.new(:pressBack_5) do
  2910. pressBack
  2911. end
  2912.  
  2913. tcase << TestAction.new(:pressBack_6) do
  2914. pressBack
  2915. end
  2916.  
  2917. tcase.run(loopTime)
  2918.  
  2919. end
  2920.  
  2921. def self.Telephony_test(loopTime)
  2922.  
  2923. tcase = TestCase.new("Telephony_test")
  2924.  
  2925. tcase << TestAction.new(:scriptAction_2) do
  2926. $saveLogToGist = true
  2927. end
  2928.  
  2929. tcase << TestAction.new(:callTest_5_1) do
  2930. $actionParamInput = "none"
  2931. Telephony_05_01_01_01 80
  2932. end
  2933.  
  2934. tcase << TestAction.new(:callTest_274) do
  2935. $actionParamInput = "none"
  2936. Telephony_05_01_01_03 80
  2937. end
  2938.  
  2939. tcase << TestAction.new(:callTest_21) do
  2940. $actionParamInput = "none"
  2941. Telephony_05_01_01_05 100
  2942. end
  2943.  
  2944. tcase << TestAction.new(:callTest_40) do
  2945. $actionParamInput = "none"
  2946. Telephony_05_01_01_06 20
  2947. end
  2948.  
  2949. tcase << TestAction.new(:callTest_40_1) do
  2950. $actionParamInput = "none"
  2951. Telephony_05_01_01_07 20
  2952. end
  2953.  
  2954. tcase << TestAction.new(:callTest_43_1) do
  2955. $actionParamInput = "none"
  2956. VoLTE_Telephony_05_01_12_01 100
  2957. end
  2958.  
  2959. tcase << TestAction.new(:callTest_43_1_1) do
  2960. $actionParamInput = "none"
  2961. VoLTE_Telephony_05_01_12_02 100
  2962. end
  2963.  
  2964. tcase << TestAction.new(:callTest_43_1_1_1) do
  2965. $actionParamInput = "none"
  2966. VoLTE_Telephony_05_01_12_03 100
  2967. end
  2968.  
  2969. tcase.run(loopTime)
  2970.  
  2971. end
  2972.  
  2973. def self.VoLTE_Telephony_05_01_12_01(loopTime)
  2974.  
  2975. tcase = TestCase.new("VoLTE_Telephony_05_01_12_01")
  2976.  
  2977. tcase << TestAction.new(:scriptAction_StartTest) do
  2978. logStartTest("05_01_12_01_VoLTE_Telephony")
  2979. end
  2980.  
  2981. tcase << TestAction.new(:gotoApp_1_1) do
  2982. gotoApp('Contacts')
  2983. end
  2984.  
  2985. tcase << TestAction.new(:TextView_MenuSearch_2) do
  2986. $ruiObj = RUIObject.new.with('objectid', 1659045365).with('selfid', -439570021).with('textdescid', 660324755).with('uniqueparentid', 0)
  2987. .with('uitreeindex', 1)
  2988. .with('classname', 'TextView')
  2989. .with('resource-id', 'com.android.contacts:id/menu_search')
  2990. .with('content-desc', 'Search')
  2991.  
  2992. $ruiObj.click
  2993.  
  2994. waitsecond(1)
  2995. end
  2996.  
  2997. tcase << TestAction.new(:EditText_SearchView_4) do
  2998. $ruiObj = RUIObject.new.with('objectid', 255377705).with('selfid', -247474260).with('textdescid', -673225705).with('uniqueparentid', 0)
  2999. .with('uitreeindex', 1)
  3000. .with('classname', 'EditText')
  3001. .with('resource-id', 'com.android.contacts:id/search_view')
  3002.  
  3003. $ruiObj.inputtext('A01 a01')
  3004.  
  3005. waitsecond(1)
  3006. end
  3007.  
  3008. tcase << TestAction.new(:TextView_ClivNameTextview_8_1) do
  3009. $ruiObj = RUIObject.new.with('objectid', -1210856875).with('selfid', 1607638428).with('textdescid', -1633378553).with('uniqueparentid', 0).with('classresourceid', -744251330)
  3010. .with('uitreeindex', 9)
  3011. .with('classname', 'TextView')
  3012. .with('resource-id', 'com.android.contacts:id/cliv_name_textview')
  3013. .with('text', 'A01 a01')
  3014.  
  3015. $ruiObj.click
  3016.  
  3017. waitsecond(1)
  3018. end
  3019.  
  3020. tcase << TestAction.new(:clickXY_120_1290_6) do
  3021. click(120,1290)
  3022.  
  3023. waitsecond(2)
  3024. end
  3025.  
  3026. tcase << TestAction.new(:wait8second_31) do
  3027. waitsecond(8)
  3028. end
  3029.  
  3030. tcase << TestAction.new(:scriptAction_BTAnswerCall) do
  3031. sendBTCmd('answerCall')
  3032.  
  3033. waitsecond(4)
  3034. end
  3035.  
  3036. tcase << TestAction.new(:scriptAction_LogStopTest_1_1) do
  3037. $myTestResult = checkLastBTCmdResult
  3038. if $myTestResult == false
  3039. $myFailReason = "Call not come to other dev"
  3040. end
  3041. logStopTest("05_01_12_01_VoLTE_Telephony")
  3042.  
  3043. end
  3044.  
  3045. tcase << TestAction.new(:scriptAction_BTEndCall) do
  3046. sendBTCmd('endCall')
  3047.  
  3048. waitsecond(1)
  3049. end
  3050.  
  3051. tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_7) do
  3052. $ruiObj = RUIObject.new.with('objectid', -866535814).with('selfid', 1448123190).with('textdescid', -89777303).with('uniqueparentid', 0)
  3053. .with('uitreeindex', 8)
  3054. .with('classname', 'ImageButton')
  3055. .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
  3056. .with('content-desc', 'End Call')
  3057.  
  3058. $ruiObj.click
  3059.  
  3060. waitsecond(1)
  3061. end
  3062.  
  3063. tcase << TestAction.new(:pressBack_3) do
  3064. pressBack
  3065. end
  3066.  
  3067. tcase << TestAction.new(:pressBack_4) do
  3068. pressBack
  3069. end
  3070.  
  3071. tcase.run(loopTime)
  3072.  
  3073. end
  3074.  
  3075. def self.VoLTE_Telephony_05_01_12_02(loopTime)
  3076.  
  3077. tcase = TestCase.new("VoLTE_Telephony_05_01_12_02")
  3078.  
  3079. tcase << TestAction.new(:scriptAction_StartTest) do
  3080. logStartTest("05_01_12_02_VoLTE_Telephony")
  3081. end
  3082.  
  3083. tcase << TestAction.new(:gotoApp_1_1) do
  3084. gotoApp('Phone')
  3085. end
  3086.  
  3087. tcase << TestAction.new(:View_Recents_2) do
  3088. $ruiObj = RUIObject.new.with('objectid', 1536973457).with('selfid', 954785271).with('textdescid', 1871997065).with('uniqueparentid', 0)
  3089. .with('uitreeindex', 1)
  3090. .with('classname', 'android.view.View')
  3091. .with('content-desc', 'Recents')
  3092.  
  3093. $ruiObj.click
  3094.  
  3095. waitsecond(1)
  3096. end
  3097.  
  3098. tcase << TestAction.new(:ImageView_PrimaryActionButton_8) do
  3099. $ruiObj = RUIObject.new.with('objectid', 1321106203).with('selfid', 1174798435).with('textdescid', 1240128135).with('uniqueparentid', 0)
  3100. .with('uitreeindex', 8)
  3101. .with('classname', 'ImageView')
  3102. .with('resource-id', 'com.android.dialer:id/primary_action_button')
  3103. .with('content-desc', 'Call A01 a01')
  3104.  
  3105. $ruiObj.click
  3106.  
  3107. waitsecond(2)
  3108. end
  3109.  
  3110. tcase << TestAction.new(:wait8second_31) do
  3111. waitsecond(8)
  3112. end
  3113.  
  3114. tcase << TestAction.new(:scriptAction_BTAnswerCall) do
  3115. sendBTCmd('answerCall')
  3116.  
  3117. waitsecond(4)
  3118. end
  3119.  
  3120. tcase << TestAction.new(:scriptAction_LogStopTest) do
  3121. $myTestResult = checkLastBTCmdResult
  3122. if $myTestResult == false
  3123. $myFailReason = "Call not come to other dev"
  3124. end
  3125. logStopTest("05_01_12_02_VoLTE_Telephony")
  3126.  
  3127. end
  3128.  
  3129. tcase << TestAction.new(:scriptAction_BTEndCall) do
  3130. sendBTCmd('endCall')
  3131.  
  3132. waitsecond(1)
  3133. end
  3134.  
  3135. tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_7) do
  3136. $ruiObj = RUIObject.new.with('objectid', -866535814).with('selfid', 1448123190).with('textdescid', -89777303).with('uniqueparentid', 0)
  3137. .with('uitreeindex', 8)
  3138. .with('classname', 'ImageButton')
  3139. .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
  3140. .with('content-desc', 'End Call')
  3141.  
  3142. $ruiObj.click
  3143. noFailCheck
  3144. end
  3145.  
  3146. tcase << TestAction.new(:pressBack_1) do
  3147. pressBack
  3148. end
  3149.  
  3150. tcase << TestAction.new(:pressBack_2) do
  3151. pressBack
  3152. end
  3153.  
  3154. tcase.run(loopTime)
  3155.  
  3156. end
  3157.  
  3158. def self.WiFi_05_01_10_01(loopTime)
  3159.  
  3160. tcase = TestCase.new("WiFi_05_01_10_01")
  3161.  
  3162. tcase << TestAction.new(:scriptAction_2) do
  3163. logStartTest("05_01_10_01_WiFi")
  3164. end
  3165.  
  3166. tcase << TestAction.new(:gotoApp_1_1) do
  3167. gotoApp('Settings')
  3168. end
  3169.  
  3170. tcase << TestAction.new(:swipeUp_1) do
  3171. swipe_vertical_back 500
  3172. end
  3173.  
  3174. tcase << TestAction.new(:swipeUp_2) do
  3175. swipe_vertical_back 500
  3176. end
  3177.  
  3178. tcase << TestAction.new(:swipeUp_3) do
  3179. swipe_vertical_back 500
  3180. end
  3181.  
  3182. tcase << TestAction.new(:swipeUp_4) do
  3183. swipe_vertical_back 500
  3184. end
  3185.  
  3186. tcase << TestAction.new(:TextView_Title_Wifi) do
  3187. $ruiObj = RUIObject.new.with('objectid', 1287569942).with('selfid', 1720054706).with('textdescid', -2038155039).with('uniqueparentid', 0).with('classresourceid', 1368752647)
  3188. .with('uitreeindex', 4)
  3189. .with('classname', 'TextView')
  3190. .with('resource-id', 'com.android.settings:id/title')
  3191. .with('text', 'WiFi')
  3192.  
  3193. $ruiObj.click
  3194.  
  3195. waitsecond(1)
  3196. end
  3197.  
  3198. tcase << TestAction.new(:TextView_SwitchText_15) do
  3199. $ruiObj = RUIObject.new.with('objectid', -1971573453).with('selfid', 1955659484).with('textdescid', 1769741716).with('uniqueparentid', 0)
  3200. .with('uitreeindex', 3)
  3201. .with('classname', 'TextView')
  3202. .with('resource-id', 'com.android.settings:id/switch_text')
  3203. .with('text', 'On')
  3204.  
  3205. $ruiObj.isExist
  3206. ifFailJumpTo(:Switch_SwitchWidget_OFF)
  3207.  
  3208. waitsecond(1)
  3209. end
  3210.  
  3211. tcase << TestAction.new(:Switch_SwitchWidget_ON) do
  3212. $ruiObj = RUIObject.new.with('objectid', -489552312).with('selfid', -1921366703).with('textdescid', -2107285431).with('uniqueparentid', 0)
  3213. .with('uitreeindex', 4)
  3214. .with('classname', 'Switch')
  3215. .with('resource-id', 'com.android.settings:id/switch_widget')
  3216. .with('text', 'ON')
  3217.  
  3218. $ruiObj.click
  3219.  
  3220. waitsecond(4)
  3221. end
  3222.  
  3223. tcase << TestAction.new(:Switch_SwitchWidget_OFF) do
  3224. $ruiObj = RUIObject.new.with('objectid', -489552312).with('selfid', 567174173).with('textdescid', -901345399).with('uniqueparentid', 0)
  3225. .with('uitreeindex', 4)
  3226. .with('classname', 'Switch')
  3227. .with('resource-id', 'com.android.settings:id/switch_widget')
  3228. .with('text', 'OFF')
  3229.  
  3230. $ruiObj.click
  3231.  
  3232. waitsecond(8)
  3233. end
  3234.  
  3235. tcase << TestAction.new(:TextView_SwitchText_9) do
  3236. $ruiObj = RUIObject.new.with('objectid', -1971573453).with('selfid', 1955659484).with('textdescid', 1769741716).with('uniqueparentid', 0)
  3237. .with('uitreeindex', 3)
  3238. .with('classname', 'TextView')
  3239. .with('resource-id', 'com.android.settings:id/switch_text')
  3240. .with('text', 'On')
  3241.  
  3242. $ruiObj.isExist
  3243.  
  3244. waitsecond(1)
  3245. end
  3246.  
  3247. tcase << TestAction.new(:Switch_SwitchWidget_ON_1) do
  3248. $ruiObj = RUIObject.new.with('objectid', -489552312).with('selfid', -1921366703).with('textdescid', -2107285431).with('uniqueparentid', 0)
  3249. .with('uitreeindex', 4)
  3250. .with('classname', 'Switch')
  3251. .with('resource-id', 'com.android.settings:id/switch_widget')
  3252. .with('text', 'ON')
  3253.  
  3254. $ruiObj.click
  3255.  
  3256. waitsecond(1)
  3257. end
  3258.  
  3259. tcase << TestAction.new(:scriptAction_10_TrueFalse) do
  3260. $myTestResult = checkLastExistResult
  3261.  
  3262. if $myTestResult == false
  3263. $myFailReason == "WiFi cannot turn ON"
  3264. end
  3265. logStopTest("05_01_10_01_WiFi")
  3266. end
  3267.  
  3268. tcase << TestAction.new(:pressBack_20) do
  3269. pressBack
  3270. end
  3271.  
  3272. tcase << TestAction.new(:pressBack_21) do
  3273. pressBack
  3274. end
  3275.  
  3276. tcase << TestAction.new(:pressHome_22) do
  3277. pressHome
  3278. end
  3279.  
  3280. tcase.run(loopTime)
  3281.  
  3282. end
  3283.  
  3284. def self.WiFi_05_01_10_02(loopTime)
  3285.  
  3286. tcase = TestCase.new("WiFi_05_01_10_02")
  3287.  
  3288. tcase << TestAction.new(:scriptAction_2) do
  3289. logStartTest("05_01_10_02_WiFi")
  3290. end
  3291.  
  3292. tcase << TestAction.new(:gotoApp_4) do
  3293. gotoApp('Settings')
  3294. end
  3295.  
  3296. tcase << TestAction.new(:swipeUp_2) do
  3297. swipe_vertical_back 500
  3298. end
  3299.  
  3300. tcase << TestAction.new(:swipeUp_4) do
  3301. swipe_vertical_back 500
  3302. end
  3303.  
  3304. tcase << TestAction.new(:swipeUp_6) do
  3305. swipe_vertical_back 500
  3306. end
  3307.  
  3308. tcase << TestAction.new(:swipeUp_8) do
  3309. swipe_vertical_back 500
  3310. end
  3311.  
  3312. tcase << TestAction.new(:TextView_Title_5) do
  3313. $ruiObj = RUIObject.new.with('objectid', 1287569942).with('selfid', 1720054706).with('textdescid', -2038155039).with('uniqueparentid', 0).with('classresourceid', 1368752647)
  3314. .with('uitreeindex', 4)
  3315. .with('classname', 'TextView')
  3316. .with('resource-id', 'com.android.settings:id/title')
  3317. .with('text', 'WiFi')
  3318.  
  3319. $ruiObj.click
  3320.  
  3321. waitsecond(2)
  3322. end
  3323.  
  3324. tcase << TestAction.new(:TextView_SwitchText_2) do
  3325. $ruiObj = RUIObject.new.with('objectid', -1971573453).with('selfid', 495901714).with('textdescid', -972587138).with('uniqueparentid', 0)
  3326. .with('uitreeindex', 3)
  3327. .with('classname', 'TextView')
  3328. .with('resource-id', 'com.android.settings:id/switch_text')
  3329. .with('text', 'Off')
  3330.  
  3331. $ruiObj.isExist
  3332. ifFailJumpTo(:TextView_Summary_Connected)
  3333.  
  3334. waitsecond(2)
  3335. end
  3336.  
  3337. tcase << TestAction.new(:Switch_SwitchWidget_3) do
  3338. $ruiObj = RUIObject.new.with('objectid', -489552312).with('selfid', 567174173).with('textdescid', -901345399).with('uniqueparentid', 0)
  3339. .with('uitreeindex', 4)
  3340. .with('classname', 'Switch')
  3341. .with('resource-id', 'com.android.settings:id/switch_widget')
  3342. .with('text', 'OFF')
  3343.  
  3344. $ruiObj.click
  3345.  
  3346. waitsecond(8)
  3347. end
  3348.  
  3349. tcase << TestAction.new(:wait4second_2) do
  3350. waitsecond(4)
  3351. end
  3352.  
  3353. tcase << TestAction.new(:TextView_Summary_Connected) do
  3354. $ruiObj = RUIObject.new.with('objectid', 1704199271).with('selfid', -404041766).with('textdescid', -634935376).with('uniqueparentid', 0).with('classresourceid', -1930775675)
  3355. .with('uitreeindex', 7)
  3356. .with('classname', 'TextView')
  3357. .with('resource-id', 'android:id/summary')
  3358. .with('text', 'Connected')
  3359.  
  3360. $ruiObj.isExist
  3361. ifFailJumpTo(:TextView_Title_QCTCOMP_2)
  3362.  
  3363. waitsecond(2)
  3364. end
  3365.  
  3366. tcase << TestAction.new(:TextView_Title_QCTCOMP) do
  3367. $ruiObj = RUIObject.new.with('objectid', 274971481).with('selfid', -71636208).with('textdescid', 341957782).with('uniqueparentid', 0).with('classresourceid', 490183159)
  3368. .with('uitreeindex', 6)
  3369. .with('classname', 'TextView')
  3370. .with('resource-id', 'android:id/title')
  3371. .with('text', 'QCTCOMP')
  3372.  
  3373. $ruiObj.click
  3374.  
  3375. waitsecond(4)
  3376. end
  3377.  
  3378. tcase << TestAction.new(:Button_Button3_Disconnect_1) do
  3379. $ruiObj = RUIObject.new.with('objectid', 972638586).with('selfid', 1759634711).with('textdescid', -1808285939).with('uniqueparentid', 0)
  3380. .with('uitreeindex', 11)
  3381. .with('classname', 'Button')
  3382. .with('resource-id', 'android:id/button3')
  3383. .with('text', 'Forget')
  3384.  
  3385. $ruiObj.click
  3386.  
  3387. waitsecond(8)
  3388. end
  3389.  
  3390. tcase << TestAction.new(:TextView_Title_QCTCOMP_2) do
  3391. $ruiObj = RUIObject.new.with('objectid', 274971481).with('selfid', -71636208).with('textdescid', 341957782).with('uniqueparentid', 0).with('classresourceid', 490183159)
  3392. .with('uitreeindex', 10)
  3393. .with('classname', 'TextView')
  3394. .with('resource-id', 'android:id/title')
  3395. .with('text', 'QCTCOMP')
  3396.  
  3397. $ruiObj.isExist
  3398.  
  3399. waitsecond(2)
  3400. end
  3401.  
  3402. tcase << TestAction.new(:TextView_Title_7) do
  3403. $ruiObj = RUIObject.new.with('objectid', 274971481).with('selfid', -71636208).with('textdescid', 341957782).with('uniqueparentid', 0).with('classresourceid', 490183159)
  3404. .with('uitreeindex', 12)
  3405. .with('classname', 'TextView')
  3406. .with('resource-id', 'android:id/title')
  3407. .with('text', 'QCTCOMP')
  3408.  
  3409. $ruiObj.click
  3410.  
  3411. waitsecond(8)
  3412. end
  3413.  
  3414. tcase << TestAction.new(:EditText_Password_8) do
  3415. $ruiObj = RUIObject.new.with('objectid', 780695774).with('selfid', 8195995).with('textdescid', -1568234750).with('uniqueparentid', 0).with('classresourceid', 1413676103)
  3416. .with('uitreeindex', 2)
  3417. .with('classname', 'EditText')
  3418. .with('resource-id', 'com.android.settings:id/password')
  3419.  
  3420. $ruiObj.inputtext('12abcdef34')
  3421.  
  3422. waitsecond(2)
  3423. end
  3424.  
  3425. tcase << TestAction.new(:Button_Button1_Connect) do
  3426. $ruiObj = RUIObject.new.with('objectid', 972638584).with('selfid', 736098498).with('textdescid', -870791618).with('uniqueparentid', 0)
  3427. .with('uitreeindex', 7)
  3428. .with('classname', 'Button')
  3429. .with('resource-id', 'android:id/button1')
  3430. .with('text', 'Connect')
  3431.  
  3432. $ruiObj.click
  3433.  
  3434. waitsecond(2)
  3435. end
  3436.  
  3437. tcase << TestAction.new(:wait8second_11_20s) do
  3438. waitsecond(20)
  3439. end
  3440.  
  3441. tcase << TestAction.new(:TextView_Summary_2) do
  3442. $ruiObj = RUIObject.new.with('objectid', 1704199271).with('selfid', -404041766).with('textdescid', -634935376).with('uniqueparentid', 0).with('classresourceid', -1930775675)
  3443. .with('uitreeindex', 7)
  3444. .with('classname', 'TextView')
  3445. .with('resource-id', 'android:id/summary')
  3446. .with('text', 'Connected')
  3447.  
  3448. $ruiObj.isExist
  3449.  
  3450. waitsecond(2)
  3451. end
  3452.  
  3453. tcase << TestAction.new(:scriptAction_23_TrueFalse) do
  3454. $myTestResult = checkLastExistResult
  3455.  
  3456. if $myTestResult == false
  3457. $myFailReason == "WiFi cannot connected"
  3458. end
  3459. logStopTest("05_01_10_02_WiFi")
  3460.  
  3461. waitsecond(2)
  3462. end
  3463.  
  3464. tcase << TestAction.new(:TextView_Title_QCTCOM_Disconnect) do
  3465. $ruiObj = RUIObject.new.with('objectid', 274971481).with('selfid', -71636208).with('textdescid', 341957782).with('uniqueparentid', 0).with('classresourceid', 490183159)
  3466. .with('uitreeindex', 6)
  3467. .with('classname', 'TextView')
  3468. .with('resource-id', 'android:id/title')
  3469. .with('text', 'QCTCOMP')
  3470.  
  3471. $ruiObj.click
  3472.  
  3473. waitsecond(4)
  3474. end
  3475.  
  3476. tcase << TestAction.new(:Button_Button3_Disconnect_2) do
  3477. $ruiObj = RUIObject.new.with('objectid', 972638586).with('selfid', 1759634711).with('textdescid', -1808285939).with('uniqueparentid', 0)
  3478. .with('uitreeindex', 11)
  3479. .with('classname', 'Button')
  3480. .with('resource-id', 'android:id/button3')
  3481. .with('text', 'Forget')
  3482.  
  3483. $ruiObj.click
  3484.  
  3485. waitsecond(8)
  3486. end
  3487.  
  3488. tcase << TestAction.new(:pressBack_15) do
  3489. pressBack
  3490. end
  3491.  
  3492. tcase << TestAction.new(:pressBack_16) do
  3493. pressBack
  3494. end
  3495.  
  3496. tcase << TestAction.new(:pressHome_17) do
  3497. pressHome
  3498. end
  3499.  
  3500. tcase.run(loopTime)
  3501.  
  3502. end
  3503.  
  3504. def self.android_ExpHandler(loopTime)
  3505.  
  3506. tcase = TestCase.new("android_ExpHandler")
  3507.  
  3508. tcase << TestAction.new(:scriptAction_check) do
  3509. $err = "system popup detected::#{takeScreenShot}::screenshot saved"
  3510. $myTestResult = false
  3511. puts $err
  3512. logcat($err)
  3513. writelog($err)
  3514. uiObj("Button").click if uiObj("Button").exists
  3515.  
  3516. waitsecond(2)
  3517. end
  3518.  
  3519. tcase.run(loopTime)
  3520.  
  3521. end
  3522.  
  3523. def self.change_3G(loopTime)
  3524.  
  3525. tcase = TestCase.new("change_3G")
  3526.  
  3527. tcase << TestAction.new(:gotoApp_16) do
  3528. gotoApp('Settings')
  3529. end
  3530.  
  3531. tcase << TestAction.new(:TextView_Title_3) do
  3532. $ruiObj = RUIObject.new.with('objectid', 163488192).with('selfid', 1719763922).with('textdescid', -163928853).with('uniqueparentid', 0).with('classresourceid', 1368752647)
  3533. .with('uitreeindex', 10)
  3534. .with('classname', 'TextView')
  3535. .with('resource-id', 'com.android.settings:id/title')
  3536. .with('text', 'More')
  3537.  
  3538. $ruiObj.click
  3539. noFailCheck
  3540.  
  3541. waitsecond(1)
  3542. end
  3543.  
  3544. tcase << TestAction.new(:TextView_Title_4) do
  3545. $ruiObj = RUIObject.new.with('objectid', -350873494).with('selfid', 1467675546).with('textdescid', -657722085).with('uniqueparentid', 0).with('classresourceid', 490183159)
  3546. .with('uitreeindex', 11)
  3547. .with('classname', 'TextView')
  3548. .with('resource-id', 'android:id/title')
  3549. .with('text', 'Cellular networks')
  3550.  
  3551. $ruiObj.click
  3552. noFailCheck
  3553.  
  3554. waitsecond(1)
  3555. end
  3556.  
  3557. tcase << TestAction.new(:TextView_Title_5) do
  3558. $ruiObj = RUIObject.new.with('objectid', 860106418).with('selfid', 517165292).with('textdescid', 1981620935).with('uniqueparentid', 0).with('classresourceid', 490183159)
  3559. .with('uitreeindex', 5)
  3560. .with('classname', 'TextView')
  3561. .with('resource-id', 'android:id/title')
  3562. .with('text', 'Preferred network type')
  3563.  
  3564. $ruiObj.click
  3565. noFailCheck
  3566.  
  3567. waitsecond(1)
  3568. end
  3569.  
  3570. tcase << TestAction.new(:CheckedTextView_Text1_6) do
  3571. $ruiObj = RUIObject.new.with('objectid', -442050023).with('selfid', 969723944).with('textdescid', -1541834331).with('uniqueparentid', 0).with('classresourceid', 2074814108)
  3572. .with('uitreeindex', 2)
  3573. .with('classname', 'CheckedTextView')
  3574. .with('resource-id', 'android:id/text1')
  3575. .with('text', '3G')
  3576.  
  3577. $ruiObj.click
  3578. noFailCheck
  3579.  
  3580. waitsecond(1)
  3581. end
  3582.  
  3583. tcase << TestAction.new(:pressBack_7) do
  3584. pressBack
  3585. end
  3586.  
  3587. tcase << TestAction.new(:pressBack_8) do
  3588. pressBack
  3589. end
  3590.  
  3591. tcase << TestAction.new(:pressHome_9) do
  3592. pressHome
  3593. end
  3594.  
  3595. tcase.run(loopTime)
  3596.  
  3597. end
  3598.  
  3599. def self.change_LTE(loopTime)
  3600.  
  3601. tcase = TestCase.new("change_LTE")
  3602.  
  3603. tcase << TestAction.new(:gotoApp_16) do
  3604. gotoApp('Settings')
  3605. end
  3606.  
  3607. tcase << TestAction.new(:TextView_Title_3) do
  3608. $ruiObj = RUIObject.new.with('objectid', 163488192).with('selfid', 1719763922).with('textdescid', -163928853).with('uniqueparentid', 0).with('classresourceid', 1368752647)
  3609. .with('uitreeindex', 10)
  3610. .with('classname', 'TextView')
  3611. .with('resource-id', 'com.android.settings:id/title')
  3612. .with('text', 'More')
  3613.  
  3614. $ruiObj.click
  3615. noFailCheck
  3616.  
  3617. waitsecond(1)
  3618. end
  3619.  
  3620. tcase << TestAction.new(:TextView_Title_4) do
  3621. $ruiObj = RUIObject.new.with('objectid', -350873494).with('selfid', 1467675546).with('textdescid', -657722085).with('uniqueparentid', 0).with('classresourceid', 490183159)
  3622. .with('uitreeindex', 11)
  3623. .with('classname', 'TextView')
  3624. .with('resource-id', 'android:id/title')
  3625. .with('text', 'Cellular networks')
  3626.  
  3627. $ruiObj.click
  3628. noFailCheck
  3629.  
  3630. waitsecond(1)
  3631. end
  3632.  
  3633. tcase << TestAction.new(:TextView_Title_5) do
  3634. $ruiObj = RUIObject.new.with('objectid', 860106418).with('selfid', 517165292).with('textdescid', 1981620935).with('uniqueparentid', 0).with('classresourceid', 490183159)
  3635. .with('uitreeindex', 5)
  3636. .with('classname', 'TextView')
  3637. .with('resource-id', 'android:id/title')
  3638. .with('text', 'Preferred network type')
  3639.  
  3640. $ruiObj.click
  3641. noFailCheck
  3642.  
  3643. waitsecond(1)
  3644. end
  3645.  
  3646. tcase << TestAction.new(:CheckedTextView_Text1_2) do
  3647. $ruiObj = RUIObject.new.with('objectid', -442050023).with('selfid', 1679268164).with('textdescid', 1652493263).with('uniqueparentid', 0).with('classresourceid', 2074814108)
  3648. .with('uitreeindex', 1)
  3649. .with('classname', 'CheckedTextView')
  3650. .with('resource-id', 'android:id/text1')
  3651. .with('text', 'LTE recommended')
  3652.  
  3653. $ruiObj.click
  3654. noFailCheck
  3655.  
  3656. waitsecond(1)
  3657. end
  3658.  
  3659. tcase << TestAction.new(:pressBack_7) do
  3660. pressBack
  3661. end
  3662.  
  3663. tcase << TestAction.new(:pressBack_8) do
  3664. pressBack
  3665. end
  3666.  
  3667. tcase << TestAction.new(:pressHome_9) do
  3668. pressHome
  3669. end
  3670.  
  3671. tcase.run(loopTime)
  3672.  
  3673. end
  3674.  
  3675. def self.connectWifi(loopTime)
  3676.  
  3677. tcase = TestCase.new("connectWifi")
  3678.  
  3679. tcase << TestAction.new(:scriptAction_2) do
  3680. logStartTest("05_01_10_02_WiFi")
  3681. end
  3682.  
  3683. tcase << TestAction.new(:gotoApp_4) do
  3684. gotoApp('Settings')
  3685. end
  3686.  
  3687. tcase << TestAction.new(:swipeUp_2) do
  3688. swipe_vertical_back 500
  3689. end
  3690.  
  3691. tcase << TestAction.new(:swipeUp_4) do
  3692. swipe_vertical_back 500
  3693. end
  3694.  
  3695. tcase << TestAction.new(:swipeUp_6) do
  3696. swipe_vertical_back 500
  3697. end
  3698.  
  3699. tcase << TestAction.new(:swipeUp_8) do
  3700. swipe_vertical_back 500
  3701. end
  3702.  
  3703. tcase << TestAction.new(:TextView_Title_5) do
  3704. $ruiObj = RUIObject.new.with('objectid', 1287569942).with('selfid', 1720054706).with('textdescid', -2038155039).with('uniqueparentid', 0).with('classresourceid', 1368752647)
  3705. .with('uitreeindex', 4)
  3706. .with('classname', 'TextView')
  3707. .with('resource-id', 'com.android.settings:id/title')
  3708. .with('text', 'WiFi')
  3709.  
  3710. $ruiObj.click
  3711.  
  3712. waitsecond(1)
  3713. end
  3714.  
  3715. tcase << TestAction.new(:TextView_SwitchText_2) do
  3716. $ruiObj = RUIObject.new.with('objectid', -1971573453).with('selfid', 495901714).with('textdescid', -972587138).with('uniqueparentid', 0)
  3717. .with('uitreeindex', 3)
  3718. .with('classname', 'TextView')
  3719. .with('resource-id', 'com.android.settings:id/switch_text')
  3720. .with('text', 'Off')
  3721.  
  3722. $ruiObj.isExist
  3723. ifFailJumpTo(:TextView_Title_2)
  3724.  
  3725. waitsecond(2)
  3726. end
  3727.  
  3728. tcase << TestAction.new(:Switch_SwitchWidget_3) do
  3729. $ruiObj = RUIObject.new.with('objectid', -489552312).with('selfid', 567174173).with('textdescid', -901345399).with('uniqueparentid', 0)
  3730. .with('uitreeindex', 4)
  3731. .with('classname', 'Switch')
  3732. .with('resource-id', 'com.android.settings:id/switch_widget')
  3733. .with('text', 'OFF')
  3734.  
  3735. $ruiObj.click
  3736.  
  3737. waitsecond(8)
  3738. end
  3739.  
  3740. tcase << TestAction.new(:wait4second_2) do
  3741. waitsecond(4)
  3742. end
  3743.  
  3744. tcase << TestAction.new(:TextView_Title_2) do
  3745. $ruiObj = RUIObject.new.with('objectid', 274971481).with('selfid', -71636208).with('textdescid', 341957782).with('uniqueparentid', 0).with('classresourceid', 490183159)
  3746. .with('uitreeindex', 12)
  3747. .with('classname', 'TextView')
  3748. .with('resource-id', 'android:id/title')
  3749. .with('text', 'QCTCOMP')
  3750.  
  3751. $ruiObj.click
  3752.  
  3753. waitsecond(4)
  3754. end
  3755.  
  3756. tcase << TestAction.new(:EditText_Password_8) do
  3757. $ruiObj = RUIObject.new.with('objectid', 780695774).with('selfid', 8195995).with('textdescid', -1568234750).with('uniqueparentid', 0).with('classresourceid', 1413676103)
  3758. .with('uitreeindex', 2)
  3759. .with('classname', 'EditText')
  3760. .with('resource-id', 'com.android.settings:id/password')
  3761.  
  3762. $ruiObj.inputtext('12abcdef34')
  3763.  
  3764. waitsecond(1)
  3765. end
  3766.  
  3767. tcase << TestAction.new(:Button_Button1_Connect) do
  3768. $ruiObj = RUIObject.new.with('objectid', 972638584).with('selfid', 736098498).with('textdescid', -870791618).with('uniqueparentid', 0)
  3769. .with('uitreeindex', 7)
  3770. .with('classname', 'Button')
  3771. .with('resource-id', 'android:id/button1')
  3772. .with('text', 'Connect')
  3773.  
  3774. $ruiObj.click
  3775.  
  3776. waitsecond(2)
  3777. end
  3778.  
  3779. tcase << TestAction.new(:wait8second_11_20s) do
  3780. waitsecond(20)
  3781. end
  3782.  
  3783. tcase << TestAction.new(:TextView_Summary_2) do
  3784. $ruiObj = RUIObject.new.with('objectid', 1704199271).with('selfid', -404041766).with('textdescid', -634935376).with('uniqueparentid', 0).with('classresourceid', -1930775675)
  3785. .with('uitreeindex', 7)
  3786. .with('classname', 'TextView')
  3787. .with('resource-id', 'android:id/summary')
  3788. .with('text', 'Connected')
  3789.  
  3790. $ruiObj.isExist
  3791.  
  3792. waitsecond(2)
  3793. end
  3794.  
  3795. tcase << TestAction.new(:scriptAction_23_TrueFalse) do
  3796. $myTestResult = checkLastExistResult
  3797.  
  3798. if $myTestResult == false
  3799. $myFailReason == "WiFi cannot connected"
  3800. end
  3801. logStopTest("05_01_10_02_WiFi")
  3802.  
  3803. waitsecond(2)
  3804. end
  3805.  
  3806. tcase << TestAction.new(:pressBack_15) do
  3807. pressBack
  3808. end
  3809.  
  3810. tcase << TestAction.new(:pressBack_16) do
  3811. pressBack
  3812. end
  3813.  
  3814. tcase << TestAction.new(:pressHome_17) do
  3815. pressHome
  3816. end
  3817.  
  3818. tcase.run(loopTime)
  3819.  
  3820. end
  3821.  
  3822. def self.startTest(loopTime)
  3823.  
  3824. tcase = TestCase.new("startTest")
  3825.  
  3826. tcase << TestAction.new(:pressBack_1) do
  3827. pressBack
  3828. end
  3829.  
  3830. tcase << TestAction.new(:pressBack_2) do
  3831. pressBack
  3832. end
  3833.  
  3834. tcase << TestAction.new(:pressHome_3) do
  3835. pressHome
  3836. end
  3837.  
  3838. tcase.run(loopTime)
  3839.  
  3840. end
  3841.  
  3842. def self.Browser_05_01_04_03(loopTime)
  3843.  
  3844. tcase = TestCase.new("Browser_05_01_04_03")
  3845.  
  3846. tcase << TestAction.new(:scriptAction_2_1_1_1) do
  3847. logStartTest("Browser_05_01_04_03")
  3848. end
  3849.  
  3850. tcase << TestAction.new(:gotoApp_2) do
  3851. gotoApp('Chrome')
  3852. end
  3853.  
  3854. tcase << TestAction.new(:EditText_UrlBar_27) do
  3855. $ruiObj = RUIObject.new.with('objectid', 1651866124).with('selfid', 613381324).with('textdescid', -331757676).with('uniqueparentid', 0)
  3856. .with('uitreeindex', 2)
  3857. .with('classname', 'EditText')
  3858. .with('resource-id', 'com.android.chrome:id/url_bar')
  3859.  
  3860. $ruiObj.inputtext('www.ebay.com')
  3861. noFailCheck
  3862.  
  3863. waitsecond(1)
  3864. end
  3865.  
  3866. tcase << TestAction.new(:pressEnter_10) do
  3867. pressEnter
  3868.  
  3869. waitsecond(4)
  3870. end
  3871.  
  3872. tcase << TestAction.new(:EditText_UrlBar_4) do
  3873. $ruiObj = RUIObject.new.with('objectid', 1651866124).with('selfid', 613381324).with('textdescid', -331757676).with('uniqueparentid', 0)
  3874. .with('uitreeindex', 2)
  3875. .with('classname', 'EditText')
  3876. .with('resource-id', 'com.android.chrome:id/url_bar')
  3877.  
  3878. $ruiObj.inputtext('www.yahoo.com')
  3879. noFailCheck
  3880.  
  3881. waitsecond(1)
  3882. end
  3883.  
  3884. tcase << TestAction.new(:pressEnter_12) do
  3885. pressEnter
  3886.  
  3887. waitsecond(4)
  3888. end
  3889.  
  3890. tcase << TestAction.new(:EditText_UrlBar_5) do
  3891. $ruiObj = RUIObject.new.with('objectid', 1651866124).with('selfid', 613381324).with('textdescid', -331757676).with('uniqueparentid', 0)
  3892. .with('uitreeindex', 2)
  3893. .with('classname', 'EditText')
  3894. .with('resource-id', 'com.android.chrome:id/url_bar')
  3895.  
  3896. $ruiObj.inputtext('www.amazon.com')
  3897. noFailCheck
  3898.  
  3899. waitsecond(1)
  3900. end
  3901.  
  3902. tcase << TestAction.new(:pressEnter_14) do
  3903. pressEnter
  3904.  
  3905. waitsecond(4)
  3906. end
  3907.  
  3908. tcase << TestAction.new(:EditText_UrlBar_6) do
  3909. $ruiObj = RUIObject.new.with('objectid', 1651866124).with('selfid', 613381324).with('textdescid', -331757676).with('uniqueparentid', 0)
  3910. .with('uitreeindex', 2)
  3911. .with('classname', 'EditText')
  3912. .with('resource-id', 'com.android.chrome:id/url_bar')
  3913.  
  3914. $ruiObj.inputtext('www.youtube.com')
  3915. noFailCheck
  3916.  
  3917. waitsecond(1)
  3918. end
  3919.  
  3920. tcase << TestAction.new(:pressEnter_16) do
  3921. pressEnter
  3922.  
  3923. waitsecond(4)
  3924. end
  3925.  
  3926. tcase << TestAction.new(:EditText_UrlBar_7) do
  3927. $ruiObj = RUIObject.new.with('objectid', 1651866124).with('selfid', 613381324).with('textdescid', -331757676).with('uniqueparentid', 0)
  3928. .with('uitreeindex', 2)
  3929. .with('classname', 'EditText')
  3930. .with('resource-id', 'com.android.chrome:id/url_bar')
  3931.  
  3932. $ruiObj.inputtext('www.nytimes.com')
  3933. noFailCheck
  3934.  
  3935. waitsecond(1)
  3936. end
  3937.  
  3938. tcase << TestAction.new(:pressEnter_18) do
  3939. pressEnter
  3940.  
  3941. waitsecond(4)
  3942. end
  3943.  
  3944. tcase << TestAction.new(:wait2second_2) do
  3945. waitsecond(2)
  3946. end
  3947.  
  3948. tcase << TestAction.new(:scriptAction_1_1_1_1) do
  3949. $reload = RUIObject.new.with('objectid', -1485276626).with('selfid', 131798869).with('textdescid', -1148751605).with('uniqueparentid', -932380963)
  3950. .with('uitreeindex', 1)
  3951. .with('classname', 'Button')
  3952. .with('content-desc', 'RELOAD').exists?
  3953.  
  3954. $progressBar = RUIObject.new.with('objectid', 460148827).with('selfid', -703099949).with('textdescid', 1379711781).with('uniqueparentid', 0)
  3955. .with('uitreeindex', 4)
  3956. .with('pretext', 'Block')
  3957. .with('classname', 'ProgressBar')
  3958. .with('resource-id', 'com.android.chrome:id/progress').exists?
  3959.  
  3960. if ($progressBar or $reload) == true
  3961. $myTestResult = false
  3962. else
  3963. $myTestResult = true
  3964. end
  3965. if $myTestResult == false
  3966. $myFailReason = "Page not loaded."
  3967. end
  3968. logStopTest("Browser_05_01_04_03")
  3969. end
  3970.  
  3971. tcase << TestAction.new(:pressHome_8) do
  3972. pressHome
  3973. end
  3974.  
  3975. tcase.run(loopTime)
  3976.  
  3977. end
  3978.  
  3979. def self.Browser_05_01_04_02(loopTime)
  3980.  
  3981. tcase = TestCase.new("Browser_05_01_04_02")
  3982.  
  3983. tcase << TestAction.new(:scriptAction_2_1) do
  3984. logStartTest("Browser_05_01_04_02")
  3985. end
  3986.  
  3987. tcase << TestAction.new(:gotoApp_21) do
  3988. gotoApp('Chrome')
  3989. end
  3990.  
  3991. tcase << TestAction.new(:EditText_UrlBar_5) do
  3992. $ruiObj = RUIObject.new.with('objectid', 1651866124).with('selfid', 613381324).with('textdescid', -331757676).with('uniqueparentid', 0)
  3993. .with('uitreeindex', 10)
  3994. .with('classname', 'EditText')
  3995. .with('resource-id', 'com.android.chrome:id/url_bar')
  3996.  
  3997. $ruiObj.inputtext('www.naver.com')
  3998.  
  3999. waitsecond(1)
  4000. end
  4001.  
  4002. tcase << TestAction.new(:pressEnter_6) do
  4003. pressEnter
  4004.  
  4005. waitsecond(4)
  4006. end
  4007.  
  4008. tcase << TestAction.new(:clickXY_411_744_8) do
  4009. click(411,744)
  4010.  
  4011. waitsecond(4)
  4012. end
  4013.  
  4014. tcase << TestAction.new(:swipeDown_9) do
  4015. swipe_vertical 500
  4016. end
  4017.  
  4018. tcase << TestAction.new(:scriptAction_1_1_1) do
  4019. $reload = RUIObject.new.with('objectid', -1485276626).with('selfid', 131798869).with('textdescid', -1148751605).with('uniqueparentid', -932380963)
  4020. .with('uitreeindex', 1)
  4021. .with('classname', 'Button')
  4022. .with('content-desc', 'RELOAD').exists?
  4023.  
  4024. $progressBar = RUIObject.new.with('objectid', 460148827).with('selfid', -703099949).with('textdescid', 1379711781).with('uniqueparentid', 0)
  4025. .with('uitreeindex', 4)
  4026. .with('pretext', 'Block')
  4027. .with('classname', 'ProgressBar')
  4028. .with('resource-id', 'com.android.chrome:id/progress').exists?
  4029.  
  4030. if ($progressBar or $reload) == true
  4031. $myTestResult = false
  4032. else
  4033. $myTestResult = true
  4034. end
  4035. if $myTestResult == false
  4036. $myFailReason = "Page not loaded."
  4037. end
  4038. logStopTest("Browser_05_01_04_02")
  4039. end
  4040.  
  4041. tcase << TestAction.new(:pressBack_10) do
  4042. pressBack
  4043. end
  4044.  
  4045. tcase << TestAction.new(:pressBack_1) do
  4046. pressBack
  4047. end
  4048.  
  4049. tcase.run(loopTime)
  4050.  
  4051. end
  4052.  
  4053. def self.Browser_05_01_04_01(loopTime)
  4054.  
  4055. tcase = TestCase.new("Browser_05_01_04_01")
  4056.  
  4057. tcase << TestAction.new(:scriptAction_2) do
  4058. logStartTest("Browser_05_01_04_01")
  4059. end
  4060.  
  4061. tcase << TestAction.new(:gotoApp_2) do
  4062. gotoApp('Chrome')
  4063. end
  4064.  
  4065. tcase << TestAction.new(:Button_TermsAccept_2) do
  4066. $ruiObj = RUIObject.new.with('objectid', -731197748).with('selfid', 659232449).with('textdescid', 1426387421).with('uniqueparentid', 0)
  4067. .with('uitreeindex', 4)
  4068. .with('classname', 'Button')
  4069. .with('resource-id', 'com.android.chrome:id/terms_accept')
  4070. .with('text', 'Accept continue')
  4071.  
  4072. $ruiObj.click
  4073. noFailCheck
  4074. end
  4075.  
  4076. tcase << TestAction.new(:Button_PositiveButton_4) do
  4077. $ruiObj = RUIObject.new.with('objectid', 608181399).with('selfid', 780691289).with('textdescid', -1851914588).with('uniqueparentid', 0)
  4078. .with('uitreeindex', 5)
  4079. .with('classname', 'Button')
  4080. .with('resource-id', 'com.android.chrome:id/positive_button')
  4081. .with('text', 'Next')
  4082.  
  4083. $ruiObj.click
  4084. noFailCheck
  4085. end
  4086.  
  4087. tcase << TestAction.new(:Button_PositiveButton_6) do
  4088. $ruiObj = RUIObject.new.with('objectid', -255474603).with('selfid', 780402664).with('textdescid', -1721638605).with('uniqueparentid', 0)
  4089. .with('uitreeindex', 7)
  4090. .with('classname', 'Button')
  4091. .with('resource-id', 'com.android.chrome:id/positive_button')
  4092. .with('text', 'Done')
  4093.  
  4094. $ruiObj.click
  4095. noFailCheck
  4096. end
  4097.  
  4098. tcase << TestAction.new(:EditText_UrlBar_2) do
  4099. $ruiObj = RUIObject.new.with('objectid', 1651866124).with('selfid', 613381324).with('textdescid', -331757676).with('uniqueparentid', 0)
  4100. .with('uitreeindex', 9)
  4101. .with('classname', 'EditText')
  4102. .with('resource-id', 'com.android.chrome:id/url_bar')
  4103.  
  4104. $ruiObj.inputtext('m.att.com')
  4105. noFailCheck
  4106.  
  4107. waitsecond(1)
  4108. end
  4109.  
  4110. tcase << TestAction.new(:pressEnter_5) do
  4111. pressEnter
  4112.  
  4113. waitsecond(2)
  4114. end
  4115.  
  4116. tcase << TestAction.new(:wait4second_2) do
  4117. waitsecond(4)
  4118. end
  4119.  
  4120. tcase << TestAction.new(:scriptAction_1_1) do
  4121. $reload = RUIObject.new.with('objectid', -1485276626).with('selfid', 131798869).with('textdescid', -1148751605).with('uniqueparentid', -932380963)
  4122. .with('uitreeindex', 1)
  4123. .with('classname', 'Button')
  4124. .with('content-desc', 'RELOAD').exists?
  4125.  
  4126. $progressBar = RUIObject.new.with('objectid', 460148827).with('selfid', -703099949).with('textdescid', 1379711781).with('uniqueparentid', 0)
  4127. .with('uitreeindex', 4)
  4128. .with('pretext', 'Block')
  4129. .with('classname', 'ProgressBar')
  4130. .with('resource-id', 'com.android.chrome:id/progress').exists?
  4131.  
  4132. if ($progressBar || $reload) == true
  4133. $myTestResult = false
  4134. else
  4135. $myTestResult = true
  4136. end
  4137. if $myTestResult == false
  4138. $myFailReason = "Page not loaded."
  4139. end
  4140. logStopTest("Browser_05_01_04_01")
  4141. end
  4142.  
  4143. tcase << TestAction.new(:pressBack_1) do
  4144. pressBack
  4145. end
  4146.  
  4147. tcase << TestAction.new(:pressHome_1) do
  4148. pressHome
  4149. end
  4150.  
  4151. tcase.run(loopTime)
  4152.  
  4153. end
  4154.  
  4155. def self.Email_05_01_03_03(loopTime)
  4156.  
  4157. tcase = TestCase.new("Email_05_01_03_03")
  4158.  
  4159. tcase << TestAction.new(:scriptAction_3) do
  4160. logStartTest("Email_05_01_03_03")
  4161. end
  4162.  
  4163. tcase << TestAction.new(:gotoApp_3) do
  4164. gotoApp('Gmail')
  4165. end
  4166.  
  4167. tcase << TestAction.new(:ImageButton_Navigate_2) do
  4168. $ruiObj = RUIObject.new.with('objectid', -387960062).with('selfid', -123872605).with('textdescid', -1698616212).with('uniqueparentid', 0)
  4169. .with('uitreeindex', 0)
  4170. .with('classname', 'ImageButton')
  4171. .with('content-desc', 'Navigate up')
  4172.  
  4173. $ruiObj.click
  4174. end
  4175.  
  4176. tcase << TestAction.new(:TextView_Name_25_1) do
  4177. $ruiObj = RUIObject.new.with('objectid', -630461263).with('selfid', 1424467117).with('textdescid', -1091979836).with('uniqueparentid', 0).with('classresourceid', 790406410)
  4178. .with('uitreeindex', 11)
  4179. .with('classname', 'TextView')
  4180. .with('resource-id', 'com.google.android.gm:id/name')
  4181. .with('text', 'Social')
  4182.  
  4183. $ruiObj.click
  4184.  
  4185. waitsecond(2)
  4186. end
  4187.  
  4188. tcase << TestAction.new(:clickXY_441_774_2) do
  4189. click(441,774)
  4190.  
  4191. waitsecond(1)
  4192. end
  4193.  
  4194. tcase << TestAction.new(:ImageView_Reply_4) do
  4195. $ruiObj = RUIObject.new.with('objectid', -1328236453).with('selfid', -78599687).with('textdescid', 562783621).with('uniqueparentid', 0)
  4196. .with('uitreeindex', 114)
  4197. .with('classname', 'ImageView')
  4198. .with('resource-id', 'com.google.android.gm:id/reply')
  4199. .with('content-desc', 'Reply')
  4200.  
  4201. $ruiObj.isExist
  4202. end
  4203.  
  4204. tcase << TestAction.new(:scriptAction_8_1_1) do
  4205. $myTestResult = checkLastExistResult
  4206.  
  4207. if $myTestResult == false
  4208. $myFailReason = "Email not opened"
  4209. end
  4210. logStopTest("Email_05_01_03_03")
  4211. end
  4212.  
  4213. tcase << TestAction.new(:pressBack_1) do
  4214. pressBack
  4215. end
  4216.  
  4217. tcase << TestAction.new(:pressBack_2) do
  4218. pressBack
  4219. end
  4220.  
  4221. tcase.run(loopTime)
  4222.  
  4223. end
  4224.  
  4225. def self.Email_05_01_03_02(loopTime)
  4226.  
  4227. tcase = TestCase.new("Email_05_01_03_02")
  4228.  
  4229. tcase << TestAction.new(:scriptAction_12) do
  4230. logStartTest("Email_05_01_03_02")
  4231. end
  4232.  
  4233. tcase << TestAction.new(:gotoApp_3) do
  4234. gotoApp('Gmail')
  4235. end
  4236.  
  4237. tcase << TestAction.new(:ImageButton_ComposeButton_27) do
  4238. $ruiObj = RUIObject.new.with('objectid', 2010391035).with('selfid', 1808564263).with('textdescid', -481574643).with('uniqueparentid', 0)
  4239. .with('uitreeindex', 23)
  4240. .with('classname', 'ImageButton')
  4241. .with('resource-id', 'com.google.android.gm:id/compose_button')
  4242. .with('content-desc', 'Compose')
  4243.  
  4244. $ruiObj.click
  4245.  
  4246. waitsecond(1)
  4247. end
  4248.  
  4249. tcase << TestAction.new(:MultiAutoCompleteTextView_To_44) do
  4250. $ruiObj = RUIObject.new.with('objectid', -1987566378).with('selfid', -538836202).with('textdescid', 151401701).with('uniqueparentid', 0).with('classresourceid', 1488875515)
  4251. .with('uitreeindex', 9)
  4252. .with('classname', 'MultiAutoCompleteTextView')
  4253. .with('resource-id', 'com.google.android.gm:id/to')
  4254. .with('content-desc', 'To')
  4255.  
  4256. $ruiObj.inputtext('dvgats1@gmail.com')
  4257. end
  4258.  
  4259. tcase << TestAction.new(:pressEnter_3) do
  4260. pressEnter
  4261. end
  4262.  
  4263. tcase << TestAction.new(:EditText_Subject_67) do
  4264. $ruiObj = RUIObject.new.with('objectid', -1237078311).with('selfid', -477614756).with('textdescid', 305278055).with('uniqueparentid', 0).with('classresourceid', 927865352)
  4265. .with('uitreeindex', 12)
  4266. .with('classname', 'EditText')
  4267. .with('resource-id', 'com.google.android.gm:id/subject')
  4268.  
  4269. $ruiObj.inputtext('Email Test')
  4270. end
  4271.  
  4272. tcase << TestAction.new(:EditText_Body_83) do
  4273. $ruiObj = RUIObject.new.with('objectid', -947933892).with('selfid', 132829042).with('textdescid', 678820452).with('uniqueparentid', 0).with('classresourceid', 52429382)
  4274. .with('uitreeindex', 14)
  4275. .with('classname', 'EditText')
  4276. .with('resource-id', 'com.google.android.gm:id/body')
  4277.  
  4278. $ruiObj.inputtext('Testing UiEngine Email Test!!!')
  4279. end
  4280.  
  4281. tcase << TestAction.new(:TextView_AddAttachment_10) do
  4282. $ruiObj = RUIObject.new.with('objectid', -173497965).with('selfid', 1566257663).with('textdescid', -1339317046).with('uniqueparentid', 0)
  4283. .with('uitreeindex', 2)
  4284. .with('classname', 'TextView')
  4285. .with('resource-id', 'com.google.android.gm:id/add_attachment')
  4286. .with('content-desc', 'Attach file')
  4287.  
  4288. $ruiObj.click
  4289. end
  4290.  
  4291. tcase << TestAction.new(:TextView_Title_12) do
  4292. $ruiObj = RUIObject.new.with('objectid', 665784376).with('selfid', -1478650284).with('textdescid', 1395090321).with('uniqueparentid', 0).with('classresourceid', -1261418567)
  4293. .with('uitreeindex', 0)
  4294. .with('classname', 'TextView')
  4295. .with('resource-id', 'com.google.android.gm:id/title')
  4296. .with('text', 'Attach file')
  4297.  
  4298. $ruiObj.click
  4299. end
  4300.  
  4301. tcase << TestAction.new(:ImageButton_Show_14) do
  4302. $ruiObj = RUIObject.new.with('objectid', -1807230859).with('selfid', -929198491).with('textdescid', 629574489).with('uniqueparentid', 0)
  4303. .with('uitreeindex', 0)
  4304. .with('classname', 'ImageButton')
  4305. .with('content-desc', 'Show roots')
  4306.  
  4307. $ruiObj.click
  4308. end
  4309.  
  4310. tcase << TestAction.new(:TextView_Title_16) do
  4311. $ruiObj = RUIObject.new.with('objectid', 942770025).with('selfid', -192133575).with('textdescid', 790630097).with('uniqueparentid', 0).with('classresourceid', 490183159)
  4312. .with('uitreeindex', 15)
  4313. .with('classname', 'TextView')
  4314. .with('resource-id', 'android:id/title')
  4315. .with('text', 'Images')
  4316.  
  4317. $ruiObj.click
  4318. end
  4319.  
  4320. tcase << TestAction.new(:TextView_Title_41) do
  4321. $ruiObj = RUIObject.new.with('objectid', -119887707).with('selfid', -429664675).with('textdescid', 1147870057).with('uniqueparentid', 0)
  4322. .with('uitreeindex', 26)
  4323. .with('classname', 'TextView')
  4324. .with('resource-id', 'android:id/title')
  4325. .with('text', '1M')
  4326.  
  4327. $ruiObj.click
  4328.  
  4329. waitsecond(1)
  4330. end
  4331.  
  4332. tcase << TestAction.new(:clickXY_285_531_6) do
  4333. click(285,531)
  4334. end
  4335.  
  4336. tcase << TestAction.new(:TextView_Send_18) do
  4337. $ruiObj = RUIObject.new.with('objectid', 263473178).with('selfid', 2103341243).with('textdescid', -1351242642).with('uniqueparentid', 0)
  4338. .with('uitreeindex', 3)
  4339. .with('classname', 'TextView')
  4340. .with('resource-id', 'com.google.android.gm:id/send')
  4341. .with('content-desc', 'Send')
  4342.  
  4343. $ruiObj.click
  4344.  
  4345. waitsecond(1)
  4346. end
  4347.  
  4348. tcase << TestAction.new(:TextView_Search_2) do
  4349. $ruiObj = RUIObject.new.with('objectid', -1003571279).with('selfid', 1669908731).with('textdescid', 932594519).with('uniqueparentid', 1865666832)
  4350. .with('uitreeindex', 2)
  4351. .with('classname', 'TextView')
  4352. .with('resource-id', 'com.google.android.gm:id/search')
  4353. .with('content-desc', 'Search')
  4354.  
  4355. $ruiObj.isExist
  4356. end
  4357.  
  4358. tcase << TestAction.new(:ImageButton_Navigate_13) do
  4359. $ruiObj = RUIObject.new.with('objectid', 602079874).with('selfid', -123872605).with('textdescid', -1025319956).with('uniqueparentid', 0)
  4360. .with('uitreeindex', 0)
  4361. .with('classname', 'ImageButton')
  4362. .with('content-desc', 'Navigate up')
  4363.  
  4364. $ruiObj.click
  4365.  
  4366. waitsecond(1)
  4367. end
  4368.  
  4369. tcase << TestAction.new(:TextView_Name_2) do
  4370. $ruiObj = RUIObject.new.with('objectid', -630461263).with('selfid', -610816808).with('textdescid', 727067449).with('uniqueparentid', 0).with('classresourceid', 790406410)
  4371. .with('uitreeindex', 21)
  4372. .with('classname', 'TextView')
  4373. .with('resource-id', 'com.google.android.gm:id/name')
  4374. .with('text', 'Sent')
  4375.  
  4376. $ruiObj.click
  4377.  
  4378. waitsecond(1)
  4379. end
  4380.  
  4381. tcase << TestAction.new(:clickXY_300_720_2) do
  4382. click(300,720)
  4383.  
  4384. waitsecond(1)
  4385. end
  4386.  
  4387. tcase << TestAction.new(:TextView_Delete_23) do
  4388. $ruiObj = RUIObject.new.with('objectid', -1432692812).with('selfid', -390800203).with('textdescid', -779181577).with('uniqueparentid', 0)
  4389. .with('uitreeindex', 1)
  4390. .with('classname', 'TextView')
  4391. .with('resource-id', 'com.google.android.gm:id/delete')
  4392. .with('content-desc', 'Delete')
  4393.  
  4394. $ruiObj.click
  4395. end
  4396.  
  4397. tcase << TestAction.new(:scriptAction_8) do
  4398. $myTestResult = checkLastExistResult
  4399.  
  4400. if $myTestResult == false
  4401. $myFailReason = "Email not sent"
  4402. end
  4403. logStopTest("Email_05_01_03_02")
  4404. end
  4405.  
  4406. tcase << TestAction.new(:pressBack_3) do
  4407. pressBack
  4408. end
  4409.  
  4410. tcase << TestAction.new(:pressBack_4) do
  4411. pressBack
  4412. end
  4413.  
  4414. tcase.run(loopTime)
  4415.  
  4416. end
  4417.  
  4418. def self.Email_05_01_03_01(loopTime)
  4419.  
  4420. tcase = TestCase.new("Email_05_01_03_01")
  4421.  
  4422. tcase << TestAction.new(:scriptAction_12) do
  4423. logStartTest("Email_05_01_03_01")
  4424. end
  4425.  
  4426. tcase << TestAction.new(:gotoApp_3) do
  4427. gotoApp('Gmail')
  4428. end
  4429.  
  4430. tcase << TestAction.new(:ImageButton_ComposeButton_2) do
  4431. $ruiObj = RUIObject.new.with('objectid', 2010391035).with('selfid', 1808564263).with('textdescid', -481574643).with('uniqueparentid', 0)
  4432. .with('uitreeindex', 10)
  4433. .with('classname', 'ImageButton')
  4434. .with('resource-id', 'com.google.android.gm:id/compose_button')
  4435. .with('content-desc', 'Compose')
  4436.  
  4437. $ruiObj.click
  4438.  
  4439. waitsecond(1)
  4440. end
  4441.  
  4442. tcase << TestAction.new(:MultiAutoCompleteTextView_To_45) do
  4443. $ruiObj = RUIObject.new.with('objectid', -1987566378).with('selfid', -538836202).with('textdescid', 151401701).with('uniqueparentid', 0).with('classresourceid', 1488875515)
  4444. .with('uitreeindex', 9)
  4445. .with('classname', 'MultiAutoCompleteTextView')
  4446. .with('resource-id', 'com.google.android.gm:id/to')
  4447. .with('content-desc', 'To')
  4448.  
  4449. $ruiObj.inputtext('dvgats1@gmail.com')
  4450. end
  4451.  
  4452. tcase << TestAction.new(:pressEnter_3) do
  4453. pressEnter
  4454. end
  4455.  
  4456. tcase << TestAction.new(:EditText_Subject_65) do
  4457. $ruiObj = RUIObject.new.with('objectid', -1237078311).with('selfid', -477614756).with('textdescid', 305278055).with('uniqueparentid', 0).with('classresourceid', 927865352)
  4458. .with('uitreeindex', 11)
  4459. .with('classname', 'EditText')
  4460. .with('resource-id', 'com.google.android.gm:id/subject')
  4461.  
  4462. $ruiObj.inputtext('Email Test')
  4463. end
  4464.  
  4465. tcase << TestAction.new(:EditText_Body_84) do
  4466. $ruiObj = RUIObject.new.with('objectid', -947933892).with('selfid', 132829042).with('textdescid', 678820452).with('uniqueparentid', 0).with('classresourceid', 52429382)
  4467. .with('uitreeindex', 12)
  4468. .with('classname', 'EditText')
  4469. .with('resource-id', 'com.google.android.gm:id/body')
  4470.  
  4471. $ruiObj.inputtext('Testing UiEngine Email Test!!!')
  4472. end
  4473.  
  4474. tcase << TestAction.new(:TextView_Send_12) do
  4475. $ruiObj = RUIObject.new.with('objectid', 263473178).with('selfid', 2103341243).with('textdescid', -1351242642).with('uniqueparentid', 0)
  4476. .with('uitreeindex', 4)
  4477. .with('classname', 'TextView')
  4478. .with('resource-id', 'com.google.android.gm:id/send')
  4479. .with('content-desc', 'Send')
  4480.  
  4481. $ruiObj.click
  4482.  
  4483. waitsecond(1)
  4484. end
  4485.  
  4486. tcase << TestAction.new(:ImageButton_ComposeButton_14) do
  4487. $ruiObj = RUIObject.new.with('objectid', 2010391035).with('selfid', 1808564263).with('textdescid', -481574643).with('uniqueparentid', 0)
  4488. .with('uitreeindex', 5)
  4489. .with('classname', 'ImageButton')
  4490. .with('resource-id', 'com.google.android.gm:id/compose_button')
  4491. .with('content-desc', 'Compose')
  4492.  
  4493. $ruiObj.isExist
  4494. end
  4495.  
  4496. tcase << TestAction.new(:ImageButton_Navigate_13) do
  4497. $ruiObj = RUIObject.new.with('objectid', 602079874).with('selfid', -123872605).with('textdescid', -1025319956).with('uniqueparentid', 0)
  4498. .with('uitreeindex', 0)
  4499. .with('classname', 'ImageButton')
  4500. .with('content-desc', 'Navigate up')
  4501.  
  4502. $ruiObj.click
  4503. end
  4504.  
  4505. tcase << TestAction.new(:TextView_Name_17) do
  4506. $ruiObj = RUIObject.new.with('objectid', -630461263).with('selfid', -610816808).with('textdescid', 727067449).with('uniqueparentid', 0).with('classresourceid', 790406410)
  4507. .with('uitreeindex', 24)
  4508. .with('classname', 'TextView')
  4509. .with('resource-id', 'com.google.android.gm:id/name')
  4510. .with('text', 'Sent')
  4511.  
  4512. $ruiObj.click
  4513.  
  4514. waitsecond(1)
  4515. end
  4516.  
  4517. tcase << TestAction.new(:clickXY_300_720_2_1) do
  4518. click(300,720)
  4519.  
  4520. waitsecond(1)
  4521. end
  4522.  
  4523. tcase << TestAction.new(:TextView_Delete_19) do
  4524. $ruiObj = RUIObject.new.with('objectid', -1432692812).with('selfid', -390800203).with('textdescid', -779181577).with('uniqueparentid', 0)
  4525. .with('uitreeindex', 2)
  4526. .with('classname', 'TextView')
  4527. .with('resource-id', 'com.google.android.gm:id/delete')
  4528. .with('content-desc', 'Delete')
  4529.  
  4530. $ruiObj.click
  4531. end
  4532.  
  4533. tcase << TestAction.new(:scriptAction_8) do
  4534. $myTestResult = checkLastExistResult
  4535.  
  4536. if $myTestResult == false
  4537. $myFailReason = "Email not sent"
  4538. end
  4539. logStopTest("Email_05_01_03_01")
  4540. end
  4541.  
  4542. tcase << TestAction.new(:pressBack_3) do
  4543. pressBack
  4544. end
  4545.  
  4546. tcase << TestAction.new(:pressBack_4) do
  4547. pressBack
  4548. end
  4549.  
  4550. tcase.run(loopTime)
  4551.  
  4552. end
  4553.  
  4554. def self.Messaging_05_01_02_06(loopTime)
  4555.  
  4556. tcase = TestCase.new("Messaging_05_01_02_06")
  4557.  
  4558. tcase << TestAction.new(:scriptAction_28) do
  4559. logStartTest("Messaging_05_01_02_06")
  4560. end
  4561.  
  4562. tcase << TestAction.new(:gotoApp_2) do
  4563. gotoApp('Messenger')
  4564. end
  4565.  
  4566. tcase << TestAction.new(:ImageView_StartNewConversationButton_2) do
  4567. $ruiObj = RUIObject.new.with('objectid', -274740130).with('selfid', 916878134).with('textdescid', -2118059933).with('uniqueparentid', 0)
  4568. .with('uitreeindex', 6)
  4569. .with('classname', 'ImageView')
  4570. .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
  4571. .with('content-desc', 'Start new conversation')
  4572.  
  4573. $ruiObj.click
  4574.  
  4575. waitsecond(1)
  4576. end
  4577.  
  4578. tcase << TestAction.new(:MultiAutoCompleteTextView_RecipientTextView_4) do
  4579. $ruiObj = RUIObject.new.with('objectid', -1115682772).with('selfid', 1163803387).with('textdescid', -226427532).with('uniqueparentid', 0).with('classresourceid', 461007471)
  4580. .with('uitreeindex', 1)
  4581. .with('classname', 'MultiAutoCompleteTextView')
  4582. .with('resource-id', 'com.google.android.apps.messaging:id/recipient_text_view')
  4583.  
  4584. $ruiObj.inputtext('A01')
  4585.  
  4586. waitsecond(1)
  4587. end
  4588.  
  4589. tcase << TestAction.new(:clickXY_213_504_2) do
  4590. click(213,504)
  4591.  
  4592. waitsecond(1)
  4593. end
  4594.  
  4595. tcase << TestAction.new(:EditText_ComposeMessageText_8) do
  4596. $ruiObj = RUIObject.new.with('objectid', 1578981159).with('selfid', -1932318364).with('textdescid', 1703775705).with('uniqueparentid', 0)
  4597. .with('uitreeindex', 5)
  4598. .with('classname', 'EditText')
  4599. .with('resource-id', 'com.google.android.apps.messaging:id/compose_message_text')
  4600.  
  4601. $ruiObj.click
  4602.  
  4603. waitsecond(1)
  4604. end
  4605.  
  4606. tcase << TestAction.new(:scriptAction_141_1) do
  4607. $ruiObj.inputtext('Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzaaaaaaaaaabbbbbbbbbbcccccccccc')
  4608.  
  4609. waitsecond(1)
  4610. end
  4611.  
  4612. tcase << TestAction.new(:ImageButton_AttachMediaButton_4) do
  4613. $ruiObj = RUIObject.new.with('objectid', 840041021).with('selfid', -952088716).with('textdescid', -438944396).with('uniqueparentid', 0)
  4614. .with('uitreeindex', 4)
  4615. .with('classname', 'ImageButton')
  4616. .with('resource-id', 'com.google.android.apps.messaging:id/attach_media_button')
  4617. .with('content-desc', 'Add an attachment')
  4618.  
  4619. $ruiObj.click
  4620.  
  4621. waitsecond(1)
  4622. end
  4623.  
  4624. tcase << TestAction.new(:ImageButton_Choose_6_1_1) do
  4625. $ruiObj = RUIObject.new.with('objectid', 1408822083).with('selfid', 538927602).with('textdescid', 531479902).with('uniqueparentid', 0)
  4626. .with('uitreeindex', 13)
  4627. .with('classname', 'ImageButton')
  4628. .with('content-desc', 'Choose images from this device')
  4629.  
  4630. $ruiObj.click
  4631.  
  4632. waitsecond(1)
  4633. end
  4634.  
  4635. tcase << TestAction.new(:ImageView_Image_2) do
  4636. $ruiObj = RUIObject.new.with('objectid', 210721229).with('selfid', -1447729616).with('textdescid', -2055736335).with('uniqueparentid', 0)
  4637. .with('uitreeindex', 8)
  4638. .with('classname', 'ImageView')
  4639. .with('resource-id', 'com.google.android.apps.messaging:id/image')
  4640. .with('content-desc', 'Choose image from document library')
  4641.  
  4642. $ruiObj.longClick
  4643.  
  4644. waitsecond(1)
  4645. end
  4646.  
  4647. tcase << TestAction.new(:ImageButton_Show_22) do
  4648. $ruiObj = RUIObject.new.with('objectid', -1807230859).with('selfid', -929198491).with('textdescid', 629574489).with('uniqueparentid', 0)
  4649. .with('uitreeindex', 0)
  4650. .with('classname', 'ImageButton')
  4651. .with('content-desc', 'Show roots')
  4652.  
  4653. $ruiObj.click
  4654.  
  4655. waitsecond(1)
  4656. end
  4657.  
  4658. tcase << TestAction.new(:TextView_Title_6) do
  4659. $ruiObj = RUIObject.new.with('objectid', 942770025).with('selfid', -192133575).with('textdescid', 790630097).with('uniqueparentid', 0).with('classresourceid', 490183159)
  4660. .with('uitreeindex', 30)
  4661. .with('classname', 'TextView')
  4662. .with('resource-id', 'android:id/title')
  4663. .with('text', 'Images')
  4664.  
  4665. $ruiObj.click
  4666.  
  4667. waitsecond(1)
  4668. end
  4669.  
  4670. tcase << TestAction.new(:TextView_Title_8) do
  4671. $ruiObj = RUIObject.new.with('objectid', -119887707).with('selfid', -429664675).with('textdescid', 1147870057).with('uniqueparentid', 0)
  4672. .with('uitreeindex', 26)
  4673. .with('classname', 'TextView')
  4674. .with('resource-id', 'android:id/title')
  4675. .with('text', '1M')
  4676.  
  4677. $ruiObj.click
  4678.  
  4679. waitsecond(1)
  4680. end
  4681.  
  4682. tcase << TestAction.new(:clickXY_189_513_30) do
  4683. click(189,513)
  4684.  
  4685. waitsecond(1)
  4686. end
  4687.  
  4688. tcase << TestAction.new(:ImageButton_CloseButton_2) do
  4689. $ruiObj = RUIObject.new.with('objectid', -1834819923).with('selfid', -966281882).with('textdescid', -863126440).with('uniqueparentid', 716741550).with('classresourceid', 369276917)
  4690. .with('uitreeindex', 1)
  4691. .with('classname', 'ImageButton')
  4692. .with('resource-id', 'com.google.android.apps.messaging:id/close_button')
  4693. .with('content-desc', 'Discard attachment')
  4694.  
  4695. $ruiObj.isExist
  4696.  
  4697. waitsecond(1)
  4698. end
  4699.  
  4700. tcase << TestAction.new(:scriptAction_4) do
  4701. if checkLastExistResult === true
  4702. $letsCount = 1
  4703. else
  4704. $letsCount = 0
  4705. end
  4706. end
  4707.  
  4708. tcase << TestAction.new(:ImageButton_SendMessageButton_17) do
  4709. $ruiObj = RUIObject.new.with('objectid', -1329122643).with('selfid', -1857249780).with('textdescid', 1740568962).with('uniqueparentid', 0)
  4710. .with('uitreeindex', 9)
  4711. .with('classname', 'ImageButton')
  4712. .with('resource-id', 'com.google.android.apps.messaging:id/send_message_button')
  4713. .with('content-desc', 'Send Message')
  4714.  
  4715. $ruiObj.click
  4716.  
  4717. waitsecond(8)
  4718. end
  4719.  
  4720. tcase << TestAction.new(:pressBack_5) do
  4721. pressBack
  4722. end
  4723.  
  4724. tcase << TestAction.new(:pressBack_6) do
  4725. pressBack
  4726. end
  4727.  
  4728. tcase << TestAction.new(:clickXY_344_384_2) do
  4729. click(344,384)
  4730.  
  4731. waitsecond(1)
  4732. end
  4733.  
  4734. tcase << TestAction.new(:ImageView_More_19) do
  4735. $ruiObj = RUIObject.new.with('objectid', -1276401870).with('selfid', 328478669).with('textdescid', -2023409951).with('uniqueparentid', 0)
  4736. .with('uitreeindex', 17)
  4737. .with('classname', 'ImageView')
  4738. .with('content-desc', 'More options')
  4739.  
  4740. $ruiObj.click
  4741.  
  4742. waitsecond(1)
  4743. end
  4744.  
  4745. tcase << TestAction.new(:TextView_Title_21) do
  4746. $ruiObj = RUIObject.new.with('objectid', -1362741768).with('selfid', 1635205580).with('textdescid', 299180429).with('uniqueparentid', 0).with('classresourceid', -128793897)
  4747. .with('uitreeindex', 4)
  4748. .with('classname', 'TextView')
  4749. .with('resource-id', 'com.google.android.apps.messaging:id/title')
  4750. .with('text', 'Delete')
  4751.  
  4752. $ruiObj.click
  4753.  
  4754. waitsecond(1)
  4755. end
  4756.  
  4757. tcase << TestAction.new(:Button_Button1_23) do
  4758. $ruiObj = RUIObject.new.with('objectid', -49953928).with('selfid', 1012902611).with('textdescid', -2073088243).with('uniqueparentid', 0)
  4759. .with('uitreeindex', 2)
  4760. .with('classname', 'Button')
  4761. .with('resource-id', 'android:id/button1')
  4762. .with('text', 'Delete')
  4763.  
  4764. $ruiObj.click
  4765.  
  4766. waitsecond(1)
  4767. end
  4768.  
  4769. tcase << TestAction.new(:ImageView_StartNewConversationButton_25) do
  4770. $ruiObj = RUIObject.new.with('objectid', -274740130).with('selfid', 916878134).with('textdescid', -2118059933).with('uniqueparentid', 0)
  4771. .with('uitreeindex', 6)
  4772. .with('classname', 'ImageView')
  4773. .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
  4774. .with('content-desc', 'Start new conversation')
  4775.  
  4776. $ruiObj.isExist
  4777.  
  4778. waitsecond(1)
  4779. end
  4780.  
  4781. tcase << TestAction.new(:scriptAction_30) do
  4782. if checkLastExistResult === true and $letsCount === 1
  4783. $myTestResult = true
  4784. else
  4785. $myTestResult = false
  4786. end
  4787.  
  4788. if $myTestResult == false
  4789. $myFailReason = "Message not sent"
  4790. end
  4791. logStopTest("Messaging_05_01_02_06")
  4792. end
  4793.  
  4794. tcase << TestAction.new(:pressBack_53) do
  4795. pressBack
  4796. end
  4797.  
  4798. tcase << TestAction.new(:pressBack_26) do
  4799. pressBack
  4800. end
  4801.  
  4802. tcase.run(loopTime)
  4803.  
  4804. end
  4805.  
  4806. def self.Messaging_05_01_02_05(loopTime)
  4807.  
  4808. tcase = TestCase.new("Messaging_05_01_02_05")
  4809.  
  4810. tcase << TestAction.new(:scriptAction_28) do
  4811. logStartTest("Messaging_05_01_02_05")
  4812. end
  4813.  
  4814. tcase << TestAction.new(:gotoApp_2) do
  4815. gotoApp('Messenger')
  4816. end
  4817.  
  4818. tcase << TestAction.new(:ImageView_StartNewConversationButton_2) do
  4819. $ruiObj = RUIObject.new.with('objectid', -274740130).with('selfid', 916878134).with('textdescid', -2118059933).with('uniqueparentid', 0)
  4820. .with('uitreeindex', 6)
  4821. .with('classname', 'ImageView')
  4822. .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
  4823. .with('content-desc', 'Start new conversation')
  4824.  
  4825. $ruiObj.click
  4826.  
  4827. waitsecond(1)
  4828. end
  4829.  
  4830. tcase << TestAction.new(:MultiAutoCompleteTextView_RecipientTextView_4) do
  4831. $ruiObj = RUIObject.new.with('objectid', -1115682772).with('selfid', 1163803387).with('textdescid', -226427532).with('uniqueparentid', 0).with('classresourceid', 461007471)
  4832. .with('uitreeindex', 1)
  4833. .with('classname', 'MultiAutoCompleteTextView')
  4834. .with('resource-id', 'com.google.android.apps.messaging:id/recipient_text_view')
  4835.  
  4836. $ruiObj.inputtext('A01')
  4837.  
  4838. waitsecond(1)
  4839. end
  4840.  
  4841. tcase << TestAction.new(:clickXY_213_504_2) do
  4842. click(213,504)
  4843.  
  4844. waitsecond(1)
  4845. end
  4846.  
  4847. tcase << TestAction.new(:EditText_ComposeMessageText_8) do
  4848. $ruiObj = RUIObject.new.with('objectid', 1578981159).with('selfid', -1932318364).with('textdescid', 1703775705).with('uniqueparentid', 0)
  4849. .with('uitreeindex', 5)
  4850. .with('classname', 'EditText')
  4851. .with('resource-id', 'com.google.android.apps.messaging:id/compose_message_text')
  4852.  
  4853. $ruiObj.click
  4854.  
  4855. waitsecond(1)
  4856. end
  4857.  
  4858. tcase << TestAction.new(:scriptAction_141_1) do
  4859. $ruiObj.inputtext('Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzaaaaaaaaaabbbbbbbbbbcccccccccc')
  4860.  
  4861. waitsecond(1)
  4862. end
  4863.  
  4864. tcase << TestAction.new(:ImageButton_AttachMediaButton_4) do
  4865. $ruiObj = RUIObject.new.with('objectid', 840041021).with('selfid', -952088716).with('textdescid', -438944396).with('uniqueparentid', 0)
  4866. .with('uitreeindex', 4)
  4867. .with('classname', 'ImageButton')
  4868. .with('resource-id', 'com.google.android.apps.messaging:id/attach_media_button')
  4869. .with('content-desc', 'Add an attachment')
  4870.  
  4871. $ruiObj.click
  4872.  
  4873. waitsecond(1)
  4874. end
  4875.  
  4876. tcase << TestAction.new(:ImageButton_Choose_6) do
  4877. $ruiObj = RUIObject.new.with('objectid', 1408822083).with('selfid', 538927602).with('textdescid', 531479902).with('uniqueparentid', 0)
  4878. .with('uitreeindex', 13)
  4879. .with('classname', 'ImageButton')
  4880. .with('content-desc', 'Choose images from this device')
  4881.  
  4882. $ruiObj.click
  4883.  
  4884. waitsecond(1)
  4885. end
  4886.  
  4887. tcase << TestAction.new(:Button_PermissionAllowButton_2) do
  4888. $ruiObj = RUIObject.new.with('objectid', 308455030).with('selfid', 1444367499).with('textdescid', -770153727).with('uniqueparentid', 0)
  4889. .with('uitreeindex', 3)
  4890. .with('classname', 'Button')
  4891. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  4892. .with('text', 'Allow')
  4893.  
  4894. $ruiObj.click
  4895.  
  4896. waitsecond(1)
  4897. end
  4898.  
  4899. tcase << TestAction.new(:ImageView_Image_34) do
  4900. $ruiObj = RUIObject.new.with('objectid', 210721229).with('selfid', -1447729616).with('textdescid', -2055736335).with('uniqueparentid', 0)
  4901. .with('uitreeindex', 6)
  4902. .with('classname', 'ImageView')
  4903. .with('resource-id', 'com.google.android.apps.messaging:id/image')
  4904. .with('content-desc', 'Choose image from document library')
  4905.  
  4906. $ruiObj.longClick
  4907.  
  4908. waitsecond(1)
  4909. end
  4910.  
  4911. tcase << TestAction.new(:ImageButton_Show_22) do
  4912. $ruiObj = RUIObject.new.with('objectid', -1807230859).with('selfid', -929198491).with('textdescid', 629574489).with('uniqueparentid', 0)
  4913. .with('uitreeindex', 0)
  4914. .with('classname', 'ImageButton')
  4915. .with('content-desc', 'Show roots')
  4916.  
  4917. $ruiObj.click
  4918.  
  4919. waitsecond(1)
  4920. end
  4921.  
  4922. tcase << TestAction.new(:TextView_Title_24) do
  4923. $ruiObj = RUIObject.new.with('objectid', 942770025).with('selfid', 176439065).with('textdescid', -668519951).with('uniqueparentid', 0).with('classresourceid', 490183159)
  4924. .with('uitreeindex', 46)
  4925. .with('classname', 'TextView')
  4926. .with('resource-id', 'android:id/title')
  4927. .with('text', 'Videos')
  4928.  
  4929. $ruiObj.click
  4930.  
  4931. waitsecond(1)
  4932. end
  4933.  
  4934. tcase << TestAction.new(:TextView_Title_11) do
  4935. $ruiObj = RUIObject.new.with('objectid', -119887707).with('selfid', -429664675).with('textdescid', 1147870057).with('uniqueparentid', 0)
  4936. .with('uitreeindex', 12)
  4937. .with('classname', 'TextView')
  4938. .with('resource-id', 'android:id/title')
  4939. .with('text', '1M')
  4940.  
  4941. $ruiObj.click
  4942.  
  4943. waitsecond(1)
  4944. end
  4945.  
  4946. tcase << TestAction.new(:clickXY_189_513_30) do
  4947. click(189,513)
  4948.  
  4949. waitsecond(1)
  4950. end
  4951.  
  4952. tcase << TestAction.new(:ImageButton_CloseButton_2) do
  4953. $ruiObj = RUIObject.new.with('objectid', -1834819923).with('selfid', -966281882).with('textdescid', -863126440).with('uniqueparentid', 0).with('classresourceid', 369276917)
  4954. .with('uitreeindex', 1)
  4955. .with('classname', 'ImageButton')
  4956. .with('resource-id', 'com.google.android.apps.messaging:id/close_button')
  4957. .with('content-desc', 'Discard attachment')
  4958.  
  4959. $ruiObj.isExist
  4960.  
  4961. waitsecond(1)
  4962. end
  4963.  
  4964. tcase << TestAction.new(:scriptAction_4) do
  4965. if checkLastExistResult === true
  4966. $letsCount = 1;
  4967. else
  4968. $letsCount = 0;
  4969. end
  4970.  
  4971. waitsecond(2)
  4972. end
  4973.  
  4974. tcase << TestAction.new(:ImageButton_SendMessageButton_17) do
  4975. $ruiObj = RUIObject.new.with('objectid', -1329122643).with('selfid', -1857249780).with('textdescid', 1740568962).with('uniqueparentid', 0)
  4976. .with('uitreeindex', 9)
  4977. .with('classname', 'ImageButton')
  4978. .with('resource-id', 'com.google.android.apps.messaging:id/send_message_button')
  4979. .with('content-desc', 'Send Message')
  4980.  
  4981. $ruiObj.click
  4982.  
  4983. waitsecond(8)
  4984. end
  4985.  
  4986. tcase << TestAction.new(:pressBack_5) do
  4987. pressBack
  4988. end
  4989.  
  4990. tcase << TestAction.new(:pressBack_6) do
  4991. pressBack
  4992. end
  4993.  
  4994. tcase << TestAction.new(:clickXY_344_384_2) do
  4995. click(344,384)
  4996.  
  4997. waitsecond(1)
  4998. end
  4999.  
  5000. tcase << TestAction.new(:ImageView_More_19) do
  5001. $ruiObj = RUIObject.new.with('objectid', -1276401870).with('selfid', 328478669).with('textdescid', -2023409951).with('uniqueparentid', 0)
  5002. .with('uitreeindex', 17)
  5003. .with('classname', 'ImageView')
  5004. .with('content-desc', 'More options')
  5005.  
  5006. $ruiObj.click
  5007.  
  5008. waitsecond(1)
  5009. end
  5010.  
  5011. tcase << TestAction.new(:TextView_Title_21) do
  5012. $ruiObj = RUIObject.new.with('objectid', -1362741768).with('selfid', 1635205580).with('textdescid', 299180429).with('uniqueparentid', 0).with('classresourceid', -128793897)
  5013. .with('uitreeindex', 4)
  5014. .with('classname', 'TextView')
  5015. .with('resource-id', 'com.google.android.apps.messaging:id/title')
  5016. .with('text', 'Delete')
  5017.  
  5018. $ruiObj.click
  5019.  
  5020. waitsecond(1)
  5021. end
  5022.  
  5023. tcase << TestAction.new(:Button_Button1_23) do
  5024. $ruiObj = RUIObject.new.with('objectid', -49953928).with('selfid', 1012902611).with('textdescid', -2073088243).with('uniqueparentid', 0)
  5025. .with('uitreeindex', 2)
  5026. .with('classname', 'Button')
  5027. .with('resource-id', 'android:id/button1')
  5028. .with('text', 'Delete')
  5029.  
  5030. $ruiObj.click
  5031.  
  5032. waitsecond(1)
  5033. end
  5034.  
  5035. tcase << TestAction.new(:ImageView_StartNewConversationButton_25) do
  5036. $ruiObj = RUIObject.new.with('objectid', -274740130).with('selfid', 916878134).with('textdescid', -2118059933).with('uniqueparentid', 0)
  5037. .with('uitreeindex', 6)
  5038. .with('classname', 'ImageView')
  5039. .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
  5040. .with('content-desc', 'Start new conversation')
  5041.  
  5042. $ruiObj.isExist
  5043.  
  5044. waitsecond(1)
  5045. end
  5046.  
  5047. tcase << TestAction.new(:scriptAction_30) do
  5048. if $letsCount === 1 and checkLastExistResult === true
  5049. $myTestResult = true
  5050. else
  5051. $myTestResult = false
  5052. end
  5053.  
  5054. if $myTestResult === false
  5055. $myFailReason = "Message not sent"
  5056. end
  5057. logStopTest("Messaging_05_01_02_05")
  5058.  
  5059. waitsecond(1)
  5060. end
  5061.  
  5062. tcase << TestAction.new(:pressBack_53) do
  5063. pressBack
  5064. end
  5065.  
  5066. tcase << TestAction.new(:pressBack_26) do
  5067. pressBack
  5068.  
  5069. waitsecond(1)
  5070. end
  5071.  
  5072. tcase.run(loopTime)
  5073.  
  5074. end
  5075.  
  5076. def self.Telephony_05_01_01_05(loopTime)
  5077.  
  5078. tcase = TestCase.new("Telephony_05_01_01_05")
  5079.  
  5080. tcase << TestAction.new(:pressHome_18) do
  5081. pressHome
  5082. end
  5083.  
  5084. tcase << TestAction.new(:scriptAction_StartTestLog) do
  5085. logStartTest("05_01_01_05_Telephony")
  5086. end
  5087.  
  5088. tcase << TestAction.new(:scriptAction_BTMakeCall) do
  5089. sendBTCmd("makeCall('#{db('CallNumber')[0]}')")
  5090.  
  5091. waitsecond(8)
  5092. end
  5093.  
  5094. tcase << TestAction.new(:wait8second_12) do
  5095. waitsecond(8)
  5096. end
  5097.  
  5098. tcase << TestAction.new(:wait8second_14) do
  5099. waitsecond(8)
  5100. end
  5101.  
  5102. tcase << TestAction.new(:wait8second_16) do
  5103. waitsecond(8)
  5104. end
  5105.  
  5106. tcase << TestAction.new(:clickXY_765_258_1_1) do
  5107. click(765,258)
  5108.  
  5109. waitsecond(1)
  5110. end
  5111.  
  5112. tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_4) do
  5113. $ruiObj = RUIObject.new.with('objectid', -866535814).with('selfid', 1448123190).with('textdescid', -89777303).with('uniqueparentid', 561858152)
  5114. .with('uitreeindex', 9)
  5115. .with('classname', 'ImageButton')
  5116. .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
  5117. .with('content-desc', 'End Call')
  5118.  
  5119. $ruiObj.select('Similiar').isNotExist
  5120. ifFailJumpTo(:ImageButton_FloatingEndCallActionButton_2)
  5121.  
  5122. waitsecond(1)
  5123. end
  5124.  
  5125. tcase << TestAction.new(:clickXY_765_258_1_1_1) do
  5126. click(765,258)
  5127.  
  5128. waitsecond(1)
  5129. end
  5130.  
  5131. tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_2) do
  5132. $ruiObj = RUIObject.new.with('objectid', 1693952669).with('selfid', 1448123190).with('textdescid', 751911782).with('uniqueparentid', 0)
  5133. .with('uitreeindex', 10)
  5134. .with('classname', 'ImageButton')
  5135. .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
  5136. .with('content-desc', 'End Call')
  5137.  
  5138. $ruiObj.isExist
  5139.  
  5140. waitsecond(1)
  5141. end
  5142.  
  5143. tcase << TestAction.new(:scriptAction_LogStopTest_1) do
  5144. $myTestResult = checkLastExistResult
  5145. if $myTestResult == false
  5146. $myFailReason = "End button not found"
  5147. end
  5148. logStopTest("05_01_01_05_Telephony")
  5149.  
  5150. end
  5151.  
  5152. tcase << TestAction.new(:scriptAction_BTEndCall) do
  5153. sendBTCmd('endCall')
  5154. end
  5155.  
  5156. tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_9) do
  5157. $ruiObj = RUIObject.new.with('objectid', -866535814).with('selfid', 1448123190).with('textdescid', -89777303).with('uniqueparentid', 561858152)
  5158. .with('uitreeindex', 9)
  5159. .with('classname', 'ImageButton')
  5160. .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
  5161. .with('content-desc', 'End Call')
  5162.  
  5163. $ruiObj.select('Similiar').click
  5164. noFailCheck
  5165. end
  5166.  
  5167. tcase << TestAction.new(:pressBack_1) do
  5168. pressBack
  5169. end
  5170.  
  5171. tcase << TestAction.new(:pressBack_2) do
  5172. pressBack
  5173. end
  5174.  
  5175. tcase.run(loopTime)
  5176.  
  5177. end
  5178.  
  5179. def self.Telephony_05_01_01_03(loopTime)
  5180.  
  5181. tcase = TestCase.new("Telephony_05_01_01_03")
  5182.  
  5183. tcase << TestAction.new(:scriptAction_StartTest) do
  5184. logStartTest("05_01_01_03_Telephony")
  5185. end
  5186.  
  5187. tcase << TestAction.new(:gotoApp_1_1) do
  5188. gotoApp('Phone')
  5189. end
  5190.  
  5191. tcase << TestAction.new(:View_Recents_1_1) do
  5192. $ruiObj = RUIObject.new.with('objectid', 1536973457).with('selfid', 954785271).with('textdescid', 1871997065).with('uniqueparentid', 0)
  5193. .with('classname', 'android.view.View')
  5194. .with('content-desc', 'Recents')
  5195.  
  5196. $ruiObj.click
  5197.  
  5198. waitsecond(1)
  5199. end
  5200.  
  5201. tcase << TestAction.new(:ImageView_PrimaryActionButton_2) do
  5202. $ruiObj = RUIObject.new.with('objectid', 1321106203).with('selfid', 1174798435).with('textdescid', 1240128135).with('uniqueparentid', 0)
  5203. .with('uitreeindex', 8)
  5204. .with('classname', 'ImageView')
  5205. .with('resource-id', 'com.android.dialer:id/primary_action_button')
  5206. .with('content-desc', 'Call A01 a01')
  5207.  
  5208. $ruiObj.click
  5209.  
  5210. waitsecond(2)
  5211. end
  5212.  
  5213. tcase << TestAction.new(:wait8second_31) do
  5214. waitsecond(8)
  5215. end
  5216.  
  5217. tcase << TestAction.new(:wait4second_4) do
  5218. waitsecond(4)
  5219. end
  5220.  
  5221. tcase << TestAction.new(:scriptAction_BTAnswerCall) do
  5222. sendBTCmd('answerCall')
  5223.  
  5224. waitsecond(4)
  5225. end
  5226.  
  5227. tcase << TestAction.new(:wait4second_6) do
  5228. waitsecond(4)
  5229. end
  5230.  
  5231. tcase << TestAction.new(:scriptAction_LogStopTest) do
  5232. $myTestResult = checkLastBTCmdResult
  5233. if $myTestResult == false
  5234. $myFailReason = "Call not come to other dev"
  5235. end
  5236. logStopTest("05_01_01_03_Telephony")
  5237.  
  5238. end
  5239.  
  5240. tcase << TestAction.new(:scriptAction_BTEndCall) do
  5241. sendBTCmd('endCall')
  5242.  
  5243. waitsecond(1)
  5244. end
  5245.  
  5246. tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_7) do
  5247. $ruiObj = RUIObject.new.with('objectid', -866535814).with('selfid', 1448123190).with('textdescid', -89777303).with('uniqueparentid', 0)
  5248. .with('uitreeindex', 8)
  5249. .with('classname', 'ImageButton')
  5250. .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
  5251. .with('content-desc', 'End Call')
  5252.  
  5253. $ruiObj.click
  5254. noFailCheck
  5255.  
  5256. waitsecond(1)
  5257. end
  5258.  
  5259. tcase << TestAction.new(:pressBack_1) do
  5260. pressBack
  5261. end
  5262.  
  5263. tcase << TestAction.new(:pressBack_2) do
  5264. pressBack
  5265. end
  5266.  
  5267. tcase.run(loopTime)
  5268.  
  5269. end
  5270.  
  5271. def self.Telephony_05_01_01_01(loopTime)
  5272.  
  5273. tcase = TestCase.new("Telephony_05_01_01_01")
  5274.  
  5275. tcase << TestAction.new(:scriptAction_StartTest) do
  5276. logStartTest("05_01_01_01_Telephony")
  5277. end
  5278.  
  5279. tcase << TestAction.new(:gotoApp_1_1) do
  5280. gotoApp('Contacts')
  5281. end
  5282.  
  5283. tcase << TestAction.new(:TextView_MenuSearch_2) do
  5284. $ruiObj = RUIObject.new.with('objectid', 1659045365).with('selfid', -439570021).with('textdescid', 660324755).with('uniqueparentid', 0)
  5285. .with('uitreeindex', 1)
  5286. .with('classname', 'TextView')
  5287. .with('resource-id', 'com.android.contacts:id/menu_search')
  5288. .with('content-desc', 'Search')
  5289.  
  5290. $ruiObj.click
  5291.  
  5292. waitsecond(1)
  5293. end
  5294.  
  5295. tcase << TestAction.new(:EditText_SearchView_4) do
  5296. $ruiObj = RUIObject.new.with('objectid', 255377705).with('selfid', -247474260).with('textdescid', -673225705).with('uniqueparentid', 0)
  5297. .with('uitreeindex', 1)
  5298. .with('classname', 'EditText')
  5299. .with('resource-id', 'com.android.contacts:id/search_view')
  5300.  
  5301. $ruiObj.inputtext('A01')
  5302.  
  5303. waitsecond(2)
  5304. end
  5305.  
  5306. tcase << TestAction.new(:TextView_ClivNameTextview_8_1) do
  5307. $ruiObj = RUIObject.new.with('objectid', -1210856875).with('selfid', 1607638428).with('textdescid', -1633378553).with('uniqueparentid', 0).with('classresourceid', -744251330)
  5308. .with('uitreeindex', 9)
  5309. .with('classname', 'TextView')
  5310. .with('resource-id', 'com.android.contacts:id/cliv_name_textview')
  5311. .with('text', 'A01 a01')
  5312.  
  5313. $ruiObj.click
  5314.  
  5315. waitsecond(1)
  5316. end
  5317.  
  5318. tcase << TestAction.new(:clickXY_117_1302_4) do
  5319. click(117,1302)
  5320.  
  5321. waitsecond(2)
  5322. end
  5323.  
  5324. tcase << TestAction.new(:wait8second_31) do
  5325. waitsecond(8)
  5326. end
  5327.  
  5328. tcase << TestAction.new(:wait4second_31_1) do
  5329. waitsecond(8)
  5330. end
  5331.  
  5332. tcase << TestAction.new(:scriptAction_BTAnswerCall) do
  5333. sendBTCmd('answerCall')
  5334.  
  5335. waitsecond(4)
  5336. end
  5337.  
  5338. tcase << TestAction.new(:wait4second_6) do
  5339. waitsecond(4)
  5340. end
  5341.  
  5342. tcase << TestAction.new(:scriptAction_LogStopTest_1_1) do
  5343. $myTestResult = checkLastBTCmdResult
  5344. if $myTestResult == false
  5345. $myFailReason = "Call not come to other dev"
  5346. end
  5347. logStopTest("05_01_01_01_Telephony")
  5348.  
  5349. end
  5350.  
  5351. tcase << TestAction.new(:scriptAction_BTEndCall) do
  5352. sendBTCmd('endCall')
  5353. end
  5354.  
  5355. tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_7) do
  5356. $ruiObj = RUIObject.new.with('objectid', -866535814).with('selfid', 1448123190).with('textdescid', -89777303).with('uniqueparentid', 0)
  5357. .with('uitreeindex', 8)
  5358. .with('classname', 'ImageButton')
  5359. .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
  5360. .with('content-desc', 'End Call')
  5361.  
  5362. $ruiObj.click
  5363. noFailCheck
  5364.  
  5365. waitsecond(1)
  5366. end
  5367.  
  5368. tcase << TestAction.new(:pressBack_3) do
  5369. pressBack
  5370. end
  5371.  
  5372. tcase << TestAction.new(:pressBack_4) do
  5373. pressBack
  5374. end
  5375.  
  5376. tcase.run(loopTime)
  5377.  
  5378. end
  5379.  
  5380. def self.VoLTE_Telephony_05_01_12_03(loopTime)
  5381.  
  5382. tcase = TestCase.new("VoLTE_Telephony_05_01_12_03")
  5383.  
  5384. tcase << TestAction.new(:pressHome_18) do
  5385. pressHome
  5386. end
  5387.  
  5388. tcase << TestAction.new(:scriptAction_StartTestLog) do
  5389. logStartTest("05_01_12_03_VoLTE_Telephony")
  5390. end
  5391.  
  5392. tcase << TestAction.new(:scriptAction_BTMakeCall) do
  5393. sendBTCmd("makeCall('#{db('CallNumber')[0]}')")
  5394.  
  5395. waitsecond(8)
  5396. end
  5397.  
  5398. tcase << TestAction.new(:wait8second_12) do
  5399. waitsecond(8)
  5400. end
  5401.  
  5402. tcase << TestAction.new(:wait8second_14) do
  5403. waitsecond(8)
  5404. end
  5405.  
  5406. tcase << TestAction.new(:wait8second_16) do
  5407. waitsecond(8)
  5408. end
  5409.  
  5410. tcase << TestAction.new(:clickXY_765_252_1_1) do
  5411. click(765,252)
  5412.  
  5413. waitsecond(4)
  5414. end
  5415.  
  5416. tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_4) do
  5417. $ruiObj = RUIObject.new.with('objectid', -866535814).with('selfid', 1448123190).with('textdescid', -89777303).with('uniqueparentid', 561858152)
  5418. .with('uitreeindex', 9)
  5419. .with('classname', 'ImageButton')
  5420. .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
  5421. .with('content-desc', 'End Call')
  5422.  
  5423. $ruiObj.select('Similiar').isNotExist
  5424. ifFailJumpTo(:wait8second_7)
  5425.  
  5426. waitsecond(1)
  5427. end
  5428.  
  5429. tcase << TestAction.new(:clickXY_765_252_1_1_1) do
  5430. click(765,252)
  5431.  
  5432. waitsecond(4)
  5433. end
  5434.  
  5435. tcase << TestAction.new(:wait8second_7) do
  5436. waitsecond(6)
  5437. end
  5438.  
  5439. tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_2) do
  5440. $ruiObj = RUIObject.new.with('objectid', 1693952669).with('selfid', 1448123190).with('textdescid', 751911782).with('uniqueparentid', 0)
  5441. .with('uitreeindex', 10)
  5442. .with('classname', 'ImageButton')
  5443. .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
  5444. .with('content-desc', 'End Call')
  5445.  
  5446. $ruiObj.isExist
  5447.  
  5448. waitsecond(1)
  5449. end
  5450.  
  5451. tcase << TestAction.new(:scriptAction_LogStopTest_1) do
  5452. $myTestResult = checkLastExistResult
  5453. if $myTestResult == false
  5454. $myFailReason = "End button not found"
  5455. end
  5456. logStopTest("05_01_12_03_VoLTE_Telephony")
  5457.  
  5458. end
  5459.  
  5460. tcase << TestAction.new(:scriptAction_BTEndCall) do
  5461. sendBTCmd('endCall')
  5462.  
  5463. waitsecond(1)
  5464. end
  5465.  
  5466. tcase << TestAction.new(:ImageButton_FloatingEndCallActionButton_9) do
  5467. $ruiObj = RUIObject.new.with('objectid', -866535814).with('selfid', 1448123190).with('textdescid', -89777303).with('uniqueparentid', 561858152)
  5468. .with('uitreeindex', 9)
  5469. .with('classname', 'ImageButton')
  5470. .with('resource-id', 'com.android.dialer:id/floating_end_call_action_button')
  5471. .with('content-desc', 'End Call')
  5472.  
  5473. $ruiObj.select('Similiar').click
  5474. noFailCheck
  5475.  
  5476. waitsecond(1)
  5477. end
  5478.  
  5479. tcase << TestAction.new(:pressBack_1) do
  5480. pressBack
  5481. end
  5482.  
  5483. tcase << TestAction.new(:pressBack_2) do
  5484. pressBack
  5485. end
  5486.  
  5487. tcase.run(loopTime)
  5488.  
  5489. end
  5490.  
  5491. def self.exception_handler
  5492. puts "Module Exception Hanlder..."
  5493. if ($lastPackageName == "android")
  5494. android_ExpHandler(1)
  5495. end
  5496. end
  5497.  
  5498. def self.run(loop)
  5499. mainLoop loop
  5500. end
  5501.  
  5502. end
  5503.  
  5504. $exceptionPackageNameList = []
  5505. $exceptionPackageNameList_exclude = []
  5506. $exceptionPackageNameList << "android"
  5507.  
  5508. def exception_handler
  5509. N3_MTBF.exception_handler
  5510. end
  5511.  
  5512. $curProjectLogFile = $useLastLogFile
  5513.  
  5514. $curProjectLogFile = "N3_MTBF_#{getTimeStamp}.log" if $useLastLogFile.nil?
  5515.  
  5516. $useLastLogFile = nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement