Advertisement
Guest User

Untitled

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