Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.84 KB | None | 0 0
  1.  
  2. loadTestDB
  3.  
  4. module Hplus_videoEditing
  5.  
  6. def self.Delete_video(loopTime)
  7.  
  8. tcase = TestCase.new("Delete_video")
  9.  
  10. tcase << TestAction.new(:pressHome_1) do
  11. pressHome
  12.  
  13. waitsecond(2)
  14. end
  15.  
  16. tcase << TestAction.new(:TextView_Gallery_2) do
  17. $ruiObj = RUIObject.new.with('objectid', -479243074).with('selfid', -2112895374).with('textdescid', -740073602).with('uniqueparentid', 0)
  18. .with('uitreeindex', 26)
  19. .with('classname', 'TextView')
  20. .with('content-desc', 'Gallery')
  21. .with('text', 'Gallery')
  22.  
  23. $ruiObj.click
  24.  
  25. waitsecond(2)
  26. end
  27.  
  28. tcase << TestAction.new(:TextView_ActionDelete_3) do
  29. $ruiObj = RUIObject.new.with('objectid', -1071203962).with('selfid', -340367424).with('textdescid', -1190220699).with('uniqueparentid', 0)
  30. .with('uitreeindex', 4)
  31. .with('classname', 'TextView')
  32. .with('resource-id', 'com.android.gallery3d:id/action_delete')
  33. .with('content-desc', 'Delete')
  34.  
  35. $ruiObj.click
  36.  
  37. waitsecond(2)
  38. end
  39.  
  40. tcase << TestAction.new(:Button_Button1_4) do
  41. $ruiObj = RUIObject.new.with('objectid', 95721616).with('selfid', 982364851).with('textdescid', -1653186491).with('uniqueparentid', 0)
  42. .with('uitreeindex', 2)
  43. .with('classname', 'Button')
  44. .with('resource-id', 'android:id/button1')
  45. .with('text', 'DELETE')
  46.  
  47. $ruiObj.click
  48.  
  49. waitsecond(2)
  50. end
  51.  
  52. tcase.run(loopTime)
  53.  
  54. end
  55.  
  56. def self.Finish(loopTime)
  57.  
  58. tcase = TestCase.new("Finish")
  59.  
  60. tcase << TestAction.new(:pressBack_1) do
  61. pressBack
  62.  
  63. waitsecond(2)
  64. end
  65.  
  66. tcase << TestAction.new(:pressBack_1_1) do
  67. pressBack
  68.  
  69. waitsecond(2)
  70. end
  71.  
  72. tcase.run(loopTime)
  73.  
  74. end
  75.  
  76. def self.Frame_Speed_1(loopTime)
  77.  
  78. tcase = TestCase.new("Frame_Speed_1")
  79.  
  80. tcase << TestAction.new(:TextView_Edit_2) do
  81. $ruiObj = RUIObject.new.with('objectid', -428282449).with('selfid', 1160143396).with('textdescid', -197620933).with('uniqueparentid', 0)
  82. .with('uitreeindex', 12)
  83. .with('classname', 'TextView')
  84. .with('content-desc', 'Edit')
  85.  
  86. $ruiObj.click
  87.  
  88. waitsecond(8)
  89. end
  90.  
  91. tcase << TestAction.new(:View_PreviewSurface_2_1) do
  92. $ruiObj = RUIObject.new.with('objectid', -936430728).with('selfid', -549442069).with('textdescid', 1035418536).with('uniqueparentid', 0)
  93. .with('uitreeindex', 33)
  94. .with('classname', 'android.view.View')
  95. .with('resource-id', 'com.lge.videostudio:id/preview_surface')
  96.  
  97. $ruiObj.click
  98.  
  99. waitsecond(2)
  100. end
  101.  
  102. tcase << TestAction.new(:drag_280_2020_4) do
  103. $UIDev.drag(280,2020,450,2020,20)
  104.  
  105. waitsecond(2)
  106. end
  107.  
  108. tcase << TestAction.new(:TextView_x12_6_1) do
  109. $ruiObj = RUIObject.new.with('objectid', 225520138).with('selfid', -535057657).with('textdescid', 1875101437).with('uniqueparentid', 0)
  110. .with('uitreeindex', 12)
  111. .with('classname', 'TextView')
  112. .with('text', 'x12')
  113.  
  114. $ruiObj.click
  115.  
  116. waitsecond(2)
  117. end
  118.  
  119. tcase << TestAction.new(:drag_1152_2024_6) do
  120. $UIDev.drag(1152,2024,952,2024,20)
  121.  
  122. waitsecond(2)
  123. end
  124.  
  125. tcase << TestAction.new(:TextView_x2_8_1) do
  126. $ruiObj = RUIObject.new.with('objectid', 225520138).with('selfid', 1091118732).with('textdescid', 1030318480).with('uniqueparentid', 0)
  127. .with('uitreeindex', 16)
  128. .with('classname', 'TextView')
  129. .with('text', 'x2')
  130.  
  131. $ruiObj.click
  132.  
  133. waitsecond(2)
  134. end
  135.  
  136. tcase << TestAction.new(:ImageButton_TrimAreaPlayPause_8) do
  137. $ruiObj = RUIObject.new.with('objectid', -1568366829).with('selfid', 571059935).with('textdescid', -50611199).with('uniqueparentid', 0)
  138. .with('uitreeindex', 30)
  139. .with('classname', 'ImageButton')
  140. .with('resource-id', 'com.lge.videostudio:id/trim_area_play_pause')
  141. .with('content-desc', 'Play')
  142.  
  143. $ruiObj.click
  144.  
  145. waitsecond(2)
  146. end
  147.  
  148. tcase << TestAction.new(:wait32second_9) do
  149. waitsecond(102)
  150. end
  151.  
  152. tcase << TestAction.new(:Button_TrimAreaSave_10) do
  153. $ruiObj = RUIObject.new.with('objectid', -2139312908).with('selfid', 893316343).with('textdescid', -1979207657).with('uniqueparentid', 0)
  154. .with('uitreeindex', 32)
  155. .with('classname', 'Button')
  156. .with('resource-id', 'com.lge.videostudio:id/trim_area_save')
  157. .with('text', 'SAVE')
  158.  
  159. $ruiObj.click
  160.  
  161. waitsecond(2)
  162. end
  163.  
  164. tcase << TestAction.new(:wait32second_11) do
  165. waitsecond(270)
  166. end
  167.  
  168. tcase << TestAction.new(:TextView_SizeSlash_5) do
  169. $ruiObj = RUIObject.new.with('objectid', -896702750).with('selfid', -1833838425).with('textdescid', -2027981442).with('uniqueparentid', 0)
  170. .with('uitreeindex', 1)
  171. .with('classname', 'TextView')
  172. .with('resource-id', 'com.lge.videostudio:id/size_slash')
  173. .with('text', '')
  174.  
  175. $ruiObj.click
  176.  
  177. waitsecond(2)
  178. end
  179.  
  180. tcase.run(loopTime)
  181.  
  182. end
  183.  
  184. def self.mainLoop(loopTime)
  185.  
  186. WebSocketXServer.setAutoUpdate(false)
  187.  
  188. index = $mainResumeMainLoop
  189. $mainResumeMainLoop = 0
  190.  
  191. writelog("mainLoop::#{index}::Resume") if index > 0
  192.  
  193. while index < loopTime
  194.  
  195. $curMainLoopNum = index
  196.  
  197. $actionParamInput = "none"
  198. Delete_video 1
  199.  
  200. waitsecond(2)
  201.  
  202. $actionParamInput = "none"
  203. Recoding_Video 1
  204.  
  205. waitsecond(2)
  206.  
  207. $actionParamInput = "none"
  208. Starting_Editing_Video 1
  209.  
  210. waitsecond(2)
  211.  
  212. $actionParamInput = "none"
  213. Frame_Speed 1
  214.  
  215. waitsecond(2)
  216.  
  217. $actionParamInput = "none"
  218. Frame_Speed_1 1
  219.  
  220. waitsecond(2)
  221.  
  222. $actionParamInput = "none"
  223. Finish 1
  224.  
  225. waitsecond(2)
  226.  
  227.  
  228. sendStatus("Done::mainLoop::Loop::#{index}")
  229.  
  230.  
  231. writelog("Finish::Loop::#{$curMainLoopNum}")
  232.  
  233.  
  234. saveLogFileToGist if $saveLogToGist
  235.  
  236. index += 1
  237.  
  238. end
  239.  
  240. $engineStatus = "Idle"
  241. resetStatus
  242. sendStatus("Finish::mainLoop::END")
  243.  
  244. end
  245.  
  246. def self.Trim_frame(loopTime)
  247.  
  248. tcase = TestCase.new("Trim_frame")
  249.  
  250. tcase.run(loopTime)
  251.  
  252. end
  253.  
  254. def self.startTest(loopTime)
  255.  
  256. tcase = TestCase.new("startTest")
  257.  
  258. tcase.run(loopTime)
  259.  
  260. end
  261.  
  262. def self.Recoding_Video(loopTime)
  263.  
  264. tcase = TestCase.new("Recoding_Video")
  265.  
  266. tcase << TestAction.new(:pressHome_1) do
  267. pressHome
  268.  
  269. waitsecond(2)
  270. end
  271.  
  272. tcase << TestAction.new(:TextView_Camera_2) do
  273. $ruiObj = RUIObject.new.with('objectid', -479243074).with('selfid', -1103134098).with('textdescid', 1803325250).with('uniqueparentid', 0)
  274. .with('uitreeindex', 25)
  275. .with('classname', 'TextView')
  276. .with('content-desc', 'Camera')
  277. .with('text', 'Camera')
  278.  
  279. $ruiObj.click
  280.  
  281. waitsecond(4)
  282. end
  283.  
  284. tcase << TestAction.new(:Button_OkButton_2) do
  285. $ruiObj = RUIObject.new.with('objectid', -658747592).with('selfid', -286954065).with('textdescid', 333963238).with('uniqueparentid', 0)
  286. .with('uitreeindex', 18)
  287. .with('classname', 'Button')
  288. .with('resource-id', 'com.lge.camera:id/ok_button')
  289. .with('text', 'TURN ON')
  290.  
  291. $ruiObj.click
  292.  
  293. waitsecond(4)
  294. end
  295.  
  296. tcase << TestAction.new(:ImageButton_ShutterTopComp_3) do
  297. $ruiObj = RUIObject.new.with('objectid', -1272519145).with('selfid', -1818636331).with('textdescid', -1380226806).with('uniqueparentid', 0)
  298. .with('uitreeindex', 11)
  299. .with('classname', 'ImageButton')
  300. .with('resource-id', 'com.lge.camera:id/shutter_top_comp')
  301. .with('content-desc', 'Start recording')
  302.  
  303. $ruiObj.click
  304.  
  305. waitsecond(2)
  306. end
  307.  
  308. tcase << TestAction.new(:wait32second_4) do
  309. waitsecond(40)
  310. end
  311.  
  312. tcase << TestAction.new(:ImageButton_ShutterTopComp_5) do
  313. $ruiObj = RUIObject.new.with('objectid', -1272519145).with('selfid', -1930433243).with('textdescid', -1819100772).with('uniqueparentid', 0)
  314. .with('uitreeindex', 10)
  315. .with('classname', 'ImageButton')
  316. .with('resource-id', 'com.lge.camera:id/shutter_top_comp')
  317. .with('content-desc', 'Stop recording')
  318.  
  319. $ruiObj.click
  320.  
  321. waitsecond(2)
  322. end
  323.  
  324. tcase << TestAction.new(:ImageButton_BackButton_7) do
  325. $ruiObj = RUIObject.new.with('objectid', -1549616416).with('selfid', -767978611).with('textdescid', -793468608).with('uniqueparentid', 0)
  326. .with('uitreeindex', 16)
  327. .with('classname', 'ImageButton')
  328. .with('resource-id', 'com.lge.camera:id/back_button')
  329.  
  330. $ruiObj.click
  331.  
  332. waitsecond(2)
  333. end
  334.  
  335. tcase.run(loopTime)
  336.  
  337. end
  338.  
  339. def self.Starting_Editing_Video(loopTime)
  340.  
  341. tcase = TestCase.new("Starting_Editing_Video")
  342.  
  343. tcase << TestAction.new(:pressHome_1) do
  344. pressHome
  345.  
  346. waitsecond(2)
  347. end
  348.  
  349. tcase << TestAction.new(:TextView_Gallery_2) do
  350. $ruiObj = RUIObject.new.with('objectid', -479243074).with('selfid', -2112895374).with('textdescid', -740073602).with('uniqueparentid', 0)
  351. .with('uitreeindex', 25)
  352. .with('classname', 'TextView')
  353. .with('content-desc', 'Gallery')
  354. .with('text', 'Gallery')
  355.  
  356. $ruiObj.click
  357.  
  358. waitsecond(2)
  359. end
  360.  
  361. tcase << TestAction.new(:ImageButton_Open_3) do
  362. $ruiObj = RUIObject.new.with('objectid', -1596683477).with('selfid', 1589392844).with('textdescid', 426502620).with('uniqueparentid', 0)
  363. .with('uitreeindex', 1)
  364. .with('classname', 'ImageButton')
  365. .with('content-desc', 'Open navigation drawer')
  366.  
  367. $ruiObj.click
  368.  
  369. waitsecond(2)
  370. end
  371.  
  372. tcase << TestAction.new(:CheckedTextView_DrawerItem_4) do
  373. $ruiObj = RUIObject.new.with('objectid', -401550358).with('selfid', 229733217).with('textdescid', 1081503090).with('uniqueparentid', 0).with('classresourceid', 396870609)
  374. .with('uitreeindex', 5)
  375. .with('classname', 'CheckedTextView')
  376. .with('resource-id', 'com.android.gallery3d:id/drawer_item')
  377. .with('text', 'Videos')
  378.  
  379. $ruiObj.click
  380.  
  381. waitsecond(2)
  382. end
  383.  
  384. tcase << TestAction.new(:clickXY_264_380_1) do
  385. click(264,380)
  386.  
  387. waitsecond(2)
  388. end
  389.  
  390. tcase << TestAction.new(:clickXY_152_548_4) do
  391. click(152,548)
  392.  
  393. waitsecond(4)
  394. end
  395.  
  396. tcase << TestAction.new(:TextView_ResolverText_40) do
  397. $ruiObj = RUIObject.new.with('objectid', 1736845148).with('selfid', 1334281818).with('textdescid', 234547305).with('uniqueparentid', 0).with('classresourceid', -472389065)
  398. .with('uitreeindex', 2)
  399. .with('classname', 'TextView')
  400. .with('resource-id', 'com.lge:id/resolver_text')
  401. .with('text', 'Video')
  402.  
  403. $ruiObj.select('Similiar').click
  404.  
  405. waitsecond(4)
  406. end
  407.  
  408. tcase << TestAction.new(:Button_AllowButton_63) do
  409. $ruiObj = RUIObject.new.with('objectid', -1049422851).with('selfid', -808516471).with('textdescid', -374437087).with('uniqueparentid', 0).with('classresourceid', 771022871)
  410. .with('uitreeindex', 8)
  411. .with('classname', 'Button')
  412. .with('resource-id', 'com.lge:id/allow_button')
  413. .with('text', 'OK')
  414.  
  415. $ruiObj.select('Similiar').click
  416.  
  417. waitsecond(4)
  418. end
  419.  
  420. tcase << TestAction.new(:Button_PermissionAllowButton_8) do
  421. $ruiObj = RUIObject.new.with('objectid', -886457929).with('selfid', 1443382411).with('textdescid', 270556320).with('uniqueparentid', 0)
  422. .with('uitreeindex', 3)
  423. .with('classname', 'Button')
  424. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  425. .with('text', 'ALLOW')
  426.  
  427. $ruiObj.select('Similiar').click
  428.  
  429. waitsecond(4)
  430. end
  431.  
  432. tcase << TestAction.new(:clickXY_1112_508_1_1) do
  433. click(1112,508)
  434.  
  435. waitsecond(2)
  436. end
  437.  
  438. tcase << TestAction.new(:TextView_Edit_2) do
  439. $ruiObj = RUIObject.new.with('objectid', -428282449).with('selfid', 1160143396).with('textdescid', -197620933).with('uniqueparentid', 0)
  440. .with('uitreeindex', 12)
  441. .with('pretext', '20160621134206')
  442. .with('classname', 'TextView')
  443. .with('content-desc', 'Edit')
  444.  
  445. $ruiObj.click
  446.  
  447. waitsecond(8)
  448. end
  449.  
  450. tcase << TestAction.new(:Button_PermissionAllowButton_10) do
  451. $ruiObj = RUIObject.new.with('objectid', -886457929).with('selfid', 1443382411).with('textdescid', 270556320).with('uniqueparentid', 0)
  452. .with('uitreeindex', 3)
  453. .with('classname', 'Button')
  454. .with('resource-id', 'com.android.packageinstaller:id/permission_allow_button')
  455. .with('text', 'ALLOW')
  456.  
  457. $ruiObj.click
  458.  
  459. waitsecond(8)
  460. end
  461.  
  462. tcase.run(loopTime)
  463.  
  464. end
  465.  
  466. def self.Frame_Speed(loopTime)
  467.  
  468. tcase = TestCase.new("Frame_Speed")
  469.  
  470. tcase << TestAction.new(:View_PreviewSurface_2) do
  471. $ruiObj = RUIObject.new.with('objectid', -936430728).with('selfid', -549442069).with('textdescid', 1035418536).with('uniqueparentid', 0)
  472. .with('uitreeindex', 33)
  473. .with('classname', 'android.view.View')
  474. .with('resource-id', 'com.lge.videostudio:id/preview_surface')
  475.  
  476. $ruiObj.click
  477.  
  478. waitsecond(2)
  479. end
  480.  
  481. tcase << TestAction.new(:drag_280_2020_4) do
  482. $UIDev.drag(280,2020,450,2020,20)
  483.  
  484. waitsecond(2)
  485. end
  486.  
  487. tcase << TestAction.new(:TextView_x14_5) do
  488. $ruiObj = RUIObject.new.with('objectid', 225520138).with('selfid', -535057655).with('textdescid', 1875101499).with('uniqueparentid', 0)
  489. .with('uitreeindex', 10)
  490. .with('classname', 'TextView')
  491. .with('text', 'x14')
  492.  
  493. $ruiObj.click
  494.  
  495. waitsecond(2)
  496. end
  497.  
  498. tcase << TestAction.new(:drag_1152_2024_6) do
  499. $UIDev.drag(1152,2024,952,2024,20)
  500.  
  501. waitsecond(2)
  502. end
  503.  
  504. tcase << TestAction.new(:TextView_x14_7) do
  505. $ruiObj = RUIObject.new.with('objectid', 225520138).with('selfid', -535057655).with('textdescid', 1875101499).with('uniqueparentid', 0)
  506. .with('uitreeindex', 10)
  507. .with('classname', 'TextView')
  508. .with('text', 'x14')
  509.  
  510. $ruiObj.click
  511.  
  512. waitsecond(2)
  513. end
  514.  
  515. tcase << TestAction.new(:ImageButton_TrimAreaPlayPause_8) do
  516. $ruiObj = RUIObject.new.with('objectid', -1568366829).with('selfid', 571059935).with('textdescid', -50611199).with('uniqueparentid', 0)
  517. .with('uitreeindex', 30)
  518. .with('classname', 'ImageButton')
  519. .with('resource-id', 'com.lge.videostudio:id/trim_area_play_pause')
  520. .with('content-desc', 'Play')
  521.  
  522. $ruiObj.click
  523.  
  524. waitsecond(2)
  525. end
  526.  
  527. tcase << TestAction.new(:wait32second_9) do
  528. waitsecond(12)
  529. end
  530.  
  531. tcase << TestAction.new(:Button_TrimAreaSave_10) do
  532. $ruiObj = RUIObject.new.with('objectid', -2139312908).with('selfid', 893316343).with('textdescid', -1979207657).with('uniqueparentid', 0)
  533. .with('uitreeindex', 32)
  534. .with('classname', 'Button')
  535. .with('resource-id', 'com.lge.videostudio:id/trim_area_save')
  536. .with('text', 'SAVE')
  537.  
  538. $ruiObj.click
  539.  
  540. waitsecond(2)
  541. end
  542.  
  543. tcase << TestAction.new(:wait32second_11) do
  544. waitsecond(600)
  545. end
  546.  
  547. tcase.run(loopTime)
  548.  
  549. end
  550.  
  551. def self.exception_handler
  552. puts "Module Exception Hanlder..."
  553. end
  554.  
  555. def self.run(loop)
  556. mainLoop loop
  557. end
  558.  
  559. end
  560.  
  561. $exceptionPackageNameList = []
  562. $exceptionPackageNameList_exclude = []
  563.  
  564. def exception_handler
  565. Hplus_videoEditing.exception_handler
  566. end
  567.  
  568. $curProjectLogFile = $useLastLogFile
  569.  
  570. $curProjectLogFile = "Hplus_videoEditing_#{getTimeStamp}.log" if $useLastLogFile.nil?
  571.  
  572. $useLastLogFile = nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement