Advertisement
Guest User

Untitled

a guest
May 15th, 2017
556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 76.50 KB | None | 0 0
  1. loadTestDB
  2.  
  3. module SNOWBOARD_MTBF_EMAIL
  4.  
  5. def self.Email_Precondition(loopTime)
  6.  
  7. tcase = TestCase.new("Email_Precondition")
  8.  
  9. tcase << TestAction.new(:Settings) do
  10. gotoAppPixel('Settings')
  11.  
  12. waitsecond(2)
  13. end
  14.  
  15. tcase << TestAction.new(:Apps) do
  16. $ruiObj = RUIObject.new.with('objectid', -1980252617).with('selfid', -999362027).with('textdescid', -2077380333).with('uniqueparentid', 1746487935)
  17. .with('uitreeindex', 18)
  18. .with('classname', 'TextView')
  19. .with('resource-id', 'android:id/title')
  20. .with('text', 'Apps notifications')
  21.  
  22. $ruiObj.click
  23.  
  24. waitsecond(2)
  25. end
  26.  
  27. tcase << TestAction.new(:SearchCamera) do
  28. scrollAndSearchText('Camera')
  29.  
  30. waitsecond(2)
  31. end
  32.  
  33. tcase << TestAction.new(:Camera) do
  34. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -374634778).with('textdescid', 1951829936).with('uniqueparentid', 1212711866)
  35. .with('uitreeindex', 4)
  36. .with('classname', 'TextView')
  37. .with('resource-id', 'android:id/title')
  38. .with('text', 'Camera')
  39.  
  40. $ruiObj.click
  41.  
  42. waitsecond(2)
  43. end
  44.  
  45. tcase << TestAction.new(:Storage) do
  46. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -1162414374).with('textdescid', -2051153520).with('uniqueparentid', 162506563)
  47. .with('uitreeindex', 10)
  48. .with('classname', 'TextView')
  49. .with('resource-id', 'android:id/title')
  50. .with('text', 'Storage')
  51.  
  52. $ruiObj.click
  53.  
  54. waitsecond(2)
  55. end
  56.  
  57. tcase << TestAction.new(:ClearCache) do
  58. $ruiObj = RUIObject.new.with('objectid', 699987448).with('selfid', 2145148908).with('textdescid', -1064159269).with('uniqueparentid', -1819455735)
  59. .with('uitreeindex', 5)
  60. .with('classname', 'Button')
  61. .with('resource-id', 'com.android.settings:id/left_button')
  62. .with('text', 'CLEAR DATA')
  63.  
  64. $ruiObj.click
  65.  
  66. waitsecond(2)
  67. end
  68.  
  69. tcase << TestAction.new(:OK) do
  70. $ruiObj = RUIObject.new.with('objectid', -1004548822).with('selfid', -1318451484).with('textdescid', -405740082).with('uniqueparentid', -2133631140).with('classresourceid', 1834539358)
  71. .with('uitreeindex', 4)
  72. .with('classname', 'Button')
  73. .with('resource-id', 'android:id/button1')
  74. .with('text', 'OK')
  75.  
  76. $ruiObj.click
  77.  
  78. waitsecond(2)
  79. end
  80.  
  81. tcase << TestAction.new(:OpenCamera) do
  82. gotoAppPixel('Camera')
  83.  
  84. waitsecond(2)
  85. end
  86.  
  87. tcase << TestAction.new(:Allow) do
  88. $ruiObj = RUIObject.new.with('objectid', 153379926).with('selfid', 1443382411).with('textdescid', 294474017).with('uniqueparentid', 725356101).with('classresourceid', -227364920)
  89. .with('uitreeindex', 3)
  90. .with('classname', 'Button')
  91. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  92. .with('text', 'ALLOW')
  93.  
  94. $ruiObj.click
  95.  
  96. waitsecond(2)
  97. end
  98.  
  99. tcase << TestAction.new(:CheckBox) do
  100. $ruiObj = RUIObject.new.with('objectid', 664129579).with('selfid', -829319141).with('textdescid', 745076204).with('uniqueparentid', 342104880)
  101. .with('uitreeindex', 2)
  102. .with('classname', 'CheckBox')
  103. .with('resource-id', 'com.android.camera2:id/check_box')
  104. .with('text', 'Tag your photos and videos with the locations where theyre taken')
  105.  
  106. $ruiObj.click
  107.  
  108. waitsecond(2)
  109. end
  110.  
  111. tcase << TestAction.new(:Next) do
  112. $ruiObj = RUIObject.new.with('objectid', -1187921382).with('selfid', -1055162259).with('textdescid', 1673606663).with('uniqueparentid', -1678803509)
  113. .with('uitreeindex', 3)
  114. .with('classname', 'Button')
  115. .with('resource-id', 'com.android.camera2:id/confirm_button')
  116. .with('text', 'NEXT')
  117.  
  118. $ruiObj.click
  119.  
  120. waitsecond(2)
  121. end
  122.  
  123. tcase << TestAction.new(:swipeLeft) do
  124. swipe_horizontal_back 50
  125.  
  126. waitsecond(2)
  127. end
  128.  
  129. tcase << TestAction.new(:wait2) do
  130. waitsecond(2)
  131. end
  132.  
  133. tcase << TestAction.new(:clickSettings) do
  134. click(1314,2128.5)
  135.  
  136. waitsecond(2)
  137. end
  138.  
  139. tcase << TestAction.new(:Resolution) do
  140. $ruiObj = RUIObject.new.with('objectid', 769121715).with('selfid', 865723314).with('textdescid', -589260518).with('uniqueparentid', -1979112293).with('classresourceid', 490183159)
  141. .with('uitreeindex', 2)
  142. .with('classname', 'TextView')
  143. .with('resource-id', 'android:id/title')
  144. .with('text', 'Resolution quality')
  145.  
  146. $ruiObj.click
  147.  
  148. waitsecond(2)
  149. end
  150.  
  151. tcase << TestAction.new(:BackCamera) do
  152. $ruiObj = RUIObject.new.with('objectid', 769121715).with('selfid', 1818667439).with('textdescid', 336805309).with('uniqueparentid', -1743767793).with('classresourceid', 490183159)
  153. .with('uitreeindex', 3)
  154. .with('classname', 'TextView')
  155. .with('resource-id', 'android:id/title')
  156. .with('text', 'Back camera photo')
  157.  
  158. $ruiObj.click
  159.  
  160. waitsecond(2)
  161. end
  162.  
  163. tcase << TestAction.new(:Pixel) do
  164. $ruiObj = RUIObject.new.with('objectid', -2032711530).with('selfid', 54695798).with('textdescid', -491191936).with('uniqueparentid', -1389815021).with('classresourceid', 2074814108)
  165. .with('uitreeindex', 7)
  166. .with('classname', 'CheckedTextView')
  167. .with('resource-id', 'android:id/text1')
  168. .with('text', '169 09 megapixels')
  169.  
  170. $ruiObj.click
  171.  
  172. waitsecond(2)
  173. end
  174.  
  175. tcase << TestAction.new(:FrontCamera) do
  176. $ruiObj = RUIObject.new.with('objectid', 769121715).with('selfid', -625898417).with('textdescid', -59672123).with('uniqueparentid', 1182748742).with('classresourceid', 490183159)
  177. .with('uitreeindex', 5)
  178. .with('classname', 'TextView')
  179. .with('resource-id', 'android:id/title')
  180. .with('text', 'Front camera photo')
  181.  
  182. $ruiObj.click
  183.  
  184. waitsecond(2)
  185. end
  186.  
  187. tcase << TestAction.new(:Pixel2) do
  188. $ruiObj = RUIObject.new.with('objectid', -2032711530).with('selfid', -848883235).with('textdescid', 1562629113).with('uniqueparentid', 2068759084).with('classresourceid', 2074814108)
  189. .with('uitreeindex', 7)
  190. .with('classname', 'CheckedTextView')
  191. .with('resource-id', 'android:id/text1')
  192. .with('text', '169 02 megapixels')
  193.  
  194. $ruiObj.click
  195.  
  196. waitsecond(2)
  197. end
  198.  
  199. tcase << TestAction.new(:Back) do
  200. $ruiObj = RUIObject.new.with('objectid', -749179047).with('selfid', -123872605).with('textdescid', -911113085).with('uniqueparentid', -292129185)
  201. .with('uitreeindex', 0)
  202. .with('classname', 'ImageButton')
  203. .with('content-desc', 'Navigate up')
  204.  
  205. $ruiObj.click
  206.  
  207. waitsecond(2)
  208. end
  209.  
  210. tcase << TestAction.new(:Back2) do
  211. $ruiObj = RUIObject.new.with('objectid', -749179047).with('selfid', -123872605).with('textdescid', -911113085).with('uniqueparentid', -292129185)
  212. .with('uitreeindex', 0)
  213. .with('classname', 'ImageButton')
  214. .with('content-desc', 'Navigate up')
  215.  
  216. $ruiObj.click
  217.  
  218. waitsecond(2)
  219. end
  220.  
  221. tcase << TestAction.new(:Shutter) do
  222. $ruiObj = RUIObject.new.with('objectid', -1444537032).with('selfid', 111453042).with('textdescid', 1162006437).with('uniqueparentid', -1154361882)
  223. .with('uitreeindex', 6)
  224. .with('classname', 'ImageView')
  225. .with('resource-id', 'com.android.camera2:id/shutter_button')
  226. .with('content-desc', 'Shutter')
  227.  
  228. $ruiObj.click
  229.  
  230. waitsecond(2)
  231. end
  232.  
  233. tcase << TestAction.new(:GoToSettings) do
  234. gotoAppPixel('Settings')
  235.  
  236. waitsecond(2)
  237. end
  238.  
  239. tcase << TestAction.new(:SearchAccounts) do
  240. scrollAndSearchText('Users & accounts')
  241.  
  242. waitsecond(2)
  243. end
  244.  
  245. tcase << TestAction.new(:UsersAccounts) do
  246. $ruiObj = RUIObject.new.with('objectid', -1980252617).with('selfid', 1816414541).with('textdescid', 483636443).with('uniqueparentid', -769009501)
  247. .with('uitreeindex', 21)
  248. .with('classname', 'TextView')
  249. .with('resource-id', 'android:id/title')
  250. .with('text', 'Users accounts')
  251.  
  252. $ruiObj.click
  253.  
  254. waitsecond(2)
  255. end
  256.  
  257. tcase << TestAction.new(:ClickAccount) do
  258. $accountButton = RUIObject.new.with('objectid', 2093003359).with('selfid', -1580627678).with('textdescid', 458594721).with('uniqueparentid', -1208912882)
  259. .with('uitreeindex', 6)
  260. .with('pretext', 'Accounts for Owner')
  261. .with('classname', 'ImageView')
  262. .with('resource-id', 'android:id/icon')
  263.  
  264. if $accountButton.isExist
  265. $accountButton.click
  266. end
  267.  
  268. waitsecond(2)
  269. end
  270.  
  271. tcase << TestAction.new(:RemoveAccount) do
  272. $removeAccount = $ruiObj = RUIObject.new.with('objectid', 142601956).with('selfid', 190620862).with('textdescid', -81471853).with('uniqueparentid', -1843605818)
  273. .with('uitreeindex', 6)
  274. .with('classname', 'Button')
  275. .with('resource-id', 'com.android.settings:id/button')
  276. .with('text', 'REMOVE ACCOUNT')
  277. if $removeAccount.isExist
  278. $removeAccount.click
  279. end
  280.  
  281. $ruiObj.click
  282.  
  283. waitsecond(2)
  284. end
  285.  
  286. tcase << TestAction.new(:Confirm) do
  287. $ruiObj = RUIObject.new.with('objectid', -1004548822).with('selfid', -1699837063).with('textdescid', -172267303).with('uniqueparentid', 1451097447).with('classresourceid', 1834539358)
  288. .with('uitreeindex', 4)
  289. .with('classname', 'Button')
  290. .with('resource-id', 'android:id/button1')
  291. .with('text', 'REMOVE ACCOUNT')
  292.  
  293. $ruiObj.click
  294.  
  295. waitsecond(2)
  296. end
  297.  
  298. tcase << TestAction.new(:GoToGmail) do
  299. gotoAppPixel('Gmail')
  300.  
  301. waitsecond(2)
  302. end
  303.  
  304. tcase << TestAction.new(:TourGotIt) do
  305. $ruiObj = RUIObject.new.with('objectid', -1374270067).with('selfid', 29381074).with('textdescid', -1431784690).with('uniqueparentid', -1320248293)
  306. .with('uitreeindex', 4)
  307. .with('classname', 'TextView')
  308. .with('resource-id', 'com.google.android.gm:id/welcome_tour_got_it')
  309. .with('text', 'GOT IT')
  310.  
  311. $ruiObj.click
  312. ifFailJumpTo(:TourNext)
  313.  
  314. waitsecond(2)
  315. end
  316.  
  317. tcase << TestAction.new(:TourNext) do
  318. $ruiObj = RUIObject.new.with('objectid', -965796713).with('selfid', 2106428631).with('textdescid', -49033732).with('uniqueparentid', 41439437)
  319. .with('uitreeindex', 6)
  320. .with('classname', 'ImageView')
  321. .with('resource-id', 'com.google.android.gm:id/welcome_tour_next')
  322. .with('content-desc', 'Next')
  323.  
  324. $ruiObj.click
  325.  
  326. waitsecond(2)
  327. end
  328.  
  329. tcase << TestAction.new(:WelcomeDone) do
  330. $ruiObj = RUIObject.new.with('objectid', -1459269354).with('selfid', -2111812423).with('textdescid', -1337192108).with('uniqueparentid', -118933564)
  331. .with('uitreeindex', 5)
  332. .with('classname', 'TextView')
  333. .with('resource-id', 'com.google.android.gm:id/welcome_tour_done')
  334. .with('text', 'DONE')
  335.  
  336. $ruiObj.click
  337.  
  338. waitsecond(2)
  339. end
  340.  
  341. tcase << TestAction.new(:AddEmail) do
  342. $ruiObj = RUIObject.new.with('objectid', 1784765643).with('selfid', 394229773).with('textdescid', -1185071217).with('uniqueparentid', 35495294).with('classresourceid', 759149223)
  343. .with('uitreeindex', 2)
  344. .with('classname', 'TextView')
  345. .with('resource-id', 'com.google.android.gm:id/setup_addresses_add_another')
  346. .with('text', 'Add an email address')
  347.  
  348. $ruiObj.click
  349.  
  350. waitsecond(2)
  351. end
  352.  
  353. tcase << TestAction.new(:SetUpGmail) do
  354. $ruiObj = RUIObject.new.with('objectid', -1456508049).with('selfid', -320144828).with('textdescid', 2104439094).with('uniqueparentid', 1362689227).with('classresourceid', -1877262527)
  355. .with('uitreeindex', 4)
  356. .with('classname', 'TextView')
  357. .with('resource-id', 'com.google.android.gm:id/account_setup_label')
  358. .with('text', 'Google')
  359.  
  360. $ruiObj.click
  361.  
  362. waitsecond(2)
  363. end
  364.  
  365. tcase << TestAction.new(:Loading) do
  366. $signIn = RUIObject.new.with('objectid', 476695571).with('selfid', 1024373019).with('textdescid', 1892660845).with('uniqueparentid', 877823464)
  367. .with('uitreeindex', 3)
  368. .with('classname', 'EditText')
  369. .with('resource-id', 'identifierId')
  370.  
  371. $second = 0;
  372.  
  373. while ($signIn.isNotExist) && $second < 15
  374. puts $second
  375. $second += 1
  376. waitsecond(1)
  377. end
  378.  
  379. waitsecond(2)
  380. end
  381.  
  382. tcase << TestAction.new(:ID) do
  383. $ruiObj = RUIObject.new.with('objectid', 476695571).with('selfid', 1024373019).with('textdescid', 1892660845).with('uniqueparentid', 877823464)
  384. .with('uitreeindex', 3)
  385. .with('classname', 'EditText')
  386. .with('resource-id', 'identifierId')
  387.  
  388. $ruiObj.inputtext('nalab.qct02@gmail.com')
  389.  
  390. waitsecond(2)
  391. end
  392.  
  393. tcase << TestAction.new(:Next2) do
  394. $ruiObj = RUIObject.new.with('objectid', -240525947).with('selfid', 1739137727).with('textdescid', 264687918).with('uniqueparentid', -1629724901)
  395. .with('uitreeindex', 6)
  396. .with('classname', 'Button')
  397. .with('resource-id', 'identifierNext')
  398. .with('content-desc', 'NEXT')
  399.  
  400. $ruiObj.click
  401.  
  402. waitsecond(2)
  403. end
  404.  
  405. tcase << TestAction.new(:PWD) do
  406. $ruiObj = RUIObject.new.with('objectid', 1904625454).with('selfid', 1666676343).with('textdescid', -1086153038).with('uniqueparentid', -1718739466)
  407. .with('uitreeindex', 3)
  408. .with('classname', 'EditText')
  409.  
  410. $ruiObj.inputtext('12abcdef34')
  411.  
  412. waitsecond(2)
  413. end
  414.  
  415. tcase << TestAction.new(:Next3) do
  416. $ruiObj = RUIObject.new.with('objectid', -412639049).with('selfid', -1426408179).with('textdescid', 1787982268).with('uniqueparentid', 446487721)
  417. .with('uitreeindex', 9)
  418. .with('classname', 'Button')
  419. .with('resource-id', 'passwordNext')
  420. .with('content-desc', 'NEXT')
  421.  
  422. $ruiObj.click
  423.  
  424. waitsecond(2)
  425. end
  426.  
  427. tcase << TestAction.new(:Agree) do
  428. $ruiObj = RUIObject.new.with('objectid', 948550242).with('selfid', -1165549500).with('textdescid', -1009902985).with('uniqueparentid', 2011089354)
  429. .with('uitreeindex', 7)
  430. .with('classname', 'Button')
  431. .with('resource-id', 'signinconsentNext')
  432. .with('content-desc', 'I AGREE')
  433.  
  434. $ruiObj.click
  435.  
  436. waitsecond(2)
  437. end
  438.  
  439. tcase << TestAction.new(:BackUpOff) do
  440. $ruiObj = RUIObject.new.with('objectid', 2065931740).with('selfid', -1480442820).with('textdescid', 1158832046).with('uniqueparentid', -1396600084).with('classresourceid', -483288220)
  441. .with('uitreeindex', 6)
  442. .with('classname', 'TextView')
  443. .with('resource-id', 'com.google.android.gms.policy_sidecar_o:id/backup_opt_in_disable_backup')
  444. .with('text', 'Turn off backup')
  445.  
  446. $ruiObj.click
  447.  
  448. waitsecond(2)
  449. end
  450.  
  451. tcase << TestAction.new(:OK2) do
  452. $ruiObj = RUIObject.new.with('objectid', -725277645).with('selfid', -1318451484).with('textdescid', -395210665).with('uniqueparentid', 887820595).with('classresourceid', 1834539358)
  453. .with('uitreeindex', 4)
  454. .with('classname', 'Button')
  455. .with('resource-id', 'android:id/button1')
  456. .with('text', 'OK')
  457.  
  458. $ruiObj.click
  459.  
  460. waitsecond(2)
  461. end
  462.  
  463. tcase << TestAction.new(:TakeToGmail) do
  464. $ruiObj = RUIObject.new.with('objectid', -1799555089).with('selfid', 1716018366).with('textdescid', -485572825).with('uniqueparentid', -1903073185)
  465. .with('uitreeindex', 7)
  466. .with('classname', 'TextView')
  467. .with('resource-id', 'com.google.android.gm:id/action_done')
  468. .with('text', 'TAKE ME TO GMAIL')
  469.  
  470. $ruiObj.click
  471.  
  472. waitsecond(2)
  473. end
  474.  
  475. tcase << TestAction.new(:RecentApps) do
  476. pressRecentApps
  477.  
  478. waitsecond(2)
  479. end
  480.  
  481. tcase << TestAction.new(:SwipeUp) do
  482. swipe_vertical_back 100
  483.  
  484. waitsecond(2)
  485. end
  486.  
  487. tcase << TestAction.new(:swipeUp) do
  488. swipe_vertical_back 100
  489.  
  490. waitsecond(2)
  491. end
  492.  
  493. tcase << TestAction.new(:ClearAll) do
  494. $ruiObj = RUIObject.new.with('objectid', -213794734).with('selfid', -204985471).with('textdescid', 1763854688).with('uniqueparentid', 1782126143)
  495. .with('uitreeindex', 12)
  496. .with('classname', 'TextView')
  497. .with('resource-id', 'com.android.systemui:id/button')
  498. .with('text', 'CLEAR ALL')
  499.  
  500. $ruiObj.click
  501.  
  502. waitsecond(2)
  503. end
  504.  
  505. tcase.run(loopTime)
  506.  
  507. end
  508.  
  509. def self.mainLoop(loopTime)
  510.  
  511. WebSocketXServer.setAutoUpdate(false)
  512.  
  513. index = $mainResumeMainLoop
  514. $mainResumeMainLoop = 0
  515.  
  516. writelog("mainLoop::#{index}::Resume") if index > 0
  517.  
  518. while index < loopTime
  519.  
  520. $curMainLoopNum = index
  521.  
  522. $actionParamInput = "none"
  523. startTest 1
  524.  
  525. waitsecond(2)
  526.  
  527.  
  528. sendStatus("Done::mainLoop::Loop::#{index}")
  529.  
  530.  
  531. writelog("Finish::Loop::#{$curMainLoopNum}")
  532.  
  533.  
  534. saveLogFileToGist if $saveLogToGist
  535.  
  536. index += 1
  537.  
  538. end
  539.  
  540. $engineStatus = "Idle"
  541. resetStatus
  542. sendStatus("Finish::mainLoop::END")
  543.  
  544. end
  545.  
  546. def self.startTest(loopTime)
  547.  
  548. tcase = TestCase.new("startTest")
  549.  
  550. tcase << TestAction.new(:blankaction) do
  551. waitsecond(0)
  552. end
  553.  
  554. tcase.run(loopTime)
  555.  
  556. end
  557.  
  558. def self.Browser_Precondition(loopTime)
  559.  
  560. tcase = TestCase.new("Browser_Precondition")
  561.  
  562. tcase << TestAction.new(:OpenChrome) do
  563. gotoAppPixel('Chrome')
  564.  
  565.  
  566. waitsecond(2)
  567. end
  568.  
  569. tcase << TestAction.new(:checkBox) do
  570. $ruiObj = RUIObject.new.with('objectid', 1560599896).with('selfid', 45001589).with('textdescid', -1345211847).with('uniqueparentid', 1351926725).with('classresourceid', 1998469038)
  571. .with('uitreeindex', 3)
  572. .with('classname', 'CheckBox')
  573. .with('resource-id', 'com.android.chrome:id/send_report_checkbox')
  574. .with('text', 'Help make Chrome better by sending usage statistics and crash reports to Google')
  575.  
  576. $ruiObj.click
  577. ifFailJumpTo(:OpenTab)
  578.  
  579. waitsecond(2)
  580. end
  581.  
  582. tcase << TestAction.new(:Accept) do
  583. $ruiObj = RUIObject.new.with('objectid', 1131623741).with('selfid', 2073999009).with('textdescid', -212510162).with('uniqueparentid', -1930936534)
  584. .with('uitreeindex', 4)
  585. .with('classname', 'Button')
  586. .with('resource-id', 'com.android.chrome:id/terms_accept')
  587. .with('text', 'ACCEPT CONTINUE')
  588.  
  589. $ruiObj.click
  590.  
  591. waitsecond(2)
  592. end
  593.  
  594. tcase << TestAction.new(:NoThanks) do
  595. $ruiObj = RUIObject.new.with('objectid', -1069290294).with('selfid', 1665543358).with('textdescid', 14199854).with('uniqueparentid', -972892335)
  596. .with('uitreeindex', 8)
  597. .with('classname', 'Button')
  598. .with('resource-id', 'com.android.chrome:id/negative_button')
  599. .with('text', 'NO THANKS')
  600.  
  601. $ruiObj.click
  602.  
  603. waitsecond(2)
  604. end
  605.  
  606. tcase << TestAction.new(:OpenTab) do
  607. $ruiObj = RUIObject.new.with('objectid', -1772071808).with('selfid', 820590808).with('textdescid', 561000469).with('uniqueparentid', 54637515)
  608. .with('uitreeindex', 1)
  609. .with('classname', 'Button')
  610. .with('resource-id', 'com.android.chrome:id/new_tab_button')
  611. .with('content-desc', 'New tab')
  612.  
  613. $ruiObj.click
  614. ifFailJumpTo(:URL1)
  615.  
  616. waitsecond(2)
  617. end
  618.  
  619. tcase << TestAction.new(:URL1) do
  620. $ruiObj = RUIObject.new.with('objectid', -740560065).with('selfid', 1023920737).with('textdescid', -1482525503).with('uniqueparentid', -1010905038)
  621. .with('uitreeindex', 1)
  622. .with('classname', 'EditText')
  623. .with('resource-id', 'com.android.chrome:id/search_box_text')
  624.  
  625. $ruiObj.inputtext('www.att.com')
  626.  
  627. waitsecond(2)
  628. end
  629.  
  630. tcase << TestAction.new(:Enter) do
  631. pressEnter
  632.  
  633. waitsecond(2)
  634. end
  635.  
  636. tcase << TestAction.new(:Loading) do
  637. waitsecond(2)
  638.  
  639. $attWait = RUIObject.new.with('objectid', 1040592064).with('selfid', 1955905798).with('textdescid', -1063252184).with('uniqueparentid', 107476858)
  640. .with('uitreeindex', 2)
  641. .with('classname', 'Button')
  642. .with('content-desc', 'Search')
  643.  
  644. $second = 0;
  645.  
  646. while ($attWait.isNotExist) && $second < 10
  647. puts $second
  648. $second += 1
  649. waitsecond(1)
  650. end
  651.  
  652. waitsecond(2)
  653. end
  654.  
  655. tcase << TestAction.new(:Options) do
  656. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  657. .with('uitreeindex', 86)
  658. .with('classname', 'ImageButton')
  659. .with('resource-id', 'com.android.chrome:id/menu_button')
  660. .with('content-desc', 'More options')
  661.  
  662. $ruiObj.click
  663.  
  664. waitsecond(2)
  665. end
  666.  
  667. tcase << TestAction.new(:EditBookmark) do
  668. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', -1695848864).with('textdescid', 223981600).with('uniqueparentid', 1676584768).with('classresourceid', 747996460)
  669. .with('uitreeindex', 1)
  670. .with('classname', 'ImageButton')
  671. .with('resource-id', 'com.android.chrome:id/button_two')
  672. .with('content-desc', 'Edit bookmark')
  673.  
  674. $ruiObj.isNotExist
  675. ifFailJumpTo(:GotoSettings)
  676.  
  677. waitsecond(2)
  678. end
  679.  
  680. tcase << TestAction.new(:Bookmark) do
  681. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', 647573709).with('textdescid', 1394875027).with('uniqueparentid', 953315029).with('classresourceid', 747996460)
  682. .with('uitreeindex', 1)
  683. .with('classname', 'ImageButton')
  684. .with('resource-id', 'com.android.chrome:id/button_two')
  685. .with('content-desc', 'Bookmark this page')
  686.  
  687. $ruiObj.click
  688.  
  689. waitsecond(2)
  690. end
  691.  
  692. tcase << TestAction.new(:URL2) do
  693. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', 0)
  694. .with('uitreeindex', 91)
  695. .with('classname', 'EditText')
  696. .with('resource-id', 'com.android.chrome:id/url_bar')
  697.  
  698. $ruiObj.inputtext('www.ebay.com')
  699.  
  700. waitsecond(2)
  701. end
  702.  
  703. tcase << TestAction.new(:Enter2) do
  704. pressEnter
  705.  
  706. waitsecond(2)
  707. end
  708.  
  709. tcase << TestAction.new(:Loading2) do
  710. waitsecond(2)
  711.  
  712. $ebayWait = RUIObject.new.with('objectid', 609044440).with('selfid', 1175141772).with('textdescid', -2143820243).with('uniqueparentid', -1830344402)
  713. .with('uitreeindex', 4)
  714. .with('classname', 'android.view.View')
  715. .with('content-desc', 'eBay Home page')
  716.  
  717. $second = 0;
  718.  
  719. while ($ebayWait.isNotExist) && $second < 10
  720. puts $second
  721. $second += 1
  722. waitsecond(1)
  723. end
  724.  
  725. waitsecond(2)
  726. end
  727.  
  728. tcase << TestAction.new(:Options2) do
  729. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  730. .with('uitreeindex', 92)
  731. .with('classname', 'ImageButton')
  732. .with('resource-id', 'com.android.chrome:id/menu_button')
  733. .with('content-desc', 'More options')
  734.  
  735. $ruiObj.click
  736.  
  737. waitsecond(2)
  738. end
  739.  
  740. tcase << TestAction.new(:EditBookmark_1) do
  741. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', -1695848864).with('textdescid', 223981600).with('uniqueparentid', 1676584768).with('classresourceid', 747996460)
  742. .with('uitreeindex', 1)
  743. .with('classname', 'ImageButton')
  744. .with('resource-id', 'com.android.chrome:id/button_two')
  745. .with('content-desc', 'Edit bookmark')
  746.  
  747. $ruiObj.isNotExist
  748. ifFailJumpTo(:GotoSettings)
  749.  
  750. waitsecond(2)
  751. end
  752.  
  753. tcase << TestAction.new(:Bookmark2) do
  754. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', 647573709).with('textdescid', 1394875027).with('uniqueparentid', 953315029).with('classresourceid', 747996460)
  755. .with('uitreeindex', 1)
  756. .with('classname', 'ImageButton')
  757. .with('resource-id', 'com.android.chrome:id/button_two')
  758. .with('content-desc', 'Bookmark this page')
  759.  
  760. $ruiObj.click
  761.  
  762. waitsecond(2)
  763. end
  764.  
  765. tcase << TestAction.new(:URL3) do
  766. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', -420161517)
  767. .with('uitreeindex', 90)
  768. .with('classname', 'EditText')
  769. .with('resource-id', 'com.android.chrome:id/url_bar')
  770.  
  771. $ruiObj.inputtext('www.yahoo.com')
  772.  
  773. waitsecond(2)
  774. end
  775.  
  776. tcase << TestAction.new(:Enter3) do
  777. pressEnter
  778.  
  779. waitsecond(2)
  780. end
  781.  
  782. tcase << TestAction.new(:Loading3) do
  783. waitsecond(2)
  784.  
  785. $yahooWait = RUIObject.new.with('objectid', -530407122).with('selfid', -326866941).with('textdescid', 13521966).with('uniqueparentid', -191624725)
  786. .with('uitreeindex', 5)
  787. .with('classname', 'Button')
  788. .with('resource-id', 'placeHolder-search-btn')
  789. .with('content-desc', 'Search Search')
  790.  
  791. $second = 0;
  792.  
  793. while ($yahooWait.isNotExist) && $second < 10
  794. puts $second
  795. $second += 1
  796. waitsecond(1)
  797. end
  798.  
  799. waitsecond(2)
  800. end
  801.  
  802. tcase << TestAction.new(:Options3) do
  803. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  804. .with('uitreeindex', 114)
  805. .with('classname', 'ImageButton')
  806. .with('resource-id', 'com.android.chrome:id/menu_button')
  807. .with('content-desc', 'More options')
  808.  
  809. $ruiObj.click
  810.  
  811. waitsecond(2)
  812. end
  813.  
  814. tcase << TestAction.new(:EditBookmark_1) do
  815. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', -1695848864).with('textdescid', 223981600).with('uniqueparentid', 1676584768).with('classresourceid', 747996460)
  816. .with('uitreeindex', 1)
  817. .with('classname', 'ImageButton')
  818. .with('resource-id', 'com.android.chrome:id/button_two')
  819. .with('content-desc', 'Edit bookmark')
  820.  
  821. $ruiObj.isNotExist
  822. ifFailJumpTo(:GotoSettings)
  823.  
  824. waitsecond(2)
  825. end
  826.  
  827. tcase << TestAction.new(:Bookmark3) do
  828. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', 647573709).with('textdescid', 1394875027).with('uniqueparentid', 953315029).with('classresourceid', 747996460)
  829. .with('uitreeindex', 1)
  830. .with('classname', 'ImageButton')
  831. .with('resource-id', 'com.android.chrome:id/button_two')
  832. .with('content-desc', 'Bookmark this page')
  833.  
  834. $ruiObj.click
  835.  
  836. waitsecond(2)
  837. end
  838.  
  839. tcase << TestAction.new(:URL4) do
  840. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', -939721082)
  841. .with('uitreeindex', 114)
  842. .with('classname', 'EditText')
  843. .with('resource-id', 'com.android.chrome:id/url_bar')
  844.  
  845. $ruiObj.inputtext('www.amazon.com ')
  846.  
  847. waitsecond(2)
  848. end
  849.  
  850. tcase << TestAction.new(:Enter4) do
  851. pressEnter
  852.  
  853. waitsecond(2)
  854. end
  855.  
  856. tcase << TestAction.new(:Loading4) do
  857. waitsecond(2)
  858.  
  859. $amazonWait = RUIObject.new.with('objectid', -1521303824).with('selfid', 1797265808).with('textdescid', 1249383791).with('uniqueparentid', -2005587295)
  860. .with('uitreeindex', 9)
  861. .with('classname', 'android.view.View')
  862. .with('content-desc', 'Prime')
  863.  
  864. $second = 0;
  865.  
  866. while ($amazonWait.isNotExist) && $second < 10
  867. puts $second
  868. $second += 1
  869. waitsecond(1)
  870. end
  871.  
  872. waitsecond(2)
  873. end
  874.  
  875. tcase << TestAction.new(:Options4) do
  876. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  877. .with('uitreeindex', 50)
  878. .with('classname', 'ImageButton')
  879. .with('resource-id', 'com.android.chrome:id/menu_button')
  880. .with('content-desc', 'More options')
  881.  
  882. $ruiObj.click
  883.  
  884. waitsecond(2)
  885. end
  886.  
  887. tcase << TestAction.new(:EditBookmark_1) do
  888. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', -1695848864).with('textdescid', 223981600).with('uniqueparentid', 1676584768).with('classresourceid', 747996460)
  889. .with('uitreeindex', 1)
  890. .with('classname', 'ImageButton')
  891. .with('resource-id', 'com.android.chrome:id/button_two')
  892. .with('content-desc', 'Edit bookmark')
  893.  
  894. $ruiObj.isNotExist
  895. ifFailJumpTo(:GotoSettings)
  896.  
  897. waitsecond(2)
  898. end
  899.  
  900. tcase << TestAction.new(:Bookmark4) do
  901. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', 647573709).with('textdescid', 1394875027).with('uniqueparentid', 953315029).with('classresourceid', 747996460)
  902. .with('uitreeindex', 1)
  903. .with('classname', 'ImageButton')
  904. .with('resource-id', 'com.android.chrome:id/button_two')
  905. .with('content-desc', 'Bookmark this page')
  906.  
  907. $ruiObj.click
  908.  
  909. waitsecond(2)
  910. end
  911.  
  912. tcase << TestAction.new(:URL5) do
  913. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', -939721082)
  914. .with('uitreeindex', 50)
  915. .with('classname', 'EditText')
  916. .with('resource-id', 'com.android.chrome:id/url_bar')
  917.  
  918. $ruiObj.inputtext('www.youtube.com')
  919.  
  920. waitsecond(2)
  921. end
  922.  
  923. tcase << TestAction.new(:Enter5) do
  924. pressEnter
  925.  
  926. waitsecond(2)
  927. end
  928.  
  929. tcase << TestAction.new(:Loading5) do
  930. waitsecond(2)
  931.  
  932. $youtubeWait = RUIObject.new.with('objectid', 2003397674).with('selfid', -1955067805).with('textdescid', -1024800959).with('uniqueparentid', 841602579)
  933. .with('uitreeindex', 1)
  934. .with('classname', 'Button')
  935. .with('content-desc', 'Search YouTube')
  936.  
  937. $second = 0;
  938.  
  939. while ($youtubeWait.isNotExist) && $second < 10
  940. puts $second
  941. $second += 1
  942. waitsecond(1)
  943. end
  944.  
  945. waitsecond(2)
  946. end
  947.  
  948. tcase << TestAction.new(:Options5) do
  949. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  950. .with('uitreeindex', 35)
  951. .with('classname', 'ImageButton')
  952. .with('resource-id', 'com.android.chrome:id/menu_button')
  953. .with('content-desc', 'More options')
  954.  
  955. $ruiObj.click
  956.  
  957. waitsecond(2)
  958. end
  959.  
  960. tcase << TestAction.new(:EditBookmark_1) do
  961. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', -1695848864).with('textdescid', 223981600).with('uniqueparentid', 1676584768).with('classresourceid', 747996460)
  962. .with('uitreeindex', 1)
  963. .with('classname', 'ImageButton')
  964. .with('resource-id', 'com.android.chrome:id/button_two')
  965. .with('content-desc', 'Edit bookmark')
  966.  
  967. $ruiObj.isNotExist
  968. ifFailJumpTo(:GotoSettings)
  969.  
  970. waitsecond(2)
  971. end
  972.  
  973. tcase << TestAction.new(:Bookmark5) do
  974. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', 647573709).with('textdescid', 1394875027).with('uniqueparentid', 953315029).with('classresourceid', 747996460)
  975. .with('uitreeindex', 1)
  976. .with('classname', 'ImageButton')
  977. .with('resource-id', 'com.android.chrome:id/button_two')
  978. .with('content-desc', 'Bookmark this page')
  979.  
  980. $ruiObj.click
  981.  
  982. waitsecond(2)
  983. end
  984.  
  985. tcase << TestAction.new(:URL6) do
  986. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', -939721082)
  987. .with('uitreeindex', 35)
  988. .with('classname', 'EditText')
  989. .with('resource-id', 'com.android.chrome:id/url_bar')
  990.  
  991. $ruiObj.inputtext('www.nytimes.com')
  992.  
  993. waitsecond(2)
  994. end
  995.  
  996. tcase << TestAction.new(:Enter6) do
  997. pressEnter
  998.  
  999. waitsecond(2)
  1000. end
  1001.  
  1002. tcase << TestAction.new(:Loading6) do
  1003. waitsecond(2)
  1004.  
  1005. $NYWait = RUIObject.new.with('objectid', 815131388).with('selfid', -1040612595).with('textdescid', -440199256).with('uniqueparentid', 1781929957)
  1006. .with('classname', 'android.view.View')
  1007. .with('content-desc', 'The New York Times')
  1008.  
  1009. $second = 0;
  1010.  
  1011. while ($NYWait.isNotExist) && $second < 10
  1012. puts $second
  1013. $second += 1
  1014. waitsecond(1)
  1015. end
  1016.  
  1017. waitsecond(2)
  1018. end
  1019.  
  1020. tcase << TestAction.new(:Options6) do
  1021. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  1022. .with('uitreeindex', 213)
  1023. .with('classname', 'ImageButton')
  1024. .with('resource-id', 'com.android.chrome:id/menu_button')
  1025. .with('content-desc', 'More options')
  1026.  
  1027. $ruiObj.click
  1028.  
  1029. waitsecond(2)
  1030. end
  1031.  
  1032. tcase << TestAction.new(:EditBookmark_1_1) do
  1033. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', -1695848864).with('textdescid', 223981600).with('uniqueparentid', 1676584768).with('classresourceid', 747996460)
  1034. .with('uitreeindex', 1)
  1035. .with('classname', 'ImageButton')
  1036. .with('resource-id', 'com.android.chrome:id/button_two')
  1037. .with('content-desc', 'Edit bookmark')
  1038.  
  1039. $ruiObj.isNotExist
  1040. ifFailJumpTo(:GotoSettings)
  1041.  
  1042. waitsecond(2)
  1043. end
  1044.  
  1045. tcase << TestAction.new(:Bookmark6) do
  1046. $ruiObj = RUIObject.new.with('objectid', -1748660012).with('selfid', 647573709).with('textdescid', 1394875027).with('uniqueparentid', 953315029).with('classresourceid', 747996460)
  1047. .with('uitreeindex', 1)
  1048. .with('classname', 'ImageButton')
  1049. .with('resource-id', 'com.android.chrome:id/button_two')
  1050. .with('content-desc', 'Bookmark this page')
  1051.  
  1052. $ruiObj.click
  1053.  
  1054. waitsecond(2)
  1055. end
  1056.  
  1057. tcase << TestAction.new(:Tab) do
  1058. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1714812761).with('textdescid', 885754).with('uniqueparentid', 0)
  1059. .with('uitreeindex', 34)
  1060. .with('classname', 'ImageButton')
  1061. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  1062. .with('content-desc', '1 open tab')
  1063.  
  1064. $ruiObj.click
  1065.  
  1066. waitsecond(2)
  1067. end
  1068.  
  1069. tcase << TestAction.new(:Options7) do
  1070. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  1071. .with('uitreeindex', 3)
  1072. .with('classname', 'ImageButton')
  1073. .with('resource-id', 'com.android.chrome:id/menu_button')
  1074. .with('content-desc', 'More options')
  1075.  
  1076. $ruiObj.click
  1077.  
  1078. waitsecond(2)
  1079. end
  1080.  
  1081. tcase << TestAction.new(:ClearAllTabs) do
  1082. $ruiObj = RUIObject.new.with('objectid', -1231103165).with('selfid', 437378293).with('textdescid', -1236643043).with('uniqueparentid', 1228315496).with('classresourceid', -11696959)
  1083. .with('uitreeindex', 2)
  1084. .with('classname', 'TextView')
  1085. .with('resource-id', 'com.android.chrome:id/menu_item_text')
  1086. .with('content-desc', 'Close all tabs')
  1087. .with('text', 'Close all tabs')
  1088.  
  1089. $ruiObj.click
  1090.  
  1091. waitsecond(2)
  1092. end
  1093.  
  1094. tcase << TestAction.new(:GotoSettings) do
  1095. gotoAppPixel("Settings")
  1096.  
  1097. waitsecond(2)
  1098. end
  1099.  
  1100. tcase << TestAction.new(:Apps2) do
  1101. $ruiObj = RUIObject.new.with('objectid', -1980252617).with('selfid', -999362027).with('textdescid', -2077380333).with('uniqueparentid', 1746487935)
  1102. .with('uitreeindex', 18)
  1103. .with('classname', 'TextView')
  1104. .with('resource-id', 'android:id/title')
  1105. .with('text', 'Apps notifications')
  1106.  
  1107. $ruiObj.click
  1108.  
  1109. waitsecond(2)
  1110. end
  1111.  
  1112. tcase << TestAction.new(:SearchChrome2) do
  1113. scrollAndSearchText("Chrome")
  1114.  
  1115. waitsecond(2)
  1116. end
  1117.  
  1118. tcase << TestAction.new(:Chrome2) do
  1119. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -368011717).with('textdescid', -2137822469).with('uniqueparentid', 1418026757)
  1120. .with('uitreeindex', 4)
  1121. .with('classname', 'TextView')
  1122. .with('resource-id', 'android:id/title')
  1123. .with('text', 'Chrome')
  1124.  
  1125. $ruiObj.click
  1126.  
  1127. waitsecond(2)
  1128. end
  1129.  
  1130. tcase << TestAction.new(:Storage2) do
  1131. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -1162414374).with('textdescid', -2051153520).with('uniqueparentid', 342750947)
  1132. .with('uitreeindex', 10)
  1133. .with('classname', 'TextView')
  1134. .with('resource-id', 'android:id/title')
  1135. .with('text', 'Storage')
  1136.  
  1137. $ruiObj.click
  1138.  
  1139. waitsecond(2)
  1140. end
  1141.  
  1142. tcase << TestAction.new(:ClearCache2) do
  1143. $ruiObj = RUIObject.new.with('objectid', 1453245671).with('selfid', 606168607).with('textdescid', 1434483946).with('uniqueparentid', 1890970267)
  1144. .with('uitreeindex', 6)
  1145. .with('classname', 'Button')
  1146. .with('resource-id', 'com.android.settings:id/right_button')
  1147. .with('text', 'CLEAR CACHE')
  1148.  
  1149. $ruiObj.click
  1150.  
  1151. waitsecond(2)
  1152. end
  1153.  
  1154. tcase << TestAction.new(:RecentApps) do
  1155. pressRecentApps
  1156.  
  1157. waitsecond(2)
  1158. end
  1159.  
  1160. tcase << TestAction.new(:SwipeUp) do
  1161. swipe_vertical_back 100
  1162.  
  1163. waitsecond(2)
  1164. end
  1165.  
  1166. tcase << TestAction.new(:SwipeUp2) do
  1167. swipe_vertical_back 100
  1168.  
  1169. waitsecond(2)
  1170. end
  1171.  
  1172. tcase << TestAction.new(:ClearAll) do
  1173. $ruiObj = RUIObject.new.with('objectid', -213794734).with('selfid', -204985471).with('textdescid', 1763854688).with('uniqueparentid', -537263169)
  1174. .with('uitreeindex', 12)
  1175. .with('classname', 'TextView')
  1176. .with('resource-id', 'com.android.systemui:id/button')
  1177. .with('text', 'CLEAR ALL')
  1178.  
  1179. $ruiObj.click
  1180.  
  1181. waitsecond(2)
  1182. end
  1183.  
  1184. tcase.run(loopTime)
  1185.  
  1186. end
  1187.  
  1188. def self.Browser_5_1_4_1(loopTime)
  1189.  
  1190. tcase = TestCase.new("Browser_5_1_4_1")
  1191.  
  1192. tcase << TestAction.new(:logStart) do
  1193. logStartTest('Browser_5_1_4_1')
  1194.  
  1195. waitsecond(2)
  1196. end
  1197.  
  1198. tcase << TestAction.new(:gotoChrome) do
  1199. gotoAppPixel("Chrome")
  1200.  
  1201. waitsecond(2)
  1202. end
  1203.  
  1204. tcase << TestAction.new(:Att) do
  1205. $ruiObj = RUIObject.new.with('objectid', 761198544).with('selfid', 877538782).with('textdescid', -1711693803).with('uniqueparentid', -448186901)
  1206. .with('uitreeindex', 5)
  1207. .with('classname', 'TextView')
  1208. .with('resource-id', 'com.android.chrome:id/tile_view_title')
  1209. .with('text', 'ATT Official Entertainment TV Wireless Internet')
  1210.  
  1211. $ruiObj.click
  1212.  
  1213. waitsecond(2)
  1214. end
  1215.  
  1216. tcase << TestAction.new(:Loading) do
  1217. waitsecond(2)
  1218.  
  1219. $attWait = RUIObject.new.with('objectid', 1040592064).with('selfid', 1955905798).with('textdescid', -1063252184).with('uniqueparentid', 107476858)
  1220. .with('uitreeindex', 2)
  1221. .with('classname', 'Button')
  1222. .with('content-desc', 'Search')
  1223.  
  1224. $second = 0;
  1225.  
  1226. while ($attWait.isNotExist) && $second < 10
  1227. puts $second
  1228. $second += 1
  1229. waitsecond(1)
  1230. end
  1231.  
  1232. waitsecond(2)
  1233. end
  1234.  
  1235. tcase << TestAction.new(:Failcheck) do
  1236. $ruiObj = RUIObject.new.with('objectid', 1040592064).with('selfid', 1955905798).with('textdescid', -1063252184).with('uniqueparentid', 107476858)
  1237. .with('uitreeindex', 2)
  1238. .with('classname', 'Button')
  1239. .with('content-desc', 'Search')
  1240.  
  1241. $ruiObj.isExist
  1242.  
  1243. waitsecond(2)
  1244. end
  1245.  
  1246. tcase << TestAction.new(:Result) do
  1247. $myTestResult = checkLastExistResult
  1248.  
  1249. waitsecond(2)
  1250. end
  1251.  
  1252. tcase << TestAction.new(:OpenTab) do
  1253. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1714812761).with('textdescid', 885754).with('uniqueparentid', 753086758)
  1254. .with('uitreeindex', 88)
  1255. .with('classname', 'ImageButton')
  1256. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  1257. .with('content-desc', '1 open tab')
  1258.  
  1259. $ruiObj.click
  1260.  
  1261. waitsecond(2)
  1262. end
  1263.  
  1264. tcase << TestAction.new(:Menu) do
  1265. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  1266. .with('uitreeindex', 3)
  1267. .with('classname', 'ImageButton')
  1268. .with('resource-id', 'com.android.chrome:id/menu_button')
  1269. .with('content-desc', 'More options')
  1270.  
  1271. $ruiObj.click
  1272.  
  1273. waitsecond(2)
  1274. end
  1275.  
  1276. tcase << TestAction.new(:CloseAllTab) do
  1277. $ruiObj = RUIObject.new.with('objectid', -1231103165).with('selfid', 437378293).with('textdescid', -1236643043).with('uniqueparentid', 1228315496).with('classresourceid', -11696959)
  1278. .with('uitreeindex', 2)
  1279. .with('classname', 'TextView')
  1280. .with('resource-id', 'com.android.chrome:id/menu_item_text')
  1281. .with('content-desc', 'Close all tabs')
  1282. .with('text', 'Close all tabs')
  1283.  
  1284. $ruiObj.click
  1285.  
  1286. waitsecond(2)
  1287. end
  1288.  
  1289. tcase << TestAction.new(:Settings) do
  1290. gotoAppPixel("Settings")
  1291.  
  1292. waitsecond(2)
  1293. end
  1294.  
  1295. tcase << TestAction.new(:Apps) do
  1296. $ruiObj = RUIObject.new.with('objectid', -1980252617).with('selfid', -999362027).with('textdescid', -2077380333).with('uniqueparentid', 1746487935)
  1297. .with('uitreeindex', 18)
  1298. .with('classname', 'TextView')
  1299. .with('resource-id', 'android:id/title')
  1300. .with('text', 'Apps notifications')
  1301.  
  1302. $ruiObj.click
  1303.  
  1304. waitsecond(2)
  1305. end
  1306.  
  1307. tcase << TestAction.new(:SearchChrome) do
  1308. scrollAndSearchText("Chrome")
  1309.  
  1310. waitsecond(2)
  1311. end
  1312.  
  1313. tcase << TestAction.new(:Chrome) do
  1314. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -368011717).with('textdescid', -2137822469).with('uniqueparentid', 1418026757)
  1315. .with('uitreeindex', 4)
  1316. .with('classname', 'TextView')
  1317. .with('resource-id', 'android:id/title')
  1318. .with('text', 'Chrome')
  1319.  
  1320. $ruiObj.click
  1321.  
  1322. waitsecond(2)
  1323. end
  1324.  
  1325. tcase << TestAction.new(:Storage) do
  1326. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -1162414374).with('textdescid', -2051153520).with('uniqueparentid', -1774219556)
  1327. .with('uitreeindex', 10)
  1328. .with('classname', 'TextView')
  1329. .with('resource-id', 'android:id/title')
  1330. .with('text', 'Storage')
  1331.  
  1332. $ruiObj.click
  1333.  
  1334. waitsecond(2)
  1335. end
  1336.  
  1337. tcase << TestAction.new(:ClearCache) do
  1338. $ruiObj = RUIObject.new.with('objectid', 1453245671).with('selfid', 606168607).with('textdescid', 1434483946).with('uniqueparentid', 1890970267)
  1339. .with('uitreeindex', 6)
  1340. .with('classname', 'Button')
  1341. .with('resource-id', 'com.android.settings:id/right_button')
  1342. .with('text', 'CLEAR CACHE')
  1343.  
  1344. $ruiObj.click
  1345.  
  1346. waitsecond(2)
  1347. end
  1348.  
  1349. tcase << TestAction.new(:Recent) do
  1350. pressRecentApps
  1351.  
  1352. waitsecond(2)
  1353. end
  1354.  
  1355. tcase << TestAction.new(:SwipeUp) do
  1356. swipe_vertical_back 500
  1357.  
  1358. waitsecond(2)
  1359. end
  1360.  
  1361. tcase << TestAction.new(:ClearAll) do
  1362. $ruiObj = RUIObject.new.with('objectid', -213794734).with('selfid', -204985471).with('textdescid', 1763854688).with('uniqueparentid', 2017700930)
  1363. .with('uitreeindex', 8)
  1364. .with('classname', 'TextView')
  1365. .with('resource-id', 'com.android.systemui:id/button')
  1366. .with('text', 'CLEAR ALL')
  1367.  
  1368. $ruiObj.click
  1369.  
  1370. waitsecond(2)
  1371. end
  1372.  
  1373. tcase << TestAction.new(:LogStop) do
  1374. logStopTest('Browser_5_1_4_1')
  1375.  
  1376. waitsecond(2)
  1377. end
  1378.  
  1379. tcase.run(loopTime)
  1380.  
  1381. end
  1382.  
  1383. def self.Browser_5_1_4_2(loopTime)
  1384.  
  1385. tcase = TestCase.new("Browser_5_1_4_2")
  1386.  
  1387. tcase << TestAction.new(:logStart) do
  1388. logStartTest('Browser_5_1_4_2')
  1389.  
  1390. waitsecond(2)
  1391. end
  1392.  
  1393. tcase << TestAction.new(:gotoChrome) do
  1394. gotoAppPixel('Chrome')
  1395.  
  1396.  
  1397. waitsecond(2)
  1398. end
  1399.  
  1400. tcase << TestAction.new(:Tab) do
  1401. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1877756082).with('textdescid', -559267845).with('uniqueparentid', -1651273323)
  1402. .with('uitreeindex', 20)
  1403. .with('classname', 'ImageButton')
  1404. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  1405. .with('content-desc', 'open tabs')
  1406.  
  1407. $ruiObj.click
  1408.  
  1409. waitsecond(2)
  1410. end
  1411.  
  1412. tcase << TestAction.new(:NewTab) do
  1413. $ruiObj = RUIObject.new.with('objectid', -1772071808).with('selfid', 820590808).with('textdescid', 561000469).with('uniqueparentid', 54637515)
  1414. .with('uitreeindex', 1)
  1415. .with('classname', 'Button')
  1416. .with('resource-id', 'com.android.chrome:id/new_tab_button')
  1417. .with('content-desc', 'New tab')
  1418.  
  1419. $ruiObj.click
  1420.  
  1421. waitsecond(2)
  1422. end
  1423.  
  1424. tcase << TestAction.new(:Link1) do
  1425. uitree.q("ImageView@com.android.chrome:id/tile_view_icon@@0").click
  1426.  
  1427. waitsecond(2)
  1428. end
  1429.  
  1430. tcase << TestAction.new(:Tab2) do
  1431. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1877756082).with('textdescid', -559267845).with('uniqueparentid', -1651273323)
  1432. .with('uitreeindex', 20)
  1433. .with('classname', 'ImageButton')
  1434. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  1435. .with('content-desc', 'open tabs')
  1436.  
  1437. $ruiObj.click
  1438.  
  1439. waitsecond(2)
  1440. end
  1441.  
  1442. tcase << TestAction.new(:NewTab2) do
  1443. $ruiObj = RUIObject.new.with('objectid', -1772071808).with('selfid', 820590808).with('textdescid', 561000469).with('uniqueparentid', 54637515)
  1444. .with('uitreeindex', 1)
  1445. .with('classname', 'Button')
  1446. .with('resource-id', 'com.android.chrome:id/new_tab_button')
  1447. .with('content-desc', 'New tab')
  1448.  
  1449. $ruiObj.click
  1450.  
  1451. waitsecond(2)
  1452. end
  1453.  
  1454. tcase << TestAction.new(:Link2) do
  1455. uitree.q("ImageView@com.android.chrome:id/tile_view_icon@@1").click
  1456.  
  1457. waitsecond(2)
  1458. end
  1459.  
  1460. tcase << TestAction.new(:Tab3) do
  1461. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1877756082).with('textdescid', -559267845).with('uniqueparentid', -1651273323)
  1462. .with('uitreeindex', 108)
  1463. .with('classname', 'ImageButton')
  1464. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  1465. .with('content-desc', 'open tabs')
  1466.  
  1467. $ruiObj.click
  1468.  
  1469. waitsecond(2)
  1470. end
  1471.  
  1472. tcase << TestAction.new(:NewTab3) do
  1473. $ruiObj = RUIObject.new.with('objectid', -1772071808).with('selfid', 820590808).with('textdescid', 561000469).with('uniqueparentid', -857215705)
  1474. .with('uitreeindex', 1)
  1475. .with('classname', 'Button')
  1476. .with('resource-id', 'com.android.chrome:id/new_tab_button')
  1477. .with('content-desc', 'New tab')
  1478.  
  1479. $ruiObj.click
  1480.  
  1481. waitsecond(2)
  1482. end
  1483.  
  1484. tcase << TestAction.new(:Link3) do
  1485. uitree.q("ImageView@com.android.chrome:id/tile_view_icon@@2").click
  1486.  
  1487. waitsecond(2)
  1488. end
  1489.  
  1490. tcase << TestAction.new(:Tab4) do
  1491. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1877756082).with('textdescid', -559267845).with('uniqueparentid', -1651273323)
  1492. .with('uitreeindex', 19)
  1493. .with('classname', 'ImageButton')
  1494. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  1495. .with('content-desc', 'open tabs')
  1496.  
  1497. $ruiObj.click
  1498.  
  1499. waitsecond(2)
  1500. end
  1501.  
  1502. tcase << TestAction.new(:Up1) do
  1503. swipe_vertical_back 500
  1504.  
  1505. waitsecond(2)
  1506. end
  1507.  
  1508. tcase << TestAction.new(:click1) do
  1509. click(693,688.5)
  1510.  
  1511. waitsecond(2)
  1512. end
  1513.  
  1514. tcase << TestAction.new(:Tab5) do
  1515. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1877756082).with('textdescid', -559267845).with('uniqueparentid', -1651273323)
  1516. .with('uitreeindex', 19)
  1517. .with('classname', 'ImageButton')
  1518. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  1519. .with('content-desc', 'open tabs')
  1520.  
  1521. $ruiObj.click
  1522.  
  1523. waitsecond(2)
  1524. end
  1525.  
  1526. tcase << TestAction.new(:Down) do
  1527. swipe_vertical 500
  1528.  
  1529. waitsecond(2)
  1530. end
  1531.  
  1532. tcase << TestAction.new(:click2) do
  1533. click(697.5,2074.5)
  1534.  
  1535. waitsecond(2)
  1536. end
  1537.  
  1538. tcase << TestAction.new(:Failcheck) do
  1539. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1748673363).with('textdescid', -265864838).with('uniqueparentid', 1682079956)
  1540. .with('uitreeindex', 95)
  1541. .with('classname', 'ImageButton')
  1542. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  1543. .with('content-desc', 'open tabs')
  1544.  
  1545. $ruiObj.isExist
  1546.  
  1547. waitsecond(2)
  1548. end
  1549.  
  1550. tcase << TestAction.new(:Result) do
  1551. $myTestResult = checkLastExistResult
  1552.  
  1553. waitsecond(2)
  1554. end
  1555.  
  1556. tcase << TestAction.new(:Tab6) do
  1557. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1748673363).with('textdescid', -265864838).with('uniqueparentid', 1682079956)
  1558. .with('uitreeindex', 95)
  1559. .with('classname', 'ImageButton')
  1560. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  1561. .with('content-desc', '2 open tabs')
  1562.  
  1563. $ruiObj.click
  1564.  
  1565. waitsecond(2)
  1566. end
  1567.  
  1568. tcase << TestAction.new(:Menu) do
  1569. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  1570. .with('uitreeindex', 96)
  1571. .with('classname', 'ImageButton')
  1572. .with('resource-id', 'com.android.chrome:id/menu_button')
  1573. .with('content-desc', 'More options')
  1574.  
  1575. $ruiObj.click
  1576.  
  1577. waitsecond(2)
  1578. end
  1579.  
  1580. tcase << TestAction.new(:CloseTabs) do
  1581. $ruiObj = RUIObject.new.with('objectid', -1231103165).with('selfid', 437378293).with('textdescid', -1236643043).with('uniqueparentid', 1228315496).with('classresourceid', -11696959)
  1582. .with('uitreeindex', 2)
  1583. .with('classname', 'TextView')
  1584. .with('resource-id', 'com.android.chrome:id/menu_item_text')
  1585. .with('content-desc', 'Close all tabs')
  1586. .with('text', 'Close all tabs')
  1587.  
  1588. $ruiObj.click
  1589.  
  1590. waitsecond(2)
  1591. end
  1592.  
  1593. tcase << TestAction.new(:logStop) do
  1594. logStopTest('Browser_5_1_4_2')
  1595.  
  1596. waitsecond(2)
  1597. end
  1598.  
  1599. tcase.run(loopTime)
  1600.  
  1601. end
  1602.  
  1603. def self.Browser_5_1_4_3(loopTime)
  1604.  
  1605. tcase = TestCase.new("Browser_5_1_4_3")
  1606.  
  1607. tcase << TestAction.new(:logStart) do
  1608. logStartTest("Browser_5_1_4_3")
  1609.  
  1610. waitsecond(2)
  1611. end
  1612.  
  1613. tcase << TestAction.new(:gotoChrome) do
  1614. gotoAppPixel('Chrome')
  1615.  
  1616.  
  1617. waitsecond(2)
  1618. end
  1619.  
  1620. tcase << TestAction.new(:NewTab) do
  1621. $ruiObj = RUIObject.new.with('objectid', -1772071808).with('selfid', 820590808).with('textdescid', 561000469).with('uniqueparentid', 54637515)
  1622. .with('uitreeindex', 1)
  1623. .with('classname', 'Button')
  1624. .with('resource-id', 'com.android.chrome:id/new_tab_button')
  1625. .with('content-desc', 'New tab')
  1626.  
  1627. $ruiObj.click
  1628.  
  1629. waitsecond(2)
  1630. end
  1631.  
  1632. tcase << TestAction.new(:URL1) do
  1633. $ruiObj = RUIObject.new.with('objectid', -740560065).with('selfid', 1023920737).with('textdescid', -1482525503).with('uniqueparentid', -1010905038)
  1634. .with('uitreeindex', 1)
  1635. .with('classname', 'EditText')
  1636. .with('resource-id', 'com.android.chrome:id/search_box_text')
  1637.  
  1638. $ruiObj.inputtext('www.ebay.com')
  1639.  
  1640. waitsecond(2)
  1641. end
  1642.  
  1643. tcase << TestAction.new(:Enter1) do
  1644. pressEnter
  1645.  
  1646. waitsecond(2)
  1647. end
  1648.  
  1649. tcase << TestAction.new(:Loading) do
  1650. waitsecond(2)
  1651.  
  1652. $ebayWait = RUIObject.new.with('objectid', 609044440).with('selfid', 1175141772).with('textdescid', -2143820243).with('uniqueparentid', -1830344402)
  1653. .with('uitreeindex', 4)
  1654. .with('classname', 'android.view.View')
  1655. .with('content-desc', 'eBay Home page')
  1656.  
  1657. $second = 0;
  1658.  
  1659. while ($ebayWait.isNotExist) && $second < 10
  1660. puts $second
  1661. $second += 1
  1662. waitsecond(1)
  1663. end
  1664.  
  1665. waitsecond(2)
  1666. end
  1667.  
  1668. tcase << TestAction.new(:Wait) do
  1669. waitsecond(2)
  1670.  
  1671. waitsecond(2)
  1672. end
  1673.  
  1674. tcase << TestAction.new(:FailCheck1) do
  1675. $ruiObj = RUIObject.new.with('objectid', 609044440).with('selfid', 1175141772).with('textdescid', -2143820243).with('uniqueparentid', -1830344402)
  1676. .with('uitreeindex', 4)
  1677. .with('classname', 'android.view.View')
  1678. .with('content-desc', 'eBay Home page')
  1679.  
  1680.  
  1681.  
  1682. $ruiObj.isExist
  1683.  
  1684. waitsecond(2)
  1685. end
  1686.  
  1687. tcase << TestAction.new(:Result1) do
  1688. $myTestResult = checkLastExistResult
  1689.  
  1690. waitsecond(2)
  1691. end
  1692.  
  1693. tcase << TestAction.new(:URL2) do
  1694. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', -420161517)
  1695. .with('uitreeindex', 90)
  1696. .with('classname', 'EditText')
  1697. .with('resource-id', 'com.android.chrome:id/url_bar')
  1698.  
  1699. $ruiObj.inputtext('www.yahoo.com')
  1700.  
  1701. waitsecond(2)
  1702. end
  1703.  
  1704. tcase << TestAction.new(:Enter2) do
  1705. pressEnter
  1706.  
  1707. waitsecond(2)
  1708. end
  1709.  
  1710. tcase << TestAction.new(:Loading2) do
  1711. waitsecond(2)
  1712.  
  1713. $yahooWait = RUIObject.new.with('objectid', -530407122).with('selfid', -326866941).with('textdescid', 13521966).with('uniqueparentid', -191624725)
  1714. .with('uitreeindex', 5)
  1715. .with('classname', 'Button')
  1716. .with('resource-id', 'placeHolder-search-btn')
  1717. .with('content-desc', 'Search Search')
  1718.  
  1719. $second = 0;
  1720.  
  1721. while ($yahooWait.isNotExist) && $second < 10
  1722. puts $second
  1723. $second += 1
  1724. waitsecond(1)
  1725. end
  1726.  
  1727. waitsecond(2)
  1728. end
  1729.  
  1730. tcase << TestAction.new(:Wait2) do
  1731. waitsecond(2)
  1732.  
  1733. waitsecond(2)
  1734. end
  1735.  
  1736. tcase << TestAction.new(:FailCheck2) do
  1737. $ruiObj = RUIObject.new.with('objectid', -530407122).with('selfid', -326866941).with('textdescid', 13521966).with('uniqueparentid', -191624725)
  1738. .with('uitreeindex', 5)
  1739. .with('classname', 'Button')
  1740. .with('resource-id', 'placeHolder-search-btn')
  1741. .with('content-desc', 'Search Search')
  1742.  
  1743.  
  1744.  
  1745. $ruiObj.isExist
  1746.  
  1747. waitsecond(2)
  1748. end
  1749.  
  1750. tcase << TestAction.new(:Result2) do
  1751. $myTestResult = checkLastExistResult
  1752.  
  1753. waitsecond(2)
  1754. end
  1755.  
  1756. tcase << TestAction.new(:URL3) do
  1757. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', -939721082)
  1758. .with('uitreeindex', 114)
  1759. .with('classname', 'EditText')
  1760. .with('resource-id', 'com.android.chrome:id/url_bar')
  1761.  
  1762. $ruiObj.inputtext('')
  1763.  
  1764. waitsecond(2)
  1765. end
  1766.  
  1767. tcase << TestAction.new(:Enter3) do
  1768. pressEnter
  1769.  
  1770. waitsecond(2)
  1771. end
  1772.  
  1773. tcase << TestAction.new(:Loading3) do
  1774. waitsecond(2)
  1775.  
  1776. $amazonWait = RUIObject.new.with('objectid', -1521303824).with('selfid', 1797265808).with('textdescid', 1249383791).with('uniqueparentid', -2005587295)
  1777. .with('uitreeindex', 9)
  1778. .with('classname', 'android.view.View')
  1779. .with('content-desc', 'Prime')
  1780.  
  1781. $second = 0;
  1782.  
  1783. while ($amazonWait.isNotExist) && $second < 10
  1784. puts $second
  1785. $second += 1
  1786. waitsecond(1)
  1787. end
  1788.  
  1789. waitsecond(2)
  1790. end
  1791.  
  1792. tcase << TestAction.new(:Wait3) do
  1793. waitsecond(2)
  1794.  
  1795. waitsecond(2)
  1796. end
  1797.  
  1798. tcase << TestAction.new(:FailCheck3) do
  1799. $ruiObj = RUIObject.new.with('objectid', -1521303824).with('selfid', 1797265808).with('textdescid', 1249383791).with('uniqueparentid', -2005587295)
  1800. .with('uitreeindex', 9)
  1801. .with('classname', 'android.view.View')
  1802. .with('content-desc', 'Prime')
  1803.  
  1804.  
  1805. $ruiObj.isExist
  1806.  
  1807. waitsecond(2)
  1808. end
  1809.  
  1810. tcase << TestAction.new(:Result3) do
  1811. $myTestResult = checkLastExistResult
  1812.  
  1813. waitsecond(2)
  1814. end
  1815.  
  1816. tcase << TestAction.new(:URL4) do
  1817. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', -939721082)
  1818. .with('uitreeindex', 50)
  1819. .with('classname', 'EditText')
  1820. .with('resource-id', 'com.android.chrome:id/url_bar')
  1821.  
  1822. $ruiObj.inputtext('www.youtube.com')
  1823.  
  1824. waitsecond(2)
  1825. end
  1826.  
  1827. tcase << TestAction.new(:Enter4) do
  1828. pressEnter
  1829.  
  1830. waitsecond(2)
  1831. end
  1832.  
  1833. tcase << TestAction.new(:Loading4) do
  1834. waitsecond(2)
  1835.  
  1836. $youtubeWait = RUIObject.new.with('objectid', 2003397674).with('selfid', -1955067805).with('textdescid', -1024800959).with('uniqueparentid', 841602579)
  1837. .with('uitreeindex', 1)
  1838. .with('classname', 'Button')
  1839. .with('content-desc', 'Search YouTube')
  1840.  
  1841. $second = 0;
  1842.  
  1843. while ($youtubeWait.isNotExist) && $second < 10
  1844. puts $second
  1845. $second += 1
  1846. waitsecond(1)
  1847. end
  1848.  
  1849. waitsecond(2)
  1850. end
  1851.  
  1852. tcase << TestAction.new(:Wait4) do
  1853. waitsecond(2)
  1854.  
  1855. waitsecond(2)
  1856. end
  1857.  
  1858. tcase << TestAction.new(:FailCheck4) do
  1859. $ruiObj = RUIObject.new.with('objectid', 2003397674).with('selfid', -1955067805).with('textdescid', -1024800959).with('uniqueparentid', 841602579)
  1860. .with('uitreeindex', 1)
  1861. .with('classname', 'Button')
  1862. .with('content-desc', 'Search YouTube')
  1863.  
  1864.  
  1865. $ruiObj.isExist
  1866.  
  1867. waitsecond(2)
  1868. end
  1869.  
  1870. tcase << TestAction.new(:Result4) do
  1871. $myTestResult = checkLastExistResult
  1872.  
  1873. waitsecond(2)
  1874. end
  1875.  
  1876. tcase << TestAction.new(:URL5) do
  1877. $ruiObj = RUIObject.new.with('objectid', 800382463).with('selfid', 613381324).with('textdescid', -957947391).with('uniqueparentid', -939721082)
  1878. .with('uitreeindex', 35)
  1879. .with('classname', 'EditText')
  1880. .with('resource-id', 'com.android.chrome:id/url_bar')
  1881.  
  1882. $ruiObj.inputtext('www.nytimes.com')
  1883.  
  1884. waitsecond(2)
  1885. end
  1886.  
  1887. tcase << TestAction.new(:Enter5) do
  1888. pressEnter
  1889.  
  1890. waitsecond(2)
  1891. end
  1892.  
  1893. tcase << TestAction.new(:Loading5) do
  1894. waitsecond(2)
  1895.  
  1896. $NYWait = RUIObject.new.with('objectid', 815131388).with('selfid', -1040612595).with('textdescid', -440199256).with('uniqueparentid', 1781929957)
  1897. .with('classname', 'android.view.View')
  1898. .with('content-desc', 'The New York Times')
  1899.  
  1900. $second = 0;
  1901.  
  1902. while ($NYWait.isNotExist) && $second < 10
  1903. puts $second
  1904. $second += 1
  1905. waitsecond(1)
  1906. end
  1907.  
  1908. waitsecond(2)
  1909. end
  1910.  
  1911. tcase << TestAction.new(:Wait5) do
  1912. waitsecond(2)
  1913.  
  1914. waitsecond(2)
  1915. end
  1916.  
  1917. tcase << TestAction.new(:FailCheck5) do
  1918. $ruiObj = RUIObject.new.with('objectid', 815131388).with('selfid', -1040612595).with('textdescid', -440199256).with('uniqueparentid', 1781929957)
  1919. .with('classname', 'android.view.View')
  1920. .with('content-desc', 'The New York Times')
  1921.  
  1922. $ruiObj.isExist
  1923.  
  1924. waitsecond(2)
  1925. end
  1926.  
  1927. tcase << TestAction.new(:Result5) do
  1928. $myTestResult = checkLastExistResult
  1929.  
  1930. waitsecond(2)
  1931. end
  1932.  
  1933. tcase << TestAction.new(:Tab) do
  1934. $ruiObj = RUIObject.new.with('objectid', 1733100788).with('selfid', 1714812761).with('textdescid', 885754).with('uniqueparentid', 0)
  1935. .with('uitreeindex', 34)
  1936. .with('classname', 'ImageButton')
  1937. .with('resource-id', 'com.android.chrome:id/tab_switcher_button')
  1938. .with('content-desc', '1 open tab')
  1939.  
  1940. $ruiObj.click
  1941.  
  1942. waitsecond(2)
  1943. end
  1944.  
  1945. tcase << TestAction.new(:Menu) do
  1946. $ruiObj = RUIObject.new.with('objectid', 286278959).with('selfid', -17041368).with('textdescid', 536559428).with('uniqueparentid', -1426174679)
  1947. .with('uitreeindex', 3)
  1948. .with('classname', 'ImageButton')
  1949. .with('resource-id', 'com.android.chrome:id/menu_button')
  1950. .with('content-desc', 'More options')
  1951.  
  1952. $ruiObj.click
  1953.  
  1954. waitsecond(2)
  1955. end
  1956.  
  1957. tcase << TestAction.new(:ClearAll) do
  1958. $ruiObj = RUIObject.new.with('objectid', -1231103165).with('selfid', 437378293).with('textdescid', -1236643043).with('uniqueparentid', 1228315496).with('classresourceid', -11696959)
  1959. .with('uitreeindex', 2)
  1960. .with('classname', 'TextView')
  1961. .with('resource-id', 'com.android.chrome:id/menu_item_text')
  1962. .with('content-desc', 'Close all tabs')
  1963. .with('text', 'Close all tabs')
  1964.  
  1965. $ruiObj.click
  1966.  
  1967. waitsecond(2)
  1968. end
  1969.  
  1970. tcase << TestAction.new(:Settings) do
  1971. gotoAppPixel("Settings")
  1972.  
  1973. waitsecond(2)
  1974. end
  1975.  
  1976. tcase << TestAction.new(:Apps) do
  1977. $ruiObj = RUIObject.new.with('objectid', -1980252617).with('selfid', -999362027).with('textdescid', -2077380333).with('uniqueparentid', 1746487935)
  1978. .with('uitreeindex', 18)
  1979. .with('classname', 'TextView')
  1980. .with('resource-id', 'android:id/title')
  1981. .with('text', 'Apps notifications')
  1982.  
  1983. $ruiObj.click
  1984.  
  1985. waitsecond(2)
  1986. end
  1987.  
  1988. tcase << TestAction.new(:SearchChrome) do
  1989. scrollAndSearchText("Chrome")
  1990.  
  1991. waitsecond(2)
  1992. end
  1993.  
  1994. tcase << TestAction.new(:Chrome) do
  1995. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -368011717).with('textdescid', -2137822469).with('uniqueparentid', 1418026757)
  1996. .with('uitreeindex', 4)
  1997. .with('classname', 'TextView')
  1998. .with('resource-id', 'android:id/title')
  1999. .with('text', 'Chrome')
  2000.  
  2001. $ruiObj.click
  2002.  
  2003. waitsecond(2)
  2004. end
  2005.  
  2006. tcase << TestAction.new(:Storage) do
  2007. $ruiObj = RUIObject.new.with('objectid', 1540349781).with('selfid', -1162414374).with('textdescid', -2051153520).with('uniqueparentid', 342750947)
  2008. .with('uitreeindex', 10)
  2009. .with('classname', 'TextView')
  2010. .with('resource-id', 'android:id/title')
  2011. .with('text', 'Storage')
  2012.  
  2013. $ruiObj.click
  2014.  
  2015. waitsecond(2)
  2016. end
  2017.  
  2018. tcase << TestAction.new(:ClearCache) do
  2019. $ruiObj = RUIObject.new.with('objectid', 1453245671).with('selfid', 606168607).with('textdescid', 1434483946).with('uniqueparentid', 1890970267)
  2020. .with('uitreeindex', 6)
  2021. .with('classname', 'Button')
  2022. .with('resource-id', 'com.android.settings:id/right_button')
  2023. .with('text', 'CLEAR CACHE')
  2024.  
  2025. $ruiObj.click
  2026.  
  2027. waitsecond(2)
  2028. end
  2029.  
  2030. tcase << TestAction.new(:Recent) do
  2031. pressRecentApps
  2032.  
  2033. waitsecond(2)
  2034. end
  2035.  
  2036. tcase << TestAction.new(:Up) do
  2037. swipe_vertical_back 100
  2038.  
  2039. waitsecond(2)
  2040. end
  2041.  
  2042. tcase << TestAction.new(:Up2) do
  2043. swipe_vertical_back 100
  2044.  
  2045. waitsecond(2)
  2046. end
  2047.  
  2048. tcase << TestAction.new(:ClearAll2) do
  2049. $ruiObj = RUIObject.new.with('objectid', -213794734).with('selfid', -204985471).with('textdescid', 1763854688).with('uniqueparentid', -537263169)
  2050. .with('uitreeindex', 12)
  2051. .with('classname', 'TextView')
  2052. .with('resource-id', 'com.android.systemui:id/button')
  2053. .with('text', 'CLEAR ALL')
  2054.  
  2055. $ruiObj.click
  2056.  
  2057. waitsecond(2)
  2058. end
  2059.  
  2060. tcase << TestAction.new(:logStop) do
  2061. logStopTest("Browser_5_1_4_3")
  2062.  
  2063. waitsecond(2)
  2064. end
  2065.  
  2066. tcase.run(loopTime)
  2067.  
  2068. end
  2069.  
  2070. def self.EMAIL_5_1_3_1(loopTime)
  2071.  
  2072. tcase = TestCase.new("EMAIL_5_1_3_1")
  2073.  
  2074. tcase << TestAction.new(:logStart) do
  2075. logStartTest('Email_5_1_3_1')
  2076.  
  2077. waitsecond(2)
  2078. end
  2079.  
  2080. tcase << TestAction.new(:gotoGmail) do
  2081. gotoAppPixel('Gmail')
  2082.  
  2083. waitsecond(2)
  2084. end
  2085.  
  2086. tcase << TestAction.new(:Compose) do
  2087. $ruiObj = RUIObject.new.with('objectid', 1598291378).with('selfid', 1808564263).with('textdescid', -1604213756).with('uniqueparentid', 150150411)
  2088. .with('uitreeindex', 22)
  2089. .with('classname', 'ImageButton')
  2090. .with('resource-id', 'com.google.android.gm:id/compose_button')
  2091. .with('content-desc', 'Compose')
  2092.  
  2093. $ruiObj.click
  2094.  
  2095. waitsecond(2)
  2096. end
  2097.  
  2098. tcase << TestAction.new(:ToField) do
  2099. $ruiObj = RUIObject.new.with('objectid', 1308296701).with('selfid', 678761455).with('textdescid', 1902492099).with('uniqueparentid', -1962010460).with('classresourceid', 1488875515)
  2100. .with('uitreeindex', 9)
  2101. .with('classname', 'MultiAutoCompleteTextView')
  2102. .with('resource-id', 'com.google.android.gm:id/to')
  2103.  
  2104. $ruiObj.inputtext('lge.qct.test4@gmail.com ')
  2105.  
  2106. waitsecond(2)
  2107. end
  2108.  
  2109. tcase << TestAction.new(:SubjectField) do
  2110. $ruiObj = RUIObject.new.with('objectid', 524508352).with('selfid', -477614756).with('textdescid', -920110240).with('uniqueparentid', -1427376388).with('classresourceid', 927865352)
  2111. .with('uitreeindex', 12)
  2112. .with('classname', 'EditText')
  2113. .with('resource-id', 'com.google.android.gm:id/subject')
  2114.  
  2115. $ruiObj.click
  2116.  
  2117. waitsecond(2)
  2118. end
  2119.  
  2120. tcase << TestAction.new(:InputText) do
  2121. $ruiObj.inputtext('Email Test 1')
  2122.  
  2123. waitsecond(2)
  2124. end
  2125.  
  2126. tcase << TestAction.new(:ComposeField) do
  2127. $ruiObj = RUIObject.new.with('objectid', -2101420856).with('selfid', -497970335).with('textdescid', 1027339414).with('uniqueparentid', 1227675605).with('classresourceid', 1815484335)
  2128. .with('uitreeindex', 14)
  2129. .with('classname', 'android.view.View')
  2130. .with('content-desc', 'Compose email')
  2131.  
  2132. $ruiObj.click
  2133.  
  2134. waitsecond(2)
  2135. end
  2136.  
  2137. tcase << TestAction.new(:InputText2) do
  2138. $ruiObj.inputtext('Email Test - 30 Characters, No Attachments')
  2139.  
  2140. waitsecond(2)
  2141. end
  2142.  
  2143. tcase << TestAction.new(:Send) do
  2144. $ruiObj = RUIObject.new.with('objectid', 823683940).with('selfid', 2103341243).with('textdescid', -976543260).with('uniqueparentid', -1674145749)
  2145. .with('uitreeindex', 3)
  2146. .with('classname', 'TextView')
  2147. .with('resource-id', 'com.google.android.gm:id/send')
  2148. .with('content-desc', 'Send')
  2149.  
  2150. $ruiObj.click
  2151.  
  2152. waitsecond(2)
  2153. end
  2154.  
  2155. tcase << TestAction.new(:Wait) do
  2156. waitsecond(2)
  2157.  
  2158. waitsecond(2)
  2159. end
  2160.  
  2161. tcase << TestAction.new(:Navigate) do
  2162. $ruiObj = RUIObject.new.with('objectid', -1013150848).with('selfid', 1589392844).with('textdescid', -993230041).with('uniqueparentid', -941014244)
  2163. .with('uitreeindex', 0)
  2164. .with('classname', 'ImageButton')
  2165. .with('content-desc', 'Open navigation drawer')
  2166.  
  2167. $ruiObj.click
  2168.  
  2169. waitsecond(2)
  2170. end
  2171.  
  2172. tcase << TestAction.new(:Sent) do
  2173. $ruiObj = RUIObject.new.with('objectid', -630461263).with('selfid', -610816808).with('textdescid', 727067449).with('uniqueparentid', -382526183).with('classresourceid', 790406410)
  2174. .with('uitreeindex', 22)
  2175. .with('classname', 'TextView')
  2176. .with('resource-id', 'com.google.android.gm:id/name')
  2177. .with('text', 'Sent')
  2178.  
  2179. $ruiObj.click
  2180.  
  2181. waitsecond(2)
  2182. end
  2183.  
  2184. tcase << TestAction.new(:FailCheck) do
  2185. $ruiObj = RUIObject.new.with('objectid', -1155201837).with('selfid', -1497543209).with('textdescid', -636469849).with('uniqueparentid', 1819926825).with('classresourceid', 1815484335)
  2186. .with('uitreeindex', 4)
  2187. .with('pretext', 'Sent?0')
  2188. .with('classname', 'android.view.View')
  2189. .with('content-desc', 'Double tap to select this conversation')
  2190.  
  2191. $ruiObj.isExist
  2192.  
  2193. waitsecond(2)
  2194. end
  2195.  
  2196. tcase << TestAction.new(:Result) do
  2197. $myTestResult = checkLastExistResult
  2198.  
  2199. if $myTestResult == false
  2200. $myFailReason = "Email not sent"
  2201. end
  2202.  
  2203. waitsecond(2)
  2204. end
  2205.  
  2206. tcase << TestAction.new(:Delete) do
  2207. $sentMail = RUIObject.new.with('objectid', -1155201837).with('selfid', -1497543209).with('textdescid', -636469849).with('uniqueparentid', -440420788).with('classresourceid', 1815484335)
  2208. .with('uitreeindex', 7)
  2209. .with('pretext', 'Sent?0')
  2210. .with('classname', 'android.view.View')
  2211. .with('content-desc', 'Double tap to select this conversation')
  2212. $deleteButton = RUIObject.new.with('objectid', 1483973719).with('selfid', -390800203).with('textdescid', 1201560756).with('uniqueparentid', 1555561971)
  2213. .with('uitreeindex', 9)
  2214. .with('classname', 'TextView')
  2215. .with('resource-id', 'com.google.android.gm:id/delete')
  2216. .with('content-desc', 'Delete')
  2217.  
  2218. $count = 0;
  2219.  
  2220. while ($sentMail.isExist) && $count < 5 do
  2221. $sentMail.click
  2222. waitsecond(2)
  2223. $deleteButton.click
  2224. puts $count
  2225. $count += 1
  2226. waitsecond(2)
  2227. end
  2228.  
  2229. waitsecond(2)
  2230. end
  2231.  
  2232. tcase << TestAction.new(:logStop) do
  2233. logStopTest('Email_5_1_3_1')
  2234.  
  2235. waitsecond(2)
  2236. end
  2237.  
  2238. tcase.run(loopTime)
  2239.  
  2240. end
  2241.  
  2242. def self.EMAIL_5_1_3_2(loopTime)
  2243.  
  2244. tcase = TestCase.new("EMAIL_5_1_3_2")
  2245.  
  2246. tcase << TestAction.new(:logStart) do
  2247. logStartTest('Email_5_1_3_2')
  2248.  
  2249. waitsecond(2)
  2250. end
  2251.  
  2252. tcase << TestAction.new(:gotoGmail) do
  2253. gotoAppPixel('Gmail')
  2254.  
  2255. waitsecond(2)
  2256. end
  2257.  
  2258. tcase << TestAction.new(:Compose) do
  2259. $ruiObj = RUIObject.new.with('objectid', 1598291378).with('selfid', 1808564263).with('textdescid', -1604213756).with('uniqueparentid', 150150411)
  2260. .with('uitreeindex', 5)
  2261. .with('classname', 'ImageButton')
  2262. .with('resource-id', 'com.google.android.gm:id/compose_button')
  2263. .with('content-desc', 'Compose')
  2264.  
  2265. $ruiObj.click
  2266.  
  2267. waitsecond(2)
  2268. end
  2269.  
  2270. tcase << TestAction.new(:ToField) do
  2271. $ruiObj = RUIObject.new.with('objectid', 1308296701).with('selfid', 678761455).with('textdescid', 1902492099).with('uniqueparentid', -1962010460).with('classresourceid', 1488875515)
  2272. .with('uitreeindex', 9)
  2273. .with('classname', 'MultiAutoCompleteTextView')
  2274. .with('resource-id', 'com.google.android.gm:id/to')
  2275.  
  2276. $ruiObj.inputtext('lge.qct.test4@gmail.com ')
  2277.  
  2278. waitsecond(2)
  2279. end
  2280.  
  2281. tcase << TestAction.new(:SubjectField) do
  2282. $ruiObj = RUIObject.new.with('objectid', 524508352).with('selfid', -477614756).with('textdescid', -920110240).with('uniqueparentid', -1427376388).with('classresourceid', 927865352)
  2283. .with('uitreeindex', 12)
  2284. .with('classname', 'EditText')
  2285. .with('resource-id', 'com.google.android.gm:id/subject')
  2286.  
  2287. $ruiObj.click
  2288.  
  2289. waitsecond(2)
  2290. end
  2291.  
  2292. tcase << TestAction.new(:InputText1) do
  2293. $ruiObj.inputtext('Email Test 2')
  2294.  
  2295. waitsecond(2)
  2296. end
  2297.  
  2298. tcase << TestAction.new(:ComposeField) do
  2299. $ruiObj = RUIObject.new.with('objectid', -2101420856).with('selfid', -497970335).with('textdescid', 1027339414).with('uniqueparentid', 1227675605).with('classresourceid', 1815484335)
  2300. .with('uitreeindex', 14)
  2301. .with('classname', 'android.view.View')
  2302. .with('content-desc', 'Compose email')
  2303.  
  2304. $ruiObj.click
  2305.  
  2306. waitsecond(2)
  2307. end
  2308.  
  2309. tcase << TestAction.new(:InputText2) do
  2310. $ruiObj.inputtext('Email Test - 30 Characters, With Attachments')
  2311.  
  2312. waitsecond(2)
  2313. end
  2314.  
  2315. tcase << TestAction.new(:AddAttachment) do
  2316. $ruiObj = RUIObject.new.with('objectid', -124211107).with('selfid', 1566257663).with('textdescid', -1240659436).with('uniqueparentid', -1674145749)
  2317. .with('uitreeindex', 2)
  2318. .with('classname', 'TextView')
  2319. .with('resource-id', 'com.google.android.gm:id/add_attachment')
  2320. .with('content-desc', 'Attach file')
  2321.  
  2322. $ruiObj.click
  2323.  
  2324. waitsecond(2)
  2325. end
  2326.  
  2327. tcase << TestAction.new(:AddFile) do
  2328. $ruiObj = RUIObject.new.with('objectid', 665784376).with('selfid', -1478650284).with('textdescid', 1395090321).with('uniqueparentid', -382816812).with('classresourceid', -1261418567)
  2329. .with('uitreeindex', 0)
  2330. .with('classname', 'TextView')
  2331. .with('resource-id', 'com.google.android.gm:id/title')
  2332. .with('text', 'Attach file')
  2333.  
  2334. $ruiObj.click
  2335.  
  2336. waitsecond(2)
  2337. end
  2338.  
  2339. tcase << TestAction.new(:FirstPicture) do
  2340. uitree.q("ImageView@com.android.documentsui:id/icon_thumb@@0").click
  2341.  
  2342. waitsecond(2)
  2343. end
  2344.  
  2345. tcase << TestAction.new(:Open) do
  2346. $ruiObj = RUIObject.new.with('objectid', -95054285).with('selfid', -1917650957).with('textdescid', -767253783).with('uniqueparentid', 543885849)
  2347. .with('uitreeindex', 46)
  2348. .with('classname', 'TextView')
  2349. .with('resource-id', 'com.android.documentsui:id/action_menu_open')
  2350. .with('text', 'OPEN')
  2351.  
  2352. $ruiObj.click
  2353.  
  2354. waitsecond(2)
  2355. end
  2356.  
  2357. tcase << TestAction.new(:Send) do
  2358. $ruiObj = RUIObject.new.with('objectid', 823683940).with('selfid', 2103341243).with('textdescid', -976543260).with('uniqueparentid', -1674145749)
  2359. .with('uitreeindex', 3)
  2360. .with('classname', 'TextView')
  2361. .with('resource-id', 'com.google.android.gm:id/send')
  2362. .with('content-desc', 'Send')
  2363.  
  2364. $ruiObj.click
  2365.  
  2366. waitsecond(2)
  2367. end
  2368.  
  2369. tcase << TestAction.new(:Wait) do
  2370. waitsecond(2)
  2371.  
  2372. waitsecond(2)
  2373. end
  2374.  
  2375. tcase << TestAction.new(:Navigate) do
  2376. $ruiObj = RUIObject.new.with('objectid', -1013150848).with('selfid', 1589392844).with('textdescid', -993230041).with('uniqueparentid', -941014244)
  2377. .with('uitreeindex', 0)
  2378. .with('classname', 'ImageButton')
  2379. .with('content-desc', 'Open navigation drawer')
  2380.  
  2381. $ruiObj.click
  2382.  
  2383. waitsecond(2)
  2384. end
  2385.  
  2386. tcase << TestAction.new(:Sent) do
  2387. $ruiObj = RUIObject.new.with('objectid', -630461263).with('selfid', -610816808).with('textdescid', 727067449).with('uniqueparentid', 336360023).with('classresourceid', 790406410)
  2388. .with('uitreeindex', 22)
  2389. .with('classname', 'TextView')
  2390. .with('resource-id', 'com.google.android.gm:id/name')
  2391. .with('text', 'Sent')
  2392.  
  2393. $ruiObj.click
  2394.  
  2395. waitsecond(2)
  2396. end
  2397.  
  2398. tcase << TestAction.new(:FailCheck) do
  2399. $ruiObj = RUIObject.new.with('objectid', -1155201837).with('selfid', -1497543209).with('textdescid', -636469849).with('uniqueparentid', 1819926825).with('classresourceid', 1815484335)
  2400. .with('uitreeindex', 4)
  2401. .with('pretext', 'Sent?0')
  2402. .with('classname', 'android.view.View')
  2403. .with('content-desc', 'Double tap to select this conversation')
  2404.  
  2405. $ruiObj.isExist
  2406.  
  2407. waitsecond(2)
  2408. end
  2409.  
  2410. tcase << TestAction.new(:Result) do
  2411. $myTestResult = checkLastExistResult
  2412.  
  2413. if $myTestResult == false
  2414. $myFailReason = "Email not sent"
  2415. end
  2416.  
  2417. waitsecond(2)
  2418. end
  2419.  
  2420. tcase << TestAction.new(:Delete) do
  2421. $sentMail = RUIObject.new.with('objectid', -1155201837).with('selfid', -1497543209).with('textdescid', -636469849).with('uniqueparentid', 619983791).with('classresourceid', 1815484335)
  2422. .with('uitreeindex', 4)
  2423. .with('pretext', 'Sent?0')
  2424. .with('classname', 'android.view.View')
  2425. .with('content-desc', 'Double tap to select this conversation')
  2426.  
  2427. $deleteButton = RUIObject.new.with('objectid', 1483973719).with('selfid', -390800203).with('textdescid', 1201560756).with('uniqueparentid', 1555561971)
  2428. .with('uitreeindex', 11)
  2429. .with('classname', 'TextView')
  2430. .with('resource-id', 'com.google.android.gm:id/delete')
  2431. .with('content-desc', 'Delete')
  2432.  
  2433. $count = 0;
  2434.  
  2435. while ($sentMail.isExist) && $count < 5 do
  2436. $sentMail.click
  2437. waitsecond(2)
  2438. $deleteButton.click
  2439. puts $count
  2440. $count += 1
  2441. waitsecond(2)
  2442. end
  2443.  
  2444. waitsecond(2)
  2445. end
  2446.  
  2447. tcase << TestAction.new(:logStop) do
  2448. logStopTest('Email_5_1_3_2')
  2449.  
  2450. waitsecond(2)
  2451. end
  2452.  
  2453. tcase.run(loopTime)
  2454.  
  2455. end
  2456.  
  2457. def self.NFC_5_1_11_1(loopTime)
  2458.  
  2459. tcase = TestCase.new("NFC_5_1_11_1")
  2460.  
  2461. tcase << TestAction.new(:logStart) do
  2462. logStartTest("NFC_5_1_11_1")
  2463.  
  2464. waitsecond(2)
  2465. end
  2466.  
  2467. tcase << TestAction.new(:Recent) do
  2468. pressRecentApps
  2469.  
  2470. waitsecond(2)
  2471. end
  2472.  
  2473. tcase << TestAction.new(:Down) do
  2474. swipe_vertical 100
  2475.  
  2476. waitsecond(2)
  2477. end
  2478.  
  2479. tcase << TestAction.new(:ClearAll) do
  2480. $ruiObj = RUIObject.new.with('objectid', -213794734).with('selfid', -204985471).with('textdescid', 1763854688).with('uniqueparentid', 432406995)
  2481. .with('uitreeindex', 4)
  2482. .with('classname', 'TextView')
  2483. .with('resource-id', 'com.android.systemui:id/button')
  2484. .with('text', 'CLEAR ALL')
  2485.  
  2486. $ruiObj.click
  2487.  
  2488. waitsecond(2)
  2489. end
  2490.  
  2491. tcase << TestAction.new(:GotoSettings) do
  2492. gotoAppPixel('Settings')
  2493.  
  2494.  
  2495. waitsecond(2)
  2496. end
  2497.  
  2498. tcase << TestAction.new(:ConnectedDevice) do
  2499. $ruiObj = RUIObject.new.with('objectid', -1980252617).with('selfid', -2089735067).with('textdescid', 48216771).with('uniqueparentid', -1387883596)
  2500. .with('uitreeindex', 13)
  2501. .with('classname', 'TextView')
  2502. .with('resource-id', 'android:id/title')
  2503. .with('text', 'Connected devices')
  2504.  
  2505. $ruiObj.click
  2506.  
  2507. waitsecond(2)
  2508. end
  2509.  
  2510. tcase << TestAction.new(:Off1) do
  2511. $NFCon = RUIObject.new.with('objectid', 104348776).with('selfid', 411050777).with('textdescid', 2105771625).with('uniqueparentid', 1207404591)
  2512. .with('uitreeindex', 14)
  2513. .with('classname', 'Switch')
  2514. .with('resource-id', 'android:id/switch_widget')
  2515. .with('text', 'ON')
  2516.  
  2517. if $NFCon.isExist
  2518. $NFCon.click
  2519. end
  2520.  
  2521. waitsecond(2)
  2522. end
  2523.  
  2524. tcase << TestAction.new(:On) do
  2525. $NFCoff = RUIObject.new.with('objectid', 104348776).with('selfid', -142327979).with('textdescid', 854404457).with('uniqueparentid', -1225169821)
  2526. .with('uitreeindex', 13)
  2527. .with('classname', 'Switch')
  2528. .with('resource-id', 'android:id/switch_widget')
  2529. .with('text', 'OFF')
  2530.  
  2531. if $NFCoff.isExist
  2532. $NFCoff.click
  2533. end
  2534.  
  2535. waitsecond(2)
  2536. end
  2537.  
  2538. tcase << TestAction.new(:Wait10Sec) do
  2539. waitsecond(10)
  2540.  
  2541. waitsecond(2)
  2542. end
  2543.  
  2544. tcase << TestAction.new(:FailCheck) do
  2545. $ruiObj = RUIObject.new.with('objectid', 104348776).with('selfid', 411050777).with('textdescid', 2105771625).with('uniqueparentid', 1207404591)
  2546. .with('uitreeindex', 13)
  2547. .with('classname', 'Switch')
  2548. .with('resource-id', 'android:id/switch_widget')
  2549. .with('text', 'ON')
  2550.  
  2551. $ruiObj.isExist
  2552.  
  2553. waitsecond(2)
  2554. end
  2555.  
  2556. tcase << TestAction.new(:Result) do
  2557. $myTestResult = checkLastExistResult
  2558.  
  2559. waitsecond(2)
  2560. end
  2561.  
  2562. tcase << TestAction.new(:Off2) do
  2563. $NFCon = RUIObject.new.with('objectid', 104348776).with('selfid', 411050777).with('textdescid', 2105771625).with('uniqueparentid', 1207404591)
  2564. .with('uitreeindex', 14)
  2565. .with('classname', 'Switch')
  2566. .with('resource-id', 'android:id/switch_widget')
  2567. .with('text', 'ON')
  2568.  
  2569. if $NFCon.isExist
  2570. $NFCon.click
  2571. end
  2572.  
  2573. waitsecond(2)
  2574. end
  2575.  
  2576. tcase << TestAction.new(:logStop) do
  2577. logStopTest('NFC_5_1_11_1')
  2578.  
  2579. waitsecond(2)
  2580. end
  2581.  
  2582. tcase.run(loopTime)
  2583.  
  2584. end
  2585.  
  2586. def self.exception_handler
  2587. puts "Module Exception Hanlder..."
  2588. end
  2589.  
  2590. def self.run(loop)
  2591. mainLoop loop
  2592. end
  2593.  
  2594. end
  2595.  
  2596. $exceptionPackageNameList = []
  2597. $exceptionPackageNameList_exclude = []
  2598.  
  2599. def exception_handler
  2600. SNOWBOARD_MTBF_EMAIL.exception_handler
  2601. end
  2602.  
  2603. $curProjectLogFile = $useLastLogFile
  2604.  
  2605. $curProjectLogFile = "SNOWBOARD_MTBF_EMAIL_#{getTimeStamp}.log" if $useLastLogFile.nil?
  2606.  
  2607. $useLastLogFile = nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement