Beispiel #1
0
 def swipe_live(self):
     MLog.info('swipe_live')
     width = self.d.info['displayWidth']
     height = self.d.info['displayHeight']
     sx = width * 0.8
     sy = height * 0.2
     ex = width * 0.8
     ey = height * 0.7
     self.d.swipe(sx, sy, ex, ey, 0.1)
     pass
Beispiel #2
0
 def ent_live(self):
     MLog.info('ent_live')
     # d.xpath(
     #     '//*[@resource-id="com.duowan.kiwi:id/content"]'
     #     '/android.widget.FrameLayout[1]'
     #     '/android.widget.FrameLayout[1]'
     #     '/androidx.recyclerview.widget.RecyclerView[1]'
     #     '/android.widget.LinearLayout[1]'
     #     '/android.widget.FrameLayout[1]'
     #     '/android.widget.RelativeLayout[1]'
     #     '/android.widget.FrameLayout[1]').click()
     self.d.xpath(
         '//androidx.recyclerview.widget.RecyclerView/android.widget.LinearLayout[1]'
         '/android.widget.RelativeLayout[1]/android.widget.ImageView[1]'
     ).click()
     pass
Beispiel #3
0
    def test_fps(self):
        MLog.info('start_fps')
        # self.start_app()  # 启动app
        # sleep(5)

        for i in range(0, 3):
            MLog.info('test repeat')
            self.ent_live()
            sleep(5)
            for j in range(0, 5):
                self.swipe_live()
                sleep(5)
            self.quit_live()
            sleep(5)
            self.app_background()
            sleep(5)
            self.app_foreground()
            sleep(5)
        self.stop_app()
        pass
Beispiel #4
0
 def app_background(self):
     MLog.info('app_background')
     self.d.press("home")
     pass
Beispiel #5
0
 def quit_live(self):
     MLog.info('quit_live')
     self.d(
         resourceId="com.yy.mobile.plugin.livebasebiz:id/btn_exit_portrait"
     ).click()
     pass
Beispiel #6
0
 def ent_live(self):
     MLog.info('ent_live')
     self.d(
         resourceId="com.yy.mobile.plugin.homepage:id/living_common_container"
     ).click()
     pass
Beispiel #7
0
 def stop_app(self):
     MLog.info('finish app')
     self.d.app_stop('com.duowan.mobile')
     pass
Beispiel #8
0
 def start_app(self):
     MLog.info('start_app')
     self.d(text=self.app_name).click()
     pass
Beispiel #9
0
 def ent_live(self):
     MLog.info('ent_live')
     self.d.xpath(
         '//*[@resource-id="sg.bigo.live:id/recycle_view"]/android.view.ViewGroup[1]'
     ).click()
     pass
Beispiel #10
0
 def ent_live(self):
     MLog.info('ent_live')
     self.d.xpath(
         '//*[@resource-id="air.tv.douyu.android:id/ku"]/android.view.ViewGroup[1]/android.widget.ImageView[1]').click()
     pass
Beispiel #11
0
 def stop_app(self):
     MLog.info('finish app')
     self.d.app_stop('air.tv.douyu.android')
     pass
Beispiel #12
0
 def quit_live(self):
     MLog.info('quit_live')
     self.d(resourceId="com.duowan.kiwi:id/close_living_ib").click()
     pass
Beispiel #13
0
        pass

    def test_fps(self):
        MLog.info('start_fps')
        # self.start_app()  # 启动app
        # sleep(5)

        for i in range(0, 3):
            MLog.info('test repeat')
            self.ent_live()
            sleep(5)
            for j in range(0, 5):
                self.swipe_live()
                sleep(5)
            self.quit_live()
            sleep(5)
            self.app_background()
            sleep(5)
            self.app_foreground()
            sleep(5)
        self.stop_app()
        pass


if __name__ == '__main__':
    d = u2.connect()  # connect to device
    app = HuYa(d)
    MLog.info("start test...")
    app.test_fps()
    MLog.info("finish test...")
Beispiel #14
0
 def quit_live(self):
     MLog.info('quit_live')
     self.d(resourceId="sg.bigo.live:id/btn_live_video_close").click()
     pass
Beispiel #15
0
 def app_foreground(self):
     MLog.info('app_foreground')
     self.start_app()
     pass
Beispiel #16
0
 def quit_live(self):
     MLog.info('quit_live')
     self.d(resourceId="air.tv.douyu.android:id/cn7").click()
     pass
Beispiel #17
0
 def stop_app(self):
     MLog.info('finish app')
     self.d.app_stop('sg.bigo.live')
     pass