def test_003_createoffline(self): """ 测试删除线下会 """ base.deprint("开始执行登录,并进入删除线下会用例") dr = self.driver o = LoginPage(dr) o.login() o = ChoosePage(dr) o.click_menu_bt('10') o = IndexPage(dr) o.click_linelist('2') object = InteractionAndCancle(dr) actual_result = object.interaction_and_cancle('2') expected_result = u'取消会议成功' self.assertEqual(actual_result, expected_result, msg="failed") base.deprint("删除线下会用例完成")
def test_002_interaction(self): """ 添加互动环节""" base.deprint("开始执行登录,并进入添加线下会互动环节用例") dr = self.driver o = LoginPage(dr) o.login() o = ChoosePage(dr) o.click_menu_bt('10') o = IndexPage(dr) o.click_linelist('2') o = InteractionAndCancle(dr) acture_result=o.interaction_and_cancle('1') excepet_result="已添加互动环节" # self.assertEqual(acture_result,excepet_result,"failed") base.deprint( "添加线下会互动环节添加用例完成")
self.driver.switch_to.window(self.driver.window_handles[-1]) # 获取下一个窗口句柄,跳转 self.wait_is_visible('css','#g-right > div > div.clearfix.ng-scope > div.contact-stats-box.w715 > div.event-stats-l > div > button') #点击创建会议 self.driver.implicitly_wait(30) self.deprint("点击创建会议完成") #点击会议列表菜单 def click_linelist(self,list_pos): self.deprint("点击会议列表") self.driver.implicitly_wait(10) css_path = "/html/body/div[2]/div[1]/ul/li[" + str(list_pos) + "]/h2/a" #点击会议列表 self.wait_is_visible('x', css_path) self.driver.refresh() self.deprint("点击第一场会议") self.driver.implicitly_wait(30) self.wait_is_visible('x','//*[@id="g-right"]/div/div[3]/table/tbody/tr[1]/td[2]/a') #点击第一场会议 self.driver.implicitly_wait(30) if __name__ == '__main__': dr = brower() o = LoginPage(dr) o.login() o = ChoosePage(dr) time.sleep(3) o.click_menu_bt('9') o = IndexPage(dr) #o.click_linelist() o.click_linelist('2') o.quit()
from pages.off_line_meeting_pages.interaction_manage_page import InteractionPageManage # from pages.off_line_meeting_pages.interaction_link_page import Interaction_Line class IndexDetailsOfMeeting(BasePage): # 点击互动环节菜单 def click_interaction(self): self.deprint("点击互动环节菜单") self.driver.switch_to.window(self.driver.window_handles[-1]) # 获取下一个窗口句柄,跳转 self.wait_is_visible('x','/html/body/div[2]/div[2]/ul[2]/li[6]') self.driver.implicitly_wait(30) self.deprint("进入互动环节页面") if __name__ == '__main__': dr = brower() o = LoginPage(dr) o.login() o = ChoosePage(dr) o.click_menu_bt('9') o = IndexPage(dr) o.click_linelist() o = Interaction_Line(dr) o.interaction_link() o = InteractionPageManage(dr) o.creat_questionnaire() o = IndexDetailsOfMeeting(dr) o.click_interaction()