Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.75 KB | None | 0 0
  1.  
  2. loadTestDB
  3.  
  4. module H1_Menu_nav
  5.  
  6. def self.mainLoop(loopTime)
  7.  
  8. WebSocketXServer.setAutoUpdate(false)
  9.  
  10. index = $mainResumeMainLoop
  11. $mainResumeMainLoop = 0
  12.  
  13. writelog("mainLoop::#{index}::Resume") if index > 0
  14.  
  15. while index < loopTime
  16.  
  17. $curMainLoopNum = index
  18.  
  19. $POWERLOG = true
  20.  
  21. waitsecond(2)
  22.  
  23. $actionParamInput = "none"
  24. FirstPage 1
  25.  
  26. waitsecond(2)
  27.  
  28. $actionParamInput = "none"
  29. OtherPage 1
  30.  
  31. waitsecond(2)
  32.  
  33.  
  34. if rand(100) < 0
  35.  
  36. $actionParamInput = "none"
  37. Menu_nav 1
  38.  
  39. waitsecond(2)
  40.  
  41. end
  42.  
  43.  
  44.  
  45. sendStatus("Done::mainLoop::Loop::#{index}")
  46.  
  47.  
  48. writelog("Finish::Loop::#{$curMainLoopNum}")
  49.  
  50.  
  51. saveLogFileToGist if $saveLogToGist
  52.  
  53. index += 1
  54.  
  55. end
  56.  
  57. $engineStatus = "Idle"
  58. resetStatus
  59. sendStatus("Finish::mainLoop::END")
  60.  
  61. end
  62.  
  63. def self.Menu_nav(loopTime)
  64.  
  65. tcase = TestCase.new("Menu_nav")
  66.  
  67. tcase << TestAction.new(:scriptAction_7) do
  68. $appCounter = 0;
  69. end
  70.  
  71. tcase << TestAction.new(:scriptAction_2) do
  72.  
  73. until $appCounter > 100
  74. $appCounter += 1
  75. gotoApp(db('MenuNavi')[$appCounter-1])
  76. waitsecond(2)
  77. pressHome
  78. end
  79. end
  80.  
  81. tcase.run(loopTime)
  82.  
  83. end
  84.  
  85. def self.OtherPage_ori(loopTime)
  86.  
  87. tcase = TestCase.new("OtherPage_ori")
  88.  
  89. tcase << TestAction.new(:swipeRight_2) do
  90. swipe_horizontal 50
  91. end
  92.  
  93. tcase << TestAction.new(:scriptAction_38_1) do
  94. $checkGallery = 0
  95. until $checkGallery === true
  96.  
  97. click(216,244)
  98. waitsecond(2)
  99. pressHome
  100. waitsecond(1)
  101.  
  102. click(436,244)
  103. waitsecond(2)
  104. pressHome
  105. waitsecond(1)
  106.  
  107. click(740,244)
  108. waitsecond(2)
  109. pressHome
  110. waitsecond(1)
  111. click(996,244)
  112. waitsecond(2)
  113. pressHome
  114. waitsecond(1)
  115. click(1280,244)
  116. waitsecond(2)
  117. pressHome
  118. waitsecond(1)
  119. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  120. .with('uitreeindex', 5)
  121. .with('classname', 'TextView')
  122. .with('content-desc', 'Gallery')
  123. .with('text', 'Gallery').exists?
  124. if $checkGallery === true
  125. break
  126. end
  127. click(216,576)
  128. waitsecond(2)
  129. pressHome
  130. waitsecond(1)
  131. click(436,576)
  132. waitsecond(2)
  133. pressHome
  134. waitsecond(1)
  135. click(740,576)
  136. waitsecond(2)
  137. pressHome
  138. waitsecond(1)
  139. click(996,576)
  140. waitsecond(2)
  141. pressHome
  142. waitsecond(1)
  143. click(1280,576)
  144. waitsecond(2)
  145. pressHome
  146. waitsecond(1)
  147. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  148. .with('uitreeindex', 5)
  149. .with('classname', 'TextView')
  150. .with('content-desc', 'Gallery')
  151. .with('text', 'Gallery').exists?
  152. if $checkGallery === true
  153. break
  154. end
  155. click(216,952)
  156. waitsecond(2)
  157. pressHome
  158. waitsecond(1)
  159. click(436,952)
  160. waitsecond(2)
  161. pressHome
  162. waitsecond(1)
  163. click(740,952)
  164. waitsecond(2)
  165. pressHome
  166. waitsecond(1)
  167. click(996,952)
  168. waitsecond(2)
  169. pressHome
  170. waitsecond(1)
  171. click(1280,952)
  172. waitsecond(2)
  173. pressHome
  174. waitsecond(1)
  175. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  176. .with('uitreeindex', 5)
  177. .with('classname', 'TextView')
  178. .with('content-desc', 'Gallery')
  179. .with('text', 'Gallery').exists?
  180. if $checkGallery === true
  181. break
  182. end
  183. click(216,1324)
  184. waitsecond(2)
  185. pressHome
  186. waitsecond(1)
  187. click(436,1324)
  188. waitsecond(2)
  189. pressHome
  190. waitsecond(1)
  191. click(740,1324)
  192. waitsecond(2)
  193. pressHome
  194. waitsecond(1)
  195. click(996,1324)
  196. waitsecond(2)
  197. pressHome
  198. waitsecond(1)
  199. click(1280,1324)
  200. waitsecond(2)
  201. pressHome
  202. waitsecond(1)
  203. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  204. .with('uitreeindex', 5)
  205. .with('classname', 'TextView')
  206. .with('content-desc', 'Gallery')
  207. .with('text', 'Gallery').exists?
  208. if $checkGallery === true
  209. break
  210. end
  211. click(216,1692)
  212. waitsecond(2)
  213. pressHome
  214. waitsecond(1)
  215. click(436,1692)
  216. waitsecond(2)
  217. pressHome
  218. waitsecond(1)
  219. click(740,1692)
  220. waitsecond(2)
  221. pressHome
  222. waitsecond(1)
  223. click(996,1692)
  224. waitsecond(2)
  225. pressHome
  226. waitsecond(1)
  227. click(1280,1692)
  228. waitsecond(2)
  229. pressHome
  230. waitsecond(1)
  231. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  232. .with('uitreeindex', 5)
  233. .with('classname', 'TextView')
  234. .with('content-desc', 'Gallery')
  235. .with('text', 'Gallery').exists?
  236. swipe_horizontal 50
  237. end
  238.  
  239. end
  240.  
  241. tcase << TestAction.new(:TextView_Gallery_5_1) do
  242. $ruiObj = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  243. .with('uitreeindex', 5)
  244. .with('classname', 'TextView')
  245. .with('content-desc', 'Gallery')
  246. .with('text', 'Gallery')
  247.  
  248. $ruiObj.isNotExist
  249. ifFailJumpTo(:pressHome_14)
  250. end
  251.  
  252. tcase << TestAction.new(:scriptAction_38_1_1) do
  253. $checkGallery = 0
  254. until $checkGallery === true
  255.  
  256. click(216,244)
  257. waitsecond(2)
  258. pressHome
  259. waitsecond(1)
  260.  
  261. click(436,244)
  262. waitsecond(2)
  263. pressHome
  264. waitsecond(1)
  265.  
  266. click(740,244)
  267. waitsecond(2)
  268. pressHome
  269. waitsecond(1)
  270. click(996,244)
  271. waitsecond(2)
  272. pressHome
  273. waitsecond(1)
  274. click(1280,244)
  275. waitsecond(2)
  276. pressHome
  277. waitsecond(1)
  278. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  279. .with('uitreeindex', 5)
  280. .with('classname', 'TextView')
  281. .with('content-desc', 'Gallery')
  282. .with('text', 'Gallery').exists?
  283. if $checkGallery === true
  284. break
  285. end
  286. click(216,576)
  287. waitsecond(2)
  288. pressHome
  289. waitsecond(1)
  290. click(436,576)
  291. waitsecond(2)
  292. pressHome
  293. waitsecond(1)
  294. click(740,576)
  295. waitsecond(2)
  296. pressHome
  297. waitsecond(1)
  298. click(996,576)
  299. waitsecond(2)
  300. pressHome
  301. waitsecond(1)
  302. click(1280,576)
  303. waitsecond(2)
  304. pressHome
  305. waitsecond(1)
  306. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  307. .with('uitreeindex', 5)
  308. .with('classname', 'TextView')
  309. .with('content-desc', 'Gallery')
  310. .with('text', 'Gallery').exists?
  311. if $checkGallery === true
  312. break
  313. end
  314. click(216,952)
  315. waitsecond(2)
  316. pressHome
  317. waitsecond(1)
  318. click(436,952)
  319. waitsecond(2)
  320. pressHome
  321. waitsecond(1)
  322. click(740,952)
  323. waitsecond(2)
  324. pressHome
  325. waitsecond(1)
  326. click(996,952)
  327. waitsecond(2)
  328. pressHome
  329. waitsecond(1)
  330. click(1280,952)
  331. waitsecond(2)
  332. pressHome
  333. waitsecond(1)
  334. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  335. .with('uitreeindex', 5)
  336. .with('classname', 'TextView')
  337. .with('content-desc', 'Gallery')
  338. .with('text', 'Gallery').exists?
  339. if $checkGallery === true
  340. break
  341. end
  342. click(216,1324)
  343. waitsecond(2)
  344. pressHome
  345. waitsecond(1)
  346. click(436,1324)
  347. waitsecond(2)
  348. pressHome
  349. waitsecond(1)
  350. click(740,1324)
  351. waitsecond(2)
  352. pressHome
  353. waitsecond(1)
  354. click(996,1324)
  355. waitsecond(2)
  356. pressHome
  357. waitsecond(1)
  358. click(1280,1324)
  359. waitsecond(2)
  360. pressHome
  361. waitsecond(1)
  362. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  363. .with('uitreeindex', 5)
  364. .with('classname', 'TextView')
  365. .with('content-desc', 'Gallery')
  366. .with('text', 'Gallery').exists?
  367. if $checkGallery === true
  368. break
  369. end
  370. click(216,1692)
  371. waitsecond(2)
  372. pressHome
  373. waitsecond(1)
  374. click(436,1692)
  375. waitsecond(2)
  376. pressHome
  377. waitsecond(1)
  378. click(740,1692)
  379. waitsecond(2)
  380. pressHome
  381. waitsecond(1)
  382. click(996,1692)
  383. waitsecond(2)
  384. pressHome
  385. waitsecond(1)
  386. click(1280,1692)
  387. waitsecond(2)
  388. pressHome
  389. waitsecond(1)
  390. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  391. .with('uitreeindex', 5)
  392. .with('classname', 'TextView')
  393. .with('content-desc', 'Gallery')
  394. .with('text', 'Gallery').exists?
  395. swipe_horizontal 50
  396. end
  397.  
  398. end
  399.  
  400. tcase << TestAction.new(:TextView_Gallery_5_1_1) do
  401. $ruiObj = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  402. .with('uitreeindex', 5)
  403. .with('classname', 'TextView')
  404. .with('content-desc', 'Gallery')
  405. .with('text', 'Gallery')
  406.  
  407. $ruiObj.isNotExist
  408. ifFailJumpTo(:pressHome_14)
  409. end
  410.  
  411. tcase << TestAction.new(:scriptAction_38_1_1_1) do
  412. $checkGallery = 0
  413. until $checkGallery === true
  414.  
  415. click(216,244)
  416. waitsecond(2)
  417. pressHome
  418. waitsecond(1)
  419.  
  420. click(436,244)
  421. waitsecond(2)
  422. pressHome
  423. waitsecond(1)
  424.  
  425. click(740,244)
  426. waitsecond(2)
  427. pressHome
  428. waitsecond(1)
  429. click(996,244)
  430. waitsecond(2)
  431. pressHome
  432. waitsecond(1)
  433. click(1280,244)
  434. waitsecond(2)
  435. pressHome
  436. waitsecond(1)
  437. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  438. .with('uitreeindex', 5)
  439. .with('classname', 'TextView')
  440. .with('content-desc', 'Gallery')
  441. .with('text', 'Gallery').exists?
  442. if $checkGallery === true
  443. break
  444. end
  445. click(216,576)
  446. waitsecond(2)
  447. pressHome
  448. waitsecond(1)
  449. click(436,576)
  450. waitsecond(2)
  451. pressHome
  452. waitsecond(1)
  453. click(740,576)
  454. waitsecond(2)
  455. pressHome
  456. waitsecond(1)
  457. click(996,576)
  458. waitsecond(2)
  459. pressHome
  460. waitsecond(1)
  461. click(1280,576)
  462. waitsecond(2)
  463. pressHome
  464. waitsecond(1)
  465. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  466. .with('uitreeindex', 5)
  467. .with('classname', 'TextView')
  468. .with('content-desc', 'Gallery')
  469. .with('text', 'Gallery').exists?
  470. if $checkGallery === true
  471. break
  472. end
  473. click(216,952)
  474. waitsecond(2)
  475. pressHome
  476. waitsecond(1)
  477. click(436,952)
  478. waitsecond(2)
  479. pressHome
  480. waitsecond(1)
  481. click(740,952)
  482. waitsecond(2)
  483. pressHome
  484. waitsecond(1)
  485. click(996,952)
  486. waitsecond(2)
  487. pressHome
  488. waitsecond(1)
  489. click(1280,952)
  490. waitsecond(2)
  491. pressHome
  492. waitsecond(1)
  493. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  494. .with('uitreeindex', 5)
  495. .with('classname', 'TextView')
  496. .with('content-desc', 'Gallery')
  497. .with('text', 'Gallery').exists?
  498. if $checkGallery === true
  499. break
  500. end
  501. click(216,1324)
  502. waitsecond(2)
  503. pressHome
  504. waitsecond(1)
  505. click(436,1324)
  506. waitsecond(2)
  507. pressHome
  508. waitsecond(1)
  509. click(740,1324)
  510. waitsecond(2)
  511. pressHome
  512. waitsecond(1)
  513. click(996,1324)
  514. waitsecond(2)
  515. pressHome
  516. waitsecond(1)
  517. click(1280,1324)
  518. waitsecond(2)
  519. pressHome
  520. waitsecond(1)
  521. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  522. .with('uitreeindex', 5)
  523. .with('classname', 'TextView')
  524. .with('content-desc', 'Gallery')
  525. .with('text', 'Gallery').exists?
  526. if $checkGallery === true
  527. break
  528. end
  529. click(216,1692)
  530. waitsecond(2)
  531. pressHome
  532. waitsecond(1)
  533. click(436,1692)
  534. waitsecond(2)
  535. pressHome
  536. waitsecond(1)
  537. click(740,1692)
  538. waitsecond(2)
  539. pressHome
  540. waitsecond(1)
  541. click(996,1692)
  542. waitsecond(2)
  543. pressHome
  544. waitsecond(1)
  545. click(1280,1692)
  546. waitsecond(2)
  547. pressHome
  548. waitsecond(1)
  549. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  550. .with('uitreeindex', 5)
  551. .with('classname', 'TextView')
  552. .with('content-desc', 'Gallery')
  553. .with('text', 'Gallery').exists?
  554. swipe_horizontal 50
  555. end
  556.  
  557. end
  558.  
  559. tcase << TestAction.new(:TextView_Gallery_5_1_1_1) do
  560. $ruiObj = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  561. .with('uitreeindex', 5)
  562. .with('classname', 'TextView')
  563. .with('content-desc', 'Gallery')
  564. .with('text', 'Gallery')
  565.  
  566. $ruiObj.isNotExist
  567. ifFailJumpTo(:pressHome_14)
  568. end
  569.  
  570. tcase << TestAction.new(:scriptAction_38_1_1_1_1) do
  571. $checkGallery = 0
  572. until $checkGallery === true
  573.  
  574. click(216,244)
  575. waitsecond(2)
  576. pressHome
  577. waitsecond(1)
  578.  
  579. click(436,244)
  580. waitsecond(2)
  581. pressHome
  582. waitsecond(1)
  583.  
  584. click(740,244)
  585. waitsecond(2)
  586. pressHome
  587. waitsecond(1)
  588. click(996,244)
  589. waitsecond(2)
  590. pressHome
  591. waitsecond(1)
  592. click(1280,244)
  593. waitsecond(2)
  594. pressHome
  595. waitsecond(1)
  596. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  597. .with('uitreeindex', 5)
  598. .with('classname', 'TextView')
  599. .with('content-desc', 'Gallery')
  600. .with('text', 'Gallery').exists?
  601. if $checkGallery === true
  602. break
  603. end
  604. click(216,576)
  605. waitsecond(2)
  606. pressHome
  607. waitsecond(1)
  608. click(436,576)
  609. waitsecond(2)
  610. pressHome
  611. waitsecond(1)
  612. click(740,576)
  613. waitsecond(2)
  614. pressHome
  615. waitsecond(1)
  616. click(996,576)
  617. waitsecond(2)
  618. pressHome
  619. waitsecond(1)
  620. click(1280,576)
  621. waitsecond(2)
  622. pressHome
  623. waitsecond(1)
  624. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  625. .with('uitreeindex', 5)
  626. .with('classname', 'TextView')
  627. .with('content-desc', 'Gallery')
  628. .with('text', 'Gallery').exists?
  629. if $checkGallery === true
  630. break
  631. end
  632. click(216,952)
  633. waitsecond(2)
  634. pressHome
  635. waitsecond(1)
  636. click(436,952)
  637. waitsecond(2)
  638. pressHome
  639. waitsecond(1)
  640. click(740,952)
  641. waitsecond(2)
  642. pressHome
  643. waitsecond(1)
  644. click(996,952)
  645. waitsecond(2)
  646. pressHome
  647. waitsecond(1)
  648. click(1280,952)
  649. waitsecond(2)
  650. pressHome
  651. waitsecond(1)
  652. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  653. .with('uitreeindex', 5)
  654. .with('classname', 'TextView')
  655. .with('content-desc', 'Gallery')
  656. .with('text', 'Gallery').exists?
  657. if $checkGallery === true
  658. break
  659. end
  660. click(216,1324)
  661. waitsecond(2)
  662. pressHome
  663. waitsecond(1)
  664. click(436,1324)
  665. waitsecond(2)
  666. pressHome
  667. waitsecond(1)
  668. click(740,1324)
  669. waitsecond(2)
  670. pressHome
  671. waitsecond(1)
  672. click(996,1324)
  673. waitsecond(2)
  674. pressHome
  675. waitsecond(1)
  676. click(1280,1324)
  677. waitsecond(2)
  678. pressHome
  679. waitsecond(1)
  680. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  681. .with('uitreeindex', 5)
  682. .with('classname', 'TextView')
  683. .with('content-desc', 'Gallery')
  684. .with('text', 'Gallery').exists?
  685. if $checkGallery === true
  686. break
  687. end
  688. click(216,1692)
  689. waitsecond(2)
  690. pressHome
  691. waitsecond(1)
  692. click(436,1692)
  693. waitsecond(2)
  694. pressHome
  695. waitsecond(1)
  696. click(740,1692)
  697. waitsecond(2)
  698. pressHome
  699. waitsecond(1)
  700. click(996,1692)
  701. waitsecond(2)
  702. pressHome
  703. waitsecond(1)
  704. click(1280,1692)
  705. waitsecond(2)
  706. pressHome
  707. waitsecond(1)
  708. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  709. .with('uitreeindex', 5)
  710. .with('classname', 'TextView')
  711. .with('content-desc', 'Gallery')
  712. .with('text', 'Gallery').exists?
  713. swipe_horizontal 50
  714. end
  715.  
  716. end
  717.  
  718. tcase << TestAction.new(:TextView_Gallery_5_1_1_1_1) do
  719. $ruiObj = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  720. .with('uitreeindex', 5)
  721. .with('classname', 'TextView')
  722. .with('content-desc', 'Gallery')
  723. .with('text', 'Gallery')
  724.  
  725. $ruiObj.isNotExist
  726. ifFailJumpTo(:pressHome_14)
  727. end
  728.  
  729. tcase << TestAction.new(:scriptAction_38_1_1_1_1_1) do
  730. $checkGallery = 0
  731. until $checkGallery === true
  732.  
  733. click(216,244)
  734. waitsecond(2)
  735. pressHome
  736. waitsecond(1)
  737.  
  738. click(436,244)
  739. waitsecond(2)
  740. pressHome
  741. waitsecond(1)
  742.  
  743. click(740,244)
  744. waitsecond(2)
  745. pressHome
  746. waitsecond(1)
  747. click(996,244)
  748. waitsecond(2)
  749. pressHome
  750. waitsecond(1)
  751. click(1280,244)
  752. waitsecond(2)
  753. pressHome
  754. waitsecond(1)
  755. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  756. .with('uitreeindex', 5)
  757. .with('classname', 'TextView')
  758. .with('content-desc', 'Gallery')
  759. .with('text', 'Gallery').exists?
  760. if $checkGallery === true
  761. break
  762. end
  763. click(216,576)
  764. waitsecond(2)
  765. pressHome
  766. waitsecond(1)
  767. click(436,576)
  768. waitsecond(2)
  769. pressHome
  770. waitsecond(1)
  771. click(740,576)
  772. waitsecond(2)
  773. pressHome
  774. waitsecond(1)
  775. click(996,576)
  776. waitsecond(2)
  777. pressHome
  778. waitsecond(1)
  779. click(1280,576)
  780. waitsecond(2)
  781. pressHome
  782. waitsecond(1)
  783. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  784. .with('uitreeindex', 5)
  785. .with('classname', 'TextView')
  786. .with('content-desc', 'Gallery')
  787. .with('text', 'Gallery').exists?
  788. if $checkGallery === true
  789. break
  790. end
  791. click(216,952)
  792. waitsecond(2)
  793. pressHome
  794. waitsecond(1)
  795. click(436,952)
  796. waitsecond(2)
  797. pressHome
  798. waitsecond(1)
  799. click(740,952)
  800. waitsecond(2)
  801. pressHome
  802. waitsecond(1)
  803. click(996,952)
  804. waitsecond(2)
  805. pressHome
  806. waitsecond(1)
  807. click(1280,952)
  808. waitsecond(2)
  809. pressHome
  810. waitsecond(1)
  811. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  812. .with('uitreeindex', 5)
  813. .with('classname', 'TextView')
  814. .with('content-desc', 'Gallery')
  815. .with('text', 'Gallery').exists?
  816. if $checkGallery === true
  817. break
  818. end
  819. click(216,1324)
  820. waitsecond(2)
  821. pressHome
  822. waitsecond(1)
  823. click(436,1324)
  824. waitsecond(2)
  825. pressHome
  826. waitsecond(1)
  827. click(740,1324)
  828. waitsecond(2)
  829. pressHome
  830. waitsecond(1)
  831. click(996,1324)
  832. waitsecond(2)
  833. pressHome
  834. waitsecond(1)
  835. click(1280,1324)
  836. waitsecond(2)
  837. pressHome
  838. waitsecond(1)
  839. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  840. .with('uitreeindex', 5)
  841. .with('classname', 'TextView')
  842. .with('content-desc', 'Gallery')
  843. .with('text', 'Gallery').exists?
  844. if $checkGallery === true
  845. break
  846. end
  847. click(216,1692)
  848. waitsecond(2)
  849. pressHome
  850. waitsecond(1)
  851. click(436,1692)
  852. waitsecond(2)
  853. pressHome
  854. waitsecond(1)
  855. click(740,1692)
  856. waitsecond(2)
  857. pressHome
  858. waitsecond(1)
  859. click(996,1692)
  860. waitsecond(2)
  861. pressHome
  862. waitsecond(1)
  863. click(1280,1692)
  864. waitsecond(2)
  865. pressHome
  866. waitsecond(1)
  867. $checkGallery = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  868. .with('uitreeindex', 5)
  869. .with('classname', 'TextView')
  870. .with('content-desc', 'Gallery')
  871. .with('text', 'Gallery').exists?
  872. swipe_horizontal 50
  873. end
  874.  
  875. end
  876.  
  877. tcase << TestAction.new(:TextView_Gallery_5) do
  878. $ruiObj = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  879. .with('uitreeindex', 5)
  880. .with('classname', 'TextView')
  881. .with('content-desc', 'Gallery')
  882. .with('text', 'Gallery')
  883.  
  884. $ruiObj.isNotExist
  885. ifFailJumpTo(:pressHome_14)
  886. end
  887.  
  888. tcase << TestAction.new(:TextView_Gallery_5_1) do
  889. $ruiObj = RUIObject.new.with('objectid', 70668614).with('selfid', -2112895374).with('textdescid', -1611398154).with('uniqueparentid', 0)
  890. .with('uitreeindex', 5)
  891. .with('classname', 'TextView')
  892. .with('content-desc', 'Gallery')
  893. .with('text', 'Gallery')
  894.  
  895. $ruiObj.isExist
  896. ifFailJumpTo(:swipeRight_2)
  897. end
  898.  
  899. tcase << TestAction.new(:pressHome_14) do
  900. pressHome
  901. end
  902.  
  903. tcase.run(loopTime)
  904.  
  905. end
  906.  
  907. def self.android_ExpHandler(loopTime)
  908.  
  909. tcase = TestCase.new("android_ExpHandler")
  910.  
  911. tcase << TestAction.new(:scriptAction_1) do
  912. $err = "system popup detected::#{takeScreenShot}::screenshot saved"
  913. $myTestResult = false
  914. puts $err
  915. logcat($err)
  916. writelog($err)
  917. uiObj("Button").click if uiObj("Button").exists
  918.  
  919. waitsecond(1)
  920. end
  921.  
  922. tcase.run(loopTime)
  923.  
  924. end
  925.  
  926. def self.startTest(loopTime)
  927.  
  928. tcase = TestCase.new("startTest")
  929.  
  930. tcase.run(loopTime)
  931.  
  932. end
  933.  
  934. def self.FirstPage(loopTime)
  935.  
  936. tcase = TestCase.new("FirstPage")
  937.  
  938. tcase << TestAction.new(:pressHome_39) do
  939. pressHome
  940.  
  941. waitsecond(2)
  942. end
  943.  
  944. tcase << TestAction.new(:pressHome_39_1_1) do
  945. pressHome
  946.  
  947. waitsecond(2)
  948. end
  949.  
  950. tcase << TestAction.new(:scriptAction_38_1) do
  951. click(216,1692)
  952. waitsecond(15)
  953. pressHome
  954. waitsecond(2)
  955. click(436,1692)
  956. waitsecond(15)
  957. pressHome
  958. waitsecond(2)
  959. click(740,1692)
  960. waitsecond(15)
  961. pressHome
  962. waitsecond(2)
  963. click(1280,1692)
  964. waitsecond(15)
  965. pressHome
  966. waitsecond(2)
  967.  
  968. waitsecond(2)
  969. end
  970.  
  971. tcase.run(loopTime)
  972.  
  973. end
  974.  
  975. def self.OtherPage(loopTime)
  976.  
  977. tcase = TestCase.new("OtherPage")
  978.  
  979. tcase << TestAction.new(:swipeRight_2) do
  980. swipe_horizontal 50
  981. end
  982.  
  983. tcase << TestAction.new(:scriptAction_3) do
  984. takeScreenShot
  985. end
  986.  
  987. tcase << TestAction.new(:scriptAction_38_1) do
  988. click(216,244)
  989. waitsecond(15)
  990. pressHome
  991. waitsecond(2)
  992.  
  993. click(436,244)
  994. waitsecond(15)
  995. pressHome
  996. waitsecond(2)
  997.  
  998. click(740,244)
  999. waitsecond(15)
  1000. pressHome
  1001. waitsecond(2)
  1002. click(1280,244)
  1003. waitsecond(15)
  1004. pressHome
  1005. waitsecond(2)
  1006.  
  1007.  
  1008. end
  1009.  
  1010. tcase << TestAction.new(:TextView_Play_2) do
  1011. $ruiObj = RUIObject.new.with('objectid', 70668614).with('selfid', 809278702).with('textdescid', 957369146).with('uniqueparentid', 0)
  1012. .with('uitreeindex', 11)
  1013. .with('classname', 'TextView')
  1014. .with('content-desc', 'Play Store')
  1015. .with('text', 'Play Store')
  1016.  
  1017. $ruiObj.isNotExist
  1018. ifFailJumpTo(:pressHome_14)
  1019. end
  1020.  
  1021. tcase << TestAction.new(:scriptAction_38_1_1) do
  1022. click(216,576)
  1023. waitsecond(15)
  1024. pressHome
  1025. waitsecond(2)
  1026. click(436,576)
  1027. waitsecond(15)
  1028. pressHome
  1029. waitsecond(2)
  1030. click(740,576)
  1031. waitsecond(15)
  1032. pressHome
  1033. waitsecond(2)
  1034. click(1280,576)
  1035. waitsecond(15)
  1036. pressHome
  1037. waitsecond(2)
  1038.  
  1039. end
  1040.  
  1041. tcase << TestAction.new(:TextView_Play_2_1) do
  1042. $ruiObj = RUIObject.new.with('objectid', 70668614).with('selfid', 809278702).with('textdescid', 957369146).with('uniqueparentid', 0)
  1043. .with('uitreeindex', 11)
  1044. .with('classname', 'TextView')
  1045. .with('content-desc', 'Play Store')
  1046. .with('text', 'Play Store')
  1047.  
  1048. $ruiObj.isNotExist
  1049. ifFailJumpTo(:pressHome_14)
  1050. end
  1051.  
  1052. tcase << TestAction.new(:scriptAction_38_1_1_1) do
  1053. click(216,952)
  1054. waitsecond(15)
  1055. pressHome
  1056. waitsecond(2)
  1057. click(436,952)
  1058. waitsecond(15)
  1059. pressHome
  1060. waitsecond(2)
  1061. click(740,952)
  1062. waitsecond(15)
  1063. pressHome
  1064. waitsecond(2)
  1065. click(1280,952)
  1066. waitsecond(15)
  1067. pressHome
  1068. waitsecond(2)
  1069.  
  1070. end
  1071.  
  1072. tcase << TestAction.new(:TextView_Play_2_1_1) do
  1073. $ruiObj = RUIObject.new.with('objectid', 70668614).with('selfid', 809278702).with('textdescid', 957369146).with('uniqueparentid', 0)
  1074. .with('uitreeindex', 11)
  1075. .with('classname', 'TextView')
  1076. .with('content-desc', 'Play Store')
  1077. .with('text', 'Play Store')
  1078.  
  1079. $ruiObj.isNotExist
  1080. ifFailJumpTo(:pressHome_14)
  1081. end
  1082.  
  1083. tcase << TestAction.new(:scriptAction_38_1_1_1_1) do
  1084. click(216,1324)
  1085. waitsecond(15)
  1086. pressHome
  1087. waitsecond(2)
  1088. click(436,1324)
  1089. waitsecond(15)
  1090. pressHome
  1091. waitsecond(2)
  1092. click(740,1324)
  1093. waitsecond(15)
  1094. pressHome
  1095. waitsecond(2)
  1096. click(1280,1324)
  1097. waitsecond(15)
  1098. pressHome
  1099. waitsecond(2)
  1100.  
  1101. end
  1102.  
  1103. tcase << TestAction.new(:TextView_Play_2_1_1_1) do
  1104. $ruiObj = RUIObject.new.with('objectid', 70668614).with('selfid', 809278702).with('textdescid', 957369146).with('uniqueparentid', 0)
  1105. .with('uitreeindex', 11)
  1106. .with('classname', 'TextView')
  1107. .with('content-desc', 'Play Store')
  1108. .with('text', 'Play Store')
  1109.  
  1110. $ruiObj.isNotExist
  1111. ifFailJumpTo(:pressHome_14)
  1112. end
  1113.  
  1114. tcase << TestAction.new(:scriptAction_38_1_1_1_1_1) do
  1115. click(216,1692)
  1116. waitsecond(15)
  1117. pressHome
  1118. waitsecond(2)
  1119. click(436,1692)
  1120. waitsecond(15)
  1121. pressHome
  1122. waitsecond(2)
  1123. click(740,1692)
  1124. waitsecond(15)
  1125. pressHome
  1126. waitsecond(2)
  1127. click(1280,1692)
  1128. waitsecond(15)
  1129. pressHome
  1130. waitsecond(2)
  1131.  
  1132. end
  1133.  
  1134. tcase << TestAction.new(:TextView_Play_2_1_1_1_1) do
  1135. $ruiObj = RUIObject.new.with('objectid', 70668614).with('selfid', 809278702).with('textdescid', 957369146).with('uniqueparentid', 0)
  1136. .with('uitreeindex', 11)
  1137. .with('classname', 'TextView')
  1138. .with('content-desc', 'Play Store')
  1139. .with('text', 'Play Store')
  1140.  
  1141. $ruiObj.isNotExist
  1142. ifFailJumpTo(:pressHome_14)
  1143. end
  1144.  
  1145. tcase << TestAction.new(:TextView_Play_2_1_1_1_1_1) do
  1146. $ruiObj = RUIObject.new.with('objectid', 70668614).with('selfid', 809278702).with('textdescid', 957369146).with('uniqueparentid', 0)
  1147. .with('uitreeindex', 11)
  1148. .with('classname', 'TextView')
  1149. .with('content-desc', 'Play Store')
  1150. .with('text', 'Play Store')
  1151.  
  1152. $ruiObj.isExist
  1153. ifFailJumpTo(:swipeRight_2)
  1154. end
  1155.  
  1156. tcase << TestAction.new(:pressHome_14) do
  1157. pressHome
  1158. end
  1159.  
  1160. tcase.run(loopTime)
  1161.  
  1162. end
  1163.  
  1164. def self.exception_handler
  1165. puts "Module Exception Hanlder..."
  1166. if ($lastPackageName == "android")
  1167. android_ExpHandler(1)
  1168. end
  1169. end
  1170.  
  1171. def self.run(loop)
  1172. mainLoop loop
  1173. end
  1174.  
  1175. end
  1176.  
  1177. $exceptionPackageNameList = []
  1178. $exceptionPackageNameList_exclude = []
  1179. $exceptionPackageNameList << "android"
  1180.  
  1181. def exception_handler
  1182. H1_Menu_nav.exception_handler
  1183. end
  1184.  
  1185. $curProjectLogFile = $useLastLogFile
  1186.  
  1187. $curProjectLogFile = "H1_Menu_nav_#{getTimeStamp}.log" if $useLastLogFile.nil?
  1188.  
  1189. $useLastLogFile = nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement