OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 # pylint: disable=W0401,W0614 | 4 # pylint: disable=W0401,W0614 |
5 from telemetry.page.actions.all_page_actions import * | 5 from telemetry.page.actions.all_page_actions import * |
6 from telemetry.page import page as page_module | 6 from telemetry.page import page as page_module |
7 from telemetry.page import page_set as page_set_module | 7 from telemetry.page import page_set as page_set_module |
8 | 8 |
9 | 9 |
10 class KeySilkCasesPage(page_module.Page): | 10 class KeySilkCasesPage(page_module.Page): |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 | 357 |
358 def RunNavigateSteps(self, action_runner): | 358 def RunNavigateSteps(self, action_runner): |
359 action_runner.NavigateToPage(self) | 359 action_runner.NavigateToPage(self) |
360 action_runner.Wait(2) | 360 action_runner.Wait(2) |
361 | 361 |
362 def RunSmoothness(self, action_runner): | 362 def RunSmoothness(self, action_runner): |
363 for _ in xrange(6): | 363 for _ in xrange(6): |
364 self.ToggleDrawer(action_runner) | 364 self.ToggleDrawer(action_runner) |
365 | 365 |
366 def ToggleDrawer(self, action_runner): | 366 def ToggleDrawer(self, action_runner): |
367 action_runner.RunAction(TapAction( | 367 interaction = action_runner.BeginInteraction( |
368 { | 368 'Action_TapAction', is_smooth=True) |
369 'selector': '#menu-button', | 369 action_runner.TapElement('#menu-button') |
370 'wait_after' : {'seconds': 1} | 370 action_runner.Wait(1) |
371 })) | 371 interaction.End() |
372 | 372 |
373 | 373 |
374 class Page19(KeySilkCasesPage): | 374 class Page19(KeySilkCasesPage): |
375 | 375 |
376 def __init__(self, page_set): | 376 def __init__(self, page_set): |
377 super(Page19, self).__init__( | 377 super(Page19, self).__init__( |
378 url='file://key_silk_cases/inbox_app.html?slide_drawer', | 378 url='file://key_silk_cases/inbox_app.html?slide_drawer', |
379 page_set=page_set) | 379 page_set=page_set) |
380 | 380 |
381 def ToggleDrawer(self, action_runner): | 381 def ToggleDrawer(self, action_runner): |
382 action_runner.RunAction(TapAction( | 382 interaction = action_runner.BeginGestureInteraction( |
383 { | 383 'TapAction', is_smooth=True) |
384 'selector': '#menu-button' | 384 action_runner.TapElement('#menu-button') |
385 })) | 385 interaction.End() |
| 386 |
386 interaction = action_runner.BeginInteraction('Wait', is_smooth=True) | 387 interaction = action_runner.BeginInteraction('Wait', is_smooth=True) |
387 action_runner.WaitForJavaScriptCondition( | 388 action_runner.WaitForJavaScriptCondition( |
388 'document.getElementById("nav-drawer").active') | 389 'document.getElementById("nav-drawer").active') |
389 interaction.End() | 390 interaction.End() |
390 | 391 |
391 | 392 |
392 def RunNavigateSteps(self, action_runner): | 393 def RunNavigateSteps(self, action_runner): |
393 action_runner.NavigateToPage(self) | 394 action_runner.NavigateToPage(self) |
394 action_runner.Wait(2) | 395 action_runner.Wait(2) |
395 self.ToggleDrawer(action_runner) | 396 self.ToggleDrawer(action_runner) |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 function() { | 450 function() { |
450 var el = document.getElementById('kno-result'); | 451 var el = document.getElementById('kno-result'); |
451 var bound = el.getBoundingClientRect(); | 452 var bound = el.getBoundingClientRect(); |
452 return bound.top - document.body.scrollTop; | 453 return bound.top - document.body.scrollTop; |
453 } | 454 } |
454 ''' | 455 ''' |
455 })) | 456 })) |
456 | 457 |
457 def ExpandKnowledgeCard(self, action_runner): | 458 def ExpandKnowledgeCard(self, action_runner): |
458 # expand card | 459 # expand card |
459 action_runner.RunAction(TapAction( | 460 interaction = action_runner.BeginInteraction( |
460 { | 461 'Action_TapAction', is_smooth=True) |
461 'element_function': ''' | 462 action_runner.TapElement( |
462 function(callback) { | 463 element_function='document.getElementsByClassName("vk_arc")[0]') |
463 callback(document.getElementsByClassName("vk_arc")[0]); | 464 action_runner.Wait(2) |
464 }''', | 465 interaction.End() |
465 'wait_after': {'seconds': 2} | |
466 })) | |
467 | 466 |
468 | 467 |
469 def RunNavigateSteps(self, action_runner): | 468 def RunNavigateSteps(self, action_runner): |
470 action_runner.NavigateToPage(self) | 469 action_runner.NavigateToPage(self) |
471 action_runner.Wait(3) | 470 action_runner.Wait(3) |
472 self.ScrollKnowledgeCardToTop(action_runner) | 471 self.ScrollKnowledgeCardToTop(action_runner) |
473 | 472 |
474 def RunSmoothness(self, action_runner): | 473 def RunSmoothness(self, action_runner): |
475 self.ExpandKnowledgeCard(action_runner) | 474 self.ExpandKnowledgeCard(action_runner) |
476 | 475 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 self.AddPage(Page17(self)) | 631 self.AddPage(Page17(self)) |
633 self.AddPage(Page18(self)) | 632 self.AddPage(Page18(self)) |
634 self.AddPage(Page19(self)) | 633 self.AddPage(Page19(self)) |
635 self.AddPage(Page20(self)) | 634 self.AddPage(Page20(self)) |
636 self.AddPage(Page21(self)) | 635 self.AddPage(Page21(self)) |
637 self.AddPage(Page22(self)) | 636 self.AddPage(Page22(self)) |
638 self.AddPage(Page23(self)) | 637 self.AddPage(Page23(self)) |
639 self.AddPage(Page24(self)) | 638 self.AddPage(Page24(self)) |
640 self.AddPage(Page25(self)) | 639 self.AddPage(Page25(self)) |
641 self.AddPage(Page26(self)) | 640 self.AddPage(Page26(self)) |
OLD | NEW |