Advertisement
Guest User

Untitled

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