Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2705)

Unified Diff: experimental/telemetry_mini/android_go_stories.py

Issue 2996123002: [telemetry_mini] Add AndroidActions class (Closed)
Patch Set: explain **kwargs Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | experimental/telemetry_mini/telemetry_mini.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/telemetry_mini/android_go_stories.py
diff --git a/experimental/telemetry_mini/android_go_stories.py b/experimental/telemetry_mini/android_go_stories.py
index 7e61ca19f50475a6485c07278277939f9d92b68e..49062ca9840851fc8fe7f1e33b8adeb5a302706d 100755
--- a/experimental/telemetry_mini/android_go_stories.py
+++ b/experimental/telemetry_mini/android_go_stories.py
@@ -25,14 +25,6 @@ TRACE_CONFIG = {
'memoryDumpConfig': {'triggers': []}
}
-FLIPKART_TWITTER_LINK = [
- ('package', 'com.twitter.android'),
- ('class', 'android.widget.TextView'),
- ('text', 'flipkart.com')
-]
-
-KEYCODE_BACK = 4
-
BROWSERS = {
'android-chrome': telemetry_mini.ChromeApp,
'android-chromium': telemetry_mini.ChromiumApp,
@@ -120,6 +112,12 @@ class TwitterApp(telemetry_mini.AndroidApp):
class TwitterFlipkartStory(telemetry_mini.UserStory):
+ FLIPKART_TWITTER_LINK = [
+ ('package', 'com.twitter.android'),
+ ('class', 'android.widget.TextView'),
+ ('text', 'flipkart.com')
+ ]
+
def __init__(self, *args, **kwargs):
super(TwitterFlipkartStory, self).__init__(*args, **kwargs)
self.watcher = ProcessWatcher(self.device)
@@ -129,26 +127,18 @@ class TwitterFlipkartStory(telemetry_mini.UserStory):
return (self.twitter,)
def RunStorySteps(self):
- # Intent will launch Twitter app on Flipkart profile.
- self.device.RunShellCommand(
- 'am', 'start', '-a', 'android.intent.action.VIEW',
- '-d', 'https://twitter.com/flipkart')
+ # Activity will launch Twitter app on Flipkart profile.
+ self.actions.StartActivity('https://twitter.com/flipkart')
self.watcher.StartWatching(self.twitter)
# Tapping on Flikpart link on Twitter app will launch Chrome.
- self.device.TapUiNode(FLIPKART_TWITTER_LINK)
+ self.actions.TapUiElement(self.FLIPKART_TWITTER_LINK)
self.watcher.StartWatching(self.browser)
-
time.sleep(10) # TODO: Replace with wait until page loaded.
- # Scroll content up a bit.
- self.device.RunShellCommand(
- 'input', 'swipe', '240', '568', '240', '284', '400')
- time.sleep(1)
-
- # Go "Back" and return to Twitter app.
- self.device.RunShellCommand('input', 'keyevent', str(KEYCODE_BACK))
- time.sleep(1)
+ self.actions.SwipeUp(repeat=3)
+ # Return to Twitter app.
+ self.actions.GoBack()
self.watcher.AssertAllAlive()
« no previous file with comments | « no previous file | experimental/telemetry_mini/telemetry_mini.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698