Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 223.10 KB | None | 0 0
  1. loadTestDB
  2.  
  3. module SNOWBIRD_MTBF
  4.  
  5. def self.Browser_5_1_4_1(loopTime)
  6.  
  7. tcase = TestCase.new("Browser_5_1_4_1")
  8.  
  9. tcase << TestAction.new(:Home) do
  10. pressHome
  11.  
  12. waitsecond(2)
  13. end
  14.  
  15. tcase << TestAction.new(:logStart) do
  16. logStartTest("Browser_5_1_4_1")
  17.  
  18. waitsecond(0)
  19. end
  20.  
  21. tcase << TestAction.new(:gotoChrome) do
  22. gotoAppPixel("Chrome")
  23.  
  24. waitsecond(2)
  25. end
  26.  
  27. tcase << TestAction.new(:Accept) do
  28. $ruiObj = RUIObject.new.with('objectid', 1131623741).with('selfid', 2073999009).with('textdescid', -212510162).with('uniqueparentid', -1930936534)
  29. .with('uitreeindex', 4)
  30. .with('classname', 'Button')
  31. .with('resource-id', 'com.android.chrome:id/terms_accept')
  32. .with('text', 'ACCEPT CONTINUE')
  33.  
  34. $ruiObj.click
  35.  
  36. waitsecond(2)
  37. end
  38.  
  39. tcase << TestAction.new(:Skip) do
  40. $ruiObj = RUIObject.new.with('objectid', -1069290294).with('selfid', 1665543358).with('textdescid', 14199854).with('uniqueparentid', -972892335)
  41. .with('uitreeindex', 8)
  42. .with('classname', 'Button')
  43. .with('resource-id', 'com.android.chrome:id/negative_button')
  44. .with('text', 'NO THANKS')
  45.  
  46. $ruiObj.click
  47.  
  48. waitsecond(2)
  49. end
  50.  
  51. tcase << TestAction.new(:OpenTabs) do
  52. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1714812761).with('textdescid', 885754).with('uniqueparentid', 753086758)
  53. .with('uitreeindex', 31)
  54. .with('classname', 'ImageButton')
  55. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  56. .with('content-desc', '1 open tab')
  57.  
  58. $ruiObj.click
  59.  
  60. waitsecond(2)
  61. end
  62.  
  63. tcase << TestAction.new(:NewTab) do
  64. $ruiObj = RUIObject.new.with('objectid', -1772071808).with('selfid', 820590808).with('textdescid', 561000469).with('uniqueparentid', -857215705)
  65. .with('uitreeindex', 1)
  66. .with('classname', 'Button')
  67. .with('resource-id', 'com.android.chrome:id/new_tab_button')
  68. .with('content-desc', 'New tab')
  69.  
  70. $ruiObj.click
  71.  
  72. waitsecond(2)
  73. end
  74.  
  75. tcase << TestAction.new(:Att1) do
  76. $ruiObj = RUIObject.new.with('objectid', -740560065).with('selfid', 1023920737).with('textdescid', -1482525503).with('uniqueparentid', -1010905038)
  77. .with('uitreeindex', 1)
  78. .with('classname', 'EditText')
  79. .with('resource-id', 'com.android.chrome:id/search_box_text')
  80.  
  81. $ruiObj.inputtext('www.att.com')
  82.  
  83. waitsecond(2)
  84. end
  85.  
  86. tcase << TestAction.new(:Enter) do
  87. pressEnter
  88.  
  89. waitsecond(2)
  90. end
  91.  
  92. tcase << TestAction.new(:Loading) do
  93. waitsecond(2)
  94.  
  95. $attWait = RUIObject.new.with('objectid', 1040592064).with('selfid', 1955905798).with('textdescid', -1063252184).with('uniqueparentid', 107476858)
  96. .with('uitreeindex', 2)
  97. .with('classname', 'Button')
  98. .with('content-desc', 'Search')
  99.  
  100. $second = 0;
  101.  
  102. while ($attWait.isNotExist) && $second < 20
  103. puts $second
  104. $second += 1
  105. waitsecond(1)
  106. end
  107.  
  108. waitsecond(2)
  109. end
  110.  
  111. tcase << TestAction.new(:Failcheck) do
  112. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1714812761).with('textdescid', 885754).with('uniqueparentid', 753086758)
  113. .with('uitreeindex', 31)
  114. .with('classname', 'ImageButton')
  115. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  116. .with('content-desc', '1 open tab')
  117.  
  118. $ruiObj.isExist
  119.  
  120. waitsecond(0)
  121. end
  122.  
  123. tcase << TestAction.new(:Result) do
  124. $myTestResult = checkLastExistResult
  125.  
  126. waitsecond(0)
  127. end
  128.  
  129. tcase << TestAction.new(:OpenTab) do
  130. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1714812761).with('textdescid', 885754).with('uniqueparentid', 753086758)
  131. .with('uitreeindex', 88)
  132. .with('classname', 'ImageButton')
  133. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  134. .with('content-desc', '1 open tab')
  135.  
  136. $ruiObj.click
  137.  
  138. waitsecond(2)
  139. end
  140.  
  141. tcase << TestAction.new(:Menu) do
  142. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  143. .with('uitreeindex', 3)
  144. .with('classname', 'ImageButton')
  145. .with('resource-id', 'com.android.chrome:id/menu_button')
  146. .with('content-desc', 'More options')
  147.  
  148. $ruiObj.click
  149.  
  150. waitsecond(2)
  151. end
  152.  
  153. tcase << TestAction.new(:CloseAllTab) do
  154. $ruiObj = RUIObject.new.with('objectid', -1231103165).with('selfid', 437378293).with('textdescid', -1236643043).with('uniqueparentid', 1228315496).with('classresourceid', -11696959)
  155. .with('uitreeindex', 2)
  156. .with('classname', 'TextView')
  157. .with('resource-id', 'com.android.chrome:id/menu_item_text')
  158. .with('content-desc', 'Close all tabs')
  159. .with('text', 'Close all tabs')
  160.  
  161. $ruiObj.click
  162.  
  163. waitsecond(2)
  164. end
  165.  
  166. tcase << TestAction.new(:Settings) do
  167. gotoAppPixel("Settings")
  168.  
  169. waitsecond(2)
  170. end
  171.  
  172. tcase << TestAction.new(:Apps) do
  173. $ruiObj = RUIObject.new.with('objectid', -1980252617).with('selfid', -999362027).with('textdescid', -2077380333).with('uniqueparentid', 1746487935)
  174. .with('uitreeindex', 18)
  175. .with('classname', 'TextView')
  176. .with('resource-id', 'android:id/title')
  177. .with('text', 'Apps notifications')
  178.  
  179. $ruiObj.click
  180.  
  181. waitsecond(2)
  182. end
  183.  
  184. tcase << TestAction.new(:SearchChrome) do
  185. scrollAndSearchText("Chrome")
  186.  
  187. waitsecond(2)
  188. end
  189.  
  190. tcase << TestAction.new(:Chrome) do
  191. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -368011717).with('textdescid', -2137822469).with('uniqueparentid', 1418026757)
  192. .with('uitreeindex', 4)
  193. .with('classname', 'TextView')
  194. .with('resource-id', 'android:id/title')
  195. .with('text', 'Chrome')
  196.  
  197. $ruiObj.click
  198.  
  199. waitsecond(2)
  200. end
  201.  
  202. tcase << TestAction.new(:Storage) do
  203. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -1162414374).with('textdescid', -2051153520).with('uniqueparentid', -1774219556)
  204. .with('uitreeindex', 10)
  205. .with('classname', 'TextView')
  206. .with('resource-id', 'android:id/title')
  207. .with('text', 'Storage')
  208.  
  209. $ruiObj.click
  210.  
  211. waitsecond(2)
  212. end
  213.  
  214. tcase << TestAction.new(:ClearCache) do
  215. $ruiObj = RUIObject.new.with('objectid', 1453245671).with('selfid', 606168607).with('textdescid', 1434483946).with('uniqueparentid', 1890970267)
  216. .with('uitreeindex', 6)
  217. .with('classname', 'Button')
  218. .with('resource-id', 'com.android.settings:id/right_button')
  219. .with('text', 'CLEAR CACHE')
  220.  
  221. $ruiObj.click
  222.  
  223. waitsecond(2)
  224. end
  225.  
  226. tcase << TestAction.new(:LogStop) do
  227. logStopTest("Browser_5_1_4_1")
  228.  
  229. waitsecond(0)
  230. end
  231.  
  232. tcase.run(loopTime)
  233.  
  234. end
  235.  
  236. def self.Browser_5_1_4_2(loopTime)
  237.  
  238. tcase = TestCase.new("Browser_5_1_4_2")
  239.  
  240. tcase << TestAction.new(:Home) do
  241. pressHome
  242.  
  243. waitsecond(2)
  244. end
  245.  
  246. tcase << TestAction.new(:logStart) do
  247. logStartTest("Browser_5_1_4_2")
  248.  
  249. waitsecond(0)
  250. end
  251.  
  252. tcase << TestAction.new(:gotoChrome) do
  253. gotoAppPixel('Chrome')
  254.  
  255.  
  256. waitsecond(2)
  257. end
  258.  
  259. tcase << TestAction.new(:Tab) do
  260. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1877756082).with('textdescid', -559267845).with('uniqueparentid', -1651273323)
  261. .with('uitreeindex', 20)
  262. .with('classname', 'ImageButton')
  263. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  264. .with('content-desc', 'open tabs')
  265.  
  266. $ruiObj.click
  267.  
  268. waitsecond(2)
  269. end
  270.  
  271. tcase << TestAction.new(:NewTab) do
  272. $ruiObj = RUIObject.new.with('objectid', -1772071808).with('selfid', 820590808).with('textdescid', 561000469).with('uniqueparentid', 54637515)
  273. .with('uitreeindex', 1)
  274. .with('classname', 'Button')
  275. .with('resource-id', 'com.android.chrome:id/new_tab_button')
  276. .with('content-desc', 'New tab')
  277.  
  278. $ruiObj.click
  279.  
  280. waitsecond(2)
  281. end
  282.  
  283. tcase << TestAction.new(:Link1) do
  284. uitree.q("ImageView@com.android.chrome:id/tile_view_icon@@0").click
  285.  
  286. waitsecond(2)
  287. end
  288.  
  289. tcase << TestAction.new(:Loading_1) do
  290. waitsecond(2)
  291.  
  292. $attWait = RUIObject.new.with('objectid', 1040592064).with('selfid', 1955905798).with('textdescid', -1063252184).with('uniqueparentid', 107476858)
  293. .with('uitreeindex', 2)
  294. .with('classname', 'Button')
  295. .with('content-desc', 'Search')
  296.  
  297. $second = 0;
  298.  
  299. while ($attWait.isNotExist) && $second < 10
  300. puts $second
  301. $second += 1
  302. waitsecond(1)
  303. end
  304.  
  305. waitsecond(2)
  306. end
  307.  
  308. tcase << TestAction.new(:Down1) do
  309. swipe_vertical 100
  310. swipe_vertical 100
  311. swipe_vertical 100
  312. swipe_vertical 100
  313. swipe_vertical 100
  314. swipe_vertical 100
  315. swipe_vertical 100
  316. swipe_vertical 100
  317.  
  318.  
  319. waitsecond(2)
  320. end
  321.  
  322. tcase << TestAction.new(:clickLink1) do
  323. $ruiObj = RUIObject.new.with('objectid', 761580953).with('selfid', -6287651).with('textdescid', -491663525).with('uniqueparentid', -1512430850).with('classresourceid', 1815484335)
  324. .with('uitreeindex', 71)
  325. .with('classname', 'android.view.View')
  326. .with('content-desc', 'About AT&T')
  327.  
  328. $ruiObj.click
  329.  
  330. waitsecond(2)
  331. end
  332.  
  333. tcase << TestAction.new(:Tab2) do
  334. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1877756082).with('textdescid', -559267845).with('uniqueparentid', -1651273323)
  335. .with('uitreeindex', 20)
  336. .with('classname', 'ImageButton')
  337. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  338. .with('content-desc', 'open tabs')
  339.  
  340. $ruiObj.click
  341.  
  342. waitsecond(2)
  343. end
  344.  
  345. tcase << TestAction.new(:NewTab2) do
  346. $ruiObj = RUIObject.new.with('objectid', -1772071808).with('selfid', 820590808).with('textdescid', 561000469).with('uniqueparentid', 54637515)
  347. .with('uitreeindex', 1)
  348. .with('classname', 'Button')
  349. .with('resource-id', 'com.android.chrome:id/new_tab_button')
  350. .with('content-desc', 'New tab')
  351.  
  352. $ruiObj.click
  353.  
  354. waitsecond(2)
  355. end
  356.  
  357. tcase << TestAction.new(:Link2) do
  358. uitree.q("ImageView@com.android.chrome:id/tile_view_icon@@0").click
  359.  
  360. waitsecond(2)
  361. end
  362.  
  363. tcase << TestAction.new(:Loading_1_1) do
  364. waitsecond(2)
  365.  
  366. $attWait = RUIObject.new.with('objectid', 1040592064).with('selfid', 1955905798).with('textdescid', -1063252184).with('uniqueparentid', 107476858)
  367. .with('uitreeindex', 2)
  368. .with('classname', 'Button')
  369. .with('content-desc', 'Search')
  370.  
  371. $second = 0;
  372.  
  373. while ($attWait.isNotExist) && $second < 10
  374. puts $second
  375. $second += 1
  376. waitsecond(1)
  377. end
  378.  
  379. waitsecond(2)
  380. end
  381.  
  382. tcase << TestAction.new(:Down1_1) do
  383. swipe_vertical 100
  384. swipe_vertical 100
  385. swipe_vertical 100
  386. swipe_vertical 100
  387. swipe_vertical 100
  388. swipe_vertical 100
  389. swipe_vertical 100
  390. swipe_vertical 100
  391.  
  392.  
  393. waitsecond(2)
  394. end
  395.  
  396. tcase << TestAction.new(:clickLink) do
  397. $ruiObj = RUIObject.new.with('objectid', 761580953).with('selfid', 485825171).with('textdescid', 1878932069).with('uniqueparentid', 858164744).with('classresourceid', 1815484335)
  398. .with('uitreeindex', 72)
  399. .with('classname', 'android.view.View')
  400. .with('content-desc', 'Contact us')
  401.  
  402. $ruiObj.click
  403.  
  404. waitsecond(2)
  405. end
  406.  
  407. tcase << TestAction.new(:Tab3) do
  408. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1877756082).with('textdescid', -559267845).with('uniqueparentid', -1651273323)
  409. .with('uitreeindex', 108)
  410. .with('classname', 'ImageButton')
  411. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  412. .with('content-desc', 'open tabs')
  413.  
  414. $ruiObj.click
  415.  
  416. waitsecond(2)
  417. end
  418.  
  419. tcase << TestAction.new(:NewTab3) do
  420. $ruiObj = RUIObject.new.with('objectid', -1772071808).with('selfid', 820590808).with('textdescid', 561000469).with('uniqueparentid', -857215705)
  421. .with('uitreeindex', 1)
  422. .with('classname', 'Button')
  423. .with('resource-id', 'com.android.chrome:id/new_tab_button')
  424. .with('content-desc', 'New tab')
  425.  
  426. $ruiObj.click
  427.  
  428. waitsecond(2)
  429. end
  430.  
  431. tcase << TestAction.new(:Link3) do
  432. uitree.q("ImageView@com.android.chrome:id/tile_view_icon@@0").click
  433.  
  434. waitsecond(2)
  435. end
  436.  
  437. tcase << TestAction.new(:Tab4) do
  438. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1877756082).with('textdescid', -559267845).with('uniqueparentid', -1651273323)
  439. .with('uitreeindex', 19)
  440. .with('classname', 'ImageButton')
  441. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  442. .with('content-desc', 'open tabs')
  443.  
  444. $ruiObj.click
  445.  
  446. waitsecond(2)
  447. end
  448.  
  449. tcase << TestAction.new(:Up1) do
  450. swipe_vertical_back 500
  451.  
  452. waitsecond(2)
  453. end
  454.  
  455. tcase << TestAction.new(:click1) do
  456. click(693,688.5)
  457.  
  458. waitsecond(2)
  459. end
  460.  
  461. tcase << TestAction.new(:Failcheck) do
  462. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1748673363).with('textdescid', -265864838).with('uniqueparentid', 1682079956)
  463. .with('uitreeindex', 95)
  464. .with('classname', 'ImageButton')
  465. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  466. .with('content-desc', 'open tabs')
  467.  
  468. $ruiObj.isExist
  469.  
  470. waitsecond(0)
  471. end
  472.  
  473. tcase << TestAction.new(:Result) do
  474. $myTestResult = checkLastExistResult
  475.  
  476. waitsecond(0)
  477. end
  478.  
  479. tcase << TestAction.new(:Tab6) do
  480. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1748673363).with('textdescid', -265864838).with('uniqueparentid', 1682079956)
  481. .with('uitreeindex', 95)
  482. .with('classname', 'ImageButton')
  483. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  484. .with('content-desc', '2 open tabs')
  485.  
  486. $ruiObj.click
  487.  
  488. waitsecond(2)
  489. end
  490.  
  491. tcase << TestAction.new(:Menu) do
  492. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  493. .with('uitreeindex', 96)
  494. .with('classname', 'ImageButton')
  495. .with('resource-id', 'com.android.chrome:id/menu_button')
  496. .with('content-desc', 'More options')
  497.  
  498. $ruiObj.click
  499.  
  500. waitsecond(2)
  501. end
  502.  
  503. tcase << TestAction.new(:CloseTabs) do
  504. $ruiObj = RUIObject.new.with('objectid', -1231103165).with('selfid', 437378293).with('textdescid', -1236643043).with('uniqueparentid', 1228315496).with('classresourceid', -11696959)
  505. .with('uitreeindex', 2)
  506. .with('classname', 'TextView')
  507. .with('resource-id', 'com.android.chrome:id/menu_item_text')
  508. .with('content-desc', 'Close all tabs')
  509. .with('text', 'Close all tabs')
  510.  
  511. $ruiObj.click
  512.  
  513. waitsecond(2)
  514. end
  515.  
  516. tcase << TestAction.new(:logStop) do
  517. logStopTest("Browser_5_1_4_2")
  518.  
  519. waitsecond(0)
  520. end
  521.  
  522. tcase.run(loopTime)
  523.  
  524. end
  525.  
  526. def self.Browser_5_1_4_3(loopTime)
  527.  
  528. tcase = TestCase.new("Browser_5_1_4_3")
  529.  
  530. tcase << TestAction.new(:Home) do
  531. pressHome
  532.  
  533. waitsecond(2)
  534. end
  535.  
  536. tcase << TestAction.new(:logStart) do
  537. logStartTest("Browser_5_1_4_3")
  538.  
  539. waitsecond(0)
  540. end
  541.  
  542. tcase << TestAction.new(:gotoChrome) do
  543. gotoAppPixel('Chrome')
  544.  
  545.  
  546. waitsecond(2)
  547. end
  548.  
  549. tcase << TestAction.new(:Tab1) do
  550. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1714812761).with('textdescid', 885754).with('uniqueparentid', 753086758)
  551. .with('uitreeindex', 29)
  552. .with('classname', 'ImageButton')
  553. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  554. .with('content-desc', '1 open tab')
  555.  
  556. $ruiObj.click
  557.  
  558. waitsecond(2)
  559. end
  560.  
  561. tcase << TestAction.new(:NewTab) do
  562. $ruiObj = RUIObject.new.with('objectid', -1772071808).with('selfid', 820590808).with('textdescid', 561000469).with('uniqueparentid', 54637515)
  563. .with('uitreeindex', 1)
  564. .with('classname', 'Button')
  565. .with('resource-id', 'com.android.chrome:id/new_tab_button')
  566. .with('content-desc', 'New tab')
  567.  
  568. $ruiObj.click
  569.  
  570. waitsecond(2)
  571. end
  572.  
  573. tcase << TestAction.new(:URL1) do
  574. $ruiObj = RUIObject.new.with('objectid', -740560065).with('selfid', 1023920737).with('textdescid', -1482525503).with('uniqueparentid', -1010905038)
  575. .with('uitreeindex', 1)
  576. .with('classname', 'EditText')
  577. .with('resource-id', 'com.android.chrome:id/search_box_text')
  578.  
  579. $ruiObj.inputtext('www.ebay.com')
  580.  
  581. waitsecond(2)
  582. end
  583.  
  584. tcase << TestAction.new(:Enter1) do
  585. pressEnter
  586.  
  587. waitsecond(2)
  588. end
  589.  
  590. tcase << TestAction.new(:Loading) do
  591. waitsecond(2)
  592.  
  593. $ebayWait = RUIObject.new.with('objectid', 609044440).with('selfid', 1175141772).with('textdescid', -2143820243).with('uniqueparentid', -1830344402)
  594. .with('uitreeindex', 4)
  595. .with('classname', 'android.view.View')
  596. .with('content-desc', 'eBay Home page')
  597.  
  598. $second = 0;
  599.  
  600. while ($ebayWait.isNotExist) && $second < 10
  601. puts $second
  602. $second += 1
  603. waitsecond(1)
  604. end
  605.  
  606. waitsecond(2)
  607. end
  608.  
  609. tcase << TestAction.new(:Wait) do
  610. waitsecond(2)
  611.  
  612. waitsecond(2)
  613. end
  614.  
  615. tcase << TestAction.new(:URL2) do
  616. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', -420161517)
  617. .with('uitreeindex', 90)
  618. .with('classname', 'EditText')
  619. .with('resource-id', 'com.android.chrome:id/url_bar')
  620.  
  621. $ruiObj.inputtext('www.yahoo.com')
  622.  
  623. waitsecond(2)
  624. end
  625.  
  626. tcase << TestAction.new(:Enter2) do
  627. pressEnter
  628.  
  629. waitsecond(2)
  630. end
  631.  
  632. tcase << TestAction.new(:Loading2) do
  633. waitsecond(2)
  634.  
  635. $yahooWait = RUIObject.new.with('objectid', -530407122).with('selfid', -326866941).with('textdescid', 13521966).with('uniqueparentid', -191624725)
  636. .with('uitreeindex', 5)
  637. .with('classname', 'Button')
  638. .with('resource-id', 'placeHolder-search-btn')
  639. .with('content-desc', 'Search Search')
  640.  
  641. $second = 0;
  642.  
  643. while ($yahooWait.isNotExist) && $second < 10
  644. puts $second
  645. $second += 1
  646. waitsecond(1)
  647. end
  648.  
  649. waitsecond(2)
  650. end
  651.  
  652. tcase << TestAction.new(:Wait2) do
  653. waitsecond(2)
  654.  
  655. waitsecond(2)
  656. end
  657.  
  658. tcase << TestAction.new(:URL3) do
  659. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', -939721082)
  660. .with('uitreeindex', 114)
  661. .with('classname', 'EditText')
  662. .with('resource-id', 'com.android.chrome:id/url_bar')
  663.  
  664. $ruiObj.inputtext('www.amazon.com')
  665.  
  666. waitsecond(2)
  667. end
  668.  
  669. tcase << TestAction.new(:Enter3) do
  670. pressEnter
  671.  
  672. waitsecond(2)
  673. end
  674.  
  675. tcase << TestAction.new(:Loading3) do
  676. waitsecond(2)
  677.  
  678. $amazonWait = RUIObject.new.with('objectid', -1521303824).with('selfid', 1797265808).with('textdescid', 1249383791).with('uniqueparentid', -2005587295)
  679. .with('uitreeindex', 9)
  680. .with('classname', 'android.view.View')
  681. .with('content-desc', 'Prime')
  682.  
  683. $second = 0;
  684.  
  685. while ($amazonWait.isNotExist) && $second < 10
  686. puts $second
  687. $second += 1
  688. waitsecond(1)
  689. end
  690.  
  691. waitsecond(2)
  692. end
  693.  
  694. tcase << TestAction.new(:Wait3) do
  695. waitsecond(2)
  696.  
  697. waitsecond(2)
  698. end
  699.  
  700. tcase << TestAction.new(:URL4) do
  701. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', -939721082)
  702. .with('uitreeindex', 50)
  703. .with('classname', 'EditText')
  704. .with('resource-id', 'com.android.chrome:id/url_bar')
  705.  
  706. $ruiObj.inputtext('www.youtube.com')
  707.  
  708. waitsecond(2)
  709. end
  710.  
  711. tcase << TestAction.new(:Enter4) do
  712. pressEnter
  713.  
  714. waitsecond(2)
  715. end
  716.  
  717. tcase << TestAction.new(:Loading4) do
  718. waitsecond(2)
  719.  
  720. $youtubeWait = RUIObject.new.with('objectid', 2003397674).with('selfid', -1955067805).with('textdescid', -1024800959).with('uniqueparentid', 841602579)
  721. .with('uitreeindex', 1)
  722. .with('classname', 'Button')
  723. .with('content-desc', 'Search YouTube')
  724.  
  725. $second = 0;
  726.  
  727. while ($youtubeWait.isNotExist) && $second < 10
  728. puts $second
  729. $second += 1
  730. waitsecond(1)
  731. end
  732.  
  733. waitsecond(2)
  734. end
  735.  
  736. tcase << TestAction.new(:Wait4) do
  737. waitsecond(2)
  738.  
  739. waitsecond(2)
  740. end
  741.  
  742. tcase << TestAction.new(:URL5) do
  743. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', -939721082)
  744. .with('uitreeindex', 35)
  745. .with('classname', 'EditText')
  746. .with('resource-id', 'com.android.chrome:id/url_bar')
  747.  
  748. $ruiObj.inputtext('www.nytimes.com')
  749.  
  750. waitsecond(2)
  751. end
  752.  
  753. tcase << TestAction.new(:Enter5) do
  754. pressEnter
  755.  
  756. waitsecond(2)
  757. end
  758.  
  759. tcase << TestAction.new(:Loading5) do
  760. waitsecond(2)
  761.  
  762. $NYWait = RUIObject.new.with('objectid', 815131388).with('selfid', -1040612595).with('textdescid', -440199256).with('uniqueparentid', 1781929957)
  763. .with('classname', 'android.view.View')
  764. .with('content-desc', 'The New York Times')
  765.  
  766. $second = 0;
  767.  
  768. while ($NYWait.isNotExist) && $second < 10
  769. puts $second
  770. $second += 1
  771. waitsecond(1)
  772. end
  773.  
  774. waitsecond(2)
  775. end
  776.  
  777. tcase << TestAction.new(:Wait5) do
  778. waitsecond(2)
  779.  
  780. waitsecond(2)
  781. end
  782.  
  783. tcase << TestAction.new(:FailCheck5) do
  784. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1714812761).with('textdescid', 885754).with('uniqueparentid', 753086758)
  785. .with('uitreeindex', 29)
  786. .with('classname', 'ImageButton')
  787. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  788. .with('content-desc', '1 open tab')
  789.  
  790. $ruiObj.isExist
  791.  
  792. waitsecond(0)
  793. end
  794.  
  795. tcase << TestAction.new(:Result5) do
  796. $myTestResult = checkLastExistResult
  797.  
  798. waitsecond(0)
  799. end
  800.  
  801. tcase << TestAction.new(:Tab) do
  802. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1714812761).with('textdescid', 885754).with('uniqueparentid', 0)
  803. .with('uitreeindex', 34)
  804. .with('classname', 'ImageButton')
  805. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  806. .with('content-desc', '1 open tab')
  807.  
  808. $ruiObj.click
  809.  
  810. waitsecond(2)
  811. end
  812.  
  813. tcase << TestAction.new(:Menu) do
  814. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  815. .with('uitreeindex', 3)
  816. .with('classname', 'ImageButton')
  817. .with('resource-id', 'com.android.chrome:id/menu_button')
  818. .with('content-desc', 'More options')
  819.  
  820. $ruiObj.click
  821.  
  822. waitsecond(2)
  823. end
  824.  
  825. tcase << TestAction.new(:ClearAll) do
  826. $ruiObj = RUIObject.new.with('objectid', -1231103165).with('selfid', 437378293).with('textdescid', -1236643043).with('uniqueparentid', 1228315496).with('classresourceid', -11696959)
  827. .with('uitreeindex', 2)
  828. .with('classname', 'TextView')
  829. .with('resource-id', 'com.android.chrome:id/menu_item_text')
  830. .with('content-desc', 'Close all tabs')
  831. .with('text', 'Close all tabs')
  832.  
  833. $ruiObj.click
  834.  
  835. waitsecond(2)
  836. end
  837.  
  838. tcase << TestAction.new(:Settings) do
  839. gotoAppPixel("Settings")
  840.  
  841. waitsecond(2)
  842. end
  843.  
  844. tcase << TestAction.new(:Apps) do
  845. $ruiObj = RUIObject.new.with('objectid', -1980252617).with('selfid', -999362027).with('textdescid', -2077380333).with('uniqueparentid', 1746487935)
  846. .with('uitreeindex', 18)
  847. .with('classname', 'TextView')
  848. .with('resource-id', 'android:id/title')
  849. .with('text', 'Apps notifications')
  850.  
  851. $ruiObj.click
  852.  
  853. waitsecond(2)
  854. end
  855.  
  856. tcase << TestAction.new(:SearchChrome) do
  857. scrollAndSearchText("Chrome")
  858.  
  859. waitsecond(2)
  860. end
  861.  
  862. tcase << TestAction.new(:Chrome) do
  863. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -368011717).with('textdescid', -2137822469).with('uniqueparentid', 1418026757)
  864. .with('uitreeindex', 4)
  865. .with('classname', 'TextView')
  866. .with('resource-id', 'android:id/title')
  867. .with('text', 'Chrome')
  868.  
  869. $ruiObj.click
  870.  
  871. waitsecond(2)
  872. end
  873.  
  874. tcase << TestAction.new(:Storage) do
  875. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -1162414374).with('textdescid', -2051153520).with('uniqueparentid', 342750947)
  876. .with('uitreeindex', 10)
  877. .with('classname', 'TextView')
  878. .with('resource-id', 'android:id/title')
  879. .with('text', 'Storage')
  880.  
  881. $ruiObj.click
  882.  
  883. waitsecond(2)
  884. end
  885.  
  886. tcase << TestAction.new(:ClearCache) do
  887. $ruiObj = RUIObject.new.with('objectid', 1453245671).with('selfid', 606168607).with('textdescid', 1434483946).with('uniqueparentid', 1890970267)
  888. .with('uitreeindex', 6)
  889. .with('classname', 'Button')
  890. .with('resource-id', 'com.android.settings:id/right_button')
  891. .with('text', 'CLEAR CACHE')
  892.  
  893. $ruiObj.click
  894.  
  895. waitsecond(2)
  896. end
  897.  
  898. tcase << TestAction.new(:logStop) do
  899. logStopTest("Browser_5_1_4_3")
  900.  
  901. waitsecond(0)
  902. end
  903.  
  904. tcase.run(loopTime)
  905.  
  906. end
  907.  
  908. def self.Browser_Precondition(loopTime)
  909.  
  910. tcase = TestCase.new("Browser_Precondition")
  911.  
  912. tcase << TestAction.new(:OpenChrome) do
  913. gotoAppPixel('Chrome')
  914.  
  915.  
  916. waitsecond(2)
  917. end
  918.  
  919. tcase << TestAction.new(:checkBox) do
  920. $ruiObj = RUIObject.new.with('objectid', 1560599896).with('selfid', 45001589).with('textdescid', -1345211847).with('uniqueparentid', 1351926725).with('classresourceid', 1998469038)
  921. .with('uitreeindex', 3)
  922. .with('classname', 'CheckBox')
  923. .with('resource-id', 'com.android.chrome:id/send_report_checkbox')
  924. .with('text', 'Help make Chrome better by sending usage statistics and crash reports to Google')
  925.  
  926. $ruiObj.click
  927. ifFailJumpTo(:OpenTab)
  928.  
  929. waitsecond(2)
  930. end
  931.  
  932. tcase << TestAction.new(:Accept) do
  933. $ruiObj = RUIObject.new.with('objectid', 1131623741).with('selfid', 2073999009).with('textdescid', -212510162).with('uniqueparentid', -1930936534)
  934. .with('uitreeindex', 4)
  935. .with('classname', 'Button')
  936. .with('resource-id', 'com.android.chrome:id/terms_accept')
  937. .with('text', 'ACCEPT CONTINUE')
  938.  
  939. $ruiObj.click
  940.  
  941. waitsecond(2)
  942. end
  943.  
  944. tcase << TestAction.new(:NoThanks) do
  945. $ruiObj = RUIObject.new.with('objectid', -1069290294).with('selfid', 1665543358).with('textdescid', 14199854).with('uniqueparentid', -972892335)
  946. .with('uitreeindex', 8)
  947. .with('classname', 'Button')
  948. .with('resource-id', 'com.android.chrome:id/negative_button')
  949. .with('text', 'NO THANKS')
  950.  
  951. $ruiObj.click
  952.  
  953. waitsecond(2)
  954. end
  955.  
  956. tcase << TestAction.new(:OpenTab) do
  957. $ruiObj = RUIObject.new.with('objectid', -1772071808).with('selfid', 820590808).with('textdescid', 561000469).with('uniqueparentid', 54637515)
  958. .with('uitreeindex', 1)
  959. .with('classname', 'Button')
  960. .with('resource-id', 'com.android.chrome:id/new_tab_button')
  961. .with('content-desc', 'New tab')
  962.  
  963. $ruiObj.click
  964. ifFailJumpTo(:URL1)
  965.  
  966. waitsecond(2)
  967. end
  968.  
  969. tcase << TestAction.new(:URL1) do
  970. $ruiObj = RUIObject.new.with('objectid', -740560065).with('selfid', 1023920737).with('textdescid', -1482525503).with('uniqueparentid', -1010905038)
  971. .with('uitreeindex', 1)
  972. .with('classname', 'EditText')
  973. .with('resource-id', 'com.android.chrome:id/search_box_text')
  974.  
  975. $ruiObj.inputtext('www.att.com')
  976.  
  977. waitsecond(2)
  978. end
  979.  
  980. tcase << TestAction.new(:Enter) do
  981. pressEnter
  982.  
  983. waitsecond(2)
  984. end
  985.  
  986. tcase << TestAction.new(:Loading) do
  987. waitsecond(2)
  988.  
  989. $attWait = RUIObject.new.with('objectid', 1040592064).with('selfid', 1955905798).with('textdescid', -1063252184).with('uniqueparentid', 107476858)
  990. .with('uitreeindex', 2)
  991. .with('classname', 'Button')
  992. .with('content-desc', 'Search')
  993.  
  994. $second = 0;
  995.  
  996. while ($attWait.isNotExist) && $second < 10
  997. puts $second
  998. $second += 1
  999. waitsecond(1)
  1000. end
  1001.  
  1002. waitsecond(2)
  1003. end
  1004.  
  1005. tcase << TestAction.new(:Options) do
  1006. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  1007. .with('uitreeindex', 86)
  1008. .with('classname', 'ImageButton')
  1009. .with('resource-id', 'com.android.chrome:id/menu_button')
  1010. .with('content-desc', 'More options')
  1011.  
  1012. $ruiObj.click
  1013.  
  1014. waitsecond(2)
  1015. end
  1016.  
  1017. tcase << TestAction.new(:EditBookmark) do
  1018. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', -1695848864).with('textdescid', 223981600).with('uniqueparentid', 1676584768).with('classresourceid', 747996460)
  1019. .with('uitreeindex', 1)
  1020. .with('classname', 'ImageButton')
  1021. .with('resource-id', 'com.android.chrome:id/button_two')
  1022. .with('content-desc', 'Edit bookmark')
  1023.  
  1024. $ruiObj.isNotExist
  1025. ifFailJumpTo(:GotoSettings)
  1026.  
  1027. waitsecond(2)
  1028. end
  1029.  
  1030. tcase << TestAction.new(:Bookmark) do
  1031. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', 647573709).with('textdescid', 1394875027).with('uniqueparentid', 953315029).with('classresourceid', 747996460)
  1032. .with('uitreeindex', 1)
  1033. .with('classname', 'ImageButton')
  1034. .with('resource-id', 'com.android.chrome:id/button_two')
  1035. .with('content-desc', 'Bookmark this page')
  1036.  
  1037. $ruiObj.click
  1038.  
  1039. waitsecond(2)
  1040. end
  1041.  
  1042. tcase << TestAction.new(:URL2) do
  1043. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', 0)
  1044. .with('uitreeindex', 91)
  1045. .with('classname', 'EditText')
  1046. .with('resource-id', 'com.android.chrome:id/url_bar')
  1047.  
  1048. $ruiObj.inputtext('www.ebay.com')
  1049.  
  1050. waitsecond(2)
  1051. end
  1052.  
  1053. tcase << TestAction.new(:Enter2) do
  1054. pressEnter
  1055.  
  1056. waitsecond(2)
  1057. end
  1058.  
  1059. tcase << TestAction.new(:Loading2) do
  1060. waitsecond(2)
  1061.  
  1062. $ebayWait = RUIObject.new.with('objectid', 609044440).with('selfid', 1175141772).with('textdescid', -2143820243).with('uniqueparentid', -1830344402)
  1063. .with('uitreeindex', 4)
  1064. .with('classname', 'android.view.View')
  1065. .with('content-desc', 'eBay Home page')
  1066.  
  1067. $second = 0;
  1068.  
  1069. while ($ebayWait.isNotExist) && $second < 10
  1070. puts $second
  1071. $second += 1
  1072. waitsecond(1)
  1073. end
  1074.  
  1075. waitsecond(2)
  1076. end
  1077.  
  1078. tcase << TestAction.new(:Options2) do
  1079. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  1080. .with('uitreeindex', 92)
  1081. .with('classname', 'ImageButton')
  1082. .with('resource-id', 'com.android.chrome:id/menu_button')
  1083. .with('content-desc', 'More options')
  1084.  
  1085. $ruiObj.click
  1086.  
  1087. waitsecond(2)
  1088. end
  1089.  
  1090. tcase << TestAction.new(:EditBookmark_1) do
  1091. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', -1695848864).with('textdescid', 223981600).with('uniqueparentid', 1676584768).with('classresourceid', 747996460)
  1092. .with('uitreeindex', 1)
  1093. .with('classname', 'ImageButton')
  1094. .with('resource-id', 'com.android.chrome:id/button_two')
  1095. .with('content-desc', 'Edit bookmark')
  1096.  
  1097. $ruiObj.isNotExist
  1098. ifFailJumpTo(:GotoSettings)
  1099.  
  1100. waitsecond(2)
  1101. end
  1102.  
  1103. tcase << TestAction.new(:Bookmark2) do
  1104. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', 647573709).with('textdescid', 1394875027).with('uniqueparentid', 953315029).with('classresourceid', 747996460)
  1105. .with('uitreeindex', 1)
  1106. .with('classname', 'ImageButton')
  1107. .with('resource-id', 'com.android.chrome:id/button_two')
  1108. .with('content-desc', 'Bookmark this page')
  1109.  
  1110. $ruiObj.click
  1111.  
  1112. waitsecond(2)
  1113. end
  1114.  
  1115. tcase << TestAction.new(:URL3) do
  1116. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', -420161517)
  1117. .with('uitreeindex', 90)
  1118. .with('classname', 'EditText')
  1119. .with('resource-id', 'com.android.chrome:id/url_bar')
  1120.  
  1121. $ruiObj.inputtext('www.yahoo.com')
  1122.  
  1123. waitsecond(2)
  1124. end
  1125.  
  1126. tcase << TestAction.new(:Enter3) do
  1127. pressEnter
  1128.  
  1129. waitsecond(2)
  1130. end
  1131.  
  1132. tcase << TestAction.new(:Loading3) do
  1133. waitsecond(2)
  1134.  
  1135. $yahooWait = RUIObject.new.with('objectid', -530407122).with('selfid', -326866941).with('textdescid', 13521966).with('uniqueparentid', -191624725)
  1136. .with('uitreeindex', 5)
  1137. .with('classname', 'Button')
  1138. .with('resource-id', 'placeHolder-search-btn')
  1139. .with('content-desc', 'Search Search')
  1140.  
  1141. $second = 0;
  1142.  
  1143. while ($yahooWait.isNotExist) && $second < 10
  1144. puts $second
  1145. $second += 1
  1146. waitsecond(1)
  1147. end
  1148.  
  1149. waitsecond(2)
  1150. end
  1151.  
  1152. tcase << TestAction.new(:Options3) do
  1153. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  1154. .with('uitreeindex', 114)
  1155. .with('classname', 'ImageButton')
  1156. .with('resource-id', 'com.android.chrome:id/menu_button')
  1157. .with('content-desc', 'More options')
  1158.  
  1159. $ruiObj.click
  1160.  
  1161. waitsecond(2)
  1162. end
  1163.  
  1164. tcase << TestAction.new(:EditBookmark_1) do
  1165. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', -1695848864).with('textdescid', 223981600).with('uniqueparentid', 1676584768).with('classresourceid', 747996460)
  1166. .with('uitreeindex', 1)
  1167. .with('classname', 'ImageButton')
  1168. .with('resource-id', 'com.android.chrome:id/button_two')
  1169. .with('content-desc', 'Edit bookmark')
  1170.  
  1171. $ruiObj.isNotExist
  1172. ifFailJumpTo(:GotoSettings)
  1173.  
  1174. waitsecond(2)
  1175. end
  1176.  
  1177. tcase << TestAction.new(:Bookmark3) do
  1178. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', 647573709).with('textdescid', 1394875027).with('uniqueparentid', 953315029).with('classresourceid', 747996460)
  1179. .with('uitreeindex', 1)
  1180. .with('classname', 'ImageButton')
  1181. .with('resource-id', 'com.android.chrome:id/button_two')
  1182. .with('content-desc', 'Bookmark this page')
  1183.  
  1184. $ruiObj.click
  1185.  
  1186. waitsecond(2)
  1187. end
  1188.  
  1189. tcase << TestAction.new(:URL4) do
  1190. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', -939721082)
  1191. .with('uitreeindex', 114)
  1192. .with('classname', 'EditText')
  1193. .with('resource-id', 'com.android.chrome:id/url_bar')
  1194.  
  1195. $ruiObj.inputtext('www.amazon.com ')
  1196.  
  1197. waitsecond(2)
  1198. end
  1199.  
  1200. tcase << TestAction.new(:Enter4) do
  1201. pressEnter
  1202.  
  1203. waitsecond(2)
  1204. end
  1205.  
  1206. tcase << TestAction.new(:Loading4) do
  1207. waitsecond(2)
  1208.  
  1209. $amazonWait = RUIObject.new.with('objectid', -1521303824).with('selfid', 1797265808).with('textdescid', 1249383791).with('uniqueparentid', -2005587295)
  1210. .with('uitreeindex', 9)
  1211. .with('classname', 'android.view.View')
  1212. .with('content-desc', 'Prime')
  1213.  
  1214. $second = 0;
  1215.  
  1216. while ($amazonWait.isNotExist) && $second < 10
  1217. puts $second
  1218. $second += 1
  1219. waitsecond(1)
  1220. end
  1221.  
  1222. waitsecond(2)
  1223. end
  1224.  
  1225. tcase << TestAction.new(:Options4) do
  1226. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  1227. .with('uitreeindex', 50)
  1228. .with('classname', 'ImageButton')
  1229. .with('resource-id', 'com.android.chrome:id/menu_button')
  1230. .with('content-desc', 'More options')
  1231.  
  1232. $ruiObj.click
  1233.  
  1234. waitsecond(2)
  1235. end
  1236.  
  1237. tcase << TestAction.new(:EditBookmark_1) do
  1238. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', -1695848864).with('textdescid', 223981600).with('uniqueparentid', 1676584768).with('classresourceid', 747996460)
  1239. .with('uitreeindex', 1)
  1240. .with('classname', 'ImageButton')
  1241. .with('resource-id', 'com.android.chrome:id/button_two')
  1242. .with('content-desc', 'Edit bookmark')
  1243.  
  1244. $ruiObj.isNotExist
  1245. ifFailJumpTo(:GotoSettings)
  1246.  
  1247. waitsecond(2)
  1248. end
  1249.  
  1250. tcase << TestAction.new(:Bookmark4) do
  1251. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', 647573709).with('textdescid', 1394875027).with('uniqueparentid', 953315029).with('classresourceid', 747996460)
  1252. .with('uitreeindex', 1)
  1253. .with('classname', 'ImageButton')
  1254. .with('resource-id', 'com.android.chrome:id/button_two')
  1255. .with('content-desc', 'Bookmark this page')
  1256.  
  1257. $ruiObj.click
  1258.  
  1259. waitsecond(2)
  1260. end
  1261.  
  1262. tcase << TestAction.new(:URL5) do
  1263. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', -939721082)
  1264. .with('uitreeindex', 50)
  1265. .with('classname', 'EditText')
  1266. .with('resource-id', 'com.android.chrome:id/url_bar')
  1267.  
  1268. $ruiObj.inputtext('www.youtube.com')
  1269.  
  1270. waitsecond(2)
  1271. end
  1272.  
  1273. tcase << TestAction.new(:Enter5) do
  1274. pressEnter
  1275.  
  1276. waitsecond(2)
  1277. end
  1278.  
  1279. tcase << TestAction.new(:Loading5) do
  1280. waitsecond(2)
  1281.  
  1282. $youtubeWait = RUIObject.new.with('objectid', 2003397674).with('selfid', -1955067805).with('textdescid', -1024800959).with('uniqueparentid', 841602579)
  1283. .with('uitreeindex', 1)
  1284. .with('classname', 'Button')
  1285. .with('content-desc', 'Search YouTube')
  1286.  
  1287. $second = 0;
  1288.  
  1289. while ($youtubeWait.isNotExist) && $second < 10
  1290. puts $second
  1291. $second += 1
  1292. waitsecond(1)
  1293. end
  1294.  
  1295. waitsecond(2)
  1296. end
  1297.  
  1298. tcase << TestAction.new(:Options5) do
  1299. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  1300. .with('uitreeindex', 35)
  1301. .with('classname', 'ImageButton')
  1302. .with('resource-id', 'com.android.chrome:id/menu_button')
  1303. .with('content-desc', 'More options')
  1304.  
  1305. $ruiObj.click
  1306.  
  1307. waitsecond(2)
  1308. end
  1309.  
  1310. tcase << TestAction.new(:EditBookmark_1) do
  1311. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', -1695848864).with('textdescid', 223981600).with('uniqueparentid', 1676584768).with('classresourceid', 747996460)
  1312. .with('uitreeindex', 1)
  1313. .with('classname', 'ImageButton')
  1314. .with('resource-id', 'com.android.chrome:id/button_two')
  1315. .with('content-desc', 'Edit bookmark')
  1316.  
  1317. $ruiObj.isNotExist
  1318. ifFailJumpTo(:GotoSettings)
  1319.  
  1320. waitsecond(2)
  1321. end
  1322.  
  1323. tcase << TestAction.new(:Bookmark5) do
  1324. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', 647573709).with('textdescid', 1394875027).with('uniqueparentid', 953315029).with('classresourceid', 747996460)
  1325. .with('uitreeindex', 1)
  1326. .with('classname', 'ImageButton')
  1327. .with('resource-id', 'com.android.chrome:id/button_two')
  1328. .with('content-desc', 'Bookmark this page')
  1329.  
  1330. $ruiObj.click
  1331.  
  1332. waitsecond(2)
  1333. end
  1334.  
  1335. tcase << TestAction.new(:URL6) do
  1336. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', -939721082)
  1337. .with('uitreeindex', 35)
  1338. .with('classname', 'EditText')
  1339. .with('resource-id', 'com.android.chrome:id/url_bar')
  1340.  
  1341. $ruiObj.inputtext('www.nytimes.com')
  1342.  
  1343. waitsecond(2)
  1344. end
  1345.  
  1346. tcase << TestAction.new(:Enter6) do
  1347. pressEnter
  1348.  
  1349. waitsecond(2)
  1350. end
  1351.  
  1352. tcase << TestAction.new(:Loading6) do
  1353. waitsecond(2)
  1354.  
  1355. $NYWait = RUIObject.new.with('objectid', 815131388).with('selfid', -1040612595).with('textdescid', -440199256).with('uniqueparentid', 1781929957)
  1356. .with('classname', 'android.view.View')
  1357. .with('content-desc', 'The New York Times')
  1358.  
  1359. $second = 0;
  1360.  
  1361. while ($NYWait.isNotExist) && $second < 10
  1362. puts $second
  1363. $second += 1
  1364. waitsecond(1)
  1365. end
  1366.  
  1367. waitsecond(2)
  1368. end
  1369.  
  1370. tcase << TestAction.new(:Options6) do
  1371. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  1372. .with('uitreeindex', 213)
  1373. .with('classname', 'ImageButton')
  1374. .with('resource-id', 'com.android.chrome:id/menu_button')
  1375. .with('content-desc', 'More options')
  1376.  
  1377. $ruiObj.click
  1378.  
  1379. waitsecond(2)
  1380. end
  1381.  
  1382. tcase << TestAction.new(:EditBookmark_1_1) do
  1383. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', -1695848864).with('textdescid', 223981600).with('uniqueparentid', 1676584768).with('classresourceid', 747996460)
  1384. .with('uitreeindex', 1)
  1385. .with('classname', 'ImageButton')
  1386. .with('resource-id', 'com.android.chrome:id/button_two')
  1387. .with('content-desc', 'Edit bookmark')
  1388.  
  1389. $ruiObj.isNotExist
  1390. ifFailJumpTo(:GotoSettings)
  1391.  
  1392. waitsecond(2)
  1393. end
  1394.  
  1395. tcase << TestAction.new(:Bookmark6) do
  1396. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', 647573709).with('textdescid', 1394875027).with('uniqueparentid', 953315029).with('classresourceid', 747996460)
  1397. .with('uitreeindex', 1)
  1398. .with('classname', 'ImageButton')
  1399. .with('resource-id', 'com.android.chrome:id/button_two')
  1400. .with('content-desc', 'Bookmark this page')
  1401.  
  1402. $ruiObj.click
  1403.  
  1404. waitsecond(2)
  1405. end
  1406.  
  1407. tcase << TestAction.new(:Tab) do
  1408. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1714812761).with('textdescid', 885754).with('uniqueparentid', 0)
  1409. .with('uitreeindex', 34)
  1410. .with('classname', 'ImageButton')
  1411. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  1412. .with('content-desc', '1 open tab')
  1413.  
  1414. $ruiObj.click
  1415.  
  1416. waitsecond(2)
  1417. end
  1418.  
  1419. tcase << TestAction.new(:Options7) do
  1420. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  1421. .with('uitreeindex', 3)
  1422. .with('classname', 'ImageButton')
  1423. .with('resource-id', 'com.android.chrome:id/menu_button')
  1424. .with('content-desc', 'More options')
  1425.  
  1426. $ruiObj.click
  1427.  
  1428. waitsecond(2)
  1429. end
  1430.  
  1431. tcase << TestAction.new(:ClearAllTabs) do
  1432. $ruiObj = RUIObject.new.with('objectid', -1231103165).with('selfid', 437378293).with('textdescid', -1236643043).with('uniqueparentid', 1228315496).with('classresourceid', -11696959)
  1433. .with('uitreeindex', 2)
  1434. .with('classname', 'TextView')
  1435. .with('resource-id', 'com.android.chrome:id/menu_item_text')
  1436. .with('content-desc', 'Close all tabs')
  1437. .with('text', 'Close all tabs')
  1438.  
  1439. $ruiObj.click
  1440.  
  1441. waitsecond(2)
  1442. end
  1443.  
  1444. tcase << TestAction.new(:GotoSettings) do
  1445. gotoAppPixel("Settings")
  1446.  
  1447. waitsecond(2)
  1448. end
  1449.  
  1450. tcase << TestAction.new(:Apps2) do
  1451. $ruiObj = RUIObject.new.with('objectid', -1980252617).with('selfid', -999362027).with('textdescid', -2077380333).with('uniqueparentid', 1746487935)
  1452. .with('uitreeindex', 18)
  1453. .with('classname', 'TextView')
  1454. .with('resource-id', 'android:id/title')
  1455. .with('text', 'Apps notifications')
  1456.  
  1457. $ruiObj.click
  1458.  
  1459. waitsecond(2)
  1460. end
  1461.  
  1462. tcase << TestAction.new(:SearchChrome2) do
  1463. scrollAndSearchText("Chrome")
  1464.  
  1465. waitsecond(2)
  1466. end
  1467.  
  1468. tcase << TestAction.new(:Chrome2) do
  1469. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -368011717).with('textdescid', -2137822469).with('uniqueparentid', 1418026757)
  1470. .with('uitreeindex', 4)
  1471. .with('classname', 'TextView')
  1472. .with('resource-id', 'android:id/title')
  1473. .with('text', 'Chrome')
  1474.  
  1475. $ruiObj.click
  1476.  
  1477. waitsecond(2)
  1478. end
  1479.  
  1480. tcase << TestAction.new(:Storage2) do
  1481. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -1162414374).with('textdescid', -2051153520).with('uniqueparentid', 342750947)
  1482. .with('uitreeindex', 10)
  1483. .with('classname', 'TextView')
  1484. .with('resource-id', 'android:id/title')
  1485. .with('text', 'Storage')
  1486.  
  1487. $ruiObj.click
  1488.  
  1489. waitsecond(2)
  1490. end
  1491.  
  1492. tcase << TestAction.new(:ClearCache2) do
  1493. $ruiObj = RUIObject.new.with('objectid', 1453245671).with('selfid', 606168607).with('textdescid', 1434483946).with('uniqueparentid', 1890970267)
  1494. .with('uitreeindex', 6)
  1495. .with('classname', 'Button')
  1496. .with('resource-id', 'com.android.settings:id/right_button')
  1497. .with('text', 'CLEAR CACHE')
  1498.  
  1499. $ruiObj.click
  1500.  
  1501. waitsecond(2)
  1502. end
  1503.  
  1504. tcase << TestAction.new(:RecentApps) do
  1505. pressRecentApps
  1506.  
  1507. waitsecond(2)
  1508. end
  1509.  
  1510. tcase << TestAction.new(:SwipeUp) do
  1511. swipe_vertical_back 100
  1512.  
  1513. waitsecond(2)
  1514. end
  1515.  
  1516. tcase << TestAction.new(:SwipeUp2) do
  1517. swipe_vertical_back 100
  1518.  
  1519. waitsecond(2)
  1520. end
  1521.  
  1522. tcase << TestAction.new(:ClearAll) do
  1523. $ruiObj = RUIObject.new.with('objectid', -213794734).with('selfid', -204985471).with('textdescid', 1763854688).with('uniqueparentid', -537263169)
  1524. .with('uitreeindex', 12)
  1525. .with('classname', 'TextView')
  1526. .with('resource-id', 'com.android.systemui:id/button')
  1527. .with('text', 'CLEAR ALL')
  1528.  
  1529. $ruiObj.click
  1530.  
  1531. waitsecond(2)
  1532. end
  1533.  
  1534. tcase.run(loopTime)
  1535.  
  1536. end
  1537.  
  1538. def self.EMAIL_5_1_3_1(loopTime)
  1539.  
  1540. tcase = TestCase.new("EMAIL_5_1_3_1")
  1541.  
  1542. tcase << TestAction.new(:Home) do
  1543. pressHome
  1544.  
  1545. waitsecond(2)
  1546. end
  1547.  
  1548. tcase << TestAction.new(:logStart_1) do
  1549. logStartTest("Email_5_1_3_1")
  1550.  
  1551. waitsecond(0)
  1552. end
  1553.  
  1554. tcase << TestAction.new(:gotoGmail) do
  1555. gotoAppPixel('Gmail')
  1556.  
  1557. waitsecond(2)
  1558. end
  1559.  
  1560. tcase << TestAction.new(:Compose) do
  1561. $ruiObj = RUIObject.new.with('objectid', 1598291378).with('selfid', 1808564263).with('textdescid', -1604213756).with('uniqueparentid', 150150411)
  1562. .with('uitreeindex', 22)
  1563. .with('classname', 'ImageButton')
  1564. .with('resource-id', 'com.google.android.gm:id/compose_button')
  1565. .with('content-desc', 'Compose')
  1566.  
  1567. $ruiObj.click
  1568.  
  1569. waitsecond(2)
  1570. end
  1571.  
  1572. tcase << TestAction.new(:ToField) do
  1573. $ruiObj = RUIObject.new.with('objectid', 1308296701).with('selfid', 678761455).with('textdescid', 1902492099).with('uniqueparentid', -1962010460).with('classresourceid', 1488875515)
  1574. .with('uitreeindex', 9)
  1575. .with('classname', 'MultiAutoCompleteTextView')
  1576. .with('resource-id', 'com.google.android.gm:id/to')
  1577.  
  1578. $ruiObj.inputtext('nalab.qct02@gmail.com')
  1579.  
  1580. waitsecond(2)
  1581. end
  1582.  
  1583. tcase << TestAction.new(:EditText_Subject_2) do
  1584. $ruiObj = RUIObject.new.with('objectid', 524508352).with('selfid', -477614756).with('textdescid', -920110240).with('uniqueparentid', -1427376388).with('classresourceid', 927865352)
  1585. .with('uitreeindex', 12)
  1586. .with('classname', 'EditText')
  1587. .with('resource-id', 'com.google.android.gm:id/subject')
  1588.  
  1589. $ruiObj.click
  1590.  
  1591. waitsecond(2)
  1592. end
  1593.  
  1594. tcase << TestAction.new(:Subject) do
  1595. $ruiObj = RUIObject.new.with('objectid', 524508352).with('selfid', -477614756).with('textdescid', -920110240).with('uniqueparentid', -1427376388).with('classresourceid', 927865352)
  1596. .with('uitreeindex', 12)
  1597. .with('classname', 'EditText')
  1598. .with('resource-id', 'com.google.android.gm:id/subject')
  1599.  
  1600. $ruiObj.inputtext('Email Test 1')
  1601.  
  1602. waitsecond(2)
  1603. end
  1604.  
  1605. tcase << TestAction.new(:TextField) do
  1606. $ruiObj = RUIObject.new.with('objectid', -2101420856).with('selfid', -497970335).with('textdescid', 1027339414).with('uniqueparentid', 1227675605).with('classresourceid', 1815484335)
  1607. .with('uitreeindex', 14)
  1608. .with('classname', 'android.view.View')
  1609. .with('content-desc', 'Compose email')
  1610.  
  1611. $ruiObj.click
  1612.  
  1613. waitsecond(2)
  1614.  
  1615. $ruiObj.inputtext('Email Test - 30 Characters, No Attachments')
  1616.  
  1617. waitsecond(2)
  1618.  
  1619. waitsecond(2)
  1620. end
  1621.  
  1622. tcase << TestAction.new(:Send) do
  1623. $ruiObj = RUIObject.new.with('objectid', 823683940).with('selfid', 2103341243).with('textdescid', -976543260).with('uniqueparentid', -1674145749)
  1624. .with('uitreeindex', 3)
  1625. .with('classname', 'TextView')
  1626. .with('resource-id', 'com.google.android.gm:id/send')
  1627. .with('content-desc', 'Send')
  1628.  
  1629. $ruiObj.click
  1630.  
  1631. waitsecond(2)
  1632. end
  1633.  
  1634. tcase << TestAction.new(:Check_Compose) do
  1635. $ruiObj = RUIObject.new.with('objectid', 1598291378).with('selfid', 1808564263).with('textdescid', -1604213756).with('uniqueparentid', 150150411)
  1636. .with('uitreeindex', 5)
  1637. .with('classname', 'ImageButton')
  1638. .with('resource-id', 'com.google.android.gm:id/compose_button')
  1639. .with('content-desc', 'Compose')
  1640.  
  1641. $ruiObj.isExist
  1642.  
  1643. waitsecond(2)
  1644. end
  1645.  
  1646. tcase << TestAction.new(:Result) do
  1647. $myTestResult = checkLastExistResult
  1648.  
  1649.  
  1650.  
  1651. waitsecond(0)
  1652. end
  1653.  
  1654. tcase << TestAction.new(:logStop) do
  1655. logStopTest("Email_5_1_3_1")
  1656.  
  1657. waitsecond(0)
  1658. end
  1659.  
  1660. tcase << TestAction.new(:View_Compose_5) do
  1661. $ruiObj = RUIObject.new.with('objectid', -2101420856).with('selfid', -497970335).with('textdescid', 1027339414).with('uniqueparentid', 1227675605).with('classresourceid', 1815484335)
  1662. .with('uitreeindex', 14)
  1663. .with('classname', 'android.view.View')
  1664. .with('content-desc', 'Compose email')
  1665.  
  1666. $ruiObj.click
  1667.  
  1668. waitsecond(2)
  1669. end
  1670.  
  1671. tcase.run(loopTime)
  1672.  
  1673. end
  1674.  
  1675. def self.EMAIL_5_1_3_2(loopTime)
  1676.  
  1677. tcase = TestCase.new("EMAIL_5_1_3_2")
  1678.  
  1679. tcase << TestAction.new(:Home) do
  1680. pressHome
  1681.  
  1682. waitsecond(2)
  1683. end
  1684.  
  1685. tcase << TestAction.new(:logStart) do
  1686. logStartTest("Email_5_1_3_2")
  1687.  
  1688. waitsecond(0)
  1689. end
  1690.  
  1691. tcase << TestAction.new(:gotoGmail) do
  1692. gotoAppPixel('Gmail')
  1693.  
  1694. waitsecond(2)
  1695. end
  1696.  
  1697. tcase << TestAction.new(:Compose) do
  1698. $ruiObj = RUIObject.new.with('objectid', 1598291378).with('selfid', 1808564263).with('textdescid', -1604213756).with('uniqueparentid', 150150411)
  1699. .with('uitreeindex', 5)
  1700. .with('classname', 'ImageButton')
  1701. .with('resource-id', 'com.google.android.gm:id/compose_button')
  1702. .with('content-desc', 'Compose')
  1703.  
  1704. $ruiObj.click
  1705.  
  1706. waitsecond(2)
  1707. end
  1708.  
  1709. tcase << TestAction.new(:ToField) do
  1710. $ruiObj = RUIObject.new.with('objectid', 1308296701).with('selfid', 678761455).with('textdescid', 1902492099).with('uniqueparentid', -1962010460).with('classresourceid', 1488875515)
  1711. .with('uitreeindex', 9)
  1712. .with('classname', 'MultiAutoCompleteTextView')
  1713. .with('resource-id', 'com.google.android.gm:id/to')
  1714.  
  1715. $ruiObj.inputtext('nalab.qct02@gmail.com')
  1716.  
  1717. waitsecond(2)
  1718. end
  1719.  
  1720. tcase << TestAction.new(:EditText_Subject_2) do
  1721. $ruiObj = RUIObject.new.with('objectid', 524508352).with('selfid', -477614756).with('textdescid', -920110240).with('uniqueparentid', -1427376388).with('classresourceid', 927865352)
  1722. .with('uitreeindex', 12)
  1723. .with('classname', 'EditText')
  1724. .with('resource-id', 'com.google.android.gm:id/subject')
  1725.  
  1726. $ruiObj.click
  1727.  
  1728. waitsecond(2)
  1729. end
  1730.  
  1731. tcase << TestAction.new(:Subject) do
  1732. $ruiObj = RUIObject.new.with('objectid', 524508352).with('selfid', -477614756).with('textdescid', -920110240).with('uniqueparentid', -1427376388).with('classresourceid', 927865352)
  1733. .with('uitreeindex', 12)
  1734. .with('classname', 'EditText')
  1735. .with('resource-id', 'com.google.android.gm:id/subject')
  1736.  
  1737. $ruiObj.inputtext('Email Test 2')
  1738.  
  1739. waitsecond(2)
  1740. end
  1741.  
  1742. tcase << TestAction.new(:InputText2) do
  1743. $ruiObj = RUIObject.new.with('objectid', -2101420856).with('selfid', -497970335).with('textdescid', 1027339414).with('uniqueparentid', 1227675605).with('classresourceid', 1815484335)
  1744. .with('uitreeindex', 14)
  1745. .with('classname', 'android.view.View')
  1746. .with('content-desc', 'Compose email')
  1747.  
  1748. $ruiObj.click
  1749. waitsecond(2)
  1750.  
  1751. $ruiObj.inputtext('Email Test - 30 Characters, With Attachments')
  1752.  
  1753. waitsecond(2)
  1754.  
  1755. waitsecond(2)
  1756. end
  1757.  
  1758. tcase << TestAction.new(:AddAttachment) do
  1759. $ruiObj = RUIObject.new.with('objectid', -124211107).with('selfid', 1566257663).with('textdescid', -1240659436).with('uniqueparentid', -1674145749)
  1760. .with('uitreeindex', 2)
  1761. .with('classname', 'TextView')
  1762. .with('resource-id', 'com.google.android.gm:id/add_attachment')
  1763. .with('content-desc', 'Attach file')
  1764.  
  1765. $ruiObj.click
  1766.  
  1767. waitsecond(3)
  1768. end
  1769.  
  1770. tcase << TestAction.new(:AddFile) do
  1771. $ruiObj = RUIObject.new.with('objectid', 665784376).with('selfid', -1478650284).with('textdescid', 1395090321).with('uniqueparentid', -382816812).with('classresourceid', -1261418567)
  1772. .with('uitreeindex', 0)
  1773. .with('classname', 'TextView')
  1774. .with('resource-id', 'com.google.android.gm:id/title')
  1775. .with('text', 'Attach file')
  1776.  
  1777. $ruiObj.click
  1778.  
  1779. waitsecond(3)
  1780. end
  1781.  
  1782. tcase << TestAction.new(:Menu) do
  1783. $ruiObj = RUIObject.new.with('objectid', 1571666208).with('selfid', -929198491).with('textdescid', 2010273934).with('uniqueparentid', 1659654416)
  1784. .with('uitreeindex', 0)
  1785. .with('classname', 'ImageButton')
  1786. .with('content-desc', 'Show roots')
  1787.  
  1788. $ruiObj.click
  1789.  
  1790. waitsecond(3)
  1791. end
  1792.  
  1793. tcase << TestAction.new(:Images) do
  1794. $ruiObj = RUIObject.new.with('objectid', -1941383373).with('selfid', -192133575).with('textdescid', -1736969061).with('uniqueparentid', -1508177030).with('classresourceid', 490183159)
  1795. .with('uitreeindex', 17)
  1796. .with('classname', 'TextView')
  1797. .with('resource-id', 'android:id/title')
  1798. .with('text', 'Images')
  1799.  
  1800. $ruiObj.click
  1801.  
  1802. waitsecond(3)
  1803. end
  1804.  
  1805. tcase << TestAction.new(:BB) do
  1806. $ruiObj = RUIObject.new.with('objectid', 1672498228).with('selfid', -434686975).with('textdescid', 1966941386).with('uniqueparentid', 250144459)
  1807. .with('uitreeindex', 15)
  1808. .with('classname', 'TextView')
  1809. .with('resource-id', 'android:id/title')
  1810. .with('text', 'BBB')
  1811.  
  1812. $ruiObj.click
  1813.  
  1814. waitsecond(3)
  1815. end
  1816.  
  1817. tcase << TestAction.new(:BBBfile) do
  1818. $ruiObj = RUIObject.new.with('objectid', 634917201).with('selfid', -433169344).with('textdescid', 1456659346).with('uniqueparentid', 338741138)
  1819. .with('uitreeindex', 11)
  1820. .with('classname', 'TextView')
  1821. .with('resource-id', 'android:id/title')
  1822. .with('text', 'BBBjpg')
  1823.  
  1824. $ruiObj.click
  1825.  
  1826. waitsecond(3)
  1827. end
  1828.  
  1829. tcase << TestAction.new(:wait2second_2) do
  1830. waitsecond(3)
  1831. end
  1832.  
  1833. tcase << TestAction.new(:Send) do
  1834. $ruiObj = RUIObject.new.with('objectid', 823683940).with('selfid', 2103341243).with('textdescid', -976543260).with('uniqueparentid', -1674145749)
  1835. .with('uitreeindex', 3)
  1836. .with('classname', 'TextView')
  1837. .with('resource-id', 'com.google.android.gm:id/send')
  1838. .with('content-desc', 'Send')
  1839.  
  1840. $ruiObj.click
  1841.  
  1842. waitsecond(2)
  1843. end
  1844.  
  1845. tcase << TestAction.new(:Check_Compose) do
  1846. $ruiObj = RUIObject.new.with('objectid', 1598291378).with('selfid', 1808564263).with('textdescid', -1604213756).with('uniqueparentid', 150150411)
  1847. .with('uitreeindex', 5)
  1848. .with('classname', 'ImageButton')
  1849. .with('resource-id', 'com.google.android.gm:id/compose_button')
  1850. .with('content-desc', 'Compose')
  1851.  
  1852. $ruiObj.isExist
  1853.  
  1854. waitsecond(2)
  1855. end
  1856.  
  1857. tcase << TestAction.new(:Result) do
  1858. $myTestResult = checkLastExistResult
  1859.  
  1860.  
  1861.  
  1862. waitsecond(0)
  1863. end
  1864.  
  1865. tcase << TestAction.new(:logStop) do
  1866. logStopTest("Email_5_1_3_2")
  1867.  
  1868. waitsecond(0)
  1869. end
  1870.  
  1871. tcase.run(loopTime)
  1872.  
  1873. end
  1874.  
  1875. def self.Email_Precondition(loopTime)
  1876.  
  1877. tcase = TestCase.new("Email_Precondition")
  1878.  
  1879. tcase << TestAction.new(:Settings) do
  1880. gotoAppPixel('Settings')
  1881.  
  1882. waitsecond(2)
  1883. end
  1884.  
  1885. tcase << TestAction.new(:Apps) do
  1886. $ruiObj = RUIObject.new.with('objectid', -1980252617).with('selfid', -999362027).with('textdescid', -2077380333).with('uniqueparentid', 1746487935)
  1887. .with('uitreeindex', 18)
  1888. .with('classname', 'TextView')
  1889. .with('resource-id', 'android:id/title')
  1890. .with('text', 'Apps notifications')
  1891.  
  1892. $ruiObj.click
  1893.  
  1894. waitsecond(2)
  1895. end
  1896.  
  1897. tcase << TestAction.new(:SearchCamera) do
  1898. scrollAndSearchText('Camera')
  1899.  
  1900. waitsecond(2)
  1901. end
  1902.  
  1903. tcase << TestAction.new(:Camera) do
  1904. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -374634778).with('textdescid', 1951829936).with('uniqueparentid', 1212711866)
  1905. .with('uitreeindex', 4)
  1906. .with('classname', 'TextView')
  1907. .with('resource-id', 'android:id/title')
  1908. .with('text', 'Camera')
  1909.  
  1910. $ruiObj.click
  1911.  
  1912. waitsecond(2)
  1913. end
  1914.  
  1915. tcase << TestAction.new(:Storage) do
  1916. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -1162414374).with('textdescid', -2051153520).with('uniqueparentid', 162506563)
  1917. .with('uitreeindex', 10)
  1918. .with('classname', 'TextView')
  1919. .with('resource-id', 'android:id/title')
  1920. .with('text', 'Storage')
  1921.  
  1922. $ruiObj.click
  1923.  
  1924. waitsecond(2)
  1925. end
  1926.  
  1927. tcase << TestAction.new(:ClearCache) do
  1928. $ruiObj = RUIObject.new.with('objectid', 699987448).with('selfid', 2145148908).with('textdescid', -1064159269).with('uniqueparentid', -1819455735)
  1929. .with('uitreeindex', 5)
  1930. .with('classname', 'Button')
  1931. .with('resource-id', 'com.android.settings:id/left_button')
  1932. .with('text', 'CLEAR DATA')
  1933.  
  1934. $ruiObj.click
  1935.  
  1936. waitsecond(2)
  1937. end
  1938.  
  1939. tcase << TestAction.new(:OK) do
  1940. $ruiObj = RUIObject.new.with('objectid', -1004548822).with('selfid', -1318451484).with('textdescid', -405740082).with('uniqueparentid', -2133631140).with('classresourceid', 1834539358)
  1941. .with('uitreeindex', 4)
  1942. .with('classname', 'Button')
  1943. .with('resource-id', 'android:id/button1')
  1944. .with('text', 'OK')
  1945.  
  1946. $ruiObj.click
  1947.  
  1948. waitsecond(2)
  1949. end
  1950.  
  1951. tcase << TestAction.new(:OpenCamera) do
  1952. gotoAppPixel('Camera')
  1953.  
  1954. waitsecond(2)
  1955. end
  1956.  
  1957. tcase << TestAction.new(:Allow) do
  1958. $ruiObj = RUIObject.new.with('objectid', 153379926).with('selfid', 1443382411).with('textdescid', 294474017).with('uniqueparentid', 725356101).with('classresourceid', -227364920)
  1959. .with('uitreeindex', 3)
  1960. .with('classname', 'Button')
  1961. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  1962. .with('text', 'ALLOW')
  1963.  
  1964. $ruiObj.click
  1965.  
  1966. waitsecond(2)
  1967. end
  1968.  
  1969. tcase << TestAction.new(:CheckBox) do
  1970. $ruiObj = RUIObject.new.with('objectid', 664129579).with('selfid', -829319141).with('textdescid', 745076204).with('uniqueparentid', 342104880)
  1971. .with('uitreeindex', 2)
  1972. .with('classname', 'CheckBox')
  1973. .with('resource-id', 'com.android.camera2:id/check_box')
  1974. .with('text', 'Tag your photos and videos with the locations where theyre taken')
  1975.  
  1976. $ruiObj.click
  1977.  
  1978. waitsecond(2)
  1979. end
  1980.  
  1981. tcase << TestAction.new(:Next) do
  1982. $ruiObj = RUIObject.new.with('objectid', -1187921382).with('selfid', -1055162259).with('textdescid', 1673606663).with('uniqueparentid', -1678803509)
  1983. .with('uitreeindex', 3)
  1984. .with('classname', 'Button')
  1985. .with('resource-id', 'com.android.camera2:id/confirm_button')
  1986. .with('text', 'NEXT')
  1987.  
  1988. $ruiObj.click
  1989.  
  1990. waitsecond(2)
  1991. end
  1992.  
  1993. tcase << TestAction.new(:swipeLeft) do
  1994. swipe_horizontal_back 50
  1995.  
  1996. waitsecond(2)
  1997. end
  1998.  
  1999. tcase << TestAction.new(:wait2) do
  2000. waitsecond(2)
  2001. end
  2002.  
  2003. tcase << TestAction.new(:clickSettings) do
  2004. click(1314,2128.5)
  2005.  
  2006. waitsecond(2)
  2007. end
  2008.  
  2009. tcase << TestAction.new(:Resolution) do
  2010. $ruiObj = RUIObject.new.with('objectid', 769121715).with('selfid', 865723314).with('textdescid', -589260518).with('uniqueparentid', -1979112293).with('classresourceid', 490183159)
  2011. .with('uitreeindex', 2)
  2012. .with('classname', 'TextView')
  2013. .with('resource-id', 'android:id/title')
  2014. .with('text', 'Resolution quality')
  2015.  
  2016. $ruiObj.click
  2017.  
  2018. waitsecond(2)
  2019. end
  2020.  
  2021. tcase << TestAction.new(:BackCamera) do
  2022. $ruiObj = RUIObject.new.with('objectid', 769121715).with('selfid', 1818667439).with('textdescid', 336805309).with('uniqueparentid', -1743767793).with('classresourceid', 490183159)
  2023. .with('uitreeindex', 3)
  2024. .with('classname', 'TextView')
  2025. .with('resource-id', 'android:id/title')
  2026. .with('text', 'Back camera photo')
  2027.  
  2028. $ruiObj.click
  2029.  
  2030. waitsecond(2)
  2031. end
  2032.  
  2033. tcase << TestAction.new(:Pixel) do
  2034. $ruiObj = RUIObject.new.with('objectid', -2032711530).with('selfid', 54695798).with('textdescid', -491191936).with('uniqueparentid', -1389815021).with('classresourceid', 2074814108)
  2035. .with('uitreeindex', 7)
  2036. .with('classname', 'CheckedTextView')
  2037. .with('resource-id', 'android:id/text1')
  2038. .with('text', '169 09 megapixels')
  2039.  
  2040. $ruiObj.click
  2041.  
  2042. waitsecond(2)
  2043. end
  2044.  
  2045. tcase << TestAction.new(:FrontCamera) do
  2046. $ruiObj = RUIObject.new.with('objectid', 769121715).with('selfid', -625898417).with('textdescid', -59672123).with('uniqueparentid', 1182748742).with('classresourceid', 490183159)
  2047. .with('uitreeindex', 5)
  2048. .with('classname', 'TextView')
  2049. .with('resource-id', 'android:id/title')
  2050. .with('text', 'Front camera photo')
  2051.  
  2052. $ruiObj.click
  2053.  
  2054. waitsecond(2)
  2055. end
  2056.  
  2057. tcase << TestAction.new(:Pixel2) do
  2058. $ruiObj = RUIObject.new.with('objectid', -2032711530).with('selfid', -848883235).with('textdescid', 1562629113).with('uniqueparentid', 2068759084).with('classresourceid', 2074814108)
  2059. .with('uitreeindex', 7)
  2060. .with('classname', 'CheckedTextView')
  2061. .with('resource-id', 'android:id/text1')
  2062. .with('text', '169 02 megapixels')
  2063.  
  2064. $ruiObj.click
  2065.  
  2066. waitsecond(2)
  2067. end
  2068.  
  2069. tcase << TestAction.new(:Back) do
  2070. $ruiObj = RUIObject.new.with('objectid', -749179047).with('selfid', -123872605).with('textdescid', -911113085).with('uniqueparentid', -292129185)
  2071. .with('uitreeindex', 0)
  2072. .with('classname', 'ImageButton')
  2073. .with('content-desc', 'Navigate up')
  2074.  
  2075. $ruiObj.click
  2076.  
  2077. waitsecond(2)
  2078. end
  2079.  
  2080. tcase << TestAction.new(:Back2) do
  2081. $ruiObj = RUIObject.new.with('objectid', -749179047).with('selfid', -123872605).with('textdescid', -911113085).with('uniqueparentid', -292129185)
  2082. .with('uitreeindex', 0)
  2083. .with('classname', 'ImageButton')
  2084. .with('content-desc', 'Navigate up')
  2085.  
  2086. $ruiObj.click
  2087.  
  2088. waitsecond(2)
  2089. end
  2090.  
  2091. tcase << TestAction.new(:Shutter) do
  2092. $ruiObj = RUIObject.new.with('objectid', -1444537032).with('selfid', 111453042).with('textdescid', 1162006437).with('uniqueparentid', -1154361882)
  2093. .with('uitreeindex', 6)
  2094. .with('classname', 'ImageView')
  2095. .with('resource-id', 'com.android.camera2:id/shutter_button')
  2096. .with('content-desc', 'Shutter')
  2097.  
  2098. $ruiObj.click
  2099.  
  2100. waitsecond(2)
  2101. end
  2102.  
  2103. tcase << TestAction.new(:GoToSettings) do
  2104. gotoAppPixel('Settings')
  2105.  
  2106. waitsecond(2)
  2107. end
  2108.  
  2109. tcase << TestAction.new(:SearchAccounts) do
  2110. scrollAndSearchText('Users & accounts')
  2111.  
  2112. waitsecond(2)
  2113. end
  2114.  
  2115. tcase << TestAction.new(:UsersAccounts) do
  2116. $ruiObj = RUIObject.new.with('objectid', -1980252617).with('selfid', 1816414541).with('textdescid', 483636443).with('uniqueparentid', -769009501)
  2117. .with('uitreeindex', 21)
  2118. .with('classname', 'TextView')
  2119. .with('resource-id', 'android:id/title')
  2120. .with('text', 'Users accounts')
  2121.  
  2122. $ruiObj.click
  2123.  
  2124. waitsecond(2)
  2125. end
  2126.  
  2127. tcase << TestAction.new(:ClickAccount) do
  2128. $accountButton = RUIObject.new.with('objectid', 2093003359).with('selfid', -1580627678).with('textdescid', 458594721).with('uniqueparentid', -1208912882)
  2129. .with('uitreeindex', 6)
  2130. .with('pretext', 'Accounts for Owner')
  2131. .with('classname', 'ImageView')
  2132. .with('resource-id', 'android:id/icon')
  2133.  
  2134. if $accountButton.isExist
  2135. $accountButton.click
  2136. end
  2137.  
  2138. waitsecond(2)
  2139. end
  2140.  
  2141. tcase << TestAction.new(:RemoveAccount) do
  2142. $removeAccount = $ruiObj = RUIObject.new.with('objectid', 142601956).with('selfid', 190620862).with('textdescid', -81471853).with('uniqueparentid', -1843605818)
  2143. .with('uitreeindex', 6)
  2144. .with('classname', 'Button')
  2145. .with('resource-id', 'com.android.settings:id/button')
  2146. .with('text', 'REMOVE ACCOUNT')
  2147. if $removeAccount.isExist
  2148. $removeAccount.click
  2149. end
  2150.  
  2151. $ruiObj.click
  2152.  
  2153. waitsecond(2)
  2154. end
  2155.  
  2156. tcase << TestAction.new(:Confirm) do
  2157. $ruiObj = RUIObject.new.with('objectid', -1004548822).with('selfid', -1699837063).with('textdescid', -172267303).with('uniqueparentid', 1451097447).with('classresourceid', 1834539358)
  2158. .with('uitreeindex', 4)
  2159. .with('classname', 'Button')
  2160. .with('resource-id', 'android:id/button1')
  2161. .with('text', 'REMOVE ACCOUNT')
  2162.  
  2163. $ruiObj.click
  2164.  
  2165. waitsecond(2)
  2166. end
  2167.  
  2168. tcase << TestAction.new(:GoToGmail) do
  2169. gotoAppPixel('Gmail')
  2170.  
  2171. waitsecond(2)
  2172. end
  2173.  
  2174. tcase << TestAction.new(:TourGotIt) do
  2175. $ruiObj = RUIObject.new.with('objectid', -1374270067).with('selfid', 29381074).with('textdescid', -1431784690).with('uniqueparentid', -1320248293)
  2176. .with('uitreeindex', 4)
  2177. .with('classname', 'TextView')
  2178. .with('resource-id', 'com.google.android.gm:id/welcome_tour_got_it')
  2179. .with('text', 'GOT IT')
  2180.  
  2181. $ruiObj.click
  2182. ifFailJumpTo(:TourNext)
  2183.  
  2184. waitsecond(2)
  2185. end
  2186.  
  2187. tcase << TestAction.new(:TourNext) do
  2188. $ruiObj = RUIObject.new.with('objectid', -965796713).with('selfid', 2106428631).with('textdescid', -49033732).with('uniqueparentid', 41439437)
  2189. .with('uitreeindex', 6)
  2190. .with('classname', 'ImageView')
  2191. .with('resource-id', 'com.google.android.gm:id/welcome_tour_next')
  2192. .with('content-desc', 'Next')
  2193.  
  2194. $ruiObj.click
  2195.  
  2196. waitsecond(2)
  2197. end
  2198.  
  2199. tcase << TestAction.new(:WelcomeDone) do
  2200. $ruiObj = RUIObject.new.with('objectid', -1459269354).with('selfid', -2111812423).with('textdescid', -1337192108).with('uniqueparentid', -118933564)
  2201. .with('uitreeindex', 5)
  2202. .with('classname', 'TextView')
  2203. .with('resource-id', 'com.google.android.gm:id/welcome_tour_done')
  2204. .with('text', 'DONE')
  2205.  
  2206. $ruiObj.click
  2207.  
  2208. waitsecond(2)
  2209. end
  2210.  
  2211. tcase << TestAction.new(:AddEmail) do
  2212. $ruiObj = RUIObject.new.with('objectid', 1784765643).with('selfid', 394229773).with('textdescid', -1185071217).with('uniqueparentid', 35495294).with('classresourceid', 759149223)
  2213. .with('uitreeindex', 2)
  2214. .with('classname', 'TextView')
  2215. .with('resource-id', 'com.google.android.gm:id/setup_addresses_add_another')
  2216. .with('text', 'Add an email address')
  2217.  
  2218. $ruiObj.click
  2219.  
  2220. waitsecond(2)
  2221. end
  2222.  
  2223. tcase << TestAction.new(:SetUpGmail) do
  2224. $ruiObj = RUIObject.new.with('objectid', -1456508049).with('selfid', -320144828).with('textdescid', 2104439094).with('uniqueparentid', 1362689227).with('classresourceid', -1877262527)
  2225. .with('uitreeindex', 4)
  2226. .with('classname', 'TextView')
  2227. .with('resource-id', 'com.google.android.gm:id/account_setup_label')
  2228. .with('text', 'Google')
  2229.  
  2230. $ruiObj.click
  2231.  
  2232. waitsecond(2)
  2233. end
  2234.  
  2235. tcase << TestAction.new(:Loading) do
  2236. $signIn = RUIObject.new.with('objectid', 476695571).with('selfid', 1024373019).with('textdescid', 1892660845).with('uniqueparentid', 877823464)
  2237. .with('uitreeindex', 3)
  2238. .with('classname', 'EditText')
  2239. .with('resource-id', 'identifierId')
  2240.  
  2241. $second = 0;
  2242.  
  2243. while ($signIn.isNotExist) && $second < 15
  2244. puts $second
  2245. $second += 1
  2246. waitsecond(1)
  2247. end
  2248.  
  2249. waitsecond(2)
  2250. end
  2251.  
  2252. tcase << TestAction.new(:ID) do
  2253. $ruiObj = RUIObject.new.with('objectid', 476695571).with('selfid', 1024373019).with('textdescid', 1892660845).with('uniqueparentid', 877823464)
  2254. .with('uitreeindex', 3)
  2255. .with('classname', 'EditText')
  2256. .with('resource-id', 'identifierId')
  2257.  
  2258. $ruiObj.inputtext('nalab.qct02@gmail.com')
  2259.  
  2260. waitsecond(2)
  2261. end
  2262.  
  2263. tcase << TestAction.new(:Next2) do
  2264. $ruiObj = RUIObject.new.with('objectid', -240525947).with('selfid', 1739137727).with('textdescid', 264687918).with('uniqueparentid', -1629724901)
  2265. .with('uitreeindex', 6)
  2266. .with('classname', 'Button')
  2267. .with('resource-id', 'identifierNext')
  2268. .with('content-desc', 'NEXT')
  2269.  
  2270. $ruiObj.click
  2271.  
  2272. waitsecond(2)
  2273. end
  2274.  
  2275. tcase << TestAction.new(:PWD) do
  2276. $ruiObj = RUIObject.new.with('objectid', 1904625454).with('selfid', 1666676343).with('textdescid', -1086153038).with('uniqueparentid', -1718739466)
  2277. .with('uitreeindex', 3)
  2278. .with('classname', 'EditText')
  2279.  
  2280. $ruiObj.inputtext('12abcdef34')
  2281.  
  2282. waitsecond(2)
  2283. end
  2284.  
  2285. tcase << TestAction.new(:Next3) do
  2286. $ruiObj = RUIObject.new.with('objectid', -412639049).with('selfid', -1426408179).with('textdescid', 1787982268).with('uniqueparentid', 446487721)
  2287. .with('uitreeindex', 9)
  2288. .with('classname', 'Button')
  2289. .with('resource-id', 'passwordNext')
  2290. .with('content-desc', 'NEXT')
  2291.  
  2292. $ruiObj.click
  2293.  
  2294. waitsecond(2)
  2295. end
  2296.  
  2297. tcase << TestAction.new(:Agree) do
  2298. $ruiObj = RUIObject.new.with('objectid', 948550242).with('selfid', -1165549500).with('textdescid', -1009902985).with('uniqueparentid', 2011089354)
  2299. .with('uitreeindex', 7)
  2300. .with('classname', 'Button')
  2301. .with('resource-id', 'signinconsentNext')
  2302. .with('content-desc', 'I AGREE')
  2303.  
  2304. $ruiObj.click
  2305.  
  2306. waitsecond(2)
  2307. end
  2308.  
  2309. tcase << TestAction.new(:BackUpOff) do
  2310. $ruiObj = RUIObject.new.with('objectid', 2065931740).with('selfid', -1480442820).with('textdescid', 1158832046).with('uniqueparentid', -1396600084).with('classresourceid', -483288220)
  2311. .with('uitreeindex', 6)
  2312. .with('classname', 'TextView')
  2313. .with('resource-id', 'com.google.android.gms.policy_sidecar_o:id/backup_opt_in_disable_backup')
  2314. .with('text', 'Turn off backup')
  2315.  
  2316. $ruiObj.click
  2317.  
  2318. waitsecond(2)
  2319. end
  2320.  
  2321. tcase << TestAction.new(:OK2) do
  2322. $ruiObj = RUIObject.new.with('objectid', -725277645).with('selfid', -1318451484).with('textdescid', -395210665).with('uniqueparentid', 887820595).with('classresourceid', 1834539358)
  2323. .with('uitreeindex', 4)
  2324. .with('classname', 'Button')
  2325. .with('resource-id', 'android:id/button1')
  2326. .with('text', 'OK')
  2327.  
  2328. $ruiObj.click
  2329.  
  2330. waitsecond(2)
  2331. end
  2332.  
  2333. tcase << TestAction.new(:TakeToGmail) do
  2334. $ruiObj = RUIObject.new.with('objectid', -1799555089).with('selfid', 1716018366).with('textdescid', -485572825).with('uniqueparentid', -1903073185)
  2335. .with('uitreeindex', 7)
  2336. .with('classname', 'TextView')
  2337. .with('resource-id', 'com.google.android.gm:id/action_done')
  2338. .with('text', 'TAKE ME TO GMAIL')
  2339.  
  2340. $ruiObj.click
  2341.  
  2342. waitsecond(2)
  2343. end
  2344.  
  2345. tcase << TestAction.new(:RecentApps) do
  2346. pressRecentApps
  2347.  
  2348. waitsecond(2)
  2349. end
  2350.  
  2351. tcase << TestAction.new(:SwipeUp) do
  2352. swipe_vertical_back 100
  2353.  
  2354. waitsecond(2)
  2355. end
  2356.  
  2357. tcase << TestAction.new(:swipeUp) do
  2358. swipe_vertical_back 100
  2359.  
  2360. waitsecond(2)
  2361. end
  2362.  
  2363. tcase << TestAction.new(:ClearAll) do
  2364. $ruiObj = RUIObject.new.with('objectid', -213794734).with('selfid', -204985471).with('textdescid', 1763854688).with('uniqueparentid', 1782126143)
  2365. .with('uitreeindex', 12)
  2366. .with('classname', 'TextView')
  2367. .with('resource-id', 'com.android.systemui:id/button')
  2368. .with('text', 'CLEAR ALL')
  2369.  
  2370. $ruiObj.click
  2371.  
  2372. waitsecond(2)
  2373. end
  2374.  
  2375. tcase.run(loopTime)
  2376.  
  2377. end
  2378.  
  2379. def self.IPME_5_1_15_2(loopTime)
  2380.  
  2381. tcase = TestCase.new("IPME_5_1_15_2")
  2382.  
  2383. tcase << TestAction.new(:logstart) do
  2384. logStartTest("05_01_15_02_IPME")
  2385.  
  2386. waitsecond(0)
  2387. end
  2388.  
  2389. tcase << TestAction.new(:gotoMessages) do
  2390. gotoAppPixel("Messages")
  2391.  
  2392. waitsecond(2)
  2393. end
  2394.  
  2395. tcase << TestAction.new(:startnewchat) do
  2396. $ruiObj = RUIObject.new.with('objectid', 764419066).with('selfid', 916878134).with('textdescid', 48640071).with('uniqueparentid', 1408873138)
  2397. .with('uitreeindex', 6)
  2398. .with('classname', 'ImageView')
  2399. .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
  2400. .with('content-desc', 'Start new conversation')
  2401.  
  2402. $ruiObj.click
  2403.  
  2404. waitsecond(2)
  2405. end
  2406.  
  2407. tcase << TestAction.new(:MultiAutoCompleteTextView_RecipientTextView_2) do
  2408. $ruiObj = RUIObject.new.with('objectid', -1173212947).with('selfid', 1163803387).with('textdescid', -2009862957).with('uniqueparentid', 955347666).with('classresourceid', 461007471)
  2409. .with('uitreeindex', 1)
  2410. .with('classname', 'MultiAutoCompleteTextView')
  2411. .with('resource-id', 'com.google.android.apps.messaging:id/recipient_text_view')
  2412.  
  2413. $ruiObj.inputtext('A01 a01')
  2414.  
  2415. waitsecond(2)
  2416. end
  2417.  
  2418. tcase << TestAction.new(:pressEnter_3) do
  2419. pressEnter
  2420.  
  2421. waitsecond(2)
  2422. end
  2423.  
  2424. tcase << TestAction.new(:input200characters) do
  2425. $ruiObj = RUIObject.new.with('objectid', 839697618).with('selfid', -1932318364).with('textdescid', 260822414).with('uniqueparentid', 1032254030)
  2426. .with('uitreeindex', 8)
  2427. .with('classname', 'EditText')
  2428. .with('resource-id', 'com.google.android.apps.messaging:id/compose_message_text')
  2429.  
  2430. $ruiObj.inputtext('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccdddddddddddddddeeeeeeeeeeeeeeffffffffffffffffgggggggggaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbb')
  2431.  
  2432. waitsecond(2)
  2433. end
  2434.  
  2435. tcase << TestAction.new(:sendmessages) do
  2436. $ruiObj = RUIObject.new.with('objectid', 874675584).with('selfid', -1214465728).with('textdescid', 1345139360).with('uniqueparentid', 1105097632)
  2437. .with('uitreeindex', 10)
  2438. .with('classname', 'ImageView')
  2439. .with('resource-id', 'com.google.android.apps.messaging:id/send_message_button_icon')
  2440.  
  2441. $ruiObj.click
  2442.  
  2443. waitsecond(2)
  2444. end
  2445.  
  2446. tcase << TestAction.new(:textmessageexist) do
  2447. $ruiObj = RUIObject.new.with('objectid', -1787159315).with('selfid', -1421701512).with('textdescid', 320778449).with('uniqueparentid', 942352883)
  2448. .with('uitreeindex', 2)
  2449. .with('classname', 'TextView')
  2450. .with('resource-id', 'com.google.android.apps.messaging:id/message_text')
  2451. .with('text', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccdddddddddddddddeeeeeeeeeeeeeeffffffffffffffffgggggggggaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbb')
  2452.  
  2453. $ruiObj.isExist
  2454.  
  2455. waitsecond(2)
  2456. end
  2457.  
  2458. tcase << TestAction.new(:logstop) do
  2459. $myTestResult = checkLastExistResult
  2460.  
  2461. if $myTestResult == false
  2462. $myFailReason == "Message is not sent"
  2463. end
  2464. logStopTest("05_01_15_02_IPME")
  2465.  
  2466.  
  2467. waitsecond(0)
  2468. end
  2469.  
  2470. tcase << TestAction.new(:pressBack_8) do
  2471. pressBack
  2472.  
  2473. waitsecond(2)
  2474. end
  2475.  
  2476. tcase << TestAction.new(:pressBack_9) do
  2477. pressBack
  2478.  
  2479. waitsecond(2)
  2480. end
  2481.  
  2482. tcase << TestAction.new(:pressBack_10) do
  2483. pressBack
  2484.  
  2485. waitsecond(2)
  2486. end
  2487.  
  2488. tcase << TestAction.new(:pressHome_11) do
  2489. pressHome
  2490.  
  2491. waitsecond(2)
  2492. end
  2493.  
  2494. tcase.run(loopTime)
  2495.  
  2496. end
  2497.  
  2498. def self.IPME_5_1_15_4(loopTime)
  2499.  
  2500. tcase = TestCase.new("IPME_5_1_15_4")
  2501.  
  2502. tcase << TestAction.new(:logstart) do
  2503. logStartTest("05_01_15_02_IPME")
  2504.  
  2505. waitsecond(0)
  2506. end
  2507.  
  2508. tcase << TestAction.new(:gotoMessages) do
  2509. gotoAppPixel("Messages")
  2510.  
  2511. waitsecond(2)
  2512. end
  2513.  
  2514. tcase << TestAction.new(:startnewchat) do
  2515. $ruiObj = RUIObject.new.with('objectid', 764419066).with('selfid', 916878134).with('textdescid', 48640071).with('uniqueparentid', 1408873138)
  2516. .with('uitreeindex', 6)
  2517. .with('classname', 'ImageView')
  2518. .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
  2519. .with('content-desc', 'Start new conversation')
  2520.  
  2521. $ruiObj.click
  2522.  
  2523. waitsecond(2)
  2524. end
  2525.  
  2526. tcase << TestAction.new(:MultiAutoCompleteTextView_RecipientTextView_2) do
  2527. $ruiObj = RUIObject.new.with('objectid', -1173212947).with('selfid', 1163803387).with('textdescid', -2009862957).with('uniqueparentid', 955347666).with('classresourceid', 461007471)
  2528. .with('uitreeindex', 1)
  2529. .with('classname', 'MultiAutoCompleteTextView')
  2530. .with('resource-id', 'com.google.android.apps.messaging:id/recipient_text_view')
  2531.  
  2532. $ruiObj.inputtext('A01 a01')
  2533.  
  2534. waitsecond(2)
  2535. end
  2536.  
  2537. tcase << TestAction.new(:pressEnter_3) do
  2538. pressEnter
  2539.  
  2540. waitsecond(2)
  2541. end
  2542.  
  2543. tcase << TestAction.new(:sendmessages) do
  2544. $ruiObj = RUIObject.new.with('objectid', 874675584).with('selfid', -1214465728).with('textdescid', 1345139360).with('uniqueparentid', 1105097632)
  2545. .with('uitreeindex', 10)
  2546. .with('classname', 'ImageView')
  2547. .with('resource-id', 'com.google.android.apps.messaging:id/send_message_button_icon')
  2548.  
  2549. $ruiObj.click
  2550.  
  2551. waitsecond(2)
  2552. end
  2553.  
  2554. tcase << TestAction.new(:textmessageexist) do
  2555. $ruiObj = RUIObject.new.with('objectid', -1787159315).with('selfid', -1421701512).with('textdescid', 320778449).with('uniqueparentid', 942352883)
  2556. .with('uitreeindex', 2)
  2557. .with('classname', 'TextView')
  2558. .with('resource-id', 'com.google.android.apps.messaging:id/message_text')
  2559. .with('text', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccdddddddddddddddeeeeeeeeeeeeeeffffffffffffffffgggggggggaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbb')
  2560.  
  2561. $ruiObj.isExist
  2562.  
  2563. waitsecond(2)
  2564. end
  2565.  
  2566. tcase << TestAction.new(:logstop) do
  2567. $myTestResult = checkLastExistResult
  2568.  
  2569. if $myTestResult == false
  2570. $myFailReason == "Message is not sent"
  2571. end
  2572. logStopTest("05_01_15_02_IPME")
  2573.  
  2574.  
  2575. waitsecond(0)
  2576. end
  2577.  
  2578. tcase << TestAction.new(:pressBack_8) do
  2579. pressBack
  2580.  
  2581. waitsecond(0)
  2582. end
  2583.  
  2584. tcase << TestAction.new(:pressBack_9) do
  2585. pressBack
  2586.  
  2587. waitsecond(0)
  2588. end
  2589.  
  2590. tcase << TestAction.new(:pressBack_10) do
  2591. pressBack
  2592.  
  2593. waitsecond(0)
  2594. end
  2595.  
  2596. tcase << TestAction.new(:pressHome_11) do
  2597. pressHome
  2598.  
  2599. waitsecond(0)
  2600. end
  2601.  
  2602. tcase.run(loopTime)
  2603.  
  2604. end
  2605.  
  2606. def self.MenuNav_5_1_9_1(loopTime)
  2607.  
  2608. tcase = TestCase.new("MenuNav_5_1_9_1")
  2609.  
  2610. tcase << TestAction.new(:scriptAction_2) do
  2611. $Apps = db("AppName").length
  2612. i = 0
  2613.  
  2614. while i < $Apps do
  2615.  
  2616. logStartTest("MenuNav_5_1_9_1")
  2617.  
  2618. gotoAppPixel(db("AppName")[i])
  2619.  
  2620. waitsecond(2)
  2621.  
  2622. RUIObject.new.with('objectid', 1308040668).with('selfid', 1900891271).with('textdescid', 1801250344).with('uniqueparentid', 125426211)
  2623. .with('uitreeindex', 4)
  2624. .with('classname', 'ImageView')
  2625. .with('resource-id', 'com.google.android.apps.nexuslauncher:id/all_apps_handle')
  2626. .with('content-desc', 'Apps list').isNotExist
  2627.  
  2628. waitsecond(2)
  2629.  
  2630. pressHome
  2631.  
  2632. $myTestResult = checkLastExistResult
  2633.  
  2634. logStopTest("MenuNav_5_1_9_1")
  2635.  
  2636. waitsecond(2)
  2637.  
  2638. i += 1
  2639. end
  2640.  
  2641.  
  2642.  
  2643. waitsecond(2)
  2644. end
  2645.  
  2646. tcase.run(loopTime)
  2647.  
  2648. end
  2649.  
  2650. def self.Messaging_5_1_2_3(loopTime)
  2651.  
  2652. tcase = TestCase.new("Messaging_5_1_2_3")
  2653.  
  2654. tcase << TestAction.new(:LogStart) do
  2655. logStartTest('Messaging_5_1_2_3')
  2656.  
  2657. waitsecond(0)
  2658. end
  2659.  
  2660. tcase << TestAction.new(:goto_Messages) do
  2661. gotoAppPixel('Messages')
  2662.  
  2663. waitsecond(2)
  2664. end
  2665.  
  2666. tcase << TestAction.new(:Messages_Default) do
  2667. $ruiObj = RUIObject.new.with('objectid', 774620124).with('selfid', -737737443).with('textdescid', -1309712823).with('uniqueparentid', 1739951846)
  2668. .with('uitreeindex', 5)
  2669. .with('classname', 'TextView')
  2670. .with('resource-id', 'com.google.android.apps.messaging:id/next')
  2671. .with('text', 'NEXT')
  2672.  
  2673. $ruiObj.click
  2674.  
  2675. waitsecond(2)
  2676. end
  2677.  
  2678. tcase << TestAction.new(:Confirm_Message_Default) do
  2679. $ruiObj = RUIObject.new.with('objectid', -1004548822).with('selfid', 2077686463).with('textdescid', 307253103).with('uniqueparentid', 1156097466).with('classresourceid', 1834539358)
  2680. .with('uitreeindex', 4)
  2681. .with('classname', 'Button')
  2682. .with('resource-id', 'android:id/button1')
  2683. .with('text', 'YES')
  2684.  
  2685. $ruiObj.click
  2686.  
  2687. waitsecond(2)
  2688. end
  2689.  
  2690. tcase << TestAction.new(:Open_New_Message) do
  2691. $ruiObj = RUIObject.new.with('objectid', 764419066).with('selfid', 916878134).with('textdescid', 48640071).with('uniqueparentid', 1408873138)
  2692. .with('uitreeindex', 6)
  2693. .with('classname', 'ImageView')
  2694. .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
  2695. .with('content-desc', 'Start new conversation')
  2696.  
  2697. $ruiObj.click
  2698.  
  2699. waitsecond(2)
  2700. end
  2701.  
  2702. tcase << TestAction.new(:Select_Recipient) do
  2703. $ruiObj = RUIObject.new.with('objectid', 1212228391).with('selfid', 1084744963).with('textdescid', -605387115).with('uniqueparentid', 1086780418).with('classresourceid', -848607765)
  2704. .with('uitreeindex', 10)
  2705. .with('classname', 'TextView')
  2706. .with('resource-id', 'com.google.android.apps.messaging:id/contact_name')
  2707. .with('text', 'A01 A01')
  2708.  
  2709. $ruiObj.click
  2710.  
  2711. waitsecond(2)
  2712. end
  2713.  
  2714. tcase << TestAction.new(:Input_Message_Text) do
  2715. $inputText = RUIObject.new.with('objectid', 839697618).with('selfid', -1932318364).with('textdescid', 260822414).with('uniqueparentid', 1032254030)
  2716. .with('uitreeindex', 8)
  2717. .with('classname', 'EditText')
  2718. .with('resource-id', 'com.google.android.apps.messaging:id/compose_message_text')
  2719.  
  2720. $inputText.inputtext('Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzaaaaaaaaaabbbbbbbbbbcccccccccc')
  2721.  
  2722. waitsecond(2)
  2723. end
  2724.  
  2725. tcase << TestAction.new(:Send_Message) do
  2726. $ruiObj = RUIObject.new.with('objectid', 874675584).with('selfid', -1214465728).with('textdescid', 1345139360).with('uniqueparentid', 1105097632)
  2727. .with('uitreeindex', 10)
  2728. .with('classname', 'ImageView')
  2729. .with('resource-id', 'com.google.android.apps.messaging:id/send_message_button_icon')
  2730.  
  2731. $ruiObj.click
  2732.  
  2733. waitsecond(5)
  2734. end
  2735.  
  2736. tcase << TestAction.new(:Confirm_Sent) do
  2737. $ruiObj = RUIObject.new.with('objectid', -1223562103).with('selfid', -2140029069).with('textdescid', -479005533).with('uniqueparentid', -952460748)
  2738. .with('uitreeindex', 3)
  2739. .with('classname', 'TextView')
  2740. .with('text', 'Now SMS')
  2741.  
  2742. $ruiObj.isExist
  2743.  
  2744. waitsecond(0)
  2745. end
  2746.  
  2747. tcase << TestAction.new(:Test_Result) do
  2748. $myTestResult = checkLastExistResult
  2749.  
  2750. waitsecond(0)
  2751. end
  2752.  
  2753. tcase << TestAction.new(:Exit_Conversation) do
  2754. $ruiObj = RUIObject.new.with('objectid', 1425651979).with('selfid', -123872605).with('textdescid', 1768877749).with('uniqueparentid', -1261979652)
  2755. .with('uitreeindex', 9)
  2756. .with('classname', 'ImageButton')
  2757. .with('content-desc', 'Navigate up')
  2758.  
  2759. $ruiObj.click
  2760.  
  2761. waitsecond(2)
  2762. end
  2763.  
  2764. tcase << TestAction.new(:Select_Conversation) do
  2765. $ruiObj = RUIObject.new.with('objectid', 201599363).with('selfid', -373177612).with('textdescid', 647161785).with('uniqueparentid', 137202537)
  2766. .with('uitreeindex', 4)
  2767. .with('classname', 'TextView')
  2768. .with('resource-id', 'com.google.android.apps.messaging:id/conversation_name')
  2769. .with('text', 'A01 A01')
  2770.  
  2771. $ruiObj.longClick
  2772.  
  2773. waitsecond(2)
  2774. end
  2775.  
  2776. tcase << TestAction.new(:Delete_Conversation) do
  2777. $ruiObj = RUIObject.new.with('objectid', 1400187979).with('selfid', -1174101288).with('textdescid', -1369143488).with('uniqueparentid', 112203385)
  2778. .with('uitreeindex', 2)
  2779. .with('classname', 'TextView')
  2780. .with('resource-id', 'com.google.android.apps.messaging:id/action_delete')
  2781. .with('content-desc', 'Delete')
  2782.  
  2783. $ruiObj.click
  2784.  
  2785. waitsecond(2)
  2786. end
  2787.  
  2788. tcase << TestAction.new(:Confirm_Delete_Conversation) do
  2789. $ruiObj = RUIObject.new.with('objectid', -968538326).with('selfid', 982364851).with('textdescid', -2103192353).with('uniqueparentid', -1643928723).with('classresourceid', 1834539358)
  2790. .with('uitreeindex', 2)
  2791. .with('classname', 'Button')
  2792. .with('resource-id', 'android:id/button1')
  2793. .with('text', 'DELETE')
  2794.  
  2795. $ruiObj.click
  2796.  
  2797. waitsecond(2)
  2798. end
  2799.  
  2800. tcase << TestAction.new(:LogStop) do
  2801. logStopTest('Messaging_5_1_2_3')
  2802.  
  2803. waitsecond(0)
  2804. end
  2805.  
  2806. tcase << TestAction.new(:Press_Back) do
  2807. pressBack
  2808. waitsecond(1)
  2809. pressBack
  2810.  
  2811. waitsecond(2)
  2812. end
  2813.  
  2814. tcase.run(loopTime)
  2815.  
  2816. end
  2817.  
  2818. def self.Messaging_5_1_2_5(loopTime)
  2819.  
  2820. tcase = TestCase.new("Messaging_5_1_2_5")
  2821.  
  2822. tcase << TestAction.new(:LogStart) do
  2823. logStartTest('Messaging_5_1_2_5')
  2824.  
  2825. waitsecond(0)
  2826. end
  2827.  
  2828. tcase << TestAction.new(:goto_Messages) do
  2829. gotoAppPixel('Messages')
  2830.  
  2831. waitsecond(2)
  2832. end
  2833.  
  2834. tcase << TestAction.new(:Open_New_Message) do
  2835. $ruiObj = RUIObject.new.with('objectid', 764419066).with('selfid', 916878134).with('textdescid', 48640071).with('uniqueparentid', 1408873138)
  2836. .with('uitreeindex', 6)
  2837. .with('classname', 'ImageView')
  2838. .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
  2839. .with('content-desc', 'Start new conversation')
  2840.  
  2841. $ruiObj.click
  2842.  
  2843. waitsecond(2)
  2844. end
  2845.  
  2846. tcase << TestAction.new(:Select_Recipient) do
  2847. $ruiObj = RUIObject.new.with('objectid', 1212228391).with('selfid', 1084744963).with('textdescid', -605387115).with('uniqueparentid', 1086780418).with('classresourceid', -848607765)
  2848. .with('uitreeindex', 10)
  2849. .with('classname', 'TextView')
  2850. .with('resource-id', 'com.google.android.apps.messaging:id/contact_name')
  2851. .with('text', 'A01 A01')
  2852.  
  2853. $ruiObj.click
  2854.  
  2855. waitsecond(2)
  2856. end
  2857.  
  2858. tcase << TestAction.new(:Input_Message_Text) do
  2859. $inputText = RUIObject.new.with('objectid', 839697618).with('selfid', -1932318364).with('textdescid', 260822414).with('uniqueparentid', 1032254030)
  2860. .with('uitreeindex', 8)
  2861. .with('classname', 'EditText')
  2862. .with('resource-id', 'com.google.android.apps.messaging:id/compose_message_text')
  2863.  
  2864. $inputText.inputtext('Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzaaaaaaaaaabbbbbbbbbbcccccccccc')
  2865.  
  2866. waitsecond(2)
  2867. end
  2868.  
  2869. tcase << TestAction.new(:Add_Attachment) do
  2870. $ruiObj = RUIObject.new.with('objectid', -1360420814).with('selfid', -952088716).with('textdescid', 1847611113).with('uniqueparentid', 1631420680)
  2871. .with('uitreeindex', 7)
  2872. .with('classname', 'ImageButton')
  2873. .with('resource-id', 'com.google.android.apps.messaging:id/attach_media_button')
  2874. .with('content-desc', 'Add an attachment')
  2875.  
  2876. $ruiObj.click
  2877.  
  2878. waitsecond(2)
  2879. end
  2880.  
  2881. tcase << TestAction.new(:Navigate_Pictures) do
  2882. $ruiObj = RUIObject.new.with('objectid', 1408822083).with('selfid', 538927602).with('textdescid', 531479902).with('uniqueparentid', -1874692983)
  2883. .with('uitreeindex', 28)
  2884. .with('classname', 'ImageButton')
  2885. .with('content-desc', 'Choose images from this device')
  2886.  
  2887. $ruiObj.click
  2888.  
  2889. waitsecond(2)
  2890. end
  2891.  
  2892. tcase << TestAction.new(:Allow_Permission) do
  2893. $ruiObj = RUIObject.new.with('objectid', -655699299).with('selfid', -1852985786).with('textdescid', -1480420102).with('uniqueparentid', -2002661991)
  2894. .with('uitreeindex', 13)
  2895. .with('classname', 'TextView')
  2896. .with('resource-id', 'com.google.android.apps.messaging:id/missing_permission_enable')
  2897. .with('text', 'ALLOW')
  2898.  
  2899. $ruiObj.click
  2900.  
  2901. waitsecond(2)
  2902. end
  2903.  
  2904. tcase << TestAction.new(:Accept_Permission) do
  2905. $ruiObj = RUIObject.new.with('objectid', 153379926).with('selfid', 1443382411).with('textdescid', 294474017).with('uniqueparentid', 725356101).with('classresourceid', -227364920)
  2906. .with('uitreeindex', 3)
  2907. .with('classname', 'Button')
  2908. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  2909. .with('text', 'ALLOW')
  2910.  
  2911. $ruiObj.click
  2912.  
  2913. waitsecond(2)
  2914. end
  2915.  
  2916. tcase << TestAction.new(:Expand_Attachments) do
  2917. swipe(getDisplayWidth/2, getDisplayHeight - 50, getDisplayWidth/2, getDisplayHeight/4, 20)
  2918.  
  2919. waitsecond(2)
  2920. end
  2921.  
  2922. tcase << TestAction.new(:Search_for_Video) do
  2923. scrollAndSearchText("031")
  2924.  
  2925. waitsecond(2)
  2926. end
  2927.  
  2928. tcase << TestAction.new(:Select_Video) do
  2929. $ruiObj = RUIObject.new.with('selfid', 387236504).with('textdescid', 1922566919).with('uniqueparentid', -660471932)
  2930. .with('content-desc', 'Video attachment 31 seconds')
  2931.  
  2932. $ruiObj.click
  2933.  
  2934. waitsecond(2)
  2935. end
  2936.  
  2937. tcase << TestAction.new(:Collapse_Attachments) do
  2938. swipe(getDisplayWidth/2, getDisplayHeight/4, getDisplayWidth/2, getDisplayHeight, 10)
  2939. swipe(getDisplayWidth/2, getDisplayHeight/4, getDisplayWidth/2, getDisplayHeight, 10)
  2940.  
  2941. waitsecond(2)
  2942. end
  2943.  
  2944. tcase << TestAction.new(:Send_Message) do
  2945. $ruiObj = RUIObject.new.with('objectid', 874675584).with('selfid', -1214465728).with('textdescid', 1345139360).with('uniqueparentid', 1105097632)
  2946. .with('uitreeindex', 10)
  2947. .with('classname', 'ImageView')
  2948. .with('resource-id', 'com.google.android.apps.messaging:id/send_message_button_icon')
  2949.  
  2950. $ruiObj.click
  2951.  
  2952. waitsecond(2)
  2953. end
  2954.  
  2955. tcase << TestAction.new(:Wait_Sent_Confirmation) do
  2956. $sentMMS = RUIObject.new.with('objectid', -1223562103).with('selfid', 893316915).with('textdescid', 1281233763).with('uniqueparentid', 807778548)
  2957. .with('uitreeindex', 4)
  2958. .with('classname', 'TextView')
  2959. .with('text', 'Now MMS')
  2960.  
  2961. $count = 0
  2962.  
  2963. while $sentMMS.isNotExist && $count < 60
  2964. waitsecond(1)
  2965. $count += 1
  2966. puts $count
  2967. end
  2968.  
  2969. waitsecond(2)
  2970. end
  2971.  
  2972. tcase << TestAction.new(:Sent_Confirmation) do
  2973. $ruiObj = RUIObject.new.with('objectid', -1223562103).with('selfid', 893316915).with('textdescid', 1281233763).with('uniqueparentid', 807778548)
  2974. .with('uitreeindex', 4)
  2975. .with('classname', 'TextView')
  2976. .with('text', 'Now MMS')
  2977.  
  2978. $ruiObj.isExist
  2979.  
  2980. waitsecond(0)
  2981. end
  2982.  
  2983. tcase << TestAction.new(:Test_Result) do
  2984. $myTestResult = checkLastExistResult
  2985.  
  2986. waitsecond(0)
  2987. end
  2988.  
  2989. tcase << TestAction.new(:Press_Back) do
  2990. pressBack
  2991.  
  2992. waitsecond(2)
  2993. end
  2994.  
  2995. tcase << TestAction.new(:Exit_Conversation) do
  2996. $ruiObj = RUIObject.new.with('objectid', 1425651979).with('selfid', -123872605).with('textdescid', 1768877749).with('uniqueparentid', -1261979652)
  2997. .with('uitreeindex', 9)
  2998. .with('classname', 'ImageButton')
  2999. .with('content-desc', 'Navigate up')
  3000.  
  3001. $ruiObj.click
  3002.  
  3003. waitsecond(2)
  3004. end
  3005.  
  3006. tcase << TestAction.new(:Select_Conversation) do
  3007. $ruiObj = RUIObject.new.with('objectid', 201599363).with('selfid', -373177612).with('textdescid', 647161785).with('uniqueparentid', 137202537)
  3008. .with('uitreeindex', 4)
  3009. .with('classname', 'TextView')
  3010. .with('resource-id', 'com.google.android.apps.messaging:id/conversation_name')
  3011. .with('text', 'A01 A01')
  3012.  
  3013. $ruiObj.longClick
  3014.  
  3015. waitsecond(2)
  3016. end
  3017.  
  3018. tcase << TestAction.new(:Delete_Conversation) do
  3019. $ruiObj = RUIObject.new.with('objectid', 1400187979).with('selfid', -1174101288).with('textdescid', -1369143488).with('uniqueparentid', 112203385)
  3020. .with('uitreeindex', 2)
  3021. .with('classname', 'TextView')
  3022. .with('resource-id', 'com.google.android.apps.messaging:id/action_delete')
  3023. .with('content-desc', 'Delete')
  3024.  
  3025. $ruiObj.click
  3026.  
  3027. waitsecond(2)
  3028. end
  3029.  
  3030. tcase << TestAction.new(:Confirm_Delete_Conversation) do
  3031. $ruiObj = RUIObject.new.with('objectid', -968538326).with('selfid', 982364851).with('textdescid', -2103192353).with('uniqueparentid', -1643928723).with('classresourceid', 1834539358)
  3032. .with('uitreeindex', 2)
  3033. .with('classname', 'Button')
  3034. .with('resource-id', 'android:id/button1')
  3035. .with('text', 'DELETE')
  3036.  
  3037. $ruiObj.click
  3038.  
  3039. waitsecond(2)
  3040. end
  3041.  
  3042. tcase << TestAction.new(:LogStop) do
  3043. logStopTest('Messaging_5_1_2_5')
  3044.  
  3045. waitsecond(0)
  3046. end
  3047.  
  3048. tcase << TestAction.new(:Press_Back_1) do
  3049. pressBack
  3050. waitsecond(1)
  3051. pressBack
  3052.  
  3053. waitsecond(2)
  3054. end
  3055.  
  3056. tcase.run(loopTime)
  3057.  
  3058. end
  3059.  
  3060. def self.Messaging_5_1_2_6(loopTime)
  3061.  
  3062. tcase = TestCase.new("Messaging_5_1_2_6")
  3063.  
  3064. tcase << TestAction.new(:LogStart) do
  3065. logStartTest('Messaging_5_1_2_6')
  3066.  
  3067. waitsecond(0)
  3068. end
  3069.  
  3070. tcase << TestAction.new(:goto_Messages) do
  3071. gotoAppPixel('Messages')
  3072.  
  3073. waitsecond(2)
  3074. end
  3075.  
  3076. tcase << TestAction.new(:Open_New_Message) do
  3077. $ruiObj = RUIObject.new.with('objectid', 764419066).with('selfid', 916878134).with('textdescid', 48640071).with('uniqueparentid', 1408873138)
  3078. .with('uitreeindex', 6)
  3079. .with('classname', 'ImageView')
  3080. .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
  3081. .with('content-desc', 'Start new conversation')
  3082.  
  3083. $ruiObj.click
  3084.  
  3085. waitsecond(2)
  3086. end
  3087.  
  3088. tcase << TestAction.new(:Select_Recipient) do
  3089. $ruiObj = RUIObject.new.with('objectid', 1212228391).with('selfid', 1084744963).with('textdescid', -605387115).with('uniqueparentid', 1086780418).with('classresourceid', -848607765)
  3090. .with('uitreeindex', 10)
  3091. .with('classname', 'TextView')
  3092. .with('resource-id', 'com.google.android.apps.messaging:id/contact_name')
  3093. .with('text', 'A01 A01')
  3094.  
  3095. $ruiObj.click
  3096.  
  3097. waitsecond(2)
  3098. end
  3099.  
  3100. tcase << TestAction.new(:Input_Message_Text) do
  3101. $inputText = RUIObject.new.with('objectid', 839697618).with('selfid', -1932318364).with('textdescid', 260822414).with('uniqueparentid', 1032254030)
  3102. .with('uitreeindex', 8)
  3103. .with('classname', 'EditText')
  3104. .with('resource-id', 'com.google.android.apps.messaging:id/compose_message_text')
  3105.  
  3106. $inputText.inputtext('Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzaaaaaaaaaabbbbbbbbbbcccccccccc')
  3107.  
  3108. waitsecond(2)
  3109. end
  3110.  
  3111. tcase << TestAction.new(:Add_Attachment) do
  3112. $ruiObj = RUIObject.new.with('objectid', -1360420814).with('selfid', -952088716).with('textdescid', 1847611113).with('uniqueparentid', 1631420680)
  3113. .with('uitreeindex', 7)
  3114. .with('classname', 'ImageButton')
  3115. .with('resource-id', 'com.google.android.apps.messaging:id/attach_media_button')
  3116. .with('content-desc', 'Add an attachment')
  3117.  
  3118. $ruiObj.click
  3119.  
  3120. waitsecond(2)
  3121. end
  3122.  
  3123. tcase << TestAction.new(:Navigate_Pictures) do
  3124. $ruiObj = RUIObject.new.with('objectid', 1408822083).with('selfid', 538927602).with('textdescid', 531479902).with('uniqueparentid', -1874692983)
  3125. .with('uitreeindex', 19)
  3126. .with('classname', 'ImageButton')
  3127. .with('content-desc', 'Choose images from this device')
  3128.  
  3129. $ruiObj.click
  3130.  
  3131. waitsecond(2)
  3132. end
  3133.  
  3134. tcase << TestAction.new(:Allow_Permission) do
  3135. $ruiObj = RUIObject.new.with('objectid', -655699299).with('selfid', -1852985786).with('textdescid', -1480420102).with('uniqueparentid', -2002661991)
  3136. .with('uitreeindex', 13)
  3137. .with('classname', 'TextView')
  3138. .with('resource-id', 'com.google.android.apps.messaging:id/missing_permission_enable')
  3139. .with('text', 'ALLOW')
  3140.  
  3141. $ruiObj.click
  3142.  
  3143. waitsecond(2)
  3144. end
  3145.  
  3146. tcase << TestAction.new(:Accept_Permission) do
  3147. $ruiObj = RUIObject.new.with('objectid', 153379926).with('selfid', 1443382411).with('textdescid', 294474017).with('uniqueparentid', 725356101).with('classresourceid', -227364920)
  3148. .with('uitreeindex', 3)
  3149. .with('classname', 'Button')
  3150. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  3151. .with('text', 'ALLOW')
  3152.  
  3153. $ruiObj.click
  3154.  
  3155. waitsecond(2)
  3156. end
  3157.  
  3158. tcase << TestAction.new(:Expand_Attachments) do
  3159. swipe(getDisplayWidth/2, getDisplayHeight - 50, getDisplayWidth/2, getDisplayHeight/4, 10)
  3160.  
  3161. waitsecond(2)
  3162. end
  3163.  
  3164. tcase << TestAction.new(:Select_Picture) do
  3165. $ruiObj = RUIObject.new.with('objectid', 210721229).with('selfid', 372442942).with('textdescid', 1772734819).with('uniqueparentid', -153679189)
  3166. .with('uitreeindex', 16)
  3167. .with('classname', 'ImageView')
  3168. .with('resource-id', 'com.google.android.apps.messaging:id/image')
  3169. .with('content-desc', 'image January 1 2017 7 12 am')
  3170.  
  3171. $ruiObj.select('Similiar').click
  3172.  
  3173. waitsecond(2)
  3174. end
  3175.  
  3176. tcase << TestAction.new(:Collapse_Attachments) do
  3177. swipe(getDisplayWidth/2, getDisplayHeight/4, getDisplayWidth/2, getDisplayHeight, 10)
  3178. swipe(getDisplayWidth/2, getDisplayHeight/4, getDisplayWidth/2, getDisplayHeight, 10)
  3179.  
  3180. waitsecond(2)
  3181. end
  3182.  
  3183. tcase << TestAction.new(:Send_Message) do
  3184. $ruiObj = RUIObject.new.with('objectid', 874675584).with('selfid', -1214465728).with('textdescid', 1345139360).with('uniqueparentid', 1105097632)
  3185. .with('uitreeindex', 10)
  3186. .with('classname', 'ImageView')
  3187. .with('resource-id', 'com.google.android.apps.messaging:id/send_message_button_icon')
  3188.  
  3189. $ruiObj.click
  3190.  
  3191. waitsecond(2)
  3192. end
  3193.  
  3194. tcase << TestAction.new(:Wait_Sent_Confirmation) do
  3195. $sentMMS = RUIObject.new.with('objectid', -1223562103).with('selfid', 893316915).with('textdescid', 1281233763).with('uniqueparentid', 807778548)
  3196. .with('uitreeindex', 4)
  3197. .with('classname', 'TextView')
  3198. .with('text', 'Now MMS')
  3199.  
  3200. $count = 0
  3201.  
  3202. while $sentMMS.isNotExist && $count < 30
  3203. waitsecond(1)
  3204. $count += 1
  3205. puts $count
  3206. end
  3207.  
  3208. waitsecond(2)
  3209. end
  3210.  
  3211. tcase << TestAction.new(:Sent_Confirmation) do
  3212. $ruiObj = RUIObject.new.with('objectid', -1223562103).with('selfid', 893316915).with('textdescid', 1281233763).with('uniqueparentid', 807778548)
  3213. .with('uitreeindex', 4)
  3214. .with('classname', 'TextView')
  3215. .with('text', 'Now MMS')
  3216.  
  3217. $ruiObj.isExist
  3218.  
  3219. waitsecond(0)
  3220. end
  3221.  
  3222. tcase << TestAction.new(:Test_Result) do
  3223. $myTestResult = checkLastExistResult
  3224.  
  3225. waitsecond(0)
  3226. end
  3227.  
  3228. tcase << TestAction.new(:Press_Back) do
  3229. pressBack
  3230.  
  3231. waitsecond(2)
  3232. end
  3233.  
  3234. tcase << TestAction.new(:Exit_Conversation) do
  3235. $ruiObj = RUIObject.new.with('objectid', 1425651979).with('selfid', -123872605).with('textdescid', 1768877749).with('uniqueparentid', -1261979652)
  3236. .with('uitreeindex', 9)
  3237. .with('classname', 'ImageButton')
  3238. .with('content-desc', 'Navigate up')
  3239.  
  3240. $ruiObj.click
  3241.  
  3242. waitsecond(2)
  3243. end
  3244.  
  3245. tcase << TestAction.new(:Select_Conversation) do
  3246. $ruiObj = RUIObject.new.with('objectid', 201599363).with('selfid', -373177612).with('textdescid', 647161785).with('uniqueparentid', 137202537)
  3247. .with('uitreeindex', 4)
  3248. .with('classname', 'TextView')
  3249. .with('resource-id', 'com.google.android.apps.messaging:id/conversation_name')
  3250. .with('text', 'A01 A01')
  3251.  
  3252. $ruiObj.longClick
  3253.  
  3254. waitsecond(2)
  3255. end
  3256.  
  3257. tcase << TestAction.new(:Delete_Conversation) do
  3258. $ruiObj = RUIObject.new.with('objectid', 1400187979).with('selfid', -1174101288).with('textdescid', -1369143488).with('uniqueparentid', 112203385)
  3259. .with('uitreeindex', 2)
  3260. .with('classname', 'TextView')
  3261. .with('resource-id', 'com.google.android.apps.messaging:id/action_delete')
  3262. .with('content-desc', 'Delete')
  3263.  
  3264. $ruiObj.click
  3265.  
  3266. waitsecond(2)
  3267. end
  3268.  
  3269. tcase << TestAction.new(:Confirm_Delete_Conversation) do
  3270. $ruiObj = RUIObject.new.with('objectid', -968538326).with('selfid', 982364851).with('textdescid', -2103192353).with('uniqueparentid', -1643928723).with('classresourceid', 1834539358)
  3271. .with('uitreeindex', 2)
  3272. .with('classname', 'Button')
  3273. .with('resource-id', 'android:id/button1')
  3274. .with('text', 'DELETE')
  3275.  
  3276. $ruiObj.click
  3277.  
  3278. waitsecond(2)
  3279. end
  3280.  
  3281. tcase << TestAction.new(:LogStop) do
  3282. logStopTest('Messaging_5_1_2_6')
  3283.  
  3284. waitsecond(0)
  3285. end
  3286.  
  3287. tcase << TestAction.new(:Press_Back_1) do
  3288. pressBack
  3289. waitsecond(1)
  3290. pressBack
  3291.  
  3292. waitsecond(2)
  3293. end
  3294.  
  3295. tcase.run(loopTime)
  3296.  
  3297. end
  3298.  
  3299. def self.MultiTasking_5_1_8_1(loopTime)
  3300.  
  3301. tcase = TestCase.new("MultiTasking_5_1_8_1")
  3302.  
  3303. tcase << TestAction.new(:LogStart) do
  3304. logStartTest("MultiTasking_5_1_8_1")
  3305.  
  3306. waitsecond(0)
  3307. end
  3308.  
  3309. tcase << TestAction.new(:goto_Phone) do
  3310. gotoAppPixel('Phone')
  3311.  
  3312. waitsecond(2)
  3313. end
  3314.  
  3315. tcase << TestAction.new(:View_Contacts) do
  3316. $ruiObj = RUIObject.new.with('objectid', 1729076897).with('selfid', -1616608746).with('textdescid', -1107521081).with('uniqueparentid', -1902824159)
  3317. .with('uitreeindex', 2)
  3318. .with('classname', 'ImageView')
  3319. .with('resource-id', 'com.android.dialer:id/icon')
  3320. .with('content-desc', 'Contacts tab.')
  3321.  
  3322. $ruiObj.click
  3323.  
  3324. waitsecond(2)
  3325. end
  3326.  
  3327. tcase << TestAction.new(:Search_A01) do
  3328. scrollAndSearchText('A01 a01', 1000)
  3329.  
  3330. waitsecond(2)
  3331. end
  3332.  
  3333. tcase << TestAction.new(:Select_Contact_A01a01) do
  3334. $ruiObj = RUIObject.new.with('objectid', -667564700).with('selfid', -43585994).with('textdescid', 89720436).with('uniqueparentid', -497841051).with('classresourceid', -695489144)
  3335. .with('uitreeindex', 6)
  3336. .with('classname', 'TextView')
  3337. .with('resource-id', 'com.android.dialer:id/cliv_name_textview')
  3338. .with('content-desc', 'A01 a01')
  3339. .with('text', 'A01 a01')
  3340.  
  3341. $ruiObj.click
  3342.  
  3343. waitsecond(2)
  3344. end
  3345.  
  3346. tcase << TestAction.new(:Start_Voice_Call) do
  3347. $ruiObj = RUIObject.new.with('objectid', 921547951).with('selfid', 692509261).with('textdescid', -1496784559).with('uniqueparentid', -1243726177).with('classresourceid', 457622547)
  3348. .with('uitreeindex', 8)
  3349. .with('classname', 'ImageView')
  3350. .with('resource-id', 'com.google.android.contacts:id/icon')
  3351.  
  3352. $ruiObj.click
  3353.  
  3354. waitsecond(8)
  3355. end
  3356.  
  3357. tcase << TestAction.new(:Slave_Answer_Call) do
  3358. sendBTCmd('answerCall')
  3359.  
  3360. waitsecond(2)
  3361. end
  3362.  
  3363. tcase << TestAction.new(:Check_End) do
  3364. $ruiObj = RUIObject.new.with('objectid', 2131066002).with('selfid', 279498384).with('textdescid', -733664719).with('uniqueparentid', 15085754)
  3365. .with('uitreeindex', 3)
  3366. .with('pretext', 'OK')
  3367. .with('classname', 'ImageButton')
  3368. .with('resource-id', 'com.google.android.dialer:id/incall_end_call')
  3369. .with('content-desc', 'End call')
  3370.  
  3371. $ruiObj.isExist
  3372.  
  3373. waitsecond(0)
  3374. end
  3375.  
  3376. tcase << TestAction.new(:LogStop) do
  3377. $myTestResult = checkLastExistResult
  3378.  
  3379. logStopTest("MultiTasking_5_1_8_1")
  3380.  
  3381. waitsecond(0)
  3382. end
  3383.  
  3384. tcase.run(loopTime)
  3385.  
  3386. end
  3387.  
  3388. def self.MultiTasking_5_1_8_2(loopTime)
  3389.  
  3390. tcase = TestCase.new("MultiTasking_5_1_8_2")
  3391.  
  3392. tcase << TestAction.new(:LogStart) do
  3393. logStartTest("MultiTasking_5_1_8_2")
  3394.  
  3395. waitsecond(0)
  3396. end
  3397.  
  3398. tcase << TestAction.new(:goto_Contacts) do
  3399. gotoAppPixel('Contacts')
  3400.  
  3401. waitsecond(5)
  3402. end
  3403.  
  3404. tcase << TestAction.new(:goto_Messages) do
  3405. gotoAppPixel('Messages')
  3406.  
  3407. waitsecond(5)
  3408. end
  3409.  
  3410. tcase << TestAction.new(:goto_Phone) do
  3411. gotoAppPixel('Phone')
  3412.  
  3413. waitsecond(5)
  3414. end
  3415.  
  3416. tcase << TestAction.new(:goto_PlayStore) do
  3417. gotoAppPixel("Play Store")
  3418.  
  3419. waitsecond(5)
  3420. end
  3421.  
  3422. tcase << TestAction.new(:goto_Camera) do
  3423. gotoAppPixel('Camera')
  3424.  
  3425. waitsecond(5)
  3426. end
  3427.  
  3428. tcase << TestAction.new(:goto_Chrome) do
  3429. gotoAppPixel('Chrome')
  3430.  
  3431. waitsecond(5)
  3432. end
  3433.  
  3434. tcase << TestAction.new(:Chrome_Check_Menu) do
  3435. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  3436. .with('uitreeindex', 29)
  3437. .with('classname', 'ImageButton')
  3438. .with('resource-id', 'com.android.chrome:id/menu_button')
  3439. .with('content-desc', 'More options')
  3440.  
  3441. $ruiObj.isExist
  3442.  
  3443. waitsecond(0)
  3444. end
  3445.  
  3446. tcase << TestAction.new(:LogStop) do
  3447. $myTestResult = checkLastExistResult
  3448.  
  3449. logStopTest("MultiTasking_5_1_8_2")
  3450.  
  3451. waitsecond(0)
  3452. end
  3453.  
  3454. tcase.run(loopTime)
  3455.  
  3456. end
  3457.  
  3458. def self.MultiTasking_5_1_8_3(loopTime)
  3459.  
  3460. tcase = TestCase.new("MultiTasking_5_1_8_3")
  3461.  
  3462. tcase << TestAction.new(:LogStart) do
  3463. logStartTest("MultiTasking_5_1_8_3")
  3464.  
  3465. waitsecond(0)
  3466. end
  3467.  
  3468. tcase << TestAction.new(:goto_Phone) do
  3469. gotoAppPixel('Phone')
  3470.  
  3471. waitsecond(2)
  3472. end
  3473.  
  3474. tcase << TestAction.new(:Return_Call_Progress) do
  3475. $ruiObj = RUIObject.new.with('objectid', -1049390963).with('selfid', 938939901).with('textdescid', 420774450).with('uniqueparentid', 2054641712).with('classresourceid', -526721384)
  3476. .with('uitreeindex', 5)
  3477. .with('classname', 'TextView')
  3478. .with('resource-id', 'com.android.dialer:id/text')
  3479. .with('text', 'Return to call in progress')
  3480.  
  3481. $ruiObj.click
  3482.  
  3483. waitsecond(2)
  3484. end
  3485.  
  3486. tcase << TestAction.new(:End_Call) do
  3487. $ruiObj = RUIObject.new.with('objectid', -1474401675).with('selfid', 714657135).with('textdescid', -724844434).with('uniqueparentid', -2124691094)
  3488. .with('uitreeindex', 13)
  3489. .with('classname', 'ImageButton')
  3490. .with('resource-id', 'com.android.dialer:id/incall_end_call')
  3491. .with('content-desc', 'End call')
  3492.  
  3493. $ruiObj.click
  3494.  
  3495. waitsecond(2)
  3496. end
  3497.  
  3498. tcase << TestAction.new(:Check_Test) do
  3499. $ruiObj = RUIObject.new.with('objectid', -1474401675).with('selfid', 714657135).with('textdescid', -724844434).with('uniqueparentid', -2124691094)
  3500. .with('uitreeindex', 13)
  3501. .with('classname', 'ImageButton')
  3502. .with('resource-id', 'com.android.dialer:id/incall_end_call')
  3503. .with('content-desc', 'End call')
  3504.  
  3505. $ruiObj.isExist
  3506.  
  3507. waitsecond(0)
  3508. end
  3509.  
  3510. tcase << TestAction.new(:LogStop) do
  3511. $myTestResult = checkLastExistResult
  3512.  
  3513. logStopTest("MultiTasking_5_1_8_3")
  3514.  
  3515. waitsecond(0)
  3516. end
  3517.  
  3518. tcase.run(loopTime)
  3519.  
  3520. end
  3521.  
  3522. def self.MultiTasking_5_1_8_4(loopTime)
  3523.  
  3524. tcase = TestCase.new("MultiTasking_5_1_8_4")
  3525.  
  3526. tcase << TestAction.new(:LogStart) do
  3527. logStartTest("MultiTasking_5_1_8_4")
  3528.  
  3529. waitsecond(0)
  3530. end
  3531.  
  3532. tcase << TestAction.new(:goto_Chrome) do
  3533. gotoAppPixel('Chrome')
  3534.  
  3535. waitsecond(2)
  3536. end
  3537.  
  3538. tcase << TestAction.new(:Open_Tabs) do
  3539. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1748673363).with('textdescid', -265864838).with('uniqueparentid', 1682079956)
  3540. .with('uitreeindex', 19)
  3541. .with('classname', 'ImageButton')
  3542. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  3543.  
  3544. $ruiObj.click
  3545.  
  3546. waitsecond(2)
  3547. end
  3548.  
  3549. tcase << TestAction.new(:New_Tab) do
  3550. $ruiObj = RUIObject.new.with('objectid', -1772071808).with('selfid', 820590808).with('textdescid', 561000469).with('uniqueparentid', 1610570984)
  3551. .with('uitreeindex', 1)
  3552. .with('classname', 'Button')
  3553. .with('resource-id', 'com.android.chrome:id/new_tab_button')
  3554. .with('content-desc', 'New tab')
  3555.  
  3556. $ruiObj.click
  3557.  
  3558. waitsecond(2)
  3559. end
  3560.  
  3561. tcase << TestAction.new(:Chrome_Check_Menu) do
  3562. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  3563. .with('uitreeindex', 29)
  3564. .with('classname', 'ImageButton')
  3565. .with('resource-id', 'com.android.chrome:id/menu_button')
  3566. .with('content-desc', 'More options')
  3567.  
  3568. $ruiObj.isExist
  3569.  
  3570. waitsecond(0)
  3571. end
  3572.  
  3573. tcase << TestAction.new(:LogStop) do
  3574. $myTestResult = checkLastExistResult
  3575.  
  3576. logStopTest("MultiTasking_5_1_8_4")
  3577.  
  3578. waitsecond(0)
  3579. end
  3580.  
  3581. tcase.run(loopTime)
  3582.  
  3583. end
  3584.  
  3585. def self.MultiTasking_5_1_8_5(loopTime)
  3586.  
  3587. tcase = TestCase.new("MultiTasking_5_1_8_5")
  3588.  
  3589. tcase << TestAction.new(:LogStart) do
  3590. logStartTest("MultiTasking_5_1_8_5")
  3591.  
  3592. waitsecond(0)
  3593. end
  3594.  
  3595. tcase << TestAction.new(:goto_Contacts) do
  3596. gotoAppPixel('Contacts')
  3597.  
  3598. waitsecond(5)
  3599. end
  3600.  
  3601. tcase << TestAction.new(:goto_Messages) do
  3602. gotoAppPixel('Messages')
  3603.  
  3604. waitsecond(5)
  3605. end
  3606.  
  3607. tcase << TestAction.new(:goto_Phone) do
  3608. gotoAppPixel('Phone')
  3609.  
  3610. waitsecond(5)
  3611. end
  3612.  
  3613. tcase << TestAction.new(:goto_PlayStore) do
  3614. gotoAppPixel("Play Store")
  3615.  
  3616. waitsecond(5)
  3617. end
  3618.  
  3619. tcase << TestAction.new(:goto_Camera) do
  3620. gotoAppPixel('Camera')
  3621.  
  3622. waitsecond(5)
  3623. end
  3624.  
  3625. tcase << TestAction.new(:goto_Chrome) do
  3626. gotoAppPixel('Chrome')
  3627.  
  3628. waitsecond(5)
  3629. end
  3630.  
  3631. tcase << TestAction.new(:Chrome_Check_Menu) do
  3632. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  3633. .with('uitreeindex', 29)
  3634. .with('classname', 'ImageButton')
  3635. .with('resource-id', 'com.android.chrome:id/menu_button')
  3636. .with('content-desc', 'More options')
  3637.  
  3638. $ruiObj.isExist
  3639.  
  3640. waitsecond(2)
  3641. end
  3642.  
  3643. tcase << TestAction.new(:LogStop) do
  3644. $myTestResult = checkLastExistResult
  3645.  
  3646. logStopTest("MultiTasking_5_1_8_5")
  3647.  
  3648. waitsecond(0)
  3649. end
  3650.  
  3651. tcase.run(loopTime)
  3652.  
  3653. end
  3654.  
  3655. def self.MultiTasking_5_1_8_6(loopTime)
  3656.  
  3657. tcase = TestCase.new("MultiTasking_5_1_8_6")
  3658.  
  3659. tcase << TestAction.new(:LogStart) do
  3660. logStartTest("MultiTasking_5_1_8_6")
  3661.  
  3662. waitsecond(0)
  3663. end
  3664.  
  3665. tcase << TestAction.new(:Press_Back) do
  3666. pressBack
  3667.  
  3668. waitsecond(2)
  3669. end
  3670.  
  3671. tcase << TestAction.new(:Press_Back_1) do
  3672. pressBack
  3673.  
  3674. waitsecond(2)
  3675. end
  3676.  
  3677. tcase << TestAction.new(:Home_Check) do
  3678. $ruiObj = RUIObject.new.with('objectid', 1308040668).with('selfid', 1900891271).with('textdescid', 1801250344).with('uniqueparentid', 125426211)
  3679. .with('uitreeindex', 7)
  3680. .with('classname', 'ImageView')
  3681. .with('resource-id', 'com.google.android.apps.nexuslauncher:id/all_apps_handle')
  3682. .with('content-desc', 'Apps list')
  3683.  
  3684. $ruiObj.isExist
  3685.  
  3686. waitsecond(0)
  3687. end
  3688.  
  3689. tcase << TestAction.new(:LogStop) do
  3690. $myTestResult = checkLastExistResult
  3691.  
  3692. logStopTest("MultiTasking_5_1_8_6")
  3693.  
  3694. waitsecond(0)
  3695. end
  3696.  
  3697. tcase.run(loopTime)
  3698.  
  3699. end
  3700.  
  3701. def self.Multimedia_5_1_7_1(loopTime)
  3702.  
  3703. tcase = TestCase.new("Multimedia_5_1_7_1")
  3704.  
  3705. tcase << TestAction.new(:logstart) do
  3706. logStartTest("05_01_07_01_MultiMedia")
  3707.  
  3708. waitsecond(0)
  3709. end
  3710.  
  3711. tcase << TestAction.new(:gotocamera) do
  3712. gotoAppPixel("Camera")
  3713.  
  3714. waitsecond(2)
  3715. end
  3716.  
  3717. tcase << TestAction.new(:PermissionAllowButton) do
  3718. $ruiObj = RUIObject.new.with('objectid', 153379926).with('selfid', 1443382411).with('textdescid', 294474017).with('uniqueparentid', 725356101).with('classresourceid', -227364920)
  3719. .with('uitreeindex', 3)
  3720. .with('classname', 'Button')
  3721. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  3722. .with('text', 'ALLOW')
  3723.  
  3724. $ruiObj.click
  3725.  
  3726. waitsecond(2)
  3727. end
  3728.  
  3729. tcase << TestAction.new(:Button_ConfirmButton_2) do
  3730. $ruiObj = RUIObject.new.with('objectid', -1187921382).with('selfid', -1055162259).with('textdescid', 1673606663).with('uniqueparentid', -1678803509)
  3731. .with('uitreeindex', 3)
  3732. .with('classname', 'Button')
  3733. .with('resource-id', 'com.android.camera2:id/confirm_button')
  3734. .with('text', 'NEXT')
  3735.  
  3736. $ruiObj.click
  3737.  
  3738. waitsecond(2)
  3739. end
  3740.  
  3741. tcase << TestAction.new(:allowpermission) do
  3742. $ruiObj = RUIObject.new.with('objectid', 1275766412).with('selfid', -1672772069).with('textdescid', -1293741455).with('uniqueparentid', -759816146)
  3743. .with('uitreeindex', 3)
  3744. .with('classname', 'Button')
  3745. .with('resource-id', 'com.google.android.GoogleCamera:id/ok_button')
  3746. .with('text', 'OK GOT IT')
  3747.  
  3748. $ruiObj.click
  3749.  
  3750. waitsecond(2)
  3751. end
  3752.  
  3753. tcase << TestAction.new(:changetovideo) do
  3754. $ruiObj = RUIObject.new.with('objectid', -733699829).with('selfid', -2081355986).with('textdescid', -1269858187).with('uniqueparentid', 1962624833)
  3755. .with('uitreeindex', 17)
  3756. .with('classname', 'ImageView')
  3757. .with('resource-id', 'com.google.android.GoogleCamera:id/smooth_rotate_video_switch_icon')
  3758.  
  3759. $ruiObj.click
  3760.  
  3761. waitsecond(2)
  3762. end
  3763.  
  3764. tcase << TestAction.new(:recordvideo) do
  3765. $ruiObj = RUIObject.new.with('objectid', -733699829).with('selfid', -2081355986).with('textdescid', -1269858187).with('uniqueparentid', 1962624833)
  3766. .with('uitreeindex', 14)
  3767. .with('classname', 'ImageView')
  3768. .with('resource-id', 'com.google.android.GoogleCamera:id/smooth_rotate_video_switch_icon')
  3769.  
  3770. $ruiObj.click
  3771.  
  3772. waitsecond(2)
  3773. end
  3774.  
  3775. tcase << TestAction.new(:wait30seconds) do
  3776. waitsecond(32)
  3777. end
  3778.  
  3779. tcase << TestAction.new(:checkforthepausebutton) do
  3780. $ruiObj = RUIObject.new.with('objectid', -1444537032).with('selfid', 111453042).with('textdescid', 1162006437).with('uniqueparentid', -1154361882)
  3781. .with('uitreeindex', 5)
  3782. .with('classname', 'ImageView')
  3783. .with('resource-id', 'com.android.camera2:id/shutter_button')
  3784. .with('content-desc', 'Shutter')
  3785.  
  3786. $ruiObj.isExist
  3787.  
  3788. waitsecond(0)
  3789. end
  3790.  
  3791. tcase << TestAction.new(:stoprecord1) do
  3792. $ruiObj = RUIObject.new.with('objectid', 897368612).with('selfid', 531572407).with('textdescid', 67272975).with('uniqueparentid', -978032123)
  3793. .with('uitreeindex', 8)
  3794. .with('classname', 'ImageButton')
  3795. .with('resource-id', 'com.google.android.GoogleCamera:id/shutter_button')
  3796. .with('content-desc', 'Stop Recording')
  3797.  
  3798. $ruiObj.click
  3799.  
  3800. waitsecond(2)
  3801. end
  3802.  
  3803. tcase << TestAction.new(:logstop) do
  3804. $myTestResult = checkLastExistResult
  3805.  
  3806. if $myTestResult == false
  3807. $myFailReason == "Video does not exist"
  3808. end
  3809.  
  3810. logStopTest("05_01_07_01_MultiMedia")
  3811.  
  3812.  
  3813. waitsecond(0)
  3814. end
  3815.  
  3816. tcase << TestAction.new(:pressBack) do
  3817. pressBack
  3818.  
  3819. waitsecond(0)
  3820. end
  3821.  
  3822. tcase << TestAction.new(:pressHome) do
  3823. pressBack
  3824.  
  3825.  
  3826. waitsecond(0)
  3827. end
  3828.  
  3829. tcase.run(loopTime)
  3830.  
  3831. end
  3832.  
  3833. def self.Multimedia_5_1_7_10(loopTime)
  3834.  
  3835. tcase = TestCase.new("Multimedia_5_1_7_10")
  3836.  
  3837. tcase << TestAction.new(:logstart) do
  3838. logStartTest("05_01_07_10_MultiMedia")
  3839.  
  3840. waitsecond(0)
  3841. end
  3842.  
  3843. tcase << TestAction.new(:scriptAction_2) do
  3844. gotoAppPixel("Chrome")
  3845.  
  3846. waitsecond(2)
  3847. end
  3848.  
  3849. tcase << TestAction.new(:ClickAccept) do
  3850. $ruiObj = RUIObject.new.with('objectid', 1131623741).with('selfid', 2073999009).with('textdescid', -212510162).with('uniqueparentid', -1930936534)
  3851. .with('uitreeindex', 4)
  3852. .with('classname', 'Button')
  3853. .with('resource-id', 'com.android.chrome:id/terms_accept')
  3854. .with('text', 'ACCEPT CONTINUE')
  3855.  
  3856. $ruiObj.click
  3857.  
  3858. waitsecond(2)
  3859. end
  3860.  
  3861. tcase << TestAction.new(:Clicknothanks) do
  3862. $ruiObj = RUIObject.new.with('objectid', -1069290294).with('selfid', 1665543358).with('textdescid', 14199854).with('uniqueparentid', -972892335)
  3863. .with('uitreeindex', 8)
  3864. .with('classname', 'Button')
  3865. .with('resource-id', 'com.android.chrome:id/negative_button')
  3866. .with('text', 'NO THANKS')
  3867.  
  3868. $ruiObj.click
  3869.  
  3870. waitsecond(2)
  3871. end
  3872.  
  3873. tcase << TestAction.new(:EditText_SearchBoxText_7) do
  3874. $ruiObj = RUIObject.new.with('objectid', -740560065).with('selfid', 1023920737).with('textdescid', -1482525503).with('uniqueparentid', -1010905038)
  3875. .with('uitreeindex', 0)
  3876. .with('classname', 'EditText')
  3877. .with('resource-id', 'com.android.chrome:id/search_box_text')
  3878.  
  3879. $ruiObj.inputtext('www.youtube.com')
  3880.  
  3881. waitsecond(2)
  3882. end
  3883.  
  3884. tcase << TestAction.new(:pressEnter_8) do
  3885. pressEnter
  3886.  
  3887. waitsecond(2)
  3888. end
  3889.  
  3890. tcase << TestAction.new(:wait15second_9) do
  3891. waitsecond(15)
  3892. end
  3893.  
  3894. tcase << TestAction.new(:Clickfirstvideo) do
  3895. click(724.5,1048.5)
  3896.  
  3897. waitsecond(6)
  3898. end
  3899.  
  3900. tcase << TestAction.new(:sharebuttonexist) do
  3901. $ruiObj = RUIObject.new.with('objectid', 537483260).with('selfid', -349777709).with('textdescid', 367962075).with('uniqueparentid', 1517455945)
  3902. .with('uitreeindex', 15)
  3903. .with('classname', 'Button')
  3904. .with('content-desc', 'Share')
  3905.  
  3906. $ruiObj.isExist
  3907.  
  3908. waitsecond(0)
  3909. end
  3910.  
  3911. tcase << TestAction.new(:logstop) do
  3912. $myTestResult = checkLastExistResult
  3913. if $myTestResult == false
  3914. $myFailReason == "Video Streaming does not work"
  3915. end
  3916. logStopTest("05_01_07_10_MultiMedia")
  3917.  
  3918.  
  3919. waitsecond(0)
  3920. end
  3921.  
  3922. tcase << TestAction.new(:pressBack_13) do
  3923. pressBack
  3924.  
  3925. waitsecond(0)
  3926. end
  3927.  
  3928. tcase << TestAction.new(:pressBack_14) do
  3929. pressBack
  3930.  
  3931. waitsecond(0)
  3932. end
  3933.  
  3934. tcase << TestAction.new(:pressBack_15) do
  3935. pressBack
  3936.  
  3937. waitsecond(0)
  3938. end
  3939.  
  3940. tcase << TestAction.new(:pressHome_16) do
  3941. pressHome
  3942.  
  3943. waitsecond(0)
  3944. end
  3945.  
  3946. tcase.run(loopTime)
  3947.  
  3948. end
  3949.  
  3950. def self.Multimedia_5_1_7_11(loopTime)
  3951.  
  3952. tcase = TestCase.new("Multimedia_5_1_7_11")
  3953.  
  3954. tcase << TestAction.new(:logstart) do
  3955. logStartTest("05_01_07_11_MultiMedia")
  3956.  
  3957. waitsecond(0)
  3958. end
  3959.  
  3960. tcase << TestAction.new(:scriptAction_2) do
  3961. gotoAppPixel("Play Music")
  3962.  
  3963. waitsecond(5)
  3964. end
  3965.  
  3966. tcase << TestAction.new(:Button_Button0_5) do
  3967. $ruiObj = RUIObject.new.with('objectid', -2137881259).with('selfid', 1844568236).with('textdescid', -1281599498).with('uniqueparentid', -1667235072)
  3968. .with('uitreeindex', 4)
  3969. .with('classname', 'Button')
  3970. .with('resource-id', 'com.google.android.music:id/button_0')
  3971. .with('text', 'SKIP')
  3972.  
  3973. $ruiObj.click
  3974.  
  3975. waitsecond(2)
  3976. end
  3977.  
  3978. tcase << TestAction.new(:Button_BtnDecline_4) do
  3979. $ruiObj = RUIObject.new.with('objectid', -1378300942).with('selfid', -1214082401).with('textdescid', -2120989690).with('uniqueparentid', -1218539231)
  3980. .with('uitreeindex', 12)
  3981. .with('classname', 'Button')
  3982. .with('resource-id', 'com.google.android.music:id/btn_decline')
  3983. .with('text', 'NO THANKS')
  3984.  
  3985. $ruiObj.click
  3986.  
  3987. waitsecond(2)
  3988. end
  3989.  
  3990. tcase << TestAction.new(:Button_Button0_2_1) do
  3991. $ruiObj = RUIObject.new.with('objectid', 1772672623).with('selfid', 1844568236).with('textdescid', 743697808).with('uniqueparentid', -1971983066)
  3992. .with('uitreeindex', 4)
  3993. .with('classname', 'Button')
  3994. .with('resource-id', 'com.google.android.music:id/button_0')
  3995. .with('text', 'SKIP')
  3996.  
  3997. $ruiObj.click
  3998.  
  3999. waitsecond(2)
  4000. end
  4001.  
  4002. tcase << TestAction.new(:ImageView_NavigationButton_6) do
  4003. $ruiObj = RUIObject.new.with('objectid', -1390467816).with('selfid', -959574335).with('textdescid', 2119483842).with('uniqueparentid', 672315111)
  4004. .with('uitreeindex', 0)
  4005. .with('classname', 'ImageView')
  4006. .with('resource-id', 'com.google.android.music:id/navigation_button')
  4007. .with('content-desc', 'Show navigation drawer')
  4008.  
  4009. $ruiObj.isExist
  4010.  
  4011. waitsecond(2)
  4012. end
  4013.  
  4014. tcase << TestAction.new(:logstop) do
  4015. $myTestResult = checkLastExistResult
  4016.  
  4017. if $myTestResult == false
  4018. $myFailReason == "Video Streaming does not work"
  4019. end
  4020. logStopTest("05_01_07_11_MultiMedia")
  4021.  
  4022.  
  4023. waitsecond(0)
  4024. end
  4025.  
  4026. tcase << TestAction.new(:pressBack_9) do
  4027. pressBack
  4028.  
  4029. waitsecond(0)
  4030. end
  4031.  
  4032. tcase << TestAction.new(:pressBack_10) do
  4033. pressBack
  4034.  
  4035. waitsecond(0)
  4036. end
  4037.  
  4038. tcase << TestAction.new(:pressHome_11) do
  4039. pressHome
  4040.  
  4041. waitsecond(0)
  4042. end
  4043.  
  4044. tcase << TestAction.new(:ImageButton_Show_1) do
  4045. $ruiObj = RUIObject.new.with('objectid', -16821482).with('selfid', -167844295).with('textdescid', 296856964).with('uniqueparentid', 1467430507)
  4046. .with('uitreeindex', 6)
  4047. .with('classname', 'ImageButton')
  4048. .with('content-desc', 'Show navigation drawer')
  4049.  
  4050. $ruiObj.click
  4051.  
  4052. waitsecond(2)
  4053. end
  4054.  
  4055. tcase.run(loopTime)
  4056.  
  4057. end
  4058.  
  4059. def self.Multimedia_5_1_7_12(loopTime)
  4060.  
  4061. tcase = TestCase.new("Multimedia_5_1_7_12")
  4062.  
  4063. tcase << TestAction.new(:logstart) do
  4064. logStartTest("05_01_07_12_MultiMedia")
  4065.  
  4066. waitsecond(0)
  4067. end
  4068.  
  4069. tcase << TestAction.new(:gotoplaymusic) do
  4070. gotoAppPixel("Play Music")
  4071.  
  4072. waitsecond(2)
  4073. end
  4074.  
  4075. tcase << TestAction.new(:Button_BtnDecline_4) do
  4076. $ruiObj = RUIObject.new.with('objectid', -1378300942).with('selfid', -1214082401).with('textdescid', -2120989690).with('uniqueparentid', -1218539231)
  4077. .with('uitreeindex', 12)
  4078. .with('classname', 'Button')
  4079. .with('resource-id', 'com.google.android.music:id/btn_decline')
  4080. .with('text', 'NO THANKS')
  4081.  
  4082. $ruiObj.click
  4083.  
  4084. waitsecond(2)
  4085. end
  4086.  
  4087. tcase << TestAction.new(:clicknavigationdrawer) do
  4088. $ruiObj = RUIObject.new.with('objectid', -1390467816).with('selfid', -959574335).with('textdescid', 2119483842).with('uniqueparentid', 672315111)
  4089. .with('uitreeindex', 0)
  4090. .with('classname', 'ImageView')
  4091. .with('resource-id', 'com.google.android.music:id/navigation_button')
  4092. .with('content-desc', 'Show navigation drawer')
  4093.  
  4094. $ruiObj.click
  4095.  
  4096. waitsecond(2)
  4097. end
  4098.  
  4099. tcase << TestAction.new(:musiclibrary) do
  4100. $ruiObj = RUIObject.new.with('objectid', 1337918942).with('selfid', -404350322).with('textdescid', -1209707262).with('uniqueparentid', 1865643829).with('classresourceid', -938935918)
  4101. .with('uitreeindex', 34)
  4102. .with('classname', 'TextView')
  4103. .with('text', 'Music library')
  4104.  
  4105. $ruiObj.click
  4106.  
  4107. waitsecond(2)
  4108. end
  4109.  
  4110. tcase << TestAction.new(:artist) do
  4111. $ruiObj = RUIObject.new.with('objectid', -741226326).with('selfid', -2050395810).with('textdescid', -294625686).with('uniqueparentid', -1232442324)
  4112. .with('uitreeindex', 5)
  4113. .with('classname', 'TextView')
  4114. .with('resource-id', 'com.google.android.music:id/title')
  4115. .with('text', 'ARTISTS')
  4116.  
  4117. $ruiObj.click
  4118.  
  4119. waitsecond(2)
  4120. end
  4121.  
  4122. tcase << TestAction.new(:clickthumbnail) do
  4123. $ruiObj = RUIObject.new.with('objectid', -146398081).with('selfid', -538001520).with('textdescid', -243373183).with('uniqueparentid', 1810546890).with('classresourceid', -1418125814)
  4124. .with('uitreeindex', 9)
  4125. .with('pretext', 'GENRES')
  4126. .with('classname', 'ImageView')
  4127. .with('resource-id', 'com.google.android.music:id/li_thumbnail_frame')
  4128.  
  4129. $ruiObj.click
  4130.  
  4131. waitsecond(2)
  4132. end
  4133.  
  4134. tcase << TestAction.new(:clickanotherthumnail) do
  4135. $ruiObj = RUIObject.new.with('objectid', 585237187).with('selfid', -538001520).with('textdescid', 962483645).with('uniqueparentid', 484936402)
  4136. .with('uitreeindex', 7)
  4137. .with('pretext', 'In my library')
  4138. .with('classname', 'ImageView')
  4139. .with('resource-id', 'com.google.android.music:id/li_thumbnail_frame')
  4140.  
  4141. $ruiObj.click
  4142.  
  4143. waitsecond(3)
  4144. end
  4145.  
  4146. tcase << TestAction.new(:clickplay) do
  4147. $ruiObj = RUIObject.new.with('objectid', 1267180639).with('selfid', -562829957).with('textdescid', -145594059).with('uniqueparentid', -1431364792).with('classresourceid', 554110641)
  4148. .with('uitreeindex', 8)
  4149. .with('classname', 'ImageButton')
  4150. .with('resource-id', 'com.google.android.music:id/fab_play')
  4151. .with('content-desc', 'Play')
  4152.  
  4153. $ruiObj.click
  4154.  
  4155. waitsecond(2)
  4156. end
  4157.  
  4158. tcase << TestAction.new(:wait12second_8) do
  4159. waitsecond(12)
  4160. end
  4161.  
  4162. tcase << TestAction.new(:pausebuttonexist) do
  4163. $ruiObj = RUIObject.new.with('objectid', 1487562708).with('selfid', 2054656518).with('textdescid', -1874588662).with('uniqueparentid', -317697394)
  4164. .with('uitreeindex', 34)
  4165. .with('classname', 'ImageButton')
  4166. .with('resource-id', 'com.google.android.music:id/play_pause_header')
  4167. .with('content-desc', 'Pause')
  4168.  
  4169. $ruiObj.isExist
  4170.  
  4171. waitsecond(2)
  4172. end
  4173.  
  4174. tcase << TestAction.new(:clickpausebutton) do
  4175. $ruiObj = RUIObject.new.with('objectid', 1487562708).with('selfid', 2054656518).with('textdescid', -1874588662).with('uniqueparentid', -317697394)
  4176. .with('uitreeindex', 34)
  4177. .with('classname', 'ImageButton')
  4178. .with('resource-id', 'com.google.android.music:id/play_pause_header')
  4179. .with('content-desc', 'Pause')
  4180.  
  4181. $ruiObj.click
  4182.  
  4183. waitsecond(3)
  4184. end
  4185.  
  4186. tcase << TestAction.new(:logstop) do
  4187. $myTestResult = checkLastExistResult
  4188.  
  4189. if $myTestResult == false
  4190. $myFailReason == "Music is not playing"
  4191. end
  4192. logStopTest("05_01_07_12_MultiMedia")
  4193.  
  4194.  
  4195. waitsecond(0)
  4196. end
  4197.  
  4198. tcase << TestAction.new(:goback) do
  4199. $ruiObj = RUIObject.new.with('objectid', -16821482).with('selfid', -123872605).with('textdescid', -2129880704).with('uniqueparentid', -272094647)
  4200. .with('uitreeindex', 0)
  4201. .with('classname', 'ImageButton')
  4202. .with('content-desc', 'Navigate up')
  4203.  
  4204. $ruiObj.click
  4205.  
  4206. waitsecond(2)
  4207. end
  4208.  
  4209. tcase << TestAction.new(:goback_1) do
  4210. $ruiObj = RUIObject.new.with('objectid', -16821482).with('selfid', -123872605).with('textdescid', -2129880704).with('uniqueparentid', -272094647)
  4211. .with('uitreeindex', 0)
  4212. .with('classname', 'ImageButton')
  4213. .with('content-desc', 'Navigate up')
  4214.  
  4215. $ruiObj.click
  4216.  
  4217. waitsecond(2)
  4218. end
  4219.  
  4220. tcase << TestAction.new(:gotomenunav) do
  4221. $ruiObj = RUIObject.new.with('objectid', -16821482).with('selfid', -167844295).with('textdescid', 296856964).with('uniqueparentid', 1467430507)
  4222. .with('uitreeindex', 6)
  4223. .with('classname', 'ImageButton')
  4224. .with('content-desc', 'Show navigation drawer')
  4225.  
  4226. $ruiObj.click
  4227.  
  4228. waitsecond(2)
  4229. end
  4230.  
  4231. tcase << TestAction.new(:gotohome) do
  4232. $ruiObj = RUIObject.new.with('objectid', 1337918942).with('selfid', 591713361).with('textdescid', -569085377).with('uniqueparentid', 1865643829).with('classresourceid', -938935918)
  4233. .with('uitreeindex', 27)
  4234. .with('classname', 'TextView')
  4235. .with('text', 'Home')
  4236.  
  4237. $ruiObj.click
  4238.  
  4239. waitsecond(2)
  4240. end
  4241.  
  4242. tcase << TestAction.new(:pressBack_9) do
  4243. pressBack
  4244.  
  4245. waitsecond(0)
  4246. end
  4247.  
  4248. tcase << TestAction.new(:pressBack_10) do
  4249. pressBack
  4250.  
  4251. waitsecond(0)
  4252. end
  4253.  
  4254. tcase << TestAction.new(:pressHome_11) do
  4255. pressHome
  4256.  
  4257. waitsecond(0)
  4258. end
  4259.  
  4260. tcase << TestAction.new(:swipenotificationbar) do
  4261. swipe(729,31.5,774,1500.5,100)
  4262.  
  4263. waitsecond(2)
  4264. end
  4265.  
  4266. tcase << TestAction.new(:swiperight) do
  4267. swipe(1102.5,679,100,679.5,100)
  4268.  
  4269. waitsecond(2)
  4270. end
  4271.  
  4272. tcase << TestAction.new(:pressHome_1) do
  4273. pressHome
  4274.  
  4275. waitsecond(2)
  4276. end
  4277.  
  4278. tcase.run(loopTime)
  4279.  
  4280. end
  4281.  
  4282. def self.Multimedia_5_1_7_13(loopTime)
  4283.  
  4284. tcase = TestCase.new("Multimedia_5_1_7_13")
  4285.  
  4286. tcase << TestAction.new(:logstart) do
  4287. logStartTest("05_01_07_13_MultiMedia")
  4288.  
  4289. waitsecond(0)
  4290. end
  4291.  
  4292. tcase << TestAction.new(:gotoplaymusic) do
  4293. gotoAppPixel("Play Music")
  4294.  
  4295. waitsecond(2)
  4296. end
  4297.  
  4298. tcase << TestAction.new(:Button_BtnDecline_4) do
  4299. $ruiObj = RUIObject.new.with('objectid', -1378300942).with('selfid', -1214082401).with('textdescid', -2120989690).with('uniqueparentid', -1218539231)
  4300. .with('uitreeindex', 12)
  4301. .with('classname', 'Button')
  4302. .with('resource-id', 'com.google.android.music:id/btn_decline')
  4303. .with('text', 'NO THANKS')
  4304.  
  4305. $ruiObj.click
  4306.  
  4307. waitsecond(2)
  4308. end
  4309.  
  4310. tcase << TestAction.new(:pressBack_9) do
  4311. pressBack
  4312.  
  4313. waitsecond(0)
  4314. end
  4315.  
  4316. tcase << TestAction.new(:pressBack_10) do
  4317. pressBack
  4318.  
  4319. waitsecond(0)
  4320. end
  4321.  
  4322. tcase << TestAction.new(:pressHome_11) do
  4323. pressHome
  4324.  
  4325. waitsecond(0)
  4326. end
  4327.  
  4328. tcase << TestAction.new(:swipenotificationbar) do
  4329. swipe(729,31.5,774,1500.5,100)
  4330.  
  4331. waitsecond(2)
  4332. end
  4333.  
  4334. tcase << TestAction.new(:pause) do
  4335. $ruiObj = RUIObject.new.with('objectid', 882076620).with('selfid', -1186380024).with('textdescid', -490366974).with('uniqueparentid', 1841961189).with('classresourceid', -343477762)
  4336. .with('uitreeindex', 18)
  4337. .with('classname', 'ImageButton')
  4338. .with('resource-id', 'android:id/action0')
  4339. .with('content-desc', 'Pause')
  4340.  
  4341. $ruiObj.isExist
  4342.  
  4343. waitsecond(3)
  4344. end
  4345.  
  4346. tcase << TestAction.new(:logstop_1) do
  4347. $myTestResult = !checkLastExistResult
  4348.  
  4349. if $myTestResult == false
  4350. $myFailReason == "Music is not closing."
  4351. end
  4352. logStopTest("05_01_07_13_MultiMedia")
  4353.  
  4354.  
  4355. waitsecond(0)
  4356. end
  4357.  
  4358. tcase << TestAction.new(:pressHome_1) do
  4359. pressHome
  4360.  
  4361. waitsecond(2)
  4362. end
  4363.  
  4364. tcase.run(loopTime)
  4365.  
  4366. end
  4367.  
  4368. def self.Multimedia_5_1_7_14(loopTime)
  4369.  
  4370. tcase = TestCase.new("Multimedia_5_1_7_14")
  4371.  
  4372. tcase << TestAction.new(:logstart) do
  4373. logStartTest("05_01_07_14_MultiMedia")
  4374.  
  4375. waitsecond(0)
  4376. end
  4377.  
  4378. tcase << TestAction.new(:gotosettings) do
  4379. gotoAppPixel("Settings")
  4380.  
  4381. waitsecond(2)
  4382. end
  4383.  
  4384. tcase << TestAction.new(:clickdisplay) do
  4385. $ruiObj = RUIObject.new.with('objectid', -1980252617).with('selfid', -1901343455).with('textdescid', 1460376455).with('uniqueparentid', -349226723)
  4386. .with('uitreeindex', 22)
  4387. .with('classname', 'TextView')
  4388. .with('resource-id', 'android:id/title')
  4389. .with('text', 'Display')
  4390.  
  4391. $ruiObj.click
  4392.  
  4393. waitsecond(2)
  4394. end
  4395.  
  4396. tcase << TestAction.new(:advancedSettings) do
  4397. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', 183975843).with('textdescid', -1659217645).with('uniqueparentid', -512886282)
  4398. .with('uitreeindex', 13)
  4399. .with('classname', 'TextView')
  4400. .with('resource-id', 'android:id/title')
  4401. .with('text', 'Advanced')
  4402.  
  4403. $ruiObj.click
  4404.  
  4405. waitsecond(2)
  4406. end
  4407.  
  4408. tcase << TestAction.new(:swipeDown_6) do
  4409. swipe_vertical 500
  4410.  
  4411. waitsecond(2)
  4412. end
  4413.  
  4414. tcase << TestAction.new(:clicktheme) do
  4415. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', 80297600).with('textdescid', 722414294).with('uniqueparentid', 818307449)
  4416. .with('uitreeindex', 20)
  4417. .with('classname', 'TextView')
  4418. .with('resource-id', 'android:id/title')
  4419. .with('text', 'Device theme')
  4420.  
  4421. $ruiObj.click
  4422.  
  4423. waitsecond(2)
  4424. end
  4425.  
  4426. tcase << TestAction.new(:changetodark) do
  4427. $ruiObj = RUIObject.new.with('objectid', 374337900).with('selfid', -102657974).with('textdescid', 679433110).with('uniqueparentid', -290305997).with('classresourceid', 2074814108)
  4428. .with('uitreeindex', 4)
  4429. .with('classname', 'CheckedTextView')
  4430. .with('resource-id', 'android:id/text1')
  4431. .with('text', 'Dark')
  4432.  
  4433. $ruiObj.click
  4434.  
  4435. waitsecond(2)
  4436. end
  4437.  
  4438. tcase << TestAction.new(:clicktheme_1) do
  4439. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', 80297600).with('textdescid', 722414294).with('uniqueparentid', 818307449)
  4440. .with('uitreeindex', 20)
  4441. .with('classname', 'TextView')
  4442. .with('resource-id', 'android:id/title')
  4443. .with('text', 'Device theme')
  4444.  
  4445. $ruiObj.click
  4446.  
  4447. waitsecond(2)
  4448. end
  4449.  
  4450. tcase << TestAction.new(:changetoinverted) do
  4451. $ruiObj = RUIObject.new.with('objectid', 374337900).with('selfid', -797465143).with('textdescid', 1689955831).with('uniqueparentid', -290305997).with('classresourceid', 2074814108)
  4452. .with('uitreeindex', 3)
  4453. .with('classname', 'CheckedTextView')
  4454. .with('resource-id', 'android:id/text1')
  4455. .with('text', 'Inverted')
  4456.  
  4457. $ruiObj.click
  4458.  
  4459. waitsecond(2)
  4460. end
  4461.  
  4462. tcase << TestAction.new(:clicktheme_2) do
  4463. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', 80297600).with('textdescid', 722414294).with('uniqueparentid', 1677638763)
  4464. .with('uitreeindex', 20)
  4465. .with('classname', 'TextView')
  4466. .with('resource-id', 'android:id/title')
  4467. .with('text', 'Device theme')
  4468.  
  4469. $ruiObj.click
  4470.  
  4471. waitsecond(2)
  4472. end
  4473.  
  4474. tcase << TestAction.new(:clickPixel) do
  4475. $ruiObj = RUIObject.new.with('objectid', 374337900).with('selfid', 1123896370).with('textdescid', -61296722).with('uniqueparentid', -290305997).with('classresourceid', 2074814108)
  4476. .with('uitreeindex', 2)
  4477. .with('classname', 'CheckedTextView')
  4478. .with('resource-id', 'android:id/text1')
  4479. .with('text', 'Pixel')
  4480.  
  4481. $ruiObj.click
  4482.  
  4483. waitsecond(2)
  4484. end
  4485.  
  4486. tcase << TestAction.new(:Displayisexist) do
  4487. $ruiObj = RUIObject.new.with('objectid', 765775369).with('selfid', 1766108176).with('textdescid', 937308149).with('uniqueparentid', 1015447283)
  4488. .with('uitreeindex', 1)
  4489. .with('classname', 'TextView')
  4490. .with('text', 'Display')
  4491.  
  4492. $ruiObj.isExist
  4493.  
  4494. waitsecond(2)
  4495. end
  4496.  
  4497. tcase << TestAction.new(:logstop) do
  4498. $myTestResult = checkLastExistResult
  4499.  
  4500. if $myTestResult == false
  4501. $myFailReason == "Theme change not working"
  4502. end
  4503. logStopTest("05_01_07_14_MultiMedia")
  4504.  
  4505.  
  4506. waitsecond(0)
  4507. end
  4508.  
  4509. tcase << TestAction.new(:pressBack_19) do
  4510. pressBack
  4511.  
  4512. waitsecond(0)
  4513. end
  4514.  
  4515. tcase << TestAction.new(:pressBack_20) do
  4516. pressBack
  4517.  
  4518. waitsecond(0)
  4519. end
  4520.  
  4521. tcase << TestAction.new(:pressHome_22) do
  4522. pressHome
  4523.  
  4524. waitsecond(0)
  4525. end
  4526.  
  4527. tcase.run(loopTime)
  4528.  
  4529. end
  4530.  
  4531. def self.Multimedia_5_1_7_2(loopTime)
  4532.  
  4533. tcase = TestCase.new("Multimedia_5_1_7_2")
  4534.  
  4535. tcase << TestAction.new(:logstart) do
  4536. logStartTest("05_01_07_02_MultiMedia")
  4537.  
  4538. waitsecond(0)
  4539. end
  4540.  
  4541. tcase << TestAction.new(:gotophotos) do
  4542. gotoAppPixel("Photos")
  4543.  
  4544. waitsecond(2)
  4545. end
  4546.  
  4547. tcase << TestAction.new(:Switch_AutoBackupSwitch_2) do
  4548. $ruiObj = RUIObject.new.with('objectid', 1900129037).with('selfid', 1682285764).with('textdescid', 1396382350).with('uniqueparentid', -1851031688).with('classresourceid', -402277641)
  4549. .with('uitreeindex', 2)
  4550. .with('classname', 'Switch')
  4551. .with('resource-id', 'com.google.android.apps.photos:id/auto_backup_switch')
  4552. .with('text', 'ON')
  4553.  
  4554. $ruiObj.click
  4555.  
  4556. waitsecond(2)
  4557. end
  4558.  
  4559. tcase << TestAction.new(:Button_DoneButton_7) do
  4560. $ruiObj = RUIObject.new.with('objectid', 1857204703).with('selfid', -544460817).with('textdescid', -1623853219).with('uniqueparentid', -1190962124)
  4561. .with('uitreeindex', 9)
  4562. .with('classname', 'Button')
  4563. .with('resource-id', 'com.google.android.apps.photos:id/done_button')
  4564. .with('text', 'DONE')
  4565.  
  4566. $ruiObj.click
  4567.  
  4568. waitsecond(2)
  4569. end
  4570.  
  4571. tcase << TestAction.new(:Keepoff) do
  4572. $ruiObj = RUIObject.new.with('objectid', -767191036).with('selfid', 780820477).with('textdescid', 1663022928).with('uniqueparentid', -1776182139).with('classresourceid', 1834539359)
  4573. .with('uitreeindex', 3)
  4574. .with('classname', 'Button')
  4575. .with('resource-id', 'android:id/button2')
  4576. .with('text', 'KEEP OFF')
  4577.  
  4578. $ruiObj.click
  4579.  
  4580. waitsecond(2)
  4581. end
  4582.  
  4583. tcase << TestAction.new(:clickdone) do
  4584. $ruiObj = RUIObject.new.with('objectid', 1857204703).with('selfid', -544460817).with('textdescid', -1623853219).with('uniqueparentid', 1110794213)
  4585. .with('uitreeindex', 11)
  4586. .with('classname', 'Button')
  4587. .with('resource-id', 'com.google.android.apps.photos:id/done_button')
  4588. .with('text', 'DONE')
  4589.  
  4590. $ruiObj.click
  4591.  
  4592. waitsecond(2)
  4593. end
  4594.  
  4595. tcase << TestAction.new(:clickgotit) do
  4596. $ruiObj = RUIObject.new.with('objectid', -767191037).with('selfid', 1077689959).with('textdescid', 1333340036).with('uniqueparentid', 1950016636).with('classresourceid', 1834539358)
  4597. .with('uitreeindex', 3)
  4598. .with('classname', 'Button')
  4599. .with('resource-id', 'android:id/button1')
  4600. .with('text', 'GOT IT')
  4601.  
  4602. $ruiObj.click
  4603.  
  4604. waitsecond(2)
  4605. end
  4606.  
  4607. tcase << TestAction.new(:clickmostrecentvideo) do
  4608. click(180,792)
  4609.  
  4610. waitsecond(2)
  4611. end
  4612.  
  4613. tcase << TestAction.new(:clicktoallowfullscreen) do
  4614. $ruiObj = RUIObject.new.with('objectid', 421858869).with('selfid', 1817701202).with('textdescid', -941601866).with('uniqueparentid', -965863814)
  4615. .with('uitreeindex', 5)
  4616. .with('classname', 'Button')
  4617. .with('resource-id', 'android:id/ok')
  4618. .with('text', 'GOT IT')
  4619.  
  4620. $ruiObj.click
  4621.  
  4622. waitsecond(2)
  4623. end
  4624.  
  4625. tcase << TestAction.new(:View_Dismiss_10) do
  4626. $ruiObj = RUIObject.new.with('objectid', 1250577209).with('selfid', 2045596453).with('textdescid', 1467340739).with('uniqueparentid', -1059167548)
  4627. .with('uitreeindex', 3)
  4628. .with('classname', 'android.view.View')
  4629. .with('content-desc', 'Dismiss')
  4630.  
  4631. $ruiObj.click
  4632.  
  4633. waitsecond(2)
  4634. end
  4635.  
  4636. tcase << TestAction.new(:wait10seconds) do
  4637. for i in 1..2
  4638.  
  4639. waitsecond(i)
  4640. refreshScreen
  4641.  
  4642. end
  4643.  
  4644. end
  4645.  
  4646. tcase << TestAction.new(:clickthescreen) do
  4647. click(1080,1516.5)
  4648.  
  4649. waitsecond(2)
  4650. end
  4651.  
  4652. tcase << TestAction.new(:checkforpausebutton) do
  4653. $ruiObj = RUIObject.new.with('objectid', 1760472289).with('selfid', -1751474194).with('textdescid', -1538603918).with('uniqueparentid', 542296211)
  4654. .with('uitreeindex', 2)
  4655. .with('classname', 'ImageButton')
  4656. .with('resource-id', 'com.google.android.apps.photos:id/photos_videoplayer_pause_button')
  4657. .with('content-desc', 'Pause video')
  4658.  
  4659. $ruiObj.isExist
  4660.  
  4661. waitsecond(0)
  4662. end
  4663.  
  4664. tcase << TestAction.new(:refreshscreen) do
  4665. refreshScreen
  4666.  
  4667. waitsecond(0)
  4668. end
  4669.  
  4670. tcase << TestAction.new(:wait16second) do
  4671. for i in 1..2
  4672.  
  4673. waitsecond(i)
  4674. refreshScreen
  4675.  
  4676. end
  4677.  
  4678. end
  4679.  
  4680. tcase << TestAction.new(:pausevideo) do
  4681. $ruiObj = RUIObject.new.with('objectid', 1760472289).with('selfid', -1751474194).with('textdescid', -1538603918).with('uniqueparentid', 542296211)
  4682. .with('uitreeindex', 2)
  4683. .with('classname', 'ImageButton')
  4684. .with('resource-id', 'com.google.android.apps.photos:id/photos_videoplayer_pause_button')
  4685. .with('content-desc', 'Pause video')
  4686.  
  4687. $ruiObj.click
  4688.  
  4689. waitsecond(2)
  4690. end
  4691.  
  4692. tcase << TestAction.new(:stoplog) do
  4693. $myTestResult = checkLastExistResult
  4694.  
  4695. logStopTest("05_01_07_02_MultiMedia")
  4696.  
  4697.  
  4698.  
  4699. waitsecond(0)
  4700. end
  4701.  
  4702. tcase << TestAction.new(:pressBack_4) do
  4703. pressBack
  4704.  
  4705. waitsecond(0)
  4706. end
  4707.  
  4708. tcase << TestAction.new(:pressBack_6) do
  4709. pressBack
  4710.  
  4711. waitsecond(0)
  4712. end
  4713.  
  4714. tcase << TestAction.new(:pressHome_7) do
  4715. pressHome
  4716.  
  4717. waitsecond(0)
  4718. end
  4719.  
  4720. tcase.run(loopTime)
  4721.  
  4722. end
  4723.  
  4724. def self.Multimedia_5_1_7_3(loopTime)
  4725.  
  4726. tcase = TestCase.new("Multimedia_5_1_7_3")
  4727.  
  4728. tcase << TestAction.new(:logstart) do
  4729. logStartTest("05_01_07_03_MultiMedia")
  4730.  
  4731. waitsecond(0)
  4732. end
  4733.  
  4734. tcase << TestAction.new(:gotoPhotos) do
  4735. gotoAppPixel("Photos")
  4736.  
  4737. waitsecond(2)
  4738. end
  4739.  
  4740. tcase << TestAction.new(:gotovideo) do
  4741. click(166.5,666)
  4742.  
  4743. waitsecond(2)
  4744. end
  4745.  
  4746. tcase << TestAction.new(:clicktheview) do
  4747. $ruiObj = RUIObject.new.with('objectid', 969208524).with('selfid', 1815484335).with('textdescid', -19306796).with('uniqueparentid', -87074755)
  4748. .with('uitreeindex', 0)
  4749. .with('classname', 'android.view.View')
  4750.  
  4751. $ruiObj.click
  4752.  
  4753. waitsecond(0)
  4754. end
  4755.  
  4756. tcase << TestAction.new(:refreshscreen) do
  4757. refreshScreen
  4758.  
  4759. waitsecond(0)
  4760. end
  4761.  
  4762. tcase << TestAction.new(:deletebuttonexist) do
  4763. $ruiObj = RUIObject.new.with('objectid', -1328088200).with('selfid', 1434121712).with('textdescid', 864436336).with('uniqueparentid', -2095656440)
  4764. .with('uitreeindex', 14)
  4765. .with('classname', 'ImageView')
  4766. .with('resource-id', 'com.google.android.apps.photos:id/trash')
  4767. .with('content-desc', 'Trash')
  4768.  
  4769. $ruiObj.isExist
  4770.  
  4771. waitsecond(2)
  4772. end
  4773.  
  4774. tcase << TestAction.new(:deletethevideo) do
  4775. $ruiObj = RUIObject.new.with('objectid', -1328088200).with('selfid', 1434121712).with('textdescid', 864436336).with('uniqueparentid', -2095656440)
  4776. .with('uitreeindex', 14)
  4777. .with('classname', 'ImageView')
  4778. .with('resource-id', 'com.google.android.apps.photos:id/trash')
  4779. .with('content-desc', 'Trash')
  4780.  
  4781. $ruiObj.click
  4782.  
  4783. waitsecond(2)
  4784. end
  4785.  
  4786. tcase << TestAction.new(:confirmdelete) do
  4787. $ruiObj = RUIObject.new.with('objectid', -767191037).with('selfid', 2007729818).with('textdescid', -414128773).with('uniqueparentid', 158965951).with('classresourceid', 1834539358)
  4788. .with('uitreeindex', 7)
  4789. .with('classname', 'Button')
  4790. .with('resource-id', 'android:id/button1')
  4791. .with('text', 'MOVE TO TRASH')
  4792.  
  4793. $ruiObj.click
  4794.  
  4795. waitsecond(2)
  4796. end
  4797.  
  4798. tcase << TestAction.new(:confirmdelete_2) do
  4799. $ruiObj = RUIObject.new.with('objectid', -767191037).with('selfid', -1194431314).with('textdescid', -875578979).with('uniqueparentid', 1357736153).with('classresourceid', 1834539358)
  4800. .with('uitreeindex', 4)
  4801. .with('classname', 'Button')
  4802. .with('resource-id', 'android:id/button1')
  4803. .with('text', 'DELETE PERMANENTLY')
  4804.  
  4805. $ruiObj.click
  4806.  
  4807. waitsecond(2)
  4808. end
  4809.  
  4810. tcase << TestAction.new(:logstop) do
  4811. $myTestResult = checkLastExistResult
  4812.  
  4813. if $myTestResult == false
  4814. $myFailReason == "Video fail to delete"
  4815.  
  4816. end
  4817. logStopTest("05_01_07_03_MultiMedia")
  4818.  
  4819.  
  4820. waitsecond(0)
  4821. end
  4822.  
  4823. tcase << TestAction.new(:pressBack_11) do
  4824. pressBack
  4825.  
  4826. waitsecond(0)
  4827. end
  4828.  
  4829. tcase << TestAction.new(:pressBack_12) do
  4830. pressBack
  4831.  
  4832. waitsecond(0)
  4833. end
  4834.  
  4835. tcase << TestAction.new(:pressHome_13) do
  4836. pressHome
  4837.  
  4838. waitsecond(0)
  4839. end
  4840.  
  4841. tcase.run(loopTime)
  4842.  
  4843. end
  4844.  
  4845. def self.Multimedia_5_1_7_4(loopTime)
  4846.  
  4847. tcase = TestCase.new("Multimedia_5_1_7_4")
  4848.  
  4849. tcase << TestAction.new(:logstart) do
  4850. logStartTest("05_01_07_04_MultiMedia")
  4851.  
  4852. waitsecond(0)
  4853. end
  4854.  
  4855. tcase << TestAction.new(:scriptAction_2) do
  4856. gotoAppPixel("Camera")
  4857.  
  4858. waitsecond(2)
  4859. end
  4860.  
  4861. tcase << TestAction.new(:clickcamera) do
  4862. $ruiObj = RUIObject.new.with('objectid', 1308773867).with('selfid', -690989467).with('textdescid', 1917284245).with('uniqueparentid', -149577887)
  4863. .with('uitreeindex', 12)
  4864. .with('classname', 'ImageView')
  4865. .with('resource-id', 'com.google.android.GoogleCamera:id/smooth_rotate_photo_switch_icon')
  4866.  
  4867. $ruiObj.click
  4868.  
  4869. waitsecond(2)
  4870. end
  4871.  
  4872. tcase << TestAction.new(:takeaphoto) do
  4873. $ruiObj = RUIObject.new.with('objectid', 897368612).with('selfid', -2009867863).with('textdescid', -1833878127).with('uniqueparentid', 1343212356)
  4874. .with('uitreeindex', 16)
  4875. .with('classname', 'ImageButton')
  4876. .with('resource-id', 'com.google.android.GoogleCamera:id/shutter_button')
  4877. .with('content-desc', 'Shutter')
  4878.  
  4879. $ruiObj.click
  4880.  
  4881. waitsecond(2)
  4882. end
  4883.  
  4884. tcase << TestAction.new(:shutterbuttonexist) do
  4885. $ruiObj = RUIObject.new.with('objectid', 897368612).with('selfid', -2009867863).with('textdescid', -1833878127).with('uniqueparentid', 1343212356)
  4886. .with('uitreeindex', 16)
  4887. .with('classname', 'ImageButton')
  4888. .with('resource-id', 'com.google.android.GoogleCamera:id/shutter_button')
  4889. .with('content-desc', 'Shutter')
  4890.  
  4891. $ruiObj.isExist
  4892.  
  4893. waitsecond(0)
  4894. end
  4895.  
  4896. tcase << TestAction.new(:logstop) do
  4897. $myTestResult = checkLastExistResult
  4898.  
  4899. if $myTestResult == false
  4900. $myFailReason == "Take picture FAILED"
  4901. end
  4902. logStopTest("05_01_07_04_MultiMedia")
  4903.  
  4904.  
  4905. waitsecond(0)
  4906. end
  4907.  
  4908. tcase << TestAction.new(:pressBack_8) do
  4909. pressBack
  4910.  
  4911. waitsecond(0)
  4912. end
  4913.  
  4914. tcase << TestAction.new(:pressHome_9) do
  4915. pressHome
  4916.  
  4917. waitsecond(0)
  4918. end
  4919.  
  4920. tcase.run(loopTime)
  4921.  
  4922. end
  4923.  
  4924. def self.Multimedia_5_1_7_5(loopTime)
  4925.  
  4926. tcase = TestCase.new("Multimedia_5_1_7_5")
  4927.  
  4928. tcase << TestAction.new(:logstart) do
  4929. logStartTest("05_01_07_05_MultiMedia")
  4930.  
  4931. waitsecond(0)
  4932. end
  4933.  
  4934. tcase << TestAction.new(:gotoGallery) do
  4935. gotoAppPixel("Photos")
  4936.  
  4937. waitsecond(2)
  4938. end
  4939.  
  4940. tcase << TestAction.new(:clickmostcurrentphoto) do
  4941. $ruiObj = RUIObject.new.with('objectid', -740392950).with('selfid', -155877827).with('textdescid', 1337650749).with('uniqueparentid', -720638774)
  4942. .with('uitreeindex', 1)
  4943. .with('pretext', 'Camera')
  4944. .with('classname', 'android.view.ViewGroup')
  4945. .with('content-desc', 'Photo taken on May 10, 2017 8:55:20 PM.')
  4946.  
  4947. $ruiObj.click
  4948.  
  4949. waitsecond(2)
  4950. end
  4951.  
  4952. tcase << TestAction.new(:ifsharebuttonexist) do
  4953. $ruiObj = RUIObject.new.with('objectid', -1982964278).with('selfid', 1056003612).with('textdescid', 1336202944).with('uniqueparentid', 1291383994)
  4954. .with('uitreeindex', 6)
  4955. .with('classname', 'ImageView')
  4956. .with('resource-id', 'com.google.android.apps.photos:id/edit')
  4957. .with('content-desc', 'Edit')
  4958.  
  4959. $ruiObj.isExist
  4960.  
  4961. waitsecond(0)
  4962. end
  4963.  
  4964. tcase << TestAction.new(:logstop) do
  4965. $myTestResult = checkLastExistResult
  4966. if $myTestResult == false
  4967. $myFailReason == "Take picture FAILED"
  4968. end
  4969. logStopTest("05_01_07_05_MultiMedia")
  4970.  
  4971.  
  4972. waitsecond(0)
  4973. end
  4974.  
  4975. tcase << TestAction.new(:pressBack_7) do
  4976. pressBack
  4977.  
  4978. waitsecond(0)
  4979. end
  4980.  
  4981. tcase << TestAction.new(:pressBack_8) do
  4982. pressBack
  4983.  
  4984. waitsecond(0)
  4985. end
  4986.  
  4987. tcase << TestAction.new(:pressHome_8) do
  4988. pressHome
  4989.  
  4990. waitsecond(0)
  4991. end
  4992.  
  4993. tcase.run(loopTime)
  4994.  
  4995. end
  4996.  
  4997. def self.Multimedia_5_1_7_6(loopTime)
  4998.  
  4999. tcase = TestCase.new("Multimedia_5_1_7_6")
  5000.  
  5001. tcase << TestAction.new(:logstart) do
  5002. logStartTest("05_01_07_06_MultiMedia")
  5003.  
  5004. waitsecond(0)
  5005. end
  5006.  
  5007. tcase << TestAction.new(:gotoGallery) do
  5008. gotoAppPixel("Photos")
  5009.  
  5010. waitsecond(2)
  5011. end
  5012.  
  5013. tcase << TestAction.new(:clickmostrecentfile) do
  5014. click(184.5,648)
  5015.  
  5016. waitsecond(2)
  5017. end
  5018.  
  5019. tcase << TestAction.new(:deletebuttonexist) do
  5020. $ruiObj = RUIObject.new.with('objectid', -1328088200).with('selfid', 1434121712).with('textdescid', 864436336).with('uniqueparentid', -2095656440)
  5021. .with('uitreeindex', 7)
  5022. .with('classname', 'ImageView')
  5023. .with('resource-id', 'com.google.android.apps.photos:id/trash')
  5024. .with('content-desc', 'Trash')
  5025.  
  5026. $ruiObj.isExist
  5027.  
  5028. waitsecond(0)
  5029. end
  5030.  
  5031. tcase << TestAction.new(:deletethepicture) do
  5032. $ruiObj = RUIObject.new.with('objectid', -1328088200).with('selfid', 1434121712).with('textdescid', 864436336).with('uniqueparentid', -2095656440)
  5033. .with('uitreeindex', 8)
  5034. .with('classname', 'ImageView')
  5035. .with('resource-id', 'com.google.android.apps.photos:id/trash')
  5036. .with('content-desc', 'Trash')
  5037.  
  5038. $ruiObj.click
  5039.  
  5040. waitsecond(2)
  5041. end
  5042.  
  5043. tcase << TestAction.new(:logstop) do
  5044. $myTestResult = checkLastExistResult
  5045. if $myTestResult == false
  5046. $myFailReason == "Picture is not deleted."
  5047. end
  5048. logStopTest("05_01_07_06_MultiMedia")
  5049.  
  5050.  
  5051. waitsecond(2)
  5052. end
  5053.  
  5054. tcase << TestAction.new(:pressBack_7) do
  5055. pressBack
  5056.  
  5057. waitsecond(0)
  5058. end
  5059.  
  5060. tcase << TestAction.new(:pressBack_8) do
  5061. pressBack
  5062.  
  5063. waitsecond(0)
  5064. end
  5065.  
  5066. tcase << TestAction.new(:pressHome_8) do
  5067. pressHome
  5068.  
  5069. waitsecond(0)
  5070. end
  5071.  
  5072. tcase.run(loopTime)
  5073.  
  5074. end
  5075.  
  5076. def self.Multimedia_5_1_7_7(loopTime)
  5077.  
  5078. tcase = TestCase.new("Multimedia_5_1_7_7")
  5079.  
  5080. tcase << TestAction.new(:logstart) do
  5081. logStartTest("05_01_07_07_MultiMedia")
  5082.  
  5083. waitsecond(0)
  5084. end
  5085.  
  5086. tcase << TestAction.new(:gotomessages) do
  5087. gotoAppPixel("Messages")
  5088.  
  5089. waitsecond(2)
  5090. end
  5091.  
  5092. tcase << TestAction.new(:Startnewmessage) do
  5093. $ruiObj = RUIObject.new.with('objectid', 764419066).with('selfid', 916878134).with('textdescid', 48640071).with('uniqueparentid', 1408873138)
  5094. .with('uitreeindex', 6)
  5095. .with('classname', 'ImageView')
  5096. .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
  5097. .with('content-desc', 'Start new conversation')
  5098.  
  5099. $ruiObj.click
  5100.  
  5101. waitsecond(2)
  5102. end
  5103.  
  5104. tcase << TestAction.new(:TextView_Skip_2) do
  5105. $ruiObj = RUIObject.new.with('objectid', 774774376).with('selfid', 692625717).with('textdescid', 125277897).with('uniqueparentid', 1739951846)
  5106. .with('uitreeindex', 3)
  5107. .with('classname', 'TextView')
  5108. .with('resource-id', 'com.google.android.apps.messaging:id/skip')
  5109. .with('text', 'SKIP')
  5110.  
  5111. $ruiObj.click
  5112.  
  5113. waitsecond(2)
  5114. end
  5115.  
  5116. tcase << TestAction.new(:TextView_Next_4) do
  5117. $ruiObj = RUIObject.new.with('objectid', 774620124).with('selfid', -737737443).with('textdescid', -1309712823).with('uniqueparentid', -1145423395)
  5118. .with('uitreeindex', 5)
  5119. .with('classname', 'TextView')
  5120. .with('resource-id', 'com.google.android.apps.messaging:id/next')
  5121. .with('text', 'NEXT')
  5122.  
  5123. $ruiObj.click
  5124.  
  5125. waitsecond(2)
  5126. end
  5127.  
  5128. tcase << TestAction.new(:Button_PermissionAllowButton_6) do
  5129. $ruiObj = RUIObject.new.with('objectid', 153379926).with('selfid', 1443382411).with('textdescid', 294474017).with('uniqueparentid', 725356101).with('classresourceid', -227364920)
  5130. .with('uitreeindex', 4)
  5131. .with('classname', 'Button')
  5132. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  5133. .with('text', 'ALLOW')
  5134.  
  5135. $ruiObj.click
  5136.  
  5137. waitsecond(2)
  5138. end
  5139.  
  5140. tcase << TestAction.new(:Button_PermissionAllowButton_8) do
  5141. $ruiObj = RUIObject.new.with('objectid', 153379926).with('selfid', 1443382411).with('textdescid', 294474017).with('uniqueparentid', 725356101).with('classresourceid', -227364920)
  5142. .with('uitreeindex', 4)
  5143. .with('classname', 'Button')
  5144. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  5145. .with('text', 'ALLOW')
  5146.  
  5147. $ruiObj.click
  5148.  
  5149. waitsecond(2)
  5150. end
  5151.  
  5152. tcase << TestAction.new(:Button_PermissionAllowButton_10) do
  5153. $ruiObj = RUIObject.new.with('objectid', 153379926).with('selfid', 1443382411).with('textdescid', 294474017).with('uniqueparentid', 725356101).with('classresourceid', -227364920)
  5154. .with('uitreeindex', 2)
  5155. .with('classname', 'Button')
  5156. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  5157. .with('text', 'ALLOW')
  5158.  
  5159. $ruiObj.click
  5160.  
  5161. waitsecond(2)
  5162. end
  5163.  
  5164. tcase << TestAction.new(:put_recipientnumber) do
  5165. $ruiObj = RUIObject.new.with('objectid', -1173212947).with('selfid', 1163803387).with('textdescid', -2009862957).with('uniqueparentid', 955347666).with('classresourceid', 461007471)
  5166. .with('uitreeindex', 1)
  5167. .with('classname', 'MultiAutoCompleteTextView')
  5168. .with('resource-id', 'com.google.android.apps.messaging:id/recipient_text_view')
  5169.  
  5170. $ruiObj.inputtext('A01 a01')
  5171.  
  5172. waitsecond(2)
  5173. end
  5174.  
  5175. tcase << TestAction.new(:nextwindow) do
  5176. click(1354.5,2605.5)
  5177.  
  5178. waitsecond(2)
  5179. end
  5180.  
  5181. tcase << TestAction.new(:gotooption) do
  5182. $ruiObj = RUIObject.new.with('objectid', -1360420814).with('selfid', -952088716).with('textdescid', 1847611113).with('uniqueparentid', 1251875640)
  5183. .with('uitreeindex', 7)
  5184. .with('classname', 'ImageButton')
  5185. .with('resource-id', 'com.google.android.apps.messaging:id/attach_media_button')
  5186. .with('content-desc', 'Add an attachment')
  5187.  
  5188. $ruiObj.click
  5189.  
  5190. waitsecond(2)
  5191. end
  5192.  
  5193. tcase << TestAction.new(:changetorecordoption) do
  5194. $ruiObj = RUIObject.new.with('objectid', 1408822083).with('selfid', -645200276).with('textdescid', -334363612).with('uniqueparentid', -1874692983)
  5195. .with('uitreeindex', 28)
  5196. .with('classname', 'ImageButton')
  5197. .with('content-desc', 'Record audio')
  5198.  
  5199. $ruiObj.click
  5200.  
  5201. waitsecond(2)
  5202. end
  5203.  
  5204. tcase << TestAction.new(:clickallow) do
  5205. $ruiObj = RUIObject.new.with('objectid', -655699299).with('selfid', -1852985786).with('textdescid', -1480420102).with('uniqueparentid', -1331106569)
  5206. .with('uitreeindex', 13)
  5207. .with('classname', 'TextView')
  5208. .with('resource-id', 'com.google.android.apps.messaging:id/missing_permission_enable')
  5209. .with('text', 'ALLOW')
  5210.  
  5211. $ruiObj.click
  5212.  
  5213. waitsecond(2)
  5214. end
  5215.  
  5216. tcase << TestAction.new(:clickPermissionAllowButton) do
  5217. $ruiObj = RUIObject.new.with('objectid', 153379926).with('selfid', 1443382411).with('textdescid', 294474017).with('uniqueparentid', 725356101).with('classresourceid', -227364920)
  5218. .with('uitreeindex', 3)
  5219. .with('classname', 'Button')
  5220. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  5221. .with('text', 'ALLOW')
  5222.  
  5223. $ruiObj.click
  5224.  
  5225. waitsecond(2)
  5226. end
  5227.  
  5228. tcase << TestAction.new(:record5secondsmessage) do
  5229. swipe(597, 2053, 842, 2298, 500)
  5230.  
  5231. waitsecond(2)
  5232. end
  5233.  
  5234. tcase << TestAction.new(:playbuttonexist) do
  5235. $ruiObj = RUIObject.new.with('objectid', 28335571).with('selfid', 801742907).with('textdescid', -1823989396).with('uniqueparentid', 1321193562)
  5236. .with('uitreeindex', 7)
  5237. .with('classname', 'ImageView')
  5238. .with('resource-id', 'com.google.android.apps.messaging:id/play_button')
  5239. .with('content-desc', 'Play audio attachment')
  5240.  
  5241. $ruiObj.isExist
  5242.  
  5243. waitsecond(0)
  5244. end
  5245.  
  5246. tcase << TestAction.new(:logstop) do
  5247. $myTestResult = checkLastExistResult
  5248. if $myTestResult == false
  5249. $myFailReason == "Message is not recorded"
  5250. end
  5251. logStopTest("05_01_07_07_MultiMedia")
  5252.  
  5253.  
  5254. waitsecond(0)
  5255. end
  5256.  
  5257. tcase << TestAction.new(:pressBack_34) do
  5258. pressBack
  5259.  
  5260. waitsecond(0)
  5261. end
  5262.  
  5263. tcase << TestAction.new(:pressBack_35) do
  5264. pressBack
  5265.  
  5266. waitsecond(0)
  5267. end
  5268.  
  5269. tcase << TestAction.new(:pressBack_36) do
  5270. pressBack
  5271.  
  5272. waitsecond(0)
  5273. end
  5274.  
  5275. tcase << TestAction.new(:pressHome_37) do
  5276. pressHome
  5277.  
  5278. waitsecond(0)
  5279. end
  5280.  
  5281. tcase.run(loopTime)
  5282.  
  5283. end
  5284.  
  5285. def self.Multimedia_5_1_7_8(loopTime)
  5286.  
  5287. tcase = TestCase.new("Multimedia_5_1_7_8")
  5288.  
  5289. tcase << TestAction.new(:logstart) do
  5290. logStartTest("05_01_07_08_MultiMedia")
  5291.  
  5292. waitsecond(0)
  5293. end
  5294.  
  5295. tcase << TestAction.new(:gotomessages) do
  5296. gotoAppPixel("Messages")
  5297.  
  5298. waitsecond(2)
  5299. end
  5300.  
  5301. tcase << TestAction.new(:Startnewmessage) do
  5302. $ruiObj = RUIObject.new.with('objectid', 764419066).with('selfid', 916878134).with('textdescid', 48640071).with('uniqueparentid', 1408873138)
  5303. .with('uitreeindex', 6)
  5304. .with('classname', 'ImageView')
  5305. .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
  5306. .with('content-desc', 'Start new conversation')
  5307.  
  5308. $ruiObj.click
  5309.  
  5310. waitsecond(2)
  5311. end
  5312.  
  5313. tcase << TestAction.new(:put_recipientnumber) do
  5314. $ruiObj = RUIObject.new.with('objectid', -1173212947).with('selfid', 1163803387).with('textdescid', -2009862957).with('uniqueparentid', 955347666).with('classresourceid', 461007471)
  5315. .with('uitreeindex', 1)
  5316. .with('classname', 'MultiAutoCompleteTextView')
  5317. .with('resource-id', 'com.google.android.apps.messaging:id/recipient_text_view')
  5318.  
  5319. $ruiObj.inputtext('A01 a01')
  5320.  
  5321. waitsecond(2)
  5322. end
  5323.  
  5324. tcase << TestAction.new(:nextwindow) do
  5325. click(1354.5,2605.5)
  5326.  
  5327. waitsecond(2)
  5328. end
  5329.  
  5330. tcase << TestAction.new(:gotooption) do
  5331. $ruiObj = RUIObject.new.with('objectid', -1360420814).with('selfid', -952088716).with('textdescid', 1847611113).with('uniqueparentid', 1251875640)
  5332. .with('uitreeindex', 7)
  5333. .with('classname', 'ImageButton')
  5334. .with('resource-id', 'com.google.android.apps.messaging:id/attach_media_button')
  5335. .with('content-desc', 'Add an attachment')
  5336.  
  5337. $ruiObj.click
  5338.  
  5339. waitsecond(2)
  5340. end
  5341.  
  5342. tcase << TestAction.new(:changetorecordoption) do
  5343. $ruiObj = RUIObject.new.with('objectid', 1408822083).with('selfid', -645200276).with('textdescid', -334363612).with('uniqueparentid', -1874692983)
  5344. .with('uitreeindex', 28)
  5345. .with('classname', 'ImageButton')
  5346. .with('content-desc', 'Record audio')
  5347.  
  5348. $ruiObj.click
  5349.  
  5350. waitsecond(2)
  5351. end
  5352.  
  5353. tcase << TestAction.new(:clickallow) do
  5354. $ruiObj = RUIObject.new.with('objectid', -655699299).with('selfid', -1852985786).with('textdescid', -1480420102).with('uniqueparentid', -1331106569)
  5355. .with('uitreeindex', 13)
  5356. .with('classname', 'TextView')
  5357. .with('resource-id', 'com.google.android.apps.messaging:id/missing_permission_enable')
  5358. .with('text', 'ALLOW')
  5359.  
  5360. $ruiObj.click
  5361.  
  5362. waitsecond(2)
  5363. end
  5364.  
  5365. tcase << TestAction.new(:clickPermissionAllowButton) do
  5366. $ruiObj = RUIObject.new.with('objectid', 153379926).with('selfid', 1443382411).with('textdescid', 294474017).with('uniqueparentid', 725356101).with('classresourceid', -227364920)
  5367. .with('uitreeindex', 3)
  5368. .with('classname', 'Button')
  5369. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  5370. .with('text', 'ALLOW')
  5371.  
  5372. $ruiObj.click
  5373.  
  5374. waitsecond(2)
  5375. end
  5376.  
  5377. tcase << TestAction.new(:record5secondsmessage) do
  5378. swipe(597, 2053, 842, 2298, 500)
  5379.  
  5380. waitsecond(2)
  5381. end
  5382.  
  5383. tcase << TestAction.new(:playbuttonis_exist_1) do
  5384. $ruiObj = RUIObject.new.with('objectid', 28335571).with('selfid', 801742907).with('textdescid', -1823989396).with('uniqueparentid', 1321193562)
  5385. .with('uitreeindex', 7)
  5386. .with('classname', 'ImageView')
  5387. .with('resource-id', 'com.google.android.apps.messaging:id/play_button')
  5388. .with('content-desc', 'Play audio attachment')
  5389.  
  5390. $ruiObj.isExist
  5391.  
  5392. waitsecond(0)
  5393. end
  5394.  
  5395. tcase << TestAction.new(:playtherecord) do
  5396. $ruiObj = RUIObject.new.with('objectid', 28335571).with('selfid', 801742907).with('textdescid', -1823989396).with('uniqueparentid', 1321193562)
  5397. .with('uitreeindex', 7)
  5398. .with('classname', 'ImageView')
  5399. .with('resource-id', 'com.google.android.apps.messaging:id/play_button')
  5400. .with('content-desc', 'Play audio attachment')
  5401.  
  5402. $ruiObj.click
  5403.  
  5404. waitsecond(2)
  5405. end
  5406.  
  5407. tcase << TestAction.new(:logstop) do
  5408. $myTestResult = checkLastExistResult
  5409. if $myTestResult == false
  5410. $myFailReason == "Record is not played"
  5411. end
  5412. logStopTest("05_01_07_08_MultiMedia")
  5413.  
  5414.  
  5415. waitsecond(0)
  5416. end
  5417.  
  5418. tcase << TestAction.new(:pressBack_34) do
  5419. pressBack
  5420.  
  5421. waitsecond(0)
  5422. end
  5423.  
  5424. tcase << TestAction.new(:pressBack_35) do
  5425. pressBack
  5426.  
  5427. waitsecond(0)
  5428. end
  5429.  
  5430. tcase << TestAction.new(:pressBack_36) do
  5431. pressBack
  5432.  
  5433. waitsecond(0)
  5434. end
  5435.  
  5436. tcase << TestAction.new(:pressHome_37) do
  5437. pressHome
  5438.  
  5439. waitsecond(0)
  5440. end
  5441.  
  5442. tcase.run(loopTime)
  5443.  
  5444. end
  5445.  
  5446. def self.Multimedia_5_1_7_9(loopTime)
  5447.  
  5448. tcase = TestCase.new("Multimedia_5_1_7_9")
  5449.  
  5450. tcase << TestAction.new(:logstart) do
  5451. logStartTest("05_01_07_09_MultiMedia")
  5452.  
  5453. waitsecond(0)
  5454. end
  5455.  
  5456. tcase << TestAction.new(:gotomessages) do
  5457. gotoAppPixel("Messages")
  5458.  
  5459. waitsecond(2)
  5460. end
  5461.  
  5462. tcase << TestAction.new(:Startnewmessage) do
  5463. $ruiObj = RUIObject.new.with('objectid', 764419066).with('selfid', 916878134).with('textdescid', 48640071).with('uniqueparentid', 1408873138)
  5464. .with('uitreeindex', 6)
  5465. .with('classname', 'ImageView')
  5466. .with('resource-id', 'com.google.android.apps.messaging:id/start_new_conversation_button')
  5467. .with('content-desc', 'Start new conversation')
  5468.  
  5469. $ruiObj.click
  5470.  
  5471. waitsecond(2)
  5472. end
  5473.  
  5474. tcase << TestAction.new(:put_recipientnumber) do
  5475. $ruiObj = RUIObject.new.with('objectid', -1173212947).with('selfid', 1163803387).with('textdescid', -2009862957).with('uniqueparentid', 955347666).with('classresourceid', 461007471)
  5476. .with('uitreeindex', 1)
  5477. .with('classname', 'MultiAutoCompleteTextView')
  5478. .with('resource-id', 'com.google.android.apps.messaging:id/recipient_text_view')
  5479.  
  5480. $ruiObj.inputtext('A01 a01')
  5481.  
  5482. waitsecond(2)
  5483. end
  5484.  
  5485. tcase << TestAction.new(:nextwindow) do
  5486. click(1354.5,2605.5)
  5487.  
  5488. waitsecond(2)
  5489. end
  5490.  
  5491. tcase << TestAction.new(:gotooption) do
  5492. $ruiObj = RUIObject.new.with('objectid', -1360420814).with('selfid', -952088716).with('textdescid', 1847611113).with('uniqueparentid', 1251875640)
  5493. .with('uitreeindex', 7)
  5494. .with('classname', 'ImageButton')
  5495. .with('resource-id', 'com.google.android.apps.messaging:id/attach_media_button')
  5496. .with('content-desc', 'Add an attachment')
  5497.  
  5498. $ruiObj.click
  5499.  
  5500. waitsecond(2)
  5501. end
  5502.  
  5503. tcase << TestAction.new(:changetorecordoption) do
  5504. $ruiObj = RUIObject.new.with('objectid', 1408822083).with('selfid', -645200276).with('textdescid', -334363612).with('uniqueparentid', -1874692983)
  5505. .with('uitreeindex', 28)
  5506. .with('classname', 'ImageButton')
  5507. .with('content-desc', 'Record audio')
  5508.  
  5509. $ruiObj.click
  5510.  
  5511. waitsecond(2)
  5512. end
  5513.  
  5514. tcase << TestAction.new(:clickallow) do
  5515. $ruiObj = RUIObject.new.with('objectid', -655699299).with('selfid', -1852985786).with('textdescid', -1480420102).with('uniqueparentid', -1331106569)
  5516. .with('uitreeindex', 13)
  5517. .with('classname', 'TextView')
  5518. .with('resource-id', 'com.google.android.apps.messaging:id/missing_permission_enable')
  5519. .with('text', 'ALLOW')
  5520.  
  5521. $ruiObj.click
  5522.  
  5523. waitsecond(2)
  5524. end
  5525.  
  5526. tcase << TestAction.new(:clickPermissionAllowButton) do
  5527. $ruiObj = RUIObject.new.with('objectid', 153379926).with('selfid', 1443382411).with('textdescid', 294474017).with('uniqueparentid', 725356101).with('classresourceid', -227364920)
  5528. .with('uitreeindex', 3)
  5529. .with('classname', 'Button')
  5530. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  5531. .with('text', 'ALLOW')
  5532.  
  5533. $ruiObj.click
  5534.  
  5535. waitsecond(2)
  5536. end
  5537.  
  5538. tcase << TestAction.new(:record5secondsmessage) do
  5539. swipe(597, 2053, 842, 2298, 500)
  5540.  
  5541. waitsecond(2)
  5542. end
  5543.  
  5544. tcase << TestAction.new(:ImageButton_CloseButton_3) do
  5545. $ruiObj = RUIObject.new.with('objectid', -8145267).with('selfid', -966281882).with('textdescid', 812421240).with('uniqueparentid', 108696351)
  5546. .with('uitreeindex', 8)
  5547. .with('classname', 'ImageButton')
  5548. .with('resource-id', 'com.google.android.apps.messaging:id/close_button')
  5549. .with('content-desc', 'Discard attachment')
  5550.  
  5551. $ruiObj.click
  5552.  
  5553. waitsecond(2)
  5554. end
  5555.  
  5556. tcase << TestAction.new(:ImageButton_CloseButton_5) do
  5557. $ruiObj = RUIObject.new.with('objectid', -8145267).with('selfid', -966281882).with('textdescid', 812421240).with('uniqueparentid', 108696351)
  5558. .with('uitreeindex', 8)
  5559. .with('classname', 'ImageButton')
  5560. .with('resource-id', 'com.google.android.apps.messaging:id/close_button')
  5561. .with('content-desc', 'Discard attachment')
  5562.  
  5563. $ruiObj.isExist
  5564.  
  5565. waitsecond(0)
  5566. end
  5567.  
  5568. tcase << TestAction.new(:logstop) do
  5569. $myTestResult = !checkLastExistResult
  5570. if $myTestResult == false
  5571. $myFailReason == "Record is not deleted"
  5572. end
  5573. logStopTest("05_01_07_09_MultiMedia")
  5574.  
  5575.  
  5576. waitsecond(0)
  5577. end
  5578.  
  5579. tcase << TestAction.new(:pressBack_34) do
  5580. pressBack
  5581.  
  5582. waitsecond(0)
  5583. end
  5584.  
  5585. tcase << TestAction.new(:pressBack_35) do
  5586. pressBack
  5587.  
  5588. waitsecond(0)
  5589. end
  5590.  
  5591. tcase << TestAction.new(:pressBack_36) do
  5592. pressBack
  5593.  
  5594. waitsecond(0)
  5595. end
  5596.  
  5597. tcase << TestAction.new(:pressHome_37) do
  5598. pressHome
  5599.  
  5600. waitsecond(0)
  5601. end
  5602.  
  5603. tcase.run(loopTime)
  5604.  
  5605. end
  5606.  
  5607. def self.NFC_5_1_11_1(loopTime)
  5608.  
  5609. tcase = TestCase.new("NFC_5_1_11_1")
  5610.  
  5611. tcase << TestAction.new(:Home) do
  5612. pressHome
  5613.  
  5614. waitsecond(2)
  5615. end
  5616.  
  5617. tcase << TestAction.new(:logStart) do
  5618. logStartTest("NFC_5_1_11_1")
  5619.  
  5620. waitsecond(0)
  5621. end
  5622.  
  5623. tcase << TestAction.new(:GotoSettings) do
  5624. gotoAppPixel('Settings')
  5625.  
  5626.  
  5627. waitsecond(2)
  5628. end
  5629.  
  5630. tcase << TestAction.new(:ConnectedDevice) do
  5631. $ruiObj = RUIObject.new.with('objectid', -1980252617).with('selfid', -2089735067).with('textdescid', 48216771).with('uniqueparentid', -1387883596)
  5632. .with('uitreeindex', 13)
  5633. .with('classname', 'TextView')
  5634. .with('resource-id', 'android:id/title')
  5635. .with('text', 'Connected devices')
  5636.  
  5637. $ruiObj.click
  5638.  
  5639. waitsecond(2)
  5640. end
  5641.  
  5642. tcase << TestAction.new(:Off1) do
  5643. $NFCon = RUIObject.new.with('objectid', 104348776).with('selfid', 411050777).with('textdescid', 2105771625).with('uniqueparentid', 1207404591)
  5644. .with('uitreeindex', 14)
  5645. .with('classname', 'Switch')
  5646. .with('resource-id', 'android:id/switch_widget')
  5647. .with('text', 'ON')
  5648.  
  5649. if $NFCon.isExist
  5650. $NFCon.click
  5651. end
  5652.  
  5653. waitsecond(2)
  5654. end
  5655.  
  5656. tcase << TestAction.new(:On) do
  5657. $NFCoff = RUIObject.new.with('objectid', 104348776).with('selfid', -142327979).with('textdescid', 854404457).with('uniqueparentid', -1225169821)
  5658. .with('uitreeindex', 13)
  5659. .with('classname', 'Switch')
  5660. .with('resource-id', 'android:id/switch_widget')
  5661. .with('text', 'OFF')
  5662.  
  5663. if $NFCoff.isExist
  5664. $NFCoff.click
  5665. end
  5666.  
  5667. waitsecond(2)
  5668. end
  5669.  
  5670. tcase << TestAction.new(:Wait10Sec) do
  5671. waitsecond(10)
  5672.  
  5673. waitsecond(2)
  5674. end
  5675.  
  5676. tcase << TestAction.new(:FailCheck) do
  5677. $ruiObj = RUIObject.new.with('objectid', 104348776).with('selfid', 411050777).with('textdescid', 2105771625).with('uniqueparentid', 1207404591)
  5678. .with('uitreeindex', 13)
  5679. .with('classname', 'Switch')
  5680. .with('resource-id', 'android:id/switch_widget')
  5681. .with('text', 'ON')
  5682.  
  5683. $ruiObj.isExist
  5684.  
  5685. waitsecond(0)
  5686. end
  5687.  
  5688. tcase << TestAction.new(:Result) do
  5689. $myTestResult = checkLastExistResult
  5690.  
  5691. waitsecond(0)
  5692. end
  5693.  
  5694. tcase << TestAction.new(:Off2) do
  5695. $NFCon = RUIObject.new.with('objectid', 104348776).with('selfid', 411050777).with('textdescid', 2105771625).with('uniqueparentid', 1207404591)
  5696. .with('uitreeindex', 14)
  5697. .with('classname', 'Switch')
  5698. .with('resource-id', 'android:id/switch_widget')
  5699. .with('text', 'ON')
  5700.  
  5701. if $NFCon.isExist
  5702. $NFCon.click
  5703. end
  5704.  
  5705. waitsecond(2)
  5706. end
  5707.  
  5708. tcase << TestAction.new(:logStop) do
  5709. logStopTest("NFC_5_1_11_1")
  5710.  
  5711. waitsecond(0)
  5712. end
  5713.  
  5714. tcase.run(loopTime)
  5715.  
  5716. end
  5717.  
  5718. def self.PIM_05_01_06_01(loopTime)
  5719.  
  5720. tcase = TestCase.new("PIM_05_01_06_01")
  5721.  
  5722. tcase << TestAction.new(:scriptAction_StartTestLog) do
  5723. logStartTest("05_01_06_01_PIM")
  5724. end
  5725.  
  5726. tcase << TestAction.new(:gotoApp_4) do
  5727. gotoApp('Calendar')
  5728.  
  5729. waitsecond(2)
  5730. end
  5731.  
  5732. tcase << TestAction.new(:ImageView_3) do
  5733. $ruiObj = RUIObject.new.with('objectid', -30724256).with('selfid', 1125864064).with('textdescid', -952451904).with('uniqueparentid', 0)
  5734. .with('uitreeindex', 23)
  5735. .with('pretext', 'SAT')
  5736. .with('classname', 'ImageView')
  5737.  
  5738. $ruiObj.click
  5739.  
  5740. waitsecond(2)
  5741. end
  5742.  
  5743. tcase << TestAction.new(:EditText_Title_7) do
  5744. $ruiObj = RUIObject.new.with('objectid', -308497519).with('selfid', 2023914653).with('textdescid', -973488465).with('uniqueparentid', 0).with('classresourceid', 1943514993)
  5745. .with('uitreeindex', 4)
  5746. .with('classname', 'EditText')
  5747. .with('resource-id', 'com.android.calendar:id/title')
  5748.  
  5749. $ruiObj.inputtext('Event')
  5750.  
  5751. waitsecond(2)
  5752. end
  5753.  
  5754. tcase << TestAction.new(:Button_BtnDone_9) do
  5755. $ruiObj = RUIObject.new.with('objectid', 2099795980).with('selfid', 2133354936).with('textdescid', -644044497).with('uniqueparentid', 0)
  5756. .with('uitreeindex', 32)
  5757. .with('classname', 'Button')
  5758. .with('resource-id', 'com.android.calendar:id/btn_done')
  5759. .with('text', 'SAVE')
  5760.  
  5761. $ruiObj.click
  5762.  
  5763. waitsecond(2)
  5764. end
  5765.  
  5766. tcase << TestAction.new(:wait1second_11) do
  5767. waitsecond(1)
  5768. end
  5769.  
  5770. tcase << TestAction.new(:scriptAction_LogStopTest) do
  5771. $myTestResult = checkLastExistResult
  5772.  
  5773. if $myTestResult == false
  5774. $myFailReason = "End button not found"
  5775. end
  5776. logStopTest("05_01_06_01_PIM")
  5777. end
  5778.  
  5779. tcase << TestAction.new(:pressBack_14) do
  5780. pressBack
  5781. end
  5782.  
  5783. tcase << TestAction.new(:pressBack_16) do
  5784. pressBack
  5785. end
  5786.  
  5787. tcase << TestAction.new(:pressHome_2) do
  5788. pressHome
  5789. end
  5790.  
  5791. tcase.run(loopTime)
  5792.  
  5793. end
  5794.  
  5795. def self.PIM_5_1_6_1(loopTime)
  5796.  
  5797. tcase = TestCase.new("PIM_5_1_6_1")
  5798.  
  5799. tcase << TestAction.new(:scriptAction_1) do
  5800. i = 0
  5801. n = 0
  5802.  
  5803. gotoAppPixel("Calendar")
  5804.  
  5805. waitsecond(3)
  5806.  
  5807. while n < 3 do
  5808. RUIObject.new.with('objectid', 1039155013).with('selfid', -773553589).with('textdescid', -1562943423).with('uniqueparentid', 1761562046)
  5809. .with('uitreeindex', 4)
  5810. .with('classname', 'ImageView')
  5811. .with('resource-id', 'com.google.android.calendar:id/right_arrow')
  5812. .with('content-desc', 'next page').click
  5813.  
  5814. waitsecond(3)
  5815.  
  5816. n += 1
  5817. end
  5818.  
  5819. RUIObject.new.with('objectid', -1343654405).with('selfid', -1828804226).with('textdescid', 769111461).with('uniqueparentid', 1254931512)
  5820. .with('uitreeindex', 4)
  5821. .with('classname', 'Button')
  5822. .with('resource-id', 'com.google.android.calendar:id/done_button')
  5823. .with('content-desc', 'Got it')
  5824. .with('text', 'GOT IT').click
  5825.  
  5826. waitsecond(3)
  5827.  
  5828. while i < 5 do
  5829.  
  5830. logStartTest("PIM_5_1_6_1")
  5831.  
  5832. RUIObject.new.with('objectid', -173740453).with('selfid', 220763148).with('textdescid', 356821123).with('uniqueparentid', -1214616113)
  5833. .with('uitreeindex', 0)
  5834. .with('classname', 'ImageButton')
  5835. .with('resource-id', 'com.google.android.calendar:id/floating_action_button')
  5836. .with('content-desc', 'Create new event and more').click
  5837.  
  5838. waitsecond(3)
  5839.  
  5840. RUIObject.new.with('objectid', 127015164).with('selfid', 498557039).with('textdescid', 42594724).with('uniqueparentid', -1133067901)
  5841. .with('uitreeindex', 4)
  5842. .with('pretext', 'Event')
  5843. .with('classname', 'ImageView')
  5844. .with('resource-id', 'com.google.android.calendar:id/speed_dial_icon')
  5845. .with('content-desc', '').click
  5846.  
  5847. waitsecond(3)
  5848.  
  5849. RUIObject.new.with('objectid', -2070965006).with('selfid', -1061118606).with('textdescid', 1487763652).with('uniqueparentid', 1410610442).with('classresourceid', 395678146)
  5850. .with('uitreeindex', 7)
  5851. .with('classname', 'TextView')
  5852. .with('resource-id', 'com.google.android.calendar:id/start_date').click
  5853.  
  5854. waitsecond(3)
  5855.  
  5856. RUIObject.new.with('objectid', -241964648).with('selfid', -834019104).with('textdescid', 1286379225).with('uniqueparentid', 507709356).with('classresourceid', 1815484335)
  5857. .with('uitreeindex', 2)
  5858. .with('classname', 'android.view.View')
  5859. .with('content-desc', '0'+db("Calendar")[i]+' May 2017')
  5860. .with('text', 'db("Calendar")[1]').click
  5861.  
  5862. waitsecond(3)
  5863.  
  5864. RUIObject.new.with('objectid', 1424815732).with('selfid', -1318451484).with('textdescid', -1879811560).with('uniqueparentid', -2069065518).with('classresourceid', 1834539358)
  5865. .with('uitreeindex', 36)
  5866. .with('classname', 'Button')
  5867. .with('resource-id', 'android:id/button1')
  5868. .with('text', 'OK').click
  5869.  
  5870. waitsecond(3)
  5871.  
  5872.  
  5873.  
  5874. RUIObject.new.with('objectid', -1341455097).with('selfid', 870535911).with('textdescid', 1753902570).with('uniqueparentid', -1107284276)
  5875. .with('uitreeindex', 2)
  5876. .with('classname', 'Button')
  5877. .with('resource-id', 'com.google.android.calendar:id/save')
  5878. .with('text', 'SAVE').click
  5879.  
  5880. waitsecond(3)
  5881.  
  5882. RUIObject.new.with('objectid', -173740453).with('selfid', 220763148).with('textdescid', 356821123).with('uniqueparentid', -1214616113)
  5883. .with('uitreeindex', 0)
  5884. .with('classname', 'ImageButton')
  5885. .with('resource-id', 'com.google.android.calendar:id/floating_action_button')
  5886. .with('content-desc', 'Create new event and more').isExist
  5887.  
  5888. waitsecond(3)
  5889.  
  5890. $myTestResult = checkLastExistResult
  5891.  
  5892. logStopTest("PIM_5_1_6_1")
  5893.  
  5894.  
  5895. i += 1
  5896. end
  5897.  
  5898. pressBack
  5899. pressHome
  5900.  
  5901. waitsecond(2)
  5902. end
  5903.  
  5904. tcase.run(loopTime)
  5905.  
  5906. end
  5907.  
  5908. def self.PIM_5_1_6_2(loopTime)
  5909.  
  5910. tcase = TestCase.new("PIM_5_1_6_2")
  5911.  
  5912. tcase << TestAction.new(:Start_Log) do
  5913. logStartTest("PIM_5_1_6_2")
  5914.  
  5915. waitsecond(0)
  5916. end
  5917.  
  5918. tcase << TestAction.new(:Clock) do
  5919. gotoAppPixel("Clock")
  5920.  
  5921. waitsecond(2)
  5922. end
  5923.  
  5924. tcase << TestAction.new(:Click_AlarmTab) do
  5925. $ruiObj = RUIObject.new.with('objectid', 1398250823).with('selfid', 1155694879).with('textdescid', -2067701496).with('uniqueparentid', 1343446106)
  5926. .with('uitreeindex', 0)
  5927. .with('classname', 'TextView')
  5928. .with('text', 'ALARM')
  5929.  
  5930. $ruiObj.click
  5931.  
  5932. waitsecond(2)
  5933. end
  5934.  
  5935. tcase << TestAction.new(:Create_Alarm) do
  5936. $ruiObj = RUIObject.new.with('objectid', -675199108).with('selfid', 1376996000).with('textdescid', -42904882).with('uniqueparentid', -647720292)
  5937. .with('uitreeindex', 16)
  5938. .with('classname', 'ImageButton')
  5939. .with('resource-id', 'com.google.android.deskclock:id/fab')
  5940. .with('content-desc', 'Add alarm')
  5941.  
  5942. $ruiObj.click
  5943.  
  5944. waitsecond(2)
  5945. end
  5946.  
  5947. tcase << TestAction.new(:Click_OK) do
  5948. $ruiObj = RUIObject.new.with('objectid', 1329788078).with('selfid', -1318451484).with('textdescid', 1447865170).with('uniqueparentid', 1005760344).with('classresourceid', 1834539358)
  5949. .with('uitreeindex', 19)
  5950. .with('classname', 'Button')
  5951. .with('resource-id', 'android:id/button1')
  5952. .with('text', 'OK')
  5953.  
  5954. $ruiObj.click
  5955.  
  5956. waitsecond(2)
  5957. end
  5958.  
  5959. tcase << TestAction.new(:Check_Delete) do
  5960. $ruiObj = RUIObject.new.with('objectid', 30134492).with('selfid', 16045296).with('textdescid', -946628495).with('uniqueparentid', -579144048)
  5961. .with('uitreeindex', 23)
  5962. .with('classname', 'Button')
  5963. .with('resource-id', 'com.google.android.deskclock:id/delete')
  5964. .with('text', 'Delete')
  5965.  
  5966. $ruiObj.isExist
  5967.  
  5968. waitsecond(0)
  5969. end
  5970.  
  5971. tcase << TestAction.new(:Alarm_Off) do
  5972. $ruiObj = RUIObject.new.with('objectid', 1189886877).with('selfid', -1968976493).with('textdescid', 957014814).with('uniqueparentid', 1693277107)
  5973. .with('uitreeindex', 7)
  5974. .with('classname', 'Switch')
  5975. .with('resource-id', 'com.google.android.deskclock:id/onoff')
  5976. .with('text', 'ON')
  5977.  
  5978. $ruiObj.click
  5979.  
  5980. waitsecond(2)
  5981. end
  5982.  
  5983. tcase << TestAction.new(:End_Log) do
  5984. $myTestResult = checkLastExistResult
  5985.  
  5986. logStopTest("PIM_5_1_6_2")
  5987.  
  5988. waitsecond(0)
  5989. end
  5990.  
  5991. tcase << TestAction.new(:pressBack_11) do
  5992. pressBack
  5993.  
  5994. waitsecond(0)
  5995. end
  5996.  
  5997. tcase << TestAction.new(:pressHome_12) do
  5998. pressHome
  5999.  
  6000. waitsecond(0)
  6001. end
  6002.  
  6003. tcase.run(loopTime)
  6004.  
  6005. end
  6006.  
  6007. def self.PIM_5_1_6_3(loopTime)
  6008.  
  6009. tcase = TestCase.new("PIM_5_1_6_3")
  6010.  
  6011. tcase << TestAction.new(:scriptAction_1) do
  6012. i = 0
  6013.  
  6014. gotoAppPixel("Calendar")
  6015.  
  6016. waitsecond(3)
  6017.  
  6018. RUIObject.new.with('objectid', -947681391).with('selfid', -2132232079).with('textdescid', 1447189041).with('uniqueparentid', -648635418)
  6019. .with('uitreeindex', 1)
  6020. .with('classname', 'ImageButton')
  6021. .with('content-desc', 'Show Calendar List and Settings drawer').click
  6022.  
  6023. waitsecond(3)
  6024.  
  6025. RUIObject.new.with('objectid', 1940182694).with('selfid', -657992039).with('textdescid', -1445067654).with('uniqueparentid', 1633433281).with('classresourceid', -498129859)
  6026. .with('uitreeindex', 31)
  6027. .with('classname', 'TextView')
  6028. .with('resource-id', 'com.google.android.calendar:id/label')
  6029. .with('text', 'Month').click
  6030.  
  6031. waitsecond(3)
  6032.  
  6033. uitree.q("android.view.View@@0@").click
  6034.  
  6035. waitsecond(3)
  6036.  
  6037. while i < 5 do
  6038.  
  6039. logStartTest("PIM_5_1_6_3")
  6040.  
  6041. waitsecond(3)
  6042.  
  6043. if i > 0
  6044.  
  6045. uitree.q("android.view.View@@0@").click
  6046.  
  6047. waitsecond(3)
  6048.  
  6049. swipe_horizontal 50
  6050.  
  6051. uitree.q("android.view.View@@0@").click
  6052.  
  6053. waitsecond(3)
  6054.  
  6055. uitree.q("android.view.View@@0@").click
  6056.  
  6057. waitsecond(3)
  6058.  
  6059. uitree.q("android.view.View@@0@").click
  6060.  
  6061. waitsecond(3)
  6062.  
  6063. else
  6064.  
  6065. uitree.q("android.view.View@@0@").click
  6066.  
  6067. waitsecond(3)
  6068.  
  6069. uitree.q("android.view.View@@0@").click
  6070.  
  6071. waitsecond(3)
  6072.  
  6073. end
  6074.  
  6075. RUIObject.new.with('objectid', -1337459766).with('selfid', 1290820192).with('textdescid', -1829626039).with('uniqueparentid', -1060096944)
  6076. .with('uitreeindex', 1)
  6077. .with('classname', 'ImageButton')
  6078. .with('content-desc', 'More options').click
  6079.  
  6080. waitsecond(3)
  6081.  
  6082. RUIObject.new.with('objectid', 1212207054).with('selfid', -342341268).with('textdescid', 1759216995).with('uniqueparentid', -382238014).with('classresourceid', 490183159)
  6083. .with('uitreeindex', 0)
  6084. .with('classname', 'TextView')
  6085. .with('resource-id', 'android:id/title')
  6086. .with('text', 'Delete').click
  6087.  
  6088. waitsecond(3)
  6089.  
  6090. RUIObject.new.with('objectid', 1424815732).with('selfid', 982364851).with('textdescid', 502569513).with('uniqueparentid', -102833181).with('classresourceid', 1834539358)
  6091. .with('uitreeindex', 3)
  6092. .with('classname', 'Button')
  6093. .with('resource-id', 'android:id/button1')
  6094. .with('text', 'DELETE').isExist
  6095.  
  6096. waitsecond(3)
  6097.  
  6098. RUIObject.new.with('objectid', 1424815732).with('selfid', 982364851).with('textdescid', 502569513).with('uniqueparentid', -102833181).with('classresourceid', 1834539358)
  6099. .with('uitreeindex', 3)
  6100. .with('classname', 'Button')
  6101. .with('resource-id', 'android:id/button1')
  6102. .with('text', 'DELETE').click
  6103.  
  6104. waitsecond(3)
  6105.  
  6106. uitree.q("android.view.View@@0@").click
  6107.  
  6108. waitsecond(3)
  6109.  
  6110. $myTestResult = checkLastExistResult
  6111.  
  6112. logStopTest("PIM_5_1_6_3")
  6113.  
  6114.  
  6115. i += 1
  6116. end
  6117.  
  6118. pressBack
  6119. pressHome
  6120.  
  6121. waitsecond(2)
  6122. end
  6123.  
  6124. tcase.run(loopTime)
  6125.  
  6126. end
  6127.  
  6128. def self.PIM_5_1_6_4(loopTime)
  6129.  
  6130. tcase = TestCase.new("PIM_5_1_6_4")
  6131.  
  6132. tcase << TestAction.new(:Start_Log) do
  6133. logStartTest("PIM_5_1_6_4")
  6134.  
  6135. waitsecond(0)
  6136. end
  6137.  
  6138. tcase << TestAction.new(:Clock) do
  6139. gotoAppPixel("Clock")
  6140.  
  6141. waitsecond(2)
  6142. end
  6143.  
  6144. tcase << TestAction.new(:Click_AlarmTab) do
  6145. $ruiObj = RUIObject.new.with('objectid', 1398250823).with('selfid', 1155694879).with('textdescid', -2067701496).with('uniqueparentid', 1343446106)
  6146. .with('uitreeindex', 0)
  6147. .with('classname', 'TextView')
  6148. .with('text', 'ALARM')
  6149.  
  6150. $ruiObj.click
  6151.  
  6152. waitsecond(2)
  6153. end
  6154.  
  6155. tcase << TestAction.new(:Check_Alarm) do
  6156. $ruiObj = RUIObject.new.with('objectid', -1717301025).with('selfid', -1665247246).with('textdescid', -993494140).with('uniqueparentid', 2079641362)
  6157. .with('uitreeindex', 8)
  6158. .with('classname', 'CheckBox')
  6159. .with('resource-id', 'com.google.android.deskclock:id/repeat_onoff')
  6160. .with('text', 'Repeat')
  6161.  
  6162. $ruiObj.isNotExist
  6163. ifFailJumpTo(:Click_Delete)
  6164.  
  6165. waitsecond(0)
  6166. end
  6167.  
  6168. tcase << TestAction.new(:Expand_Alarm) do
  6169. $ruiObj = RUIObject.new.with('objectid', -553129188).with('selfid', 380069409).with('textdescid', 1044151343).with('uniqueparentid', 792291641)
  6170. .with('uitreeindex', 9)
  6171. .with('classname', 'ImageButton')
  6172. .with('resource-id', 'com.google.android.deskclock:id/arrow')
  6173. .with('content-desc', 'Expand alarm')
  6174.  
  6175. $ruiObj.click
  6176.  
  6177. waitsecond(2)
  6178. end
  6179.  
  6180. tcase << TestAction.new(:Click_Delete) do
  6181. $ruiObj = RUIObject.new.with('objectid', 30134492).with('selfid', 16045296).with('textdescid', -946628495).with('uniqueparentid', -53158187)
  6182. .with('uitreeindex', 13)
  6183. .with('classname', 'Button')
  6184. .with('resource-id', 'com.google.android.deskclock:id/delete')
  6185. .with('text', 'Delete')
  6186.  
  6187. $ruiObj.click
  6188.  
  6189. waitsecond(2)
  6190. end
  6191.  
  6192. tcase << TestAction.new(:Check_Delete_DNE) do
  6193. $ruiObj = RUIObject.new.with('objectid', 30134492).with('selfid', 16045296).with('textdescid', -946628495).with('uniqueparentid', -53158187)
  6194. .with('uitreeindex', 13)
  6195. .with('classname', 'Button')
  6196. .with('resource-id', 'com.google.android.deskclock:id/delete')
  6197. .with('text', 'Delete')
  6198.  
  6199. $ruiObj.isExist
  6200.  
  6201. waitsecond(0)
  6202. end
  6203.  
  6204. tcase << TestAction.new(:End_Log) do
  6205. $myTestResult = !checkLastExistResult
  6206.  
  6207. logStopTest("PIM_5_1_6_4")
  6208.  
  6209. waitsecond(0)
  6210. end
  6211.  
  6212. tcase << TestAction.new(:pressBack_10) do
  6213. pressBack
  6214.  
  6215. waitsecond(0)
  6216. end
  6217.  
  6218. tcase << TestAction.new(:pressHome_11) do
  6219. pressHome
  6220.  
  6221. waitsecond(0)
  6222. end
  6223.  
  6224. tcase.run(loopTime)
  6225.  
  6226. end
  6227.  
  6228. def self.mainLoop(loopTime)
  6229.  
  6230. WebSocketXServer.setAutoUpdate(false)
  6231.  
  6232. index = $mainResumeMainLoop
  6233. $mainResumeMainLoop = 0
  6234.  
  6235. writelog("mainLoop::#{index}::Resume") if index > 0
  6236.  
  6237. while index < loopTime
  6238.  
  6239. $curMainLoopNum = index
  6240.  
  6241. $actionParamInput = "none"
  6242. startTest 1
  6243.  
  6244. waitsecond(2)
  6245.  
  6246. $actionParamInput = "none"
  6247. Telephony_5_1_1_1 80
  6248.  
  6249. waitsecond(2)
  6250.  
  6251. $actionParamInput = "none"
  6252. Telephony_5_1_1_3 80
  6253.  
  6254. waitsecond(2)
  6255.  
  6256. $actionParamInput = "none"
  6257. Telephony_5_1_1_6_7 20
  6258.  
  6259. waitsecond(2)
  6260.  
  6261. $actionParamInput = "none"
  6262. Messaging_5_1_2_3 50
  6263.  
  6264. waitsecond(2)
  6265.  
  6266. $actionParamInput = "none"
  6267. Messaging_5_1_2_5 50
  6268.  
  6269. waitsecond(2)
  6270.  
  6271. $actionParamInput = "none"
  6272. Messaging_5_1_2_6 50
  6273.  
  6274. waitsecond(2)
  6275.  
  6276. $actionParamInput = "none"
  6277. Store_Front_5_1_5_1 20
  6278.  
  6279. waitsecond(2)
  6280.  
  6281. $actionParamInput = "none"
  6282. Store_Front_5_1_5_2 10
  6283.  
  6284. waitsecond(2)
  6285.  
  6286. $actionParamInput = "none"
  6287. Store_Front_5_1_5_3 10
  6288.  
  6289. waitsecond(2)
  6290.  
  6291. $actionParamInput = "none"
  6292. PIM_5_1_6_1 1
  6293.  
  6294. waitsecond(2)
  6295.  
  6296. $actionParamInput = "none"
  6297. PIM_5_1_6_2 1
  6298.  
  6299. waitsecond(2)
  6300.  
  6301. $actionParamInput = "none"
  6302. PIM_5_1_6_3 1
  6303.  
  6304. waitsecond(2)
  6305.  
  6306. $actionParamInput = "none"
  6307. PIM_5_1_6_4 1
  6308.  
  6309. waitsecond(2)
  6310.  
  6311. $actionParamInput = "none"
  6312. Multimedia_5_1_7_1 1
  6313.  
  6314. waitsecond(2)
  6315.  
  6316. $actionParamInput = "none"
  6317. Multimedia_5_1_7_2 1
  6318.  
  6319. waitsecond(2)
  6320.  
  6321. $actionParamInput = "none"
  6322. Multimedia_5_1_7_3 1
  6323.  
  6324. waitsecond(2)
  6325.  
  6326. $actionParamInput = "none"
  6327. Multimedia_5_1_7_4 20
  6328.  
  6329. waitsecond(2)
  6330.  
  6331. $actionParamInput = "none"
  6332. Multimedia_5_1_7_5 20
  6333.  
  6334. waitsecond(2)
  6335.  
  6336. $actionParamInput = "none"
  6337. Multimedia_5_1_7_6 20
  6338.  
  6339. waitsecond(2)
  6340.  
  6341. $actionParamInput = "none"
  6342. Multimedia_5_1_7_7 1
  6343.  
  6344. waitsecond(2)
  6345.  
  6346. $actionParamInput = "none"
  6347. Multimedia_5_1_7_8 1
  6348.  
  6349. waitsecond(2)
  6350.  
  6351. $actionParamInput = "none"
  6352. Multimedia_5_1_7_9 1
  6353.  
  6354. waitsecond(2)
  6355.  
  6356. $actionParamInput = "none"
  6357. Multimedia_5_1_7_10 10
  6358.  
  6359. waitsecond(2)
  6360.  
  6361. $actionParamInput = "none"
  6362. Multimedia_5_1_7_11 20
  6363.  
  6364. waitsecond(2)
  6365.  
  6366. $actionParamInput = "none"
  6367. Multimedia_5_1_7_12 50
  6368.  
  6369. waitsecond(2)
  6370.  
  6371. $actionParamInput = "none"
  6372. Multimedia_5_1_7_13 1
  6373.  
  6374. waitsecond(2)
  6375.  
  6376. $actionParamInput = "none"
  6377. MultiTasking_5_1_8_1 1
  6378.  
  6379. waitsecond(2)
  6380.  
  6381. $actionParamInput = "none"
  6382. MultiTasking_5_1_8_2 50
  6383.  
  6384. waitsecond(2)
  6385.  
  6386. $actionParamInput = "none"
  6387. MultiTasking_5_1_8_3 1
  6388.  
  6389. waitsecond(2)
  6390.  
  6391. $actionParamInput = "none"
  6392. MultiTasking_5_1_8_4 1
  6393.  
  6394. waitsecond(2)
  6395.  
  6396. $actionParamInput = "none"
  6397. MultiTasking_5_1_8_5 50
  6398.  
  6399. waitsecond(2)
  6400.  
  6401. $actionParamInput = "none"
  6402. MultiTasking_5_1_8_6 1
  6403.  
  6404. waitsecond(2)
  6405.  
  6406. $actionParamInput = "none"
  6407. MenuNav_5_1_9_1 1
  6408.  
  6409. waitsecond(2)
  6410.  
  6411. $actionParamInput = "none"
  6412. WiFi_5_1_10_1 20
  6413.  
  6414. waitsecond(2)
  6415.  
  6416. $actionParamInput = "none"
  6417. WiFi_5_1_10_2 20
  6418.  
  6419. waitsecond(2)
  6420.  
  6421. $actionParamInput = "none"
  6422. IPME_5_1_15_2 75
  6423.  
  6424. waitsecond(2)
  6425.  
  6426. $actionParamInput = "none"
  6427. IPME_5_1_15_4 75
  6428.  
  6429. waitsecond(2)
  6430.  
  6431. $actionParamInput = "none"
  6432. EMAIL_5_1_3_1 50
  6433.  
  6434. waitsecond(2)
  6435.  
  6436. $actionParamInput = "none"
  6437. EMAIL_5_1_3_2 50
  6438.  
  6439. waitsecond(2)
  6440.  
  6441. $actionParamInput = "none"
  6442. Browser_5_1_4_1 50
  6443.  
  6444. waitsecond(2)
  6445.  
  6446. $actionParamInput = "none"
  6447. Browser_5_1_4_2 50
  6448.  
  6449. waitsecond(2)
  6450.  
  6451. $actionParamInput = "none"
  6452. Browser_5_1_4_3 10
  6453.  
  6454. waitsecond(2)
  6455.  
  6456. $actionParamInput = "none"
  6457. NFC_5_1_11_1 20
  6458.  
  6459. waitsecond(2)
  6460.  
  6461.  
  6462. sendStatus("Done::mainLoop::Loop::#{index}")
  6463.  
  6464.  
  6465. writelog("Finish::Loop::#{$curMainLoopNum}")
  6466.  
  6467.  
  6468. saveLogFileToGist if $saveLogToGist
  6469.  
  6470. index += 1
  6471.  
  6472. end
  6473.  
  6474. $engineStatus = "Idle"
  6475. resetStatus
  6476. sendStatus("Finish::mainLoop::END")
  6477.  
  6478. end
  6479.  
  6480. def self.Store_Front_5_1_5_1(loopTime)
  6481.  
  6482. tcase = TestCase.new("Store_Front_5_1_5_1")
  6483.  
  6484. tcase << TestAction.new(:Start_Log) do
  6485. logStartTest("Store_Front_5_1_5_1")
  6486.  
  6487. waitsecond(0)
  6488. end
  6489.  
  6490. tcase << TestAction.new(:Play_Store) do
  6491. gotoAppPixel("Play Store")
  6492.  
  6493. waitsecond(2)
  6494. end
  6495.  
  6496. tcase << TestAction.new(:AppSearch_Check) do
  6497. $ruiObj = RUIObject.new.with('objectid', 1987043402).with('selfid', 88317888).with('textdescid', -133777698).with('uniqueparentid', 42455286)
  6498. .with('uitreeindex', 49)
  6499. .with('classname', 'ImageView')
  6500. .with('resource-id', 'com.android.vending:id/search_box_idle_text')
  6501. .with('content-desc', 'Search')
  6502.  
  6503. $ruiObj.isExist
  6504.  
  6505. waitsecond(2)
  6506. end
  6507.  
  6508. tcase << TestAction.new(:pressHome_6) do
  6509. pressHome
  6510.  
  6511. waitsecond(0)
  6512. end
  6513.  
  6514. tcase << TestAction.new(:End_Log) do
  6515. $myTestResult = checkLastExistResult
  6516.  
  6517. logStopTest("Store_Front_5_1_5_1")
  6518.  
  6519. waitsecond(0)
  6520. end
  6521.  
  6522. tcase.run(loopTime)
  6523.  
  6524. end
  6525.  
  6526. def self.Store_Front_5_1_5_2(loopTime)
  6527.  
  6528. tcase = TestCase.new("Store_Front_5_1_5_2")
  6529.  
  6530. tcase << TestAction.new(:Start_Log_5_1_5_2) do
  6531. logStartTest("Store_Front_5_1_5_2")
  6532.  
  6533. waitsecond(0)
  6534. end
  6535.  
  6536. tcase << TestAction.new(:Play_Store_1) do
  6537. gotoAppPixel('Play Store')
  6538.  
  6539. waitsecond(2)
  6540. end
  6541.  
  6542. tcase << TestAction.new(:Click_Search) do
  6543. $ruiObj = RUIObject.new.with('objectid', 1987043402).with('selfid', 88317888).with('textdescid', -133777698).with('uniqueparentid', 42455286)
  6544. .with('uitreeindex', 49)
  6545. .with('classname', 'ImageView')
  6546. .with('resource-id', 'com.android.vending:id/search_box_idle_text')
  6547. .with('content-desc', 'Search')
  6548.  
  6549. $ruiObj.click
  6550.  
  6551. waitsecond(2)
  6552. end
  6553.  
  6554. tcase << TestAction.new(:Input_Search) do
  6555. $ruiObj = RUIObject.new.with('objectid', 1660565057).with('selfid', 209465679).with('textdescid', -62090753).with('uniqueparentid', 1316281134)
  6556. .with('uitreeindex', 50)
  6557. .with('classname', 'EditText')
  6558. .with('resource-id', 'com.android.vending:id/search_box_text_input')
  6559.  
  6560. $ruiObj.inputtext('Clash Royale')
  6561.  
  6562. waitsecond(2)
  6563. end
  6564.  
  6565. tcase << TestAction.new(:pressEnter_3) do
  6566. pressEnter
  6567.  
  6568. waitsecond(2)
  6569. end
  6570.  
  6571. tcase << TestAction.new(:Click_Clash_Royale) do
  6572. $ruiObj = RUIObject.new.with('objectid', 1456557201).with('selfid', 911224488).with('textdescid', 1328898808).with('uniqueparentid', 944556771)
  6573. .with('uitreeindex', 1)
  6574. .with('classname', 'TextView')
  6575. .with('resource-id', 'com.android.vending:id/li_title')
  6576. .with('content-desc', 'App: Clash Royale')
  6577. .with('text', 'Clash Royale')
  6578.  
  6579. $ruiObj.click
  6580.  
  6581. waitsecond(2)
  6582. end
  6583.  
  6584. tcase << TestAction.new(:Click_Install) do
  6585. $ruiObj = RUIObject.new.with('objectid', 1227366429).with('selfid', 998476585).with('textdescid', 915934888).with('uniqueparentid', -349714783)
  6586. .with('uitreeindex', 11)
  6587. .with('classname', 'Button')
  6588. .with('text', 'INSTALL')
  6589.  
  6590. $ruiObj.click
  6591.  
  6592. waitsecond(2)
  6593. end
  6594.  
  6595. tcase << TestAction.new(:Confirm_Install) do
  6596. $ruiObj = RUIObject.new.with('objectid', 1379336962).with('selfid', -1471442810).with('textdescid', 2077853872).with('uniqueparentid', -1070189422)
  6597. .with('uitreeindex', 4)
  6598. .with('classname', 'Button')
  6599. .with('resource-id', 'android:id/button1')
  6600. .with('text', 'PROCEED')
  6601.  
  6602. $ruiObj.click
  6603.  
  6604. waitsecond(2)
  6605. end
  6606.  
  6607. tcase << TestAction.new(:Wait_Loop) do
  6608. count = 0
  6609. waitsecond(4)
  6610. $UninstallStatus = RUIObject.new.with('classname', 'Button').with('text', 'UNINSTALL')
  6611.  
  6612. while ($UninstallStatus.isNotExist) && count < 30 do
  6613. waitsecond(5)
  6614. count += 1
  6615. end
  6616.  
  6617.  
  6618.  
  6619.  
  6620.  
  6621. waitsecond(2)
  6622. end
  6623.  
  6624. tcase << TestAction.new(:Uninstall_Check) do
  6625. $ruiObj = RUIObject.new.with('objectid', 1227366429).with('selfid', 1103650544).with('textdescid', 926077825).with('uniqueparentid', 488799519)
  6626. .with('uitreeindex', 10)
  6627. .with('classname', 'Button')
  6628. .with('text', 'UNINSTALL')
  6629.  
  6630. $ruiObj.isExist
  6631.  
  6632. waitsecond(0)
  6633. end
  6634.  
  6635. tcase << TestAction.new(:End_Log_5_1_5_2) do
  6636. $myTestResult = checkLastExistResult
  6637.  
  6638. logStopTest("Store_Front_5_1_5_2")
  6639.  
  6640. waitsecond(2)
  6641. end
  6642.  
  6643. tcase << TestAction.new(:Start_Log_5_1_5_5) do
  6644. logStartTest("Store_Front_5_1_5_5")
  6645.  
  6646. waitsecond(2)
  6647. end
  6648.  
  6649. tcase << TestAction.new(:Click_Open) do
  6650. $ruiObj = RUIObject.new.with('objectid', 1227366429).with('selfid', 343626588).with('textdescid', -876702381).with('uniqueparentid', 488799519)
  6651. .with('uitreeindex', 14)
  6652. .with('classname', 'Button')
  6653. .with('text', 'OPEN')
  6654.  
  6655. $ruiObj.click
  6656.  
  6657. waitsecond(2)
  6658. end
  6659.  
  6660. tcase << TestAction.new(:wait_1) do
  6661. waitsecond(6)
  6662. end
  6663.  
  6664. tcase << TestAction.new(:App_Loop) do
  6665. count = 0
  6666. waitsecond(4)
  6667. $AppStatus = RUIObject.new.with('classname', 'Button').with('resource-id', 'android:id/button1').with('text', 'INSTALL')
  6668.  
  6669. while ($AppStatus.isNotExist) && count < 30 do
  6670. waitsecond(5)
  6671. count += 1
  6672. end
  6673.  
  6674.  
  6675. waitsecond(2)
  6676. end
  6677.  
  6678. tcase << TestAction.new(:Check_App) do
  6679. $ruiObj = RUIObject.new.with('classname', 'Button').with('resource-id', 'android:id/button1').with('text', 'INSTALL')
  6680.  
  6681. $ruiObj.isExist
  6682.  
  6683. waitsecond(0)
  6684. end
  6685.  
  6686. tcase << TestAction.new(:pressHome_10) do
  6687. pressHome
  6688.  
  6689. waitsecond(2)
  6690. end
  6691.  
  6692. tcase << TestAction.new(:End_Log_5_1_5_5) do
  6693. $myTestResult = checkLastExistResult
  6694.  
  6695. logStopTest("Store_Front_5_1_5_5")
  6696.  
  6697. waitsecond(2)
  6698. end
  6699.  
  6700. tcase << TestAction.new(:Start_Log_5_1_5_7) do
  6701. logStartTest("Store_Front_5_1_5_7")
  6702.  
  6703. waitsecond(2)
  6704. end
  6705.  
  6706. tcase << TestAction.new(:Play_Store_2) do
  6707. gotoAppPixel('Play Store')
  6708.  
  6709. waitsecond(2)
  6710. end
  6711.  
  6712. tcase << TestAction.new(:Click_Uninstall) do
  6713. $ruiObj = RUIObject.new.with('objectid', 82686867).with('selfid', -895718918).with('textdescid', 1814403659).with('uniqueparentid', 1781270761)
  6714. .with('uitreeindex', 9)
  6715. .with('classname', 'Button')
  6716. .with('resource-id', 'com.android.vending:id/uninstall_button')
  6717. .with('text', 'UNINSTALL')
  6718.  
  6719. $ruiObj.click
  6720.  
  6721. waitsecond(2)
  6722. end
  6723.  
  6724. tcase << TestAction.new(:Confirm_Uninstall) do
  6725. $ruiObj = RUIObject.new.with('objectid', 1379336962).with('selfid', -1318451484).with('textdescid', -1993773146).with('uniqueparentid', -1645912444)
  6726. .with('uitreeindex', 2)
  6727. .with('classname', 'Button')
  6728. .with('resource-id', 'android:id/button1')
  6729. .with('text', 'OK')
  6730.  
  6731. $ruiObj.click
  6732.  
  6733. waitsecond(2)
  6734. end
  6735.  
  6736. tcase << TestAction.new(:Check_Install) do
  6737. $ruiObj = RUIObject.new.with('objectid', -329901969).with('selfid', -652886121).with('textdescid', 992432790).with('uniqueparentid', -1937838608)
  6738. .with('uitreeindex', 9)
  6739. .with('classname', 'Button')
  6740. .with('resource-id', 'com.android.vending:id/buy_button')
  6741. .with('text', 'INSTALL')
  6742.  
  6743. $ruiObj.isExist
  6744.  
  6745. waitsecond(0)
  6746. end
  6747.  
  6748. tcase << TestAction.new(:End_Log_5_1_5_7) do
  6749. $myTestResult = checkLastExistResult
  6750.  
  6751. logStopTest("Store_Front_5_1_5_7")
  6752.  
  6753. waitsecond(0)
  6754. end
  6755.  
  6756. tcase << TestAction.new(:pressBack_14) do
  6757. pressBack
  6758.  
  6759. waitsecond(0)
  6760. end
  6761.  
  6762. tcase << TestAction.new(:pressBack_14_1) do
  6763. pressBack
  6764.  
  6765. waitsecond(0)
  6766. end
  6767.  
  6768. tcase << TestAction.new(:pressBack_14_1_1) do
  6769. pressBack
  6770.  
  6771. waitsecond(0)
  6772. end
  6773.  
  6774. tcase << TestAction.new(:pressHome_18) do
  6775. pressHome
  6776.  
  6777. waitsecond(0)
  6778. end
  6779.  
  6780. tcase.run(loopTime)
  6781.  
  6782. end
  6783.  
  6784. def self.Store_Front_5_1_5_3(loopTime)
  6785.  
  6786. tcase = TestCase.new("Store_Front_5_1_5_3")
  6787.  
  6788. tcase << TestAction.new(:Start_Log_5_1_5_3) do
  6789. logStartTest("Store_Front_5_1_5_3")
  6790.  
  6791. waitsecond(0)
  6792. end
  6793.  
  6794. tcase << TestAction.new(:Play_Store_1) do
  6795. gotoAppPixel('Play Store')
  6796.  
  6797. waitsecond(2)
  6798. end
  6799.  
  6800. tcase << TestAction.new(:Click_Search) do
  6801. $ruiObj = RUIObject.new.with('objectid', 1987043402).with('selfid', 88317888).with('textdescid', -133777698).with('uniqueparentid', 42455286)
  6802. .with('uitreeindex', 49)
  6803. .with('classname', 'ImageView')
  6804. .with('resource-id', 'com.android.vending:id/search_box_idle_text')
  6805. .with('content-desc', 'Search')
  6806.  
  6807. $ruiObj.click
  6808.  
  6809. waitsecond(2)
  6810. end
  6811.  
  6812. tcase << TestAction.new(:Input_Search) do
  6813. $ruiObj = RUIObject.new.with('objectid', 1660565057).with('selfid', 209465679).with('textdescid', -62090753).with('uniqueparentid', 1316281134)
  6814. .with('uitreeindex', 50)
  6815. .with('classname', 'EditText')
  6816. .with('resource-id', 'com.android.vending:id/search_box_text_input')
  6817.  
  6818. $ruiObj.inputtext('ColorNote')
  6819.  
  6820. waitsecond(2)
  6821. end
  6822.  
  6823. tcase << TestAction.new(:pressEnter_3) do
  6824. pressEnter
  6825.  
  6826. waitsecond(2)
  6827. end
  6828.  
  6829. tcase << TestAction.new(:Click_Install) do
  6830. $ruiObj = RUIObject.new.with('objectid', 1227366429).with('selfid', 998476585).with('textdescid', 915934888).with('uniqueparentid', -349714783)
  6831. .with('uitreeindex', 11)
  6832. .with('classname', 'Button')
  6833. .with('text', 'INSTALL')
  6834.  
  6835. $ruiObj.click
  6836.  
  6837. waitsecond(2)
  6838. end
  6839.  
  6840. tcase << TestAction.new(:Confirm_Install) do
  6841. $ruiObj = RUIObject.new.with('objectid', 1379336962).with('selfid', -1471442810).with('textdescid', 2077853872).with('uniqueparentid', -1070189422)
  6842. .with('uitreeindex', 4)
  6843. .with('classname', 'Button')
  6844. .with('resource-id', 'android:id/button1')
  6845. .with('text', 'PROCEED')
  6846.  
  6847. $ruiObj.click
  6848.  
  6849. waitsecond(2)
  6850. end
  6851.  
  6852. tcase << TestAction.new(:scriptAction_2) do
  6853. count = 0
  6854. waitsecond(4)
  6855. $UninstallStatus = RUIObject.new.with('classname', 'Button').with('text', 'UNINSTALL')
  6856.  
  6857. while ($UninstallStatus.isNotExist) && count < 30 do
  6858. waitsecond(5)
  6859. count += 1
  6860. end
  6861.  
  6862. waitsecond(2)
  6863. end
  6864.  
  6865. tcase << TestAction.new(:Check_Unisntall) do
  6866. $ruiObj = RUIObject.new.with('objectid', 1227366429).with('selfid', 1103650544).with('textdescid', 926077825).with('uniqueparentid', 488799519)
  6867. .with('uitreeindex', 10)
  6868. .with('classname', 'Button')
  6869. .with('text', 'UNINSTALL')
  6870.  
  6871. $ruiObj.isExist
  6872.  
  6873. waitsecond(2)
  6874. end
  6875.  
  6876. tcase << TestAction.new(:End_Log_5_1_5_3) do
  6877. $myTestResult = checkLastExistResult
  6878.  
  6879. logStopTest("Store_Front_5_1_5_3")
  6880.  
  6881. waitsecond(0)
  6882. end
  6883.  
  6884. tcase << TestAction.new(:Start_Log_5_1_5_6) do
  6885. logStartTest("Store_Front_5_1_5_6")
  6886.  
  6887. waitsecond(0)
  6888. end
  6889.  
  6890. tcase << TestAction.new(:Click_Open) do
  6891. $ruiObj = RUIObject.new.with('objectid', 1227366429).with('selfid', 343626588).with('textdescid', -876702381).with('uniqueparentid', 488799519)
  6892. .with('uitreeindex', 14)
  6893. .with('classname', 'Button')
  6894. .with('text', 'OPEN')
  6895.  
  6896. $ruiObj.click
  6897.  
  6898. waitsecond(2)
  6899. end
  6900.  
  6901. tcase << TestAction.new(:wait_1) do
  6902. waitsecond(4)
  6903. end
  6904.  
  6905. tcase << TestAction.new(:Check_ColorNote) do
  6906. $ruiObj = RUIObject.new.with('objectid', 39336378).with('selfid', -1815503323).with('textdescid', -1889368720).with('uniqueparentid', 2031216929).with('classresourceid', 71951079)
  6907. .with('uitreeindex', 1)
  6908. .with('classname', 'TextView')
  6909. .with('resource-id', 'com.android.packageinstaller:id/permission_message')
  6910. .with('text', 'Allow ColorNote to access photos media and files on your device')
  6911.  
  6912. $ruiObj.isExist
  6913.  
  6914. waitsecond(2)
  6915. end
  6916.  
  6917. tcase << TestAction.new(:pressHome_10) do
  6918. pressHome
  6919.  
  6920. waitsecond(2)
  6921. end
  6922.  
  6923. tcase << TestAction.new(:End_Log_5_1_5_6) do
  6924. $myTestResult = checkLastExistResult
  6925.  
  6926. logStopTest("Store_Front_5_1_5_6")
  6927.  
  6928. waitsecond(0)
  6929. end
  6930.  
  6931. tcase << TestAction.new(:Start_Log_5_1_5_8) do
  6932. logStartTest("Store_Front_5_1_5_8")
  6933.  
  6934. waitsecond(0)
  6935. end
  6936.  
  6937. tcase << TestAction.new(:Play_Store_2) do
  6938. gotoAppPixel('Play Store')
  6939.  
  6940. waitsecond(2)
  6941. end
  6942.  
  6943. tcase << TestAction.new(:Click_Uninstall) do
  6944. $ruiObj = RUIObject.new.with('objectid', 1227366429).with('selfid', 1103650544).with('textdescid', 926077825).with('uniqueparentid', 488799519)
  6945. .with('uitreeindex', 10)
  6946. .with('classname', 'Button')
  6947. .with('text', 'UNINSTALL')
  6948.  
  6949. $ruiObj.click
  6950.  
  6951. waitsecond(2)
  6952. end
  6953.  
  6954. tcase << TestAction.new(:Confirm_Uninstall) do
  6955. $ruiObj = RUIObject.new.with('objectid', 1379336962).with('selfid', -1318451484).with('textdescid', -1993773146).with('uniqueparentid', -1645912444)
  6956. .with('uitreeindex', 2)
  6957. .with('classname', 'Button')
  6958. .with('resource-id', 'android:id/button1')
  6959. .with('text', 'OK')
  6960.  
  6961. $ruiObj.click
  6962.  
  6963. waitsecond(2)
  6964. end
  6965.  
  6966. tcase << TestAction.new(:Check_Install) do
  6967. $ruiObj = RUIObject.new.with('objectid', 1227366429).with('selfid', 998476585).with('textdescid', 915934888).with('uniqueparentid', -349714783)
  6968. .with('uitreeindex', 11)
  6969. .with('classname', 'Button')
  6970. .with('text', 'INSTALL')
  6971.  
  6972. $ruiObj.isExist
  6973.  
  6974. waitsecond(2)
  6975. end
  6976.  
  6977. tcase << TestAction.new(:End_Log_5_1_5_8) do
  6978. $myTestResult = checkLastExistResult
  6979.  
  6980. logStopTest("Store_Front_5_1_5_8")
  6981.  
  6982. waitsecond(0)
  6983. end
  6984.  
  6985. tcase << TestAction.new(:pressBack_14) do
  6986. pressBack
  6987.  
  6988. waitsecond(0)
  6989. end
  6990.  
  6991. tcase << TestAction.new(:pressBack_14_1) do
  6992. pressBack
  6993.  
  6994. waitsecond(0)
  6995. end
  6996.  
  6997. tcase << TestAction.new(:pressBack_14_1_1) do
  6998. pressBack
  6999.  
  7000. waitsecond(0)
  7001. end
  7002.  
  7003. tcase << TestAction.new(:pressHome_18) do
  7004. pressHome
  7005.  
  7006. waitsecond(0)
  7007. end
  7008.  
  7009. tcase.run(loopTime)
  7010.  
  7011. end
  7012.  
  7013. def self.Telephony_5_1_1_1(loopTime)
  7014.  
  7015. tcase = TestCase.new("Telephony_5_1_1_1")
  7016.  
  7017. tcase << TestAction.new(:Start_Log) do
  7018. logStartTest("Telephony_5_1_1_1")
  7019.  
  7020. waitsecond(0)
  7021. end
  7022.  
  7023. tcase << TestAction.new(:Phone) do
  7024. gotoAppPixel("Phone")
  7025.  
  7026. waitsecond(2)
  7027. end
  7028.  
  7029. tcase << TestAction.new(:Check_Send) do
  7030. $ruiObj = RUIObject.new.with('objectid', 633567).with('selfid', -361167454).with('textdescid', -433420335).with('uniqueparentid', -308205312)
  7031. .with('uitreeindex', 27)
  7032. .with('classname', 'ImageButton')
  7033. .with('resource-id', 'com.android.dialer:id/dialpad_floating_action_button')
  7034. .with('content-desc', 'dial')
  7035.  
  7036. $ruiObj.isExist
  7037. ifFailJumpTo(:Click_Search_Contacts)
  7038.  
  7039. waitsecond(2)
  7040. end
  7041.  
  7042. tcase << TestAction.new(:pressBack_7) do
  7043. pressBack
  7044.  
  7045. waitsecond(2)
  7046. end
  7047.  
  7048. tcase << TestAction.new(:Click_Search_Contacts) do
  7049. $ruiObj = RUIObject.new.with('objectid', -704390840).with('selfid', -1478003981).with('textdescid', 1372423649).with('uniqueparentid', -369013492)
  7050. .with('uitreeindex', 10)
  7051. .with('classname', 'TextView')
  7052. .with('resource-id', 'com.google.android.dialer:id/search_box_start_search')
  7053. .with('text', 'Search contacts places')
  7054.  
  7055. $ruiObj.click
  7056.  
  7057. waitsecond(2)
  7058. end
  7059.  
  7060. tcase << TestAction.new(:Input_Contact) do
  7061. $ruiObj = RUIObject.new.with('objectid', 497288161).with('selfid', 1558211317).with('textdescid', -1763936161).with('uniqueparentid', 1665093136)
  7062. .with('uitreeindex', 4)
  7063. .with('classname', 'EditText')
  7064. .with('resource-id', 'com.google.android.dialer:id/search_view')
  7065.  
  7066. $ruiObj.inputtext('A01 A01')
  7067.  
  7068. waitsecond(2)
  7069. end
  7070.  
  7071. tcase << TestAction.new(:Call_Contact) do
  7072. $ruiObj = RUIObject.new.with('objectid', -322876442).with('selfid', -319629281).with('textdescid', 1885068402).with('uniqueparentid', -976474824).with('classresourceid', -861593581)
  7073. .with('uitreeindex', 1)
  7074. .with('classname', 'TextView')
  7075. .with('resource-id', 'com.google.android.dialer:id/cliv_name_textview')
  7076. .with('content-desc', 'A01 A01')
  7077. .with('text', 'A01 A01')
  7078.  
  7079. $ruiObj.click
  7080.  
  7081. waitsecond(8)
  7082. end
  7083.  
  7084. tcase << TestAction.new(:Send_CMD_Answer) do
  7085. sendBTCmd("answerCall")
  7086.  
  7087. waitsecond(2)
  7088. end
  7089.  
  7090. tcase << TestAction.new(:Check_End_Button) do
  7091. $ruiObj = RUIObject.new.with('objectid', 2131066002).with('selfid', 279498384).with('textdescid', -733664719).with('uniqueparentid', -837339317)
  7092. .with('uitreeindex', 11)
  7093. .with('classname', 'ImageButton')
  7094. .with('resource-id', 'com.google.android.dialer:id/incall_end_call')
  7095. .with('content-desc', 'End call')
  7096.  
  7097. $ruiObj.isExist
  7098.  
  7099. waitsecond(2)
  7100. end
  7101.  
  7102. tcase << TestAction.new(:Click_End_Button) do
  7103. $ruiObj = RUIObject.new.with('objectid', 2131066002).with('selfid', 279498384).with('textdescid', -733664719).with('uniqueparentid', 1725432907)
  7104. .with('uitreeindex', 11)
  7105. .with('classname', 'ImageButton')
  7106. .with('resource-id', 'com.google.android.dialer:id/incall_end_call')
  7107. .with('content-desc', 'End call')
  7108.  
  7109. $ruiObj.click
  7110.  
  7111. waitsecond(2)
  7112. end
  7113.  
  7114. tcase << TestAction.new(:End_Log) do
  7115. $myTestResult = checkLastExistResult
  7116.  
  7117. logStopTest("Telephony_5_1_1_1")
  7118.  
  7119. waitsecond(0)
  7120. end
  7121.  
  7122. tcase << TestAction.new(:pressBack_2) do
  7123. pressBack
  7124.  
  7125. waitsecond(2)
  7126. end
  7127.  
  7128. tcase << TestAction.new(:pressBack_2_1) do
  7129. pressBack
  7130.  
  7131. waitsecond(2)
  7132. end
  7133.  
  7134. tcase.run(loopTime)
  7135.  
  7136. end
  7137.  
  7138. def self.Telephony_5_1_1_3(loopTime)
  7139.  
  7140. tcase = TestCase.new("Telephony_5_1_1_3")
  7141.  
  7142. tcase << TestAction.new(:Start_Log) do
  7143. logStartTest("Telephony_5_1_1_3")
  7144.  
  7145. waitsecond(2)
  7146. end
  7147.  
  7148. tcase << TestAction.new(:Phone) do
  7149. gotoAppPixel("Phone")
  7150.  
  7151. waitsecond(2)
  7152. end
  7153.  
  7154. tcase << TestAction.new(:Check_Send) do
  7155. $ruiObj = RUIObject.new.with('objectid', 1989851740).with('selfid', -258431583).with('textdescid', -443636210).with('uniqueparentid', -1480900557)
  7156. .with('uitreeindex', 10)
  7157. .with('classname', 'ImageButton')
  7158. .with('resource-id', 'com.google.android.dialer:id/floating_action_button')
  7159. .with('content-desc', 'key pad')
  7160.  
  7161. $ruiObj.isExist
  7162.  
  7163. waitsecond(2)
  7164. end
  7165.  
  7166. tcase << TestAction.new(:ImageView_Icon_6) do
  7167. $ruiObj = RUIObject.new.with('objectid', -234370495).with('selfid', 736604880).with('textdescid', -145176664).with('uniqueparentid', -790378223)
  7168. .with('uitreeindex', 1)
  7169. .with('classname', 'ImageView')
  7170. .with('resource-id', 'com.google.android.dialer:id/icon')
  7171. .with('content-desc', 'Call History tab.')
  7172.  
  7173. $ruiObj.click
  7174.  
  7175. waitsecond(2)
  7176. end
  7177.  
  7178. tcase << TestAction.new(:Call_Contact) do
  7179. $ruiObj = RUIObject.new.with('objectid', 403814180).with('selfid', 437031326).with('textdescid', 1821768510).with('uniqueparentid', -321253152)
  7180. .with('uitreeindex', 10)
  7181. .with('classname', 'ImageView')
  7182. .with('resource-id', 'com.google.android.dialer:id/primary_action_button')
  7183. .with('content-desc', 'Call A01 A01')
  7184.  
  7185. $ruiObj.click
  7186.  
  7187. waitsecond(10)
  7188. end
  7189.  
  7190. tcase << TestAction.new(:Send_CMD_Answer) do
  7191. sendBTCmd("answerCall")
  7192.  
  7193. waitsecond(5)
  7194. end
  7195.  
  7196. tcase << TestAction.new(:Check_End_Button) do
  7197. $ruiObj = RUIObject.new.with('objectid', 2131066002).with('selfid', 279498384).with('textdescid', -733664719).with('uniqueparentid', -476405821)
  7198. .with('uitreeindex', 11)
  7199. .with('classname', 'ImageButton')
  7200. .with('resource-id', 'com.google.android.dialer:id/incall_end_call')
  7201. .with('content-desc', 'End call')
  7202.  
  7203. $ruiObj.isExist
  7204.  
  7205. waitsecond(2)
  7206. end
  7207.  
  7208. tcase << TestAction.new(:End_Call) do
  7209. $ruiObj = RUIObject.new.with('objectid', 2131066002).with('selfid', 279498384).with('textdescid', -733664719).with('uniqueparentid', 2077889873)
  7210. .with('uitreeindex', 11)
  7211. .with('classname', 'ImageButton')
  7212. .with('resource-id', 'com.google.android.dialer:id/incall_end_call')
  7213. .with('content-desc', 'End call')
  7214.  
  7215. $ruiObj.click
  7216.  
  7217. waitsecond(2)
  7218. end
  7219.  
  7220. tcase << TestAction.new(:End_Log) do
  7221. $myTestResult = checkLastExistResult
  7222.  
  7223. logStopTest("Telephony_5_1_1_3")
  7224.  
  7225. waitsecond(2)
  7226. end
  7227.  
  7228. tcase << TestAction.new(:pressBack_6) do
  7229. pressBack
  7230.  
  7231. waitsecond(2)
  7232. end
  7233.  
  7234. tcase << TestAction.new(:pressBack_6_1) do
  7235. pressBack
  7236.  
  7237. waitsecond(2)
  7238. end
  7239.  
  7240. tcase.run(loopTime)
  7241.  
  7242. end
  7243.  
  7244. def self.Telephony_5_1_1_6_7(loopTime)
  7245.  
  7246. tcase = TestCase.new("Telephony_5_1_1_6_7")
  7247.  
  7248. tcase << TestAction.new(:scriptAction_2) do
  7249. logStartTest("Telephony_5_1_1_7")
  7250.  
  7251. waitsecond(0)
  7252. end
  7253.  
  7254. tcase << TestAction.new(:scriptAction_1) do
  7255. gotoAppPixel("Phone")
  7256.  
  7257. waitsecond(2)
  7258. end
  7259.  
  7260. tcase << TestAction.new(:ImageView_Icon_29) do
  7261. $ruiObj = RUIObject.new.with('objectid', 1729076897).with('selfid', -1616608746).with('textdescid', -1107521081).with('uniqueparentid', -1902824159)
  7262. .with('uitreeindex', 2)
  7263. .with('classname', 'ImageView')
  7264. .with('resource-id', 'com.android.dialer:id/icon')
  7265. .with('content-desc', 'Contacts tab.')
  7266.  
  7267. $ruiObj.click
  7268.  
  7269. waitsecond(2)
  7270. end
  7271.  
  7272. tcase << TestAction.new(:ImageButton_FloatingActionButton_41) do
  7273. $ruiObj = RUIObject.new.with('objectid', -563620762).with('selfid', 586481042).with('textdescid', 1205026070).with('uniqueparentid', -529133278)
  7274. .with('uitreeindex', 28)
  7275. .with('classname', 'ImageButton')
  7276. .with('resource-id', 'com.android.dialer:id/floating_action_button')
  7277. .with('content-desc', 'Create new contact')
  7278.  
  7279. $ruiObj.click
  7280.  
  7281. waitsecond(2)
  7282. end
  7283.  
  7284. tcase << TestAction.new(:EditText_6) do
  7285. $ruiObj = RUIObject.new.with('objectid', 819811840).with('selfid', 1666676343).with('textdescid', -355636704).with('uniqueparentid', 1682676351).with('classresourceid', 1666676343)
  7286. .with('uitreeindex', 12)
  7287. .with('pretext', 'lgeqcttest4gmailcom?0')
  7288. .with('classname', 'EditText')
  7289.  
  7290. $ruiObj.inputtext('tn tn')
  7291.  
  7292. waitsecond(2)
  7293. end
  7294.  
  7295. tcase << TestAction.new(:ImageView_KindIcon_18) do
  7296. $ruiObj = RUIObject.new.with('objectid', 1187803482).with('selfid', 565066917).with('textdescid', -854093455).with('uniqueparentid', 833678705).with('classresourceid', -301662486)
  7297. .with('uitreeindex', 11)
  7298. .with('classname', 'ImageView')
  7299. .with('resource-id', 'com.google.android.contacts:id/kind_icon')
  7300. .with('content-desc', 'Name')
  7301.  
  7302. $ruiObj.click
  7303.  
  7304. waitsecond(2)
  7305. end
  7306.  
  7307. tcase << TestAction.new(:EditText_20) do
  7308. $ruiObj = RUIObject.new.with('objectid', 819811840).with('selfid', 1666676343).with('textdescid', -355636704).with('uniqueparentid', 301757543).with('classresourceid', 1666676343)
  7309. .with('uitreeindex', 16)
  7310. .with('pretext', 'lgeqcttest4gmailcom?2')
  7311. .with('classname', 'EditText')
  7312.  
  7313. $ruiObj.inputtext('0000000000')
  7314.  
  7315. waitsecond(2)
  7316. end
  7317.  
  7318. tcase << TestAction.new(:Button_EditorMenuSaveButton_22) do
  7319. $ruiObj = RUIObject.new.with('objectid', -1708784447).with('selfid', -1130240991).with('textdescid', -1687078364).with('uniqueparentid', 2006790125)
  7320. .with('uitreeindex', 2)
  7321. .with('classname', 'Button')
  7322. .with('resource-id', 'com.google.android.contacts:id/editor_menu_save_button')
  7323. .with('text', 'SAVE')
  7324.  
  7325. $ruiObj.isExist
  7326.  
  7327. waitsecond(0)
  7328. end
  7329.  
  7330. tcase << TestAction.new(:Button_EditorMenuSaveButton_22_1) do
  7331. $ruiObj = RUIObject.new.with('objectid', -1708784447).with('selfid', -1130240991).with('textdescid', -1687078364).with('uniqueparentid', 2006790125)
  7332. .with('uitreeindex', 2)
  7333. .with('classname', 'Button')
  7334. .with('resource-id', 'com.google.android.contacts:id/editor_menu_save_button')
  7335. .with('text', 'SAVE')
  7336.  
  7337. $ruiObj.click
  7338.  
  7339. waitsecond(2)
  7340. end
  7341.  
  7342. tcase << TestAction.new(:scriptAction_4) do
  7343. logStopTest("Telephony_5_1_1_7")
  7344.  
  7345. waitsecond(0)
  7346. end
  7347.  
  7348. tcase << TestAction.new(:scriptAction_2_1) do
  7349. logStartTest("Telephony_5_1_1_6")
  7350.  
  7351. waitsecond(0)
  7352. end
  7353.  
  7354. tcase << TestAction.new(:scriptAction_12) do
  7355. gotoAppPixel("Phone")
  7356.  
  7357. waitsecond(2)
  7358. end
  7359.  
  7360. tcase << TestAction.new(:ImageView_Icon_3) do
  7361. $ruiObj = RUIObject.new.with('objectid', 1729076897).with('selfid', -1616608746).with('textdescid', -1107521081).with('uniqueparentid', -1902824159)
  7362. .with('uitreeindex', 2)
  7363. .with('classname', 'ImageView')
  7364. .with('resource-id', 'com.android.dialer:id/icon')
  7365. .with('content-desc', 'Contacts tab.')
  7366.  
  7367. $ruiObj.click
  7368.  
  7369. waitsecond(2)
  7370. end
  7371.  
  7372. tcase << TestAction.new(:TextView_SearchBoxStartSearch_5) do
  7373. $ruiObj = RUIObject.new.with('objectid', 923652289).with('selfid', -1151038352).with('textdescid', 1007284052).with('uniqueparentid', 183054914)
  7374. .with('uitreeindex', 30)
  7375. .with('classname', 'TextView')
  7376. .with('resource-id', 'com.android.dialer:id/search_box_start_search')
  7377. .with('text', 'Search contacts')
  7378.  
  7379. $ruiObj.click
  7380.  
  7381. waitsecond(2)
  7382. end
  7383.  
  7384. tcase << TestAction.new(:EditText_SearchView_9) do
  7385. $ruiObj = RUIObject.new.with('objectid', 633166156).with('selfid', -1518126622).with('textdescid', -1846685612).with('uniqueparentid', 1793823206)
  7386. .with('uitreeindex', 1)
  7387. .with('classname', 'EditText')
  7388. .with('resource-id', 'com.android.dialer:id/search_view')
  7389.  
  7390. $ruiObj.inputtext('tn tn')
  7391.  
  7392. waitsecond(2)
  7393. end
  7394.  
  7395. tcase << TestAction.new(:clickXY_117_441_17) do
  7396. click(117,441)
  7397.  
  7398. waitsecond(2)
  7399. end
  7400.  
  7401. tcase << TestAction.new(:ImageButton_More_19) do
  7402. $ruiObj = RUIObject.new.with('objectid', 1906984818).with('selfid', 1290820192).with('textdescid', 1695157921).with('uniqueparentid', 1370851987)
  7403. .with('uitreeindex', 6)
  7404. .with('classname', 'ImageButton')
  7405. .with('content-desc', 'More options')
  7406.  
  7407. $ruiObj.click
  7408.  
  7409. waitsecond(2)
  7410. end
  7411.  
  7412. tcase << TestAction.new(:TextView_Title_21) do
  7413. $ruiObj = RUIObject.new.with('objectid', -374621661).with('selfid', -342341268).with('textdescid', -931837256).with('uniqueparentid', 749545879).with('classresourceid', 490183159)
  7414. .with('uitreeindex', 1)
  7415. .with('classname', 'TextView')
  7416. .with('resource-id', 'android:id/title')
  7417. .with('text', 'Delete')
  7418.  
  7419. $ruiObj.click
  7420.  
  7421. waitsecond(2)
  7422. end
  7423.  
  7424. tcase << TestAction.new(:Button_Button1_23) do
  7425. $ruiObj = RUIObject.new.with('objectid', 1890289855).with('selfid', 982364851).with('textdescid', 319664500).with('uniqueparentid', 864646072).with('classresourceid', 1834539358)
  7426. .with('uitreeindex', 3)
  7427. .with('classname', 'Button')
  7428. .with('resource-id', 'android:id/button1')
  7429. .with('text', 'DELETE')
  7430.  
  7431. $ruiObj.isExist
  7432.  
  7433. waitsecond(2)
  7434. end
  7435.  
  7436. tcase << TestAction.new(:Button_Button1_23_1) do
  7437. $ruiObj = RUIObject.new.with('objectid', 1890289855).with('selfid', 982364851).with('textdescid', 319664500).with('uniqueparentid', 864646072).with('classresourceid', 1834539358)
  7438. .with('uitreeindex', 3)
  7439. .with('classname', 'Button')
  7440. .with('resource-id', 'android:id/button1')
  7441. .with('text', 'DELETE')
  7442.  
  7443. $ruiObj.click
  7444.  
  7445. waitsecond(2)
  7446. end
  7447.  
  7448. tcase << TestAction.new(:scriptAction_4_1) do
  7449. logStopTest("Telephony_5_1_1_6")
  7450.  
  7451. waitsecond(0)
  7452. end
  7453.  
  7454. tcase.run(loopTime)
  7455.  
  7456. end
  7457.  
  7458. def self.WiFi_5_1_10_1(loopTime)
  7459.  
  7460. tcase = TestCase.new("WiFi_5_1_10_1")
  7461.  
  7462. tcase << TestAction.new(:logstart) do
  7463. logStartTest("05_01_10_01_WiFi")
  7464.  
  7465. waitsecond(0)
  7466. end
  7467.  
  7468. tcase << TestAction.new(:swipenotification) do
  7469. swipe(720,18,720,1881,100)
  7470.  
  7471. waitsecond(2)
  7472. end
  7473.  
  7474. tcase << TestAction.new(:clickwifi) do
  7475. $ruiObj = RUIObject.new.with('objectid', 507839883).with('selfid', -359220911).with('textdescid', 672961582).with('uniqueparentid', 848298487)
  7476. .with('classname', 'Switch')
  7477. .with('content-desc', 'Wi-Fi,')
  7478. .with('text', 'Off')
  7479.  
  7480. $ruiObj.longClick
  7481.  
  7482. waitsecond(2)
  7483. end
  7484.  
  7485. tcase << TestAction.new(:ifwifiison_turnoffwifi) do
  7486. $WiFiOn= RUIObject.new.with('objectid', -312510337).with('selfid', 1955659484).with('textdescid', -940514592).with('uniqueparentid', 2062568066)
  7487. .with('uitreeindex', 3)
  7488. .with('classname', 'TextView')
  7489. .with('resource-id', 'com.android.settings:id/switch_text')
  7490. .with('text', 'On')
  7491.  
  7492. if $WiFiOn.isExist
  7493. RUIObject.new.with('objectid', 1169510804).with('selfid', -1921366703).with('textdescid', -522574443).with('uniqueparentid', 2062568066)
  7494. .with('uitreeindex', 4)
  7495. .with('classname', 'Switch')
  7496. .with('resource-id', 'com.android.settings:id/switch_widget')
  7497. .with('text', 'ON').click
  7498. end
  7499.  
  7500. waitsecond(2)
  7501. end
  7502.  
  7503. tcase << TestAction.new(:TurnOnWifi) do
  7504. $ruiObj = RUIObject.new.with('objectid', 1169510804).with('selfid', -1921366703).with('textdescid', -522574443).with('uniqueparentid', 2062568066)
  7505. .with('uitreeindex', 4)
  7506. .with('classname', 'Switch')
  7507. .with('resource-id', 'com.android.settings:id/switch_widget')
  7508. .with('text', 'ON')
  7509.  
  7510. $ruiObj.click
  7511.  
  7512. waitsecond(2)
  7513. end
  7514.  
  7515. tcase << TestAction.new(:wait10second_4) do
  7516. waitsecond(10)
  7517. end
  7518.  
  7519. tcase << TestAction.new(:ON_Exist) do
  7520. $ruiObj = RUIObject.new.with('objectid', -312510337).with('selfid', 1955659484).with('textdescid', -940514592).with('uniqueparentid', 2062568066)
  7521. .with('uitreeindex', 2)
  7522. .with('classname', 'TextView')
  7523. .with('resource-id', 'com.android.settings:id/switch_text')
  7524. .with('text', 'On')
  7525.  
  7526. $ruiObj.isExist
  7527.  
  7528. waitsecond(0)
  7529. end
  7530.  
  7531. tcase << TestAction.new(:TurnoffWifi) do
  7532. $ruiObj = RUIObject.new.with('objectid', 1169510804).with('selfid', -1921366703).with('textdescid', -522574443).with('uniqueparentid', 2062568066)
  7533. .with('uitreeindex', 3)
  7534. .with('classname', 'Switch')
  7535. .with('resource-id', 'com.android.settings:id/switch_widget')
  7536. .with('text', 'ON')
  7537.  
  7538. $ruiObj.click
  7539.  
  7540. waitsecond(2)
  7541. end
  7542.  
  7543. tcase << TestAction.new(:stoplog) do
  7544. $myTestResult = checkLastExistResult
  7545.  
  7546. if $myTestResult == false
  7547. $myFailReason = "WiFi cannot turn ON"
  7548. end
  7549. logStopTest("05_01_10_01_WiFi")
  7550.  
  7551.  
  7552. waitsecond(0)
  7553. end
  7554.  
  7555. tcase << TestAction.new(:pressBack_8) do
  7556. pressBack
  7557.  
  7558. waitsecond(0)
  7559. end
  7560.  
  7561. tcase << TestAction.new(:pressBack_9) do
  7562. pressBack
  7563.  
  7564. waitsecond(0)
  7565. end
  7566.  
  7567. tcase << TestAction.new(:pressBack_10) do
  7568. pressBack
  7569.  
  7570. waitsecond(0)
  7571. end
  7572.  
  7573. tcase << TestAction.new(:pressBack_11) do
  7574. pressBack
  7575.  
  7576. waitsecond(0)
  7577. end
  7578.  
  7579. tcase << TestAction.new(:pressHome_12) do
  7580. pressHome
  7581.  
  7582. waitsecond(0)
  7583. end
  7584.  
  7585. tcase.run(loopTime)
  7586.  
  7587. end
  7588.  
  7589. def self.WiFi_5_1_10_2(loopTime)
  7590.  
  7591. tcase = TestCase.new("WiFi_5_1_10_2")
  7592.  
  7593. tcase << TestAction.new(:logstart) do
  7594. logStartTest("05_01_10_02_WiFi")
  7595.  
  7596. waitsecond(0)
  7597. end
  7598.  
  7599. tcase << TestAction.new(:swipenotification_1) do
  7600. swipe(720,18,720,1881,100)
  7601.  
  7602. waitsecond(2)
  7603. end
  7604.  
  7605. tcase << TestAction.new(:clickwifi) do
  7606. $ruiObj = RUIObject.new.with('objectid', 507839883).with('selfid', -427229763).with('textdescid', 991539940).with('uniqueparentid', -1358108677)
  7607. .with('classname', 'Switch')
  7608. .with('content-desc', 'Wi-Fi,')
  7609. .with('text', 'On')
  7610.  
  7611. $ruiObj.longClick
  7612.  
  7613. waitsecond(2)
  7614. end
  7615.  
  7616. tcase << TestAction.new(:ifwifiison_turnoffwifi) do
  7617. $WiFiOn= RUIObject.new.with('objectid', -312510337).with('selfid', 1955659484).with('textdescid', -940514592).with('uniqueparentid', 2062568066)
  7618. .with('uitreeindex', 3)
  7619. .with('classname', 'TextView')
  7620. .with('resource-id', 'com.android.settings:id/switch_text')
  7621. .with('text', 'On')
  7622.  
  7623. if $WiFiOn.isExist
  7624. RUIObject.new.with('objectid', 1169510804).with('selfid', -1921366703).with('textdescid', -522574443).with('uniqueparentid', 2062568066)
  7625. .with('uitreeindex', 4)
  7626. .with('classname', 'Switch')
  7627. .with('resource-id', 'com.android.settings:id/switch_widget')
  7628. .with('text', 'ON').click
  7629. end
  7630.  
  7631. waitsecond(2)
  7632. end
  7633.  
  7634. tcase << TestAction.new(:TurnOnWifi) do
  7635. $ruiObj = RUIObject.new.with('objectid', 1169510804).with('selfid', -1921366703).with('textdescid', -522574443).with('uniqueparentid', 2062568066)
  7636. .with('uitreeindex', 4)
  7637. .with('classname', 'Switch')
  7638. .with('resource-id', 'com.android.settings:id/switch_widget')
  7639. .with('text', 'ON')
  7640.  
  7641. $ruiObj.click
  7642.  
  7643. waitsecond(2)
  7644. end
  7645.  
  7646. tcase << TestAction.new(:wait5second_4) do
  7647. waitsecond(5)
  7648. end
  7649.  
  7650. tcase << TestAction.new(:clickMTBFATT24GHZ) do
  7651. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -2006843326).with('textdescid', 445555028).with('uniqueparentid', -1447642125)
  7652. .with('uitreeindex', 21)
  7653. .with('classname', 'TextView')
  7654. .with('resource-id', 'android:id/title')
  7655. .with('text', 'MTBFATT24Ghz')
  7656.  
  7657. $ruiObj.click
  7658.  
  7659. waitsecond(2)
  7660. end
  7661.  
  7662. tcase << TestAction.new(:putpassword) do
  7663. $ruiObj = RUIObject.new.with('objectid', 780695774).with('selfid', 8195995).with('textdescid', -1568234750).with('uniqueparentid', -1143128344).with('classresourceid', 1413676103)
  7664. .with('uitreeindex', 2)
  7665. .with('classname', 'EditText')
  7666. .with('resource-id', 'com.android.settings:id/password')
  7667.  
  7668. $ruiObj.inputtext('12abcdef34')
  7669.  
  7670. waitsecond(2)
  7671. end
  7672.  
  7673. tcase << TestAction.new(:pressEnter_13) do
  7674. pressEnter
  7675.  
  7676. waitsecond(2)
  7677. end
  7678.  
  7679. tcase << TestAction.new(:wait5second_15) do
  7680. waitsecond(5)
  7681. end
  7682.  
  7683. tcase << TestAction.new(:ifwifionexist) do
  7684. $ruiObj = RUIObject.new.with('objectid', -312510337).with('selfid', 1955659484).with('textdescid', -940514592).with('uniqueparentid', 2062568066)
  7685. .with('uitreeindex', 1)
  7686. .with('classname', 'TextView')
  7687. .with('resource-id', 'com.android.settings:id/switch_text')
  7688. .with('text', 'On')
  7689.  
  7690. $ruiObj.isExist
  7691.  
  7692. waitsecond(2)
  7693. end
  7694.  
  7695. tcase << TestAction.new(:gotowifisetting) do
  7696. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -2006843326).with('textdescid', 445555028).with('uniqueparentid', 589819388)
  7697. .with('uitreeindex', 6)
  7698. .with('classname', 'TextView')
  7699. .with('resource-id', 'android:id/title')
  7700. .with('text', 'MTBFATT24Ghz')
  7701.  
  7702. $ruiObj.click
  7703.  
  7704. waitsecond(2)
  7705. end
  7706.  
  7707. tcase << TestAction.new(:disconnectwifi) do
  7708. $ruiObj = RUIObject.new.with('objectid', 699987448).with('selfid', 2030417820).with('textdescid', 281870763).with('uniqueparentid', -1500304950)
  7709. .with('uitreeindex', 4)
  7710. .with('classname', 'Button')
  7711. .with('resource-id', 'com.android.settings:id/left_button')
  7712. .with('text', 'FORGET')
  7713.  
  7714. $ruiObj.click
  7715.  
  7716. waitsecond(2)
  7717. end
  7718.  
  7719. tcase << TestAction.new(:stoplog) do
  7720. $myTestResult = checkLastExistResult
  7721.  
  7722. if $myTestResult == false
  7723. $myFailReason == "WiFi cannot connected"
  7724. end
  7725. logStopTest("05_01_10_02_WiFi")
  7726.  
  7727.  
  7728. waitsecond(0)
  7729. end
  7730.  
  7731. tcase << TestAction.new(:pressBack_8) do
  7732. pressBack
  7733.  
  7734. waitsecond(0)
  7735. end
  7736.  
  7737. tcase << TestAction.new(:pressBack_9) do
  7738. pressBack
  7739.  
  7740. waitsecond(0)
  7741. end
  7742.  
  7743. tcase << TestAction.new(:pressBack_10) do
  7744. pressBack
  7745.  
  7746. waitsecond(0)
  7747. end
  7748.  
  7749. tcase << TestAction.new(:pressBack_11) do
  7750. pressBack
  7751.  
  7752. waitsecond(0)
  7753. end
  7754.  
  7755. tcase << TestAction.new(:pressHome_12) do
  7756. pressHome
  7757.  
  7758. waitsecond(0)
  7759. end
  7760.  
  7761. tcase.run(loopTime)
  7762.  
  7763. end
  7764.  
  7765. def self.startTest(loopTime)
  7766.  
  7767. tcase = TestCase.new("startTest")
  7768.  
  7769. tcase << TestAction.new(:blankaction) do
  7770. waitsecond(0)
  7771. end
  7772.  
  7773. tcase.run(loopTime)
  7774.  
  7775. end
  7776.  
  7777. def self.Telephony_5_1_1_5(loopTime)
  7778.  
  7779. tcase = TestCase.new("Telephony_5_1_1_5")
  7780.  
  7781. tcase << TestAction.new(:Start_Log) do
  7782. logStartTest("Telephony_5_1_1_5")
  7783.  
  7784. waitsecond(0)
  7785. end
  7786.  
  7787. tcase << TestAction.new(:Settings) do
  7788.  
  7789. if rand(100) < 0
  7790.  
  7791. gotoSettings
  7792.  
  7793. waitsecond(2)
  7794.  
  7795. end
  7796.  
  7797. end
  7798.  
  7799. tcase << TestAction.new(:Click_Network_Internet) do
  7800.  
  7801. if rand(100) < 0
  7802.  
  7803. $ruiObj = RUIObject.new.with('objectid', -1134408456).with('selfid', 1379611054).with('textdescid', -996692423).with('uniqueparentid', -644785799)
  7804. .with('uitreeindex', 6)
  7805. .with('classname', 'TextView')
  7806. .with('resource-id', 'android:id/title')
  7807. .with('text', 'Network Internet')
  7808.  
  7809. $ruiObj.click
  7810.  
  7811. waitsecond(2)
  7812.  
  7813. end
  7814.  
  7815. end
  7816.  
  7817. tcase << TestAction.new(:Click_Preferred) do
  7818.  
  7819. if rand(100) < 0
  7820.  
  7821. $ruiObj = RUIObject.new.with('objectid', 559310926).with('selfid', 517165292).with('textdescid', 482560099).with('uniqueparentid', -1016225766).with('classresourceid', 490183159)
  7822. .with('uitreeindex', 5)
  7823. .with('classname', 'TextView')
  7824. .with('resource-id', 'android:id/title')
  7825. .with('text', 'Preferred network type')
  7826.  
  7827. $ruiObj.click
  7828.  
  7829. waitsecond(2)
  7830.  
  7831. end
  7832.  
  7833. end
  7834.  
  7835. tcase << TestAction.new(:Click_LTE_TMUS) do
  7836.  
  7837. if rand(100) < 0
  7838.  
  7839. $ruiObj = RUIObject.new.with('objectid', -442050023).with('selfid', 1679268164).with('textdescid', 1652493263).with('uniqueparentid', -990483570).with('classresourceid', 2074814108)
  7840. .with('uitreeindex', 2)
  7841. .with('classname', 'CheckedTextView')
  7842. .with('resource-id', 'android:id/text1')
  7843. .with('text', 'LTE recommended')
  7844.  
  7845. $ruiObj.click
  7846.  
  7847. waitsecond(2)
  7848.  
  7849. end
  7850.  
  7851. end
  7852.  
  7853. tcase << TestAction.new(:Click_LTE_VZW) do
  7854.  
  7855. if rand(100) < 0
  7856.  
  7857. $ruiObj = RUIObject.new.with('objectid', -442050023).with('selfid', -196746481).with('textdescid', 587737118).with('uniqueparentid', 9112671).with('classresourceid', 2074814108)
  7858. .with('uitreeindex', 4)
  7859. .with('classname', 'CheckedTextView')
  7860. .with('resource-id', 'android:id/text1')
  7861. .with('text', 'LTE GSM UMTS')
  7862.  
  7863. $ruiObj.click
  7864.  
  7865. waitsecond(2)
  7866.  
  7867. end
  7868.  
  7869. end
  7870.  
  7871. tcase << TestAction.new(:Send_CMD_Phone) do
  7872. sendBTCmd("gotoApp('Phone')")
  7873.  
  7874. waitsecond(2)
  7875. end
  7876.  
  7877. tcase << TestAction.new(:Send_CMD_Click_Dialer) do
  7878. sendBTCmd("RUIObject.new.with('classname', 'TextView').with('text', 'Dial').click")
  7879.  
  7880. waitsecond(2)
  7881. end
  7882.  
  7883. tcase << TestAction.new(:Send_CMD_Input_DB) do
  7884. sendBTCmd("RUIObject.new.with('classname', 'EditText').inputtext('#{db('CallNumber')[0]}')")
  7885.  
  7886. waitsecond(8)
  7887. end
  7888.  
  7889. tcase << TestAction.new(:Send_CMD_Call) do
  7890. sendBTCmd("RUIObject.new.with('classname', 'ImageButton').with('content-desc', 'Call').click")
  7891.  
  7892. waitsecond(2)
  7893. end
  7894.  
  7895. tcase << TestAction.new(:Refresh) do
  7896. refreshScreen
  7897.  
  7898. waitsecond(2)
  7899. end
  7900.  
  7901. tcase << TestAction.new(:Answer_Call) do
  7902. click(1048.5,409.5)
  7903.  
  7904. waitsecond(8)
  7905. end
  7906.  
  7907. tcase << TestAction.new(:Check_End) do
  7908. $ruiObj = RUIObject.new.with('objectid', -1474401675).with('selfid', 714657135).with('textdescid', -724844434).with('uniqueparentid', -909340709)
  7909. .with('uitreeindex', 13)
  7910. .with('classname', 'ImageButton')
  7911. .with('resource-id', 'com.android.dialer:id/incall_end_call')
  7912. .with('content-desc', 'End call')
  7913.  
  7914. $ruiObj.isExist
  7915.  
  7916. waitsecond(2)
  7917. end
  7918.  
  7919. tcase << TestAction.new(:Click_End) do
  7920. $ruiObj = RUIObject.new.with('objectid', -1474401675).with('selfid', 714657135).with('textdescid', -724844434).with('uniqueparentid', -909340709)
  7921. .with('uitreeindex', 13)
  7922. .with('classname', 'ImageButton')
  7923. .with('resource-id', 'com.android.dialer:id/incall_end_call')
  7924. .with('content-desc', 'End call')
  7925.  
  7926. $ruiObj.click
  7927.  
  7928. waitsecond(2)
  7929. end
  7930.  
  7931. tcase << TestAction.new(:Stop_Log) do
  7932. $myTestResult = checkLastExistResult
  7933.  
  7934. logStopTest("Telephony_5_1_1_5")
  7935.  
  7936. waitsecond(0)
  7937. end
  7938.  
  7939. tcase << TestAction.new(:pressBack_2) do
  7940. pressBack
  7941.  
  7942. waitsecond(2)
  7943. end
  7944.  
  7945. tcase << TestAction.new(:pressBack_2_1) do
  7946. pressBack
  7947.  
  7948. waitsecond(2)
  7949. end
  7950.  
  7951. tcase.run(loopTime)
  7952.  
  7953. end
  7954.  
  7955. def self.exception_handler
  7956. puts "Module Exception Hanlder..."
  7957. end
  7958.  
  7959. def self.run(loop)
  7960. mainLoop loop
  7961. end
  7962.  
  7963. end
  7964.  
  7965. $exceptionPackageNameList = []
  7966. $exceptionPackageNameList_exclude = []
  7967.  
  7968. def exception_handler
  7969. SNOWBIRD_MTBF.exception_handler
  7970. end
  7971.  
  7972. $curProjectLogFile = $useLastLogFile
  7973.  
  7974. $curProjectLogFile = "SNOWBIRD_MTBF_#{getTimeStamp}.log" if $useLastLogFile.nil?
  7975.  
  7976. $useLastLogFile = nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement