1# Copyright 2015 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5from telemetry import story 6from telemetry import page 7 8 9class ExamplePage(page.Page): 10 11 def __init__(self, page_set): 12 super(ExamplePage, self).__init__( 13 url='https://google.com/search?q=lemon', 14 page_set=page_set) 15 16 def RunPageInteractions(self, action_runner): 17 # To see all the web APIs that action_runner supports, see: 18 # telemetry.page.action_runner module. 19 20 action_runner.Wait(0.5) 21 # Create interaction record will create a region of interest in tracing that 22 # cover the wait, tap, and scroll actions nested in the block below. 23 with action_runner.CreateInteraction('Scroll-And-Tap'): 24 action_runner.Wait(0.3) 25 action_runner.ScrollPage() 26 action_runner.TapElement(text='Next') 27 action_runner.Wait(1) 28 with action_runner.CreateInteraction('Scroll'): 29 action_runner.ScrollPage() 30 with action_runner.CreateInteraction('Wait-two'): 31 action_runner.Wait(1) 32 33 34class SimpleStorySet(story.StorySet): 35 def __init__(self): 36 super(SimpleStorySet, self).__init__( 37 archive_data_file='data/simple_story_set.json', 38 cloud_storage_bucket=story.PARTNER_BUCKET) 39 self.AddStory(ExamplePage(self)) 40