예제 #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
예제 #2
0
파일: huya.py 프로젝트: hutcwp/autoFps
 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
예제 #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
예제 #4
0
 def app_background(self):
     MLog.info('app_background')
     self.d.press("home")
     pass
예제 #5
0
 def quit_live(self):
     MLog.info('quit_live')
     self.d(
         resourceId="com.yy.mobile.plugin.livebasebiz:id/btn_exit_portrait"
     ).click()
     pass
예제 #6
0
 def ent_live(self):
     MLog.info('ent_live')
     self.d(
         resourceId="com.yy.mobile.plugin.homepage:id/living_common_container"
     ).click()
     pass
예제 #7
0
 def stop_app(self):
     MLog.info('finish app')
     self.d.app_stop('com.duowan.mobile')
     pass
예제 #8
0
 def start_app(self):
     MLog.info('start_app')
     self.d(text=self.app_name).click()
     pass
예제 #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
예제 #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
예제 #11
0
 def stop_app(self):
     MLog.info('finish app')
     self.d.app_stop('air.tv.douyu.android')
     pass
예제 #12
0
파일: huya.py 프로젝트: hutcwp/autoFps
 def quit_live(self):
     MLog.info('quit_live')
     self.d(resourceId="com.duowan.kiwi:id/close_living_ib").click()
     pass
예제 #13
0
파일: huya.py 프로젝트: hutcwp/autoFps
        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...")
예제 #14
0
 def quit_live(self):
     MLog.info('quit_live')
     self.d(resourceId="sg.bigo.live:id/btn_live_video_close").click()
     pass
예제 #15
0
 def app_foreground(self):
     MLog.info('app_foreground')
     self.start_app()
     pass
예제 #16
0
 def quit_live(self):
     MLog.info('quit_live')
     self.d(resourceId="air.tv.douyu.android:id/cn7").click()
     pass
예제 #17
0
 def stop_app(self):
     MLog.info('finish app')
     self.d.app_stop('sg.bigo.live')
     pass