Skip to content
Browse files

scroll the remaining pages

  • Loading branch information...
1 parent f050843 commit 83c6f6e25df2efe0b09e598a3d9c58d26f8a51cd @malini committed Mar 7, 2013
Showing with 21 additions and 2 deletions.
  1. +21 −2 b2gperf/b2gperf.py
View
23 b2gperf/b2gperf.py
@@ -21,6 +21,7 @@
import gaiatest
from marionette import Marionette
from marionette import MarionetteTouchMixin
+from gestures import smooth_scroll
import mozdevice
TEST_TYPES = ['startup', 'scrollfps']
@@ -285,14 +286,32 @@ def scroll_app(self, app_name):
self.marionette.__class__ = type('Marionette', (Marionette, MarionetteTouchMixin), {})
self.marionette.setup_touch()
+ apps = gaiatest.GaiaApps(self.marionette)
if app_name == 'Homescreen':
self.marionette.flick(self.marionette.find_element('id', 'landing-page'), '90%', '50%', '10%', '50%', touch_duration)
time.sleep(touch_duration / 1000)
self.marionette.flick(self.marionette.find_elements('css selector', '.page')[1], '10%', '50%', '90%', '50%', touch_duration)
elif app_name == 'Contacts':
- print "SCROLL ME NOW"
- time.sleep(25)
+ contacts = apps.launch('Contacts')
+ time.sleep(5) # wait for the contacts to load
+ names = self.marionette.find_elements("class name", "contact-item")
+ smooth_scroll(self.marionette, names[0], "y", "negative", 5000, scroll_back=False)
+ time.sleep(5)
+ elif app_name == 'Browser':
+ browser = apps.launch('Browser')
+ #navigate is misbehaving
+ self.marionette.execute_script("window.location.href='http://taskjs.org/';")
+ time.sleep(5) # wait for the page to load
+ a = self.marionette.find_element("tag name", "a")
+ smooth_scroll(self.marionette, a, "y", "negative", 5000, scroll_back=True)
+ time.sleep(5)
+ elif app_name == 'Email':
+ email = apps.launch('Email')
+ time.sleep(10) # wait for the page to load
+ emails = self.marionette.find_elements("class name", "msg-header-item")
+ smooth_scroll(self.marionette, emails[0], "y", "negative", 2000, scroll_back=True)
+ time.sleep(5)
class dzOptionParser(OptionParser):

0 comments on commit 83c6f6e

Please sign in to comment.
Something went wrong with that request. Please try again.