Exemplo n.º 1
0
 def aboutUs(self):
     login(self)
     sleep(4)
     s=c.session()
     s(id='个人中心').tap()
     s.swipe(800,500,800,50,0.5)
     sleep(2)
     s(id='关于我们').tap()
     sleep(8)
     now=time.strftime('%Y-%m-%d %H_%M_%S')
     sf0='./'+now+'_010b_aboutUsTop_R.png'
     c.screenshot(sf0)
     sleep(2)
     s.swipe(800,600,800,50,0.5)
     sleep(1)
     s.swipe(800,600,800,50,0.5)
     sleep(1)
     now=time.strftime('%Y-%m-%d %H_%M_%S')
     sf2='./'+now+'_010b_aboutUsMiddle_R.png'
     c.screenshot(sf2)
     sleep(2)
     s.swipe(800,600,800,50,0.5)
     sleep(1)
     s.swipe(800,600,800,50,0.5)
     sleep(1)
     now=time.strftime('%Y-%m-%d %H_%M_%S')
     sf1='./'+now+'_010b_aboutUsTail_R.png'
     c.screenshot(sf1)
     sleep(2)
     s(id='ic nav back').tap()
     sleep(2)
     s(id='退出登录').tap()
     s(id='确定').tap()
     sleep(1)
 def generalSetting(self):
     login(self)
     sleep(2)
     s = c.session()
     s(id='个人中心').tap()
     sleep(2)
     now = time.strftime('%Y-%m-%d %H_%M_%S')
     sf0 = './' + now + '_011b_personCenter_R.png'
     c.screenshot(sf0)
     sleep(2)
     s(id='通用设置').tap()
     sleep(2)
     #上传日志
     s(id='上传日志').tap()
     sleep(5)
     #清除缓存
     s(id='清空缓存').tap()
     sleep(2)
     now = time.strftime('%Y-%m-%d %H_%M_%S')
     sf4 = './' + now + '_011b_clearCache_R.png'
     c.screenshot(sf4)
     sleep(2)
     s(id='ic nav back').tap()
     sleep(2)
     s.swipe(800, 500, 800, 280, 0.5)
     sleep(2)
     s(id='退出登录').tap()
     s(id='确定').tap()
     sleep(1)
Exemplo n.º 3
0
 def bottomClassSheet(self):
     login(self)
     sleep(3)
     s=c.session()
     #bottom classSheet
     s(id='陪练单').tap()
     sleep(1)
     s(id='查看陪练单').tap()
     sleep(6)
     now=time.strftime('%Y-%m-%d %H_%M_%S')
     sf0='./'+now+'_015b_classSheetBottomTop_R.png'
     c.screenshot(sf0)
     sleep(2)
     s.swipe(800,500,800,50,0.5)
     sleep(1)
     s.swipe(800,500,800,50,0.5)
     sleep(1)
     s.swipe(800,500,800,50,0.5)
     sleep(1)
     now=time.strftime('%Y-%m-%d %H_%M_%S')
     sf1='./'+now+'_015b_classSheetBottomTail_R.png'
     c.screenshot(sf1)
     sleep(2)
     if s(id='点击播放语音评价').exists:
         s(id='点击播放语音评价').tap()
         sleep(6)
         s(id='点击播放语音评价').tap()
         sleep(2)
     s(id='ic nav back').tap()
     sleep(3)
     logout(self)
Exemplo n.º 4
0
 def testDevice(self):
     login(self)
     sleep(2)
     s = c.session()
     s(id='个人中心').tap()
     sleep(2)
     now = time.strftime('%Y-%m-%d %H_%M_%S')
     sf0 = './' + now + '_008b_personalCenter_R.png'
     c.screenshot(sf0)
     sleep(2)
     s(id='设备检测').tap()
     sleep(2)
     #test now
     s(id='开始测试').tap()
     s(id='点击开始录音').tap()
     sleep(2)
     s(id='停止录音').tap()
     s(id='有听到声音').tap()
     s(id='下一步').tap()
     s(id='下一步').tap()
     s(id='完成测试').tap()
     sleep(2)
     if s(id='已通过').exists:
         print('设备检测已通过')
     else:
         print('设备检测失败!')
     sleep(1)
     s.swipe(800, 500, 800, 280, 0.5)
     sleep(2)
     s(id='退出登录').tap()
     s(id='确定').tap()
     sleep(1)
Exemplo n.º 5
0
 def waitForTeacher(self):
     login(self)
     sleep(2)
     s = c.session()
     s(id='进入教室').tap()
     sleep(5)
     if s(id='确定').exists:
         s(id='确定').tap()
         sleep(3)
     now = time.strftime('%Y-%m-%d %H_%M_%S')
     sf0 = './' + now + '_002b_enteredClassroom_R.png'
     c.screenshot(sf0)
     sleep(2)
     if s(id='pic_wait').exists:
         print('\nThere is a sign:请等待老师进入教室')
         sleep(2)
     s(id='呼叫老师').tap()
     sleep(4)
     now = time.strftime('%Y-%m-%d %H_%M_%S')
     sf1 = './' + now + '_002b_afterCallTeacher_R.png'
     c.screenshot(sf1)
     sleep(2)
     s.tap(349, 37)
     sleep(2)
     logout(self)
 def Logout(self):
     login(self)
     sleep(3)
     logout(self)
     now = time.strftime('%Y-%m-%d %H_%M_%S')
     sf1 = './' + now + '_012b_logout_R.png'
     c.screenshot(sf1)
     sleep(1)
Exemplo n.º 7
0
 def Login(self):
     #start
     login(self)
     sleep(3)
     now=time.strftime('%Y-%m-%d %H_%M_%S')
     sf0='./'+now+'_001b_login_R.png'
     #wda.DEBUG=False
     c.screenshot(sf0)
     sleep(3)
     logout(self)
 def uploadMusic(self):
     login(self)
     sleep(2)
     s=c.session()
     if s(id='上传乐谱').exists:
         s(id='上传乐谱').tap()
     else:
         s(id='查看乐谱').tap()
     sleep(2)
     if s.alert.wait(3):
         s.alert.accept()
         sleep(2)
     now=time.strftime('%Y-%m-%d %H_%M_%S')
     sf0='./'+now+'_005b_beforeAddMusic_R.png'
     c.screenshot(sf0)
     sleep(2)
     s(id='上传乐谱').tap()
     sleep(2)
     s(id='钢琴').tap()
     sleep(2)
     s(id='小提琴').tap()
     sleep(2)
     s(id='手风琴').tap()
     sleep(2)
     s(id='钢琴').tap()
     sleep(2)
     s(id='搜索书名或者曲目名').tap()
     sleep(2)
     s(id='车尔尼').tap()
     sleep(2)
     s(id='包含该曲目').tap()
     sleep(2)
     #first music
     s(className='XCUIElementTypeCell')[0].tap()
     sleep(3)
     turnpage_play(self)
     sleep(1)
     s(id='ic nav back').tap()
     sleep(2)
     s(id='   添 加   ').tap()
     sleep(2)
     s(id='ic nav back').tap()
     sleep(1)
     s(id='ic nav back').tap()
     sleep(1)
     now=time.strftime('%Y-%m-%d %H_%M_%S')
     sf1='./'+now+'_005b_afterAddMusic_R.png'
     c.screenshot(sf1)
     sleep(2)
     s(id='ic nav back').tap()
     sleep(2)
     logout(self)
 def changePwd(self):
     now=time.strftime('%Y-%m-%d %H_%M_%S')
     print('\n021:修改密码----开始:'+now)
     login(self)
     sleep(2)
     s=c.session()
     s(id='个人中心').tap()
     sleep(1)
     s(id='修改密码').tap()
     sleep(1)
     s(className='XCUIElementTypeSecureTextField')[0].tap()
     s(className='XCUIElementTypeSecureTextField')[0].set_text('123456')
     sleep(1)
     s(xpath='//XCUIElementTypeOther[2]/XCUIElementTypeSecureTextField').tap()
     s(xpath='//XCUIElementTypeOther[2]/XCUIElementTypeSecureTextField').set_text('123456wxl')
     sleep(1)
     s(xpath='//XCUIElementTypeOther[3]/XCUIElementTypeSecureTextField').tap()
     s(xpath='//XCUIElementTypeOther[3]/XCUIElementTypeSecureTextField').set_text('123456wxl')
     sleep(1)
     s(id='确认').tap()
     sleep(3)
     s.swipe(800,500,800,280,0.5)
     sleep(2)
     s(id='退出登录').tap()
     s(id='确定').tap()
     sleep(1)
     s(id='登录').tap()
     sleep(1)
     #check new password
     s(className='XCUIElementTypeTextField').tap()
     s(className='XCUIElementTypeTextField').clear_text()
     s(className='XCUIElementTypeTextField').set_text('14100000011')
     sleep(1)
     s(className='XCUIElementTypeSecureTextField').tap()
     s(className='XCUIElementTypeSecureTextField').clear_text()
     s(className='XCUIElementTypeSecureTextField').set_text('123456wxl')
     sleep(1)
     #登 录
     s(className='XCUIElementTypeButton',name='登录').tap()
     sleep(8)
     now=time.strftime('%Y-%m-%d %H_%M_%S')
     sf2='./'+now+'_021b_reLogin_R.png'
     c.screenshot(sf2)
     sleep(2)
     logout(self)
     sleep(1)
     now=time.strftime('%Y-%m-%d %H_%M_%S')
     print('\n021:修改密码----结束:'+now)
Exemplo n.º 10
0
 def changeHeadIcon(self):
     login(self)
     sleep(2)
     s = c.session()
     s(id='个人中心').tap()
     sleep(2)
     s(xpath='//XCUIElementTypeCell[1]/XCUIElementTypeImage[3]').tap()
     sleep(2)
     s(id='拍照').tap()
     sleep(2)
     if s.alert.wait(3):
         s.alert.accept()
         sleep(2)
     #FrontBackFacingCameraChooser
     s(xpath='//XCUIElementTypeButton[@name="FrontBackFacingCameraChooser"]'
       ).tap()
     sleep(3)
     #PhotoCapture
     s(id='PhotoCapture').tap()
     sleep(2)
     s(id='使用照片').tap()
     sleep(3)
     now = time.strftime('%Y-%m-%d %H_%M_%S')
     sf0 = './' + now + '_007b_selfie_R.png'
     c.screenshot(sf0)
     sleep(2)
     s(xpath='//XCUIElementTypeCell[1]/XCUIElementTypeImage[3]').tap()
     sleep(2)
     s(id='从相册选择').tap()
     sleep(2)
     if s.alert.wait(3):
         s.alert.accept()
         sleep(2)
     s(id='相机胶卷').tap()
     sleep(2)
     s.tap(320, 320)
     sleep(6)
     now = time.strftime('%Y-%m-%d %H_%M_%S')
     sf1 = './' + now + '_007b_selectedPhoto_R.png'
     c.screenshot(sf1)
     sleep(3)
     s.swipe(800, 500, 800, 280, 0.5)
     sleep(2)
     s(id='退出登录').tap()
     s(id='确定').tap()
     sleep(1)
Exemplo n.º 11
0
 def checkClassSheet(self):
     login(self)
     sleep(2)
     s = c.session()
     #bottom classSheet
     s(id='陪练单').tap()
     sleep(3)
     i = random.randrange(0, 3, 1)
     s(id='查看陪练单')[i].tap()
     sleep(8)
     now = time.strftime('%Y-%m-%d %H_%M_%S')
     sf0 = './' + now + '_022b_classSheetDetail1_R.png'
     c.screenshot(sf0)
     sleep(2)
     s.swipe(800, 600, 0, 50, 0.5)
     sleep(1)
     s.swipe(800, 600, 0, 50, 0.5)
     sleep(1)
     s.swipe(800, 600, 0, 50, 0.5)
     sleep(1)
     now = time.strftime('%Y-%m-%d %H_%M_%S')
     sf1 = './' + now + '_022b_classSheetDetail2_R.png'
     c.screenshot(sf1)
     sleep(2)
     if s(id='评价老师').exists:
         s(id='评价老师').tap()
         sleep(1)
         s(id='满意').tap()
         s(id='非常耐心').tap()
         s(id='声音甜美').tap()
         s(id='互动性强').tap()
         s(id='满意').tap()
         s.swipe(800, 500, 0, 100, 0.5)
         sleep(2)
         #without name
         s(className='XCUIElementTypeTextView').tap()
         s(className='XCUIElementTypeTextView').set_text(
             '我的意见非常大,不是一句话能说完的。123456 abcdefg')
         sleep(1)
         s(id='完成').tap()
         s(id='提交评价').tap()
         sleep(3)
     s(id='ic nav back').tap()
     sleep(2)
     logout(self)
 def advice(self):
     login(self)
     sleep(2)
     s=c.session()
     s(id='个人中心').tap()
     #s.swipe(700,500,700,50,0.5)
     #sleep(2)
     s(id='投诉建议').tap()
     sleep(1)
     s(className='XCUIElementTypeTextView').tap()
     s(className='XCUIElementTypeTextView').set_text('我的意见非常大,不是一句话能说完的。123456 abcdefg')
     sleep(1)
     s(id='提交').tap()
     sleep(3)
     s.swipe(800,500,800,280,0.5)
     s(id='退出登录').tap()
     s(id='确定').tap()
     sleep(1)
Exemplo n.º 13
0
 def callService(self):
     login(self)
     sleep(2)
     s = c.session()
     s(id='个人中心').tap()
     sleep(1)
     #ic customer
     s(id='呼叫客服').tap()
     sleep(2)
     s(id='呼叫').tap()
     sleep(1)
     s.alert.dismiss()
     sleep(2)
     s.swipe(800, 500, 800, 280, 0.5)
     sleep(2)
     s(id='退出登录').tap()
     s(id='确定').tap()
     sleep(1)
Exemplo n.º 14
0
 def personalCenter(self):
     login(self)
     sleep(2)
     s=c.session()
     s(id='个人中心').tap()
     sleep(2)
     now=time.strftime('%Y-%m-%d %H_%M_%S')
     sf0='./'+now+'_016b_personCenter1_R.png'
     c.screenshot(sf0)
     sleep(2)
     s.swipe(800,500,800,280,0.5)
     sleep(2)
     now=time.strftime('%Y-%m-%d %H_%M_%S')
     sf1='./'+now+'_016b_personCenter2_R.png'
     c.screenshot(sf1)
     sleep(2)
     s(id='退出登录').tap()
     s(id='确定').tap()
     sleep(1)
 def classUI(self):
     login(self)
     sleep(2)
     s = c.session()
     if s(id='本日暂时没有课程安排').exists:
         print('本日暂时没有课程安排!')
         sleep(2)
     else:
         if s(id='ic classroom2').enabled:
             print('进入教室的按钮现在是红色的!')
             sleep(2)
         else:
             print('进入教室的按钮现在是灰色的!')
             sleep(2)
     sleep(1)
     now = time.strftime('%Y-%m-%d %H_%M_%S')
     sf0 = './' + now + '_020b_classUI_R.png'
     c.screenshot(sf0)
     sleep(3)
     logout(self)
Exemplo n.º 16
0
 def checkMusic(self):
     login(self)
     sleep(2)
     s = c.session()
     now = time.strftime('%Y-%m-%d %H_%M_%S')
     sf0 = './' + now + '_004b_classMuisc_R.png'
     c.screenshot(sf0)
     sleep(2)
     if s(id='上节课程').exists:
         s(id='上节课程').tap()
         flag = s(className='XCUIElementTypeStaticText')[2].text
     else:
         flag = s(className='XCUIElementTypeStaticText')[3].text
     sleep(2)
     #ic upload1
     #('查看乐谱')
     print('\n' + flag)
     print('\n已开始:' + str('已开始' in flag))
     print('\n已结束:' + str('已结束' in flag))
     sleep(2)
     if s(id='上传乐谱').exists:
         s(id='上传乐谱').tap()
     else:
         s(id='查看乐谱').tap()
     sleep(2)
     if s.alert.wait(3):
         s.alert.accept()
         sleep(2)
     now = time.strftime('%Y-%m-%d %H_%M_%S')
     sf = './' + now + '_004b_muiscItems_R.png'
     c.screenshot(sf)
     sleep(2)
     items = s(className='XCUIElementTypeCell').find_elements()
     i = len(items)
     print('items:' + str(i))
     if i == 1:
         print('本节课暂未上传乐谱')
         sleep(1)
     else:
         if s(id='自主上传乐谱').exists:
             s(id='自主上传乐谱')[0].tap()
             sleep(5)
             now = time.strftime('%Y-%m-%d %H_%M_%S')
             sf1 = './' + now + '_004b_musicBySelfDetail_R.png'
             c.screenshot(sf1)
             sleep(2)
             #turnpage_play(self)
             s.swipe(600, 600, 50, 600, 0.5)
             sleep(2)
             s.swipe(50, 600, 550, 600, 0.5)
             sleep(2)
             s(id='编辑').tap()
             sleep(2)
             s(id='ic drag').tap()
             sleep(2)
             s(id='完成').tap()
             sleep(2)
             if (not ('已开始' in flag)) and (not ('已结束' in flag)):
                 sleep(2)
                 now = time.strftime('%Y-%m-%d %H_%M_%S')
                 sf2 = './' + now + '_004b_afterEdit_R.png'
                 c.screenshot(sf2)
                 sleep(2)
             else:
                 now = time.strftime('%Y-%m-%d %H_%M_%S')
                 sf2 = './' + now + '_004b_editNotAllowed_R.png'
                 c.screenshot(sf2)
                 sleep(2)
                 print('课程已开始/已结束后不允许编辑乐谱')
                 sleep(2)
                 s(id='ic nav back').tap()
                 sleep(2)
         else:
             s(id='ic_next')[1].click()
             sleep(10)
             now = time.strftime('%Y-%m-%d %H_%M_%S')
             sf3 = './' + now + '_004b_classMusicDetail_R.png'
             c.screenshot(sf3)
             sleep(2)
             #turn page left/right and play music
             s.swipe(600, 600, 50, 600, 0.5)
             sleep(2)
             s.swipe(50, 600, 550, 600, 0.5)
             sleep(2)
             #Add play code here
             if s(id='play').exists:
                 s(id='play').tap()
                 sleep(8)
                 s(id='play').tap()
                 sleep(2)
             sleep(1)
             s(id='ic nav back').tap()
             sleep(2)
         if (not ('已开始' in flag)) and (not ('已结束' in flag)):
             s(id='删除').tap()
             sleep(2)
             s(id='确定').tap()
             sleep(2)
             now = time.strftime('%Y-%m-%d %H_%M_%S')
             sf4 = './' + now + '_004b_afterDelete_R.png'
             c.screenshot(sf4)
             sleep(2)
         else:
             print('\n课程已开始/已结束后不允许删除乐谱')
             sleep(2)
     s(id='ic nav back').tap()
     sleep(3)
     s(id='个人中心').tap()
     s.swipe(800, 500, 800, 280, 0.5)
     sleep(2)
     #s.tap(160, 465)
     s(id='退出登录').tap()
     s(id='确定').tap()
     sleep(1)
 def uploadMusicByOneself(self):
     login(self)
     sleep(3)
     s = c.session()
     if s(id='上节课程').exists:
         s(id='上节课程').tap()
         flag = s(className='XCUIElementTypeStaticText')[2].text
     else:
         flag = s(className='XCUIElementTypeStaticText')[3].text
     sleep(2)
     #ic upload1
     print('\n' + flag)
     print('\n已开始:' + str('已开始' in flag))
     print('\n已结束:' + str('已结束' in flag))
     sleep(1)
     if s(id='上传乐谱').exists:
         s(id='上传乐谱').tap()
     else:
         s(id='查看乐谱').tap()
     sleep(2)
     if s.alert.wait(3):
         s.alert.accept()
         sleep(2)
     now = time.strftime('%Y-%m-%d %H_%M_%S')
     sf = './' + now + '_024b_uploadedMusicIni_R.png'
     c.screenshot(sf)
     sleep(2)
     lis = s(className='XCUIElementTypeCell').find_elements()
     i = len(lis)
     print('\ni:' + str(i) + '----实际已有乐谱数量:' + str(i - 1))
     sleep(2)
     #delete existing music
     if (i != 1 and (not ('已开始' in flag) and not ('已结束' in flag))):
         for j in range(i - 1):
             s(id='删除').tap()
             sleep(2)
             s(id='确定').tap()
             sleep(2)
         sleep(2)
         s(id='上传乐谱').tap()
         sleep(2)
         """
         s(id='自主上传').tap()
         sleep(2)
         s(id='取消').tap()
         sleep(2)
         """
         s(id='自主上传').tap()
         sleep(2)
         s(id='最近上过的乐谱').tap()
         sleep(2)
         s(id='   添 加   ').tap()
         sleep(2)
         s(id='ic nav back').tap()
         sleep(2)
         now = time.strftime('%Y-%m-%d %H_%M_%S')
         sf0 = './' + now + '_024b_uploadedMusicByBefore_R.png'
         c.screenshot(sf0)
         sleep(2)
         #[i] for not deleting firstly
         s(id='ic_next')[1].tap()
         sleep(2)
         now = time.strftime('%Y-%m-%d %H_%M_%S')
         sf2 = './' + now + '_024b_uploadedMusicByBeforeDetail_R.png'
         c.screenshot(sf2)
         sleep(2)
         turnpage_play(self)
         sleep(2)
         s(id='ic nav back').tap()
         sleep(2)
         s(id='上传乐谱').tap()
         sleep(2)
         s(id='自主上传').tap()
         sleep(2)
         s(id='从相册选择').tap()
         sleep(2)
         s(className='XCUIElementTypeButton')[7].tap()
         sleep(2)
         s(id='完成').tap()
         sleep(8)
         now = time.strftime('%Y-%m-%d %H_%M_%S')
         sf1 = './' + now + '_024b_uploadedMusicByAlbum_R.png'
         c.screenshot(sf1)
         sleep(2)
         #[i+1] for not deleting firstly
         s(id='ic_next')[2].tap()
         sleep(8)
         now = time.strftime('%Y-%m-%d %H_%M_%S')
         sf3 = './' + now + '_024b_uploadedMusicByAlbumDetail_R.png'
         c.screenshot(sf3)
         sleep(2)
         s(id='ic nav back').tap()
         sleep(2)
         s(id='上传乐谱').tap()
         sleep(2)
         s(id='自主上传').tap()
         sleep(2)
         s(id='拍照上传').tap()
         sleep(2)
         s(id='ic_ photograph').tap()
         sleep(2)
         if s.alert.wait(3):
             s.alert.accept()
             sleep(2)
         s(xpath=
           '//XCUIElementTypeButton[@name="FrontBackFacingCameraChooser"]'
           ).tap()
         sleep(3)
         #PhotoCapture
         s(id='PhotoCapture').tap()
         sleep(2)
         s(id='使用照片').tap()
         sleep(2)
         s(id='完成').tap()
         sleep(10)
         now = time.strftime('%Y-%m-%d %H_%M_%S')
         sf4 = './' + now + '_024b_uploadedMusicBySelfie_R.png'
         c.screenshot(sf4)
         sleep(2)
         #[i+2] for not deleting firstly
         s(id='ic_next')[3].tap()
         sleep(8)
     else:
         s(id='上传乐谱').tap()
         sleep(2)
         s(id='自主上传').tap()
         sleep(2)
         s(id='取消').tap()
         sleep(2)
         s(id='自主上传').tap()
         sleep(2)
         s(id='最近上过的乐谱').tap()
         sleep(2)
         s(id='   添 加   ').tap()
         sleep(2)
         s(id='ic nav back').tap()
         sleep(2)
         now = time.strftime('%Y-%m-%d %H_%M_%S')
         sf5 = './' + now + '_024b_uploadedMusicByBefore_R.png'
         c.screenshot(sf5)
         sleep(2)
         #[i] for not deleting firstly
         s(id='ic_next')[i].tap()
         sleep(2)
         now = time.strftime('%Y-%m-%d %H_%M_%S')
         sf6 = './' + now + '_024b_uploadedMusicByBeforeDetail_R.png'
         c.screenshot(sf6)
         sleep(2)
         turnpage_play(self)
         sleep(2)
         s(id='ic nav back').tap()
         sleep(2)
         s(id='上传乐谱').tap()
         sleep(2)
         s(id='自主上传').tap()
         sleep(2)
         s(id='从相册选择').tap()
         sleep(2)
         s(className='XCUIElementTypeButton')[4].tap()
         sleep(2)
         s(id='完成').tap()
         sleep(8)
         now = time.strftime('%Y-%m-%d %H_%M_%S')
         sf7 = './' + now + '_024b_uploadedMusicByAlbum_R.png'
         c.screenshot(sf7)
         sleep(2)
         #[i+1] for not deleting firstly
         s(id='ic_next')[i + 1].tap()
         sleep(8)
         now = time.strftime('%Y-%m-%d %H_%M_%S')
         sf8 = './' + now + '_024b_uploadedMusicByAlbumDetail_R.png'
         c.screenshot(sf8)
         sleep(2)
         s(id='ic nav back').tap()
         sleep(2)
         s(id='上传乐谱').tap()
         sleep(2)
         s(id='自主上传').tap()
         sleep(2)
         s(id='拍照上传').tap()
         sleep(2)
         s(id='ic_ photograph').tap()
         sleep(2)
         if s.alert.wait(3):
             s.alert.accept()
             sleep(2)
         s(xpath=
           '//XCUIElementTypeButton[@name="FrontBackFacingCameraChooser"]'
           ).tap()
         sleep(2)
         #PhotoCapture
         s(id='PhotoCapture').tap()
         sleep(2)
         s(id='使用照片').tap()
         sleep(2)
         s(id='完成').tap()
         sleep(10)
         now = time.strftime('%Y-%m-%d %H_%M_%S')
         sf9 = './' + now + '_024b_uploadedMusicBySelfie_R.png'
         c.screenshot(sf9)
         sleep(2)
         #[i+2] for not deleting firstly
         s(id='ic_next')[i + 2].tap()
         sleep(8)
     now = time.strftime('%Y-%m-%d %H_%M_%S')
     sf10 = './' + now + '_024b_uploadedMusicBySelfieDetail_R.png'
     c.screenshot(sf10)
     sleep(2)
     s(id='ic nav back').tap()
     sleep(2)
     s(id='ic nav back').tap()
     sleep(2)
     logout(self)
 def searchMusic(self):
     login(self)
     sleep(3)
     #ic upload1
     s=c.session()
     if s(id='上传乐谱').exists:
         s(id='上传乐谱').tap()
     else:
         s(id='查看乐谱').tap()
     sleep(2)
     if s.alert.wait(3):
         s.alert.accept()
         sleep(2)
     s(id='上传乐谱').tap()
     #hot search
     s(id='搜索书名或者曲目名').tap()
     s(id='考级').tap()
     sleep(1)
     s(id='钢琴').tap()
     sleep(3)
     s(id='小提琴').tap()
     sleep(3)
     s(id='手风琴').tap()
     sleep(3)
     s(id='钢琴').tap()
     sleep(3)
     #first music
     s(className='XCUIElementTypeCell')[0].tap()
     sleep(3)
     #first item
     s(className='XCUIElementTypeCell')[0].tap()
     sleep(3)
     now=time.strftime('%Y-%m-%d %H_%M_%S')
     sf2='./'+now+'_003b_searchedMusicByHotDetail_R.png'
     c.screenshot(sf2)
     sleep(2)
     turnpage_play(self)
     sleep(1)
     s(id='ic nav back').tap()
     sleep(1)
     s(id='ic nav back').tap()
     sleep(1)
     """
     s(id='取消').tap()
     sleep(2)
     s(id='全部').tap()
     sleep(2)
     """
     #whole music name
     s(className='XCUIElementTypeTextField').tap()
     s(className='XCUIElementTypeTextField').set_text('车尔尼299 No.02')
     sleep(1)
     s(id='Search').tap()
     sleep(3)
     s(id='包含该曲目').tap()
     sleep(3)
     s(className='XCUIElementTypeCell')[0].tap()
     sleep(3)
     now=time.strftime('%Y-%m-%d %H_%M_%S')
     sf1='./'+now+'_003b_searchedMusicByWholenameDetail_R.png'
     c.screenshot(sf1)
     sleep(2)
     turnpage_play(self)
     sleep(2)
     s(id='ic nav back').tap()
     sleep(1)
     s(id='ic nav back').tap()
     sleep(1)
     s(id='取消').tap()
     sleep(2)
     s(id='全部').tap()
     sleep(2)
     #keyword
     s(className='XCUIElementTypeTextField').tap()
     s(className='XCUIElementTypeTextField').set_text('299 No.07')
     sleep(1)
     s(id='Search').tap()
     sleep(3)
     s(id='包含该曲目').tap()
     sleep(3)
     s(className='XCUIElementTypeCell')[0].tap()
     sleep(3)
     now=time.strftime('%Y-%m-%d %H_%M_%S')
     sf3='./'+now+'_003b_searchedMusicByKeywordDetail_R.png'
     c.screenshot(sf3)
     sleep(2)
     turnpage_play(self)
     sleep(1)
     s(id='ic nav back').tap()
     sleep(1)
     s(id='ic nav back').tap()
     sleep(1)
     s(id='取消').tap()
     sleep(2)
     s(id='ic nav back').tap()
     sleep(1)
     s(id='ic nav back').tap()
     sleep(2)
     logout(self)
 def deleteEditMusic(self):
     login(self)
     sleep(2)
     s = c.session()
     if s(id='上节课程').exists:
         s(id='上节课程').tap()
         flag = s(className='XCUIElementTypeStaticText')[2].text
     else:
         flag = s(className='XCUIElementTypeStaticText')[3].text
     sleep(2)
     #ic upload1
     print('\n' + flag)
     print('\n已开始:' + str('已开始' in flag))
     print('\n已结束:' + str('已结束' in flag))
     sleep(1)
     now = time.strftime('%Y-%m-%d %H_%M_%S')
     sf = './' + now + '_025b_classUI_R.png'
     c.screenshot(sf)
     sleep(2)
     if ((s(id='查看乐谱').exists)
             and (not ('已开始' in flag) and not ('已结束' in flag))):
         s(id='查看乐谱').tap()
         sleep(2)
         if s.alert.wait(3):
             s.alert.accept()
             sleep(2)
         now = time.strftime('%Y-%m-%d %H_%M_%S')
         sf0 = './' + now + '_025b_beforeDelete_R.png'
         c.screenshot(sf0)
         sleep(2)
         #item=s(className='XCUIElementTypeStaticText')[2].text
         #print(str(item))
         #sleep(1)
         if s(id='自主上传乐谱').exists:
             s(id='自主上传乐谱').tap()
             sleep(2)
             s(id='编辑').tap()
             sleep(2)
             #xy
             s(id='ic drag').tap()
             sleep(2)
             s(id='完成').tap()
             sleep(2)
         else:
             print('\n没有自主上传乐谱可以编辑!')
             sleep(2)
         s(id='删除')[0].tap()
         sleep(2)
         s(id='确定').tap()
         sleep(2)
         now = time.strftime('%Y-%m-%d %H_%M_%S')
         sf4 = './' + now + '_025b_afterDelete_R.png'
         c.screenshot(sf4)
         sleep(2)
         s(id='ic nav back').tap()
         sleep(2)
     elif (('已开始' in flag) or ('已结束' in flag)):
         print('\n现在时间不符合该脚本运行条件!')
         sleep(2)
     elif (not (s(id='查看乐谱').exists)):
         print('\n没有乐谱可以删除/编辑!')
         sleep(2)
     else:
         print('\n发生未知原因错误,请检查!')
     sleep(3)
     logout(self)