MCPcopy Create free account
hub / github.com/dtmilano/AndroidViewClient / testSomething

Method testSomething

examples/culebratester/soptify.py:59–73  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

57 return True
58
59 def testSomething(self):
60 if not self.preconditions():
61 self.fail('Preconditions failed')
62
63 _s = CulebraTests.sleep
64 _v = CulebraTests.verbose
65
66 UiScrollable(self.vc.uiAutomatorHelper, uiSelector='clazz@com.android.launcher3.Workspace,res@com.google.android.apps.nexuslauncher:id/workspace,index@0,parentIndex@0,package@com.google.android.apps.nexuslauncher').getChildByDescription(uiSelector='desc@Spotify', description="Spotify", allowScrollSearch=True).click()
67 self.vc.uiAutomatorHelper.findObject(bySelector='res@com.spotify.music:id/home_tab,desc@Home,clazz@android.widget.TextView,text@Home,package@com.spotify.music').clickAndWait(eventCondition='until:newWindow', timeout=_s*1000)
68 self.vc.uiAutomatorHelper.findObject(bySelector='res@com.spotify.music:id/playPause,desc@Play,clazz@android.widget.ImageButton,text@$,package@com.spotify.music').clickAndWait(eventCondition='until:newWindow', timeout=_s*1000)
69 self.vc.uiAutomatorHelper.findObject(bySelector='res@com.spotify.music:id/player_navigation_unit_container,desc@Show Now Playing,clazz@android.widget.FrameLayout,text@$,package@com.spotify.music').clickAndWait(eventCondition='until:newWindow', timeout=_s*1000)
70 self.vc.uiAutomatorHelper.findObject(bySelector='res@com.spotify.music:id/btn_play,desc@Pause,clazz@android.widget.ImageButton,text@$,package@com.spotify.music').clickAndWait(eventCondition='until:newWindow', timeout=_s*1000)
71 self.vc.uiAutomatorHelper.findObject(bySelector='res@com.spotify.music:id/btn_play,desc@Play,clazz@android.widget.ImageButton,text@$,package@com.spotify.music').clickAndWait(eventCondition='until:newWindow', timeout=_s*1000)
72 self.vc.uiAutomatorHelper.findObject(bySelector='res@com.spotify.music:id/btn_play,desc@Pause,clazz@android.widget.ImageButton,text@$,package@com.spotify.music').clickAndWait(eventCondition='until:newWindow', timeout=_s*1000)
73 self.vc.uiAutomatorHelper.findObject(bySelector='res@com.spotify.music:id/connect_view_root,clazz@android.widget.LinearLayout,text@$,package@com.spotify.music').clickAndWait(eventCondition='until:newWindow', timeout=_s*1000)
74
75if __name__ == '__main__':
76 CulebraTests.main()

Callers

nothing calls this directly

Calls 4

preconditionsMethod · 0.95
UiScrollableClass · 0.85
findObjectMethod · 0.80
clickMethod · 0.45

Tested by

no test coverage detected