Пример #1
0
 def pre_test(self):
     self.start_step("初始化环境")
     self.common = Common()
     # 初始化Luadriver
     self.luadriver = self.common.setupdriver()
     self.hall_page = Hall_Page()
     self.personinfo_page = Personinfo_Page()
     self.sign_page = Sign_Page()
     # PHPInterface.set_env(PHPInterface.PRE_REPUBLISH_ENV)
     return1 = PHPInterface.set_notice('公告自动化测试',
                                       "文本公告测试",
                                       app_id=103000,
                                       end_time=int(time.time() + 60 * 2),
                                       is_html=1,
                                       conditions={"poptype": 2})
     print return1
     self.start_step("配置公告")
     self.common.closeactivity_switchserver(self.luadriver)
     Flag = True
     while Flag:  # 关闭干扰活动弹框,找到公告弹框
         try:
             self.hall_page.wait_element('公告标题')
             print '找到公告标题'
             Flag = False
         except:
             try:
                 self.sign_page.wait_element("关闭1").click()
             except:
                 print '未找到关闭按钮'
             time.sleep(2)
Пример #2
0
 def pre_test(self):
     self.start_step("初始化环境")
     self.common = Common()
     # 初始化Luadriver
     self.luadriver = self.common.setupdriver()
     self.hall_page = Hall_Page()
     self.personinfo_page = Personinfo_Page()
     self.sign_page = Sign_Page()
     # PHPInterface.set_env(PHPInterface.PRE_REPUBLISH_ENV)
     return1 = PHPInterface.set_notice(
         title='666666',
         content={
             "htmlpic":
             "https://dfqppic.266.com/dfqp/pic/notice/mycff2zj.png"
         },
         app_id=103000,
         end_time=int(time.time() + 60 * 2),
         is_html=2,
         conditions={"poptype": 2})
     print return1
     time.sleep(10)
     self.start_step("配置公告")
     self.common.closeactivity_switchserver(self.luadriver)
     Flag = True
     while Flag:  # 关闭干扰活动弹框,找到公告弹框
         try:
             self.hall_page.wait_element('公告图片')
             print '找到公告图片'
             Flag = False
         except:
             try:
                 self.sign_page.wait_element("关闭1").click()
             except:
                 print '未找到关闭按钮'
             time.sleep(2)
Пример #3
0
 def pre_test(self):
     self.start_step("初始化环境")
     self.common = Common()
     # 初始化Luadriver
     self.luadriver = self.common.setupdriver()
     self.hall_page = Hall_Page()
     self.personinfo_page = Personinfo_Page()
     self.sign_page = Sign_Page()
     # PHPInterface.set_env(PHPInterface.PRE_REPUBLISH_ENV)
     return1 = PHPInterface.set_notice(
         title='666666',
         content={
             "htmlpic":
             "https://dfqppic.266.com/dfqp/pic/notice/mycff2zj.png",
             "cmd": 1022,
             "gameid": 203,
             "level": 12
         },
         app_id=103000,
         end_time=int(time.time() + 60 * 2),
         is_html=2,
         conditions={"poptype": 2})
     print return1
     time.sleep(10)
     self.start_step("配置公告")
     self.common.closeactivity_switchserver(self.luadriver)
 def pre_test(self):
     self.start_step("初始化环境")
     self.common = Common()
     # 初始化Luadriver
     self.luadriver = self.common.setupdriver()
     self.hall_page = Hall_Page()
     self.personinfo_page = Personinfo_Page()
     self.sign_page = Sign_Page()
     # PHPInterface.set_env(PHPInterface.PRE_REPUBLISH_ENV)
     return1 = PHPInterface.set_notice('公告自动化测试',
                                       "1111",
                                       id=103000,
                                       end_time=int(time.time() + 60 * 4),
                                       is_html=1)
     print return1
     time.sleep(10)
     self.start_step("配置公告")
     try:
         self.luadriver.find_element_by_name("允许").click()
     except:
         print "未出现按钮"
     time.sleep(15)
     try:
         self.hall_page.wait_element("确认登陆").click()
     except:
         print "未出现登陆按钮"