def test_case_smoke1(self):
        """smoke1-BS全流程测试-通过场景"""
        # Chrome驱动
        driver = webdriver.Chrome()
        # 浏览器最大化
        driver.maximize_window()
        # 打开网址
        driver.get(URL.url)
        # 等待
        driver.implicitly_wait(20)
        # loginPage实例化
        loginPage1 = LoginPage()
        """test登陆通知调度"""
        # 调用对象loginPage1的login方法
        loginPage1.test_user_login(driver=driver,
                                   username='******',
                                   password='******')
        # homePage实例化
        homePage1 = HomePage()
        # 等待
        driver.implicitly_wait(20)
        # 点击实时监控button
        homePage1.click_real_time_monitoring(driver=driver)
        # 实时监控页面实例化
        realTimeMonitoringPage1 = RealTimeMonitoringPage()
        # 等待
        driver.implicitly_wait(20)
        # 点击实时监控的左侧第一个卡片
        realTimeMonitoringPage1.click_first_warn_notice_card(driver=driver)
        driver.implicitly_wait(20)
        # 点击实时监控的右侧通知调度button
        realTimeMonitoringPage1.click_notice_dispatcher_button(driver=driver)
        driver.implicitly_wait(20)
        # 输入通知调度dialog
        realTimeMonitoringPage1.input_notice_dispatcher_dialog(
            driver=driver, notice_dispatcher_content=u'通知调度')
        # 点击通知调度dialog的确定button
        driver.implicitly_wait(20)
        realTimeMonitoringPage1.click_notice_dispatcher_input_confirm_button(
            driver=driver)
        sleep(1)
        # 点击调度管理button
        homePage1.click_dispatching_management(driver=driver)
        # 调度管理页面实例化
        dispatchingManagementPage1 = DispatchingManagementPage()
        # 等待
        driver.implicitly_wait(20)
        # 第一个调度单派单
        dispatchingManagementPage1.click_first_dispatch_button(driver=driver)
        driver.implicitly_wait(20)
        # 点击工单类型---3.维修单
        dispatchingManagementPage1.click_slow_repair_button(driver=driver)
        driver.implicitly_wait(20)
        # 点击派发流程按钮
        dispatchingManagementPage1.click_dispatch_flow_button(driver=driver)
        driver.implicitly_wait(20)
        # 选择第一个派发流程
        dispatchingManagementPage1.select_first_dispatch_flow(driver=driver)
        driver.implicitly_wait(20)
        # 点击自动匹配
        sleep(1)
        dispatchingManagementPage1.click_auto_match_button(driver=driver)
        driver.implicitly_wait(20)
        # 自动匹配点击第一个人员
        sleep(1)
        dispatchingManagementPage1.click_auto_match_first_user_list(
            driver=driver)
        driver.implicitly_wait(20)
        # 点击自动匹配对话框的确定按钮
        dispatchingManagementPage1.click_auto_match_confirm_button(
            driver=driver)
        driver.implicitly_wait(20)
        # 输入工单内容描述
        dispatchingManagementPage1.input_work_order_content(
            driver=driver, work_order_content_input=u'工单内容描述')
        driver.implicitly_wait(20)
        # 选择计划开始时间
        dispatchingManagementPage1.select_plan_start_time(
            driver=driver, plan_start_time='2018-03-22 00:00')
        driver.implicitly_wait(20)
        # 选择计划结束时间
        dispatchingManagementPage1.select_plan_end_time(
            driver=driver, plan_end_time='2018-12-29 00:00')
        driver.implicitly_wait(20)
        # 输入班组
        dispatchingManagementPage1.input_team_group(driver=driver,
                                                    team_group=u'巡检一班')
        driver.implicitly_wait(20)
        # 调度管理派单界面的派单按钮
        sleep(1)
        dispatchingManagementPage1.click_dispatch_button(driver=driver)
        sleep(1)
        # 退出登陆实例化
        logoutPage1 = LogoutPage()
        # 退出登陆
        logoutPage1.test_user_logout(driver=driver)
        """电工1登陆,走流程,审核和处理"""
        # 电工1登陆
        loginPage1.test_user_login(driver=driver,
                                   username='******',
                                   password='******')
        # 等待
        driver.implicitly_wait(20)
        # 点击首页工单按钮
        homePage1.click_work_order(driver=driver)
        sleep(1)
        # 工单实例化
        workOrderPage1 = WorkOrderPage()
        # 等待
        driver.implicitly_wait(20)
        # 点击工单中的我的待办
        workOrderPage1.click_my_to_do_button(driver=driver)
        sleep(1)
        driver.implicitly_wait(20)
        # 点击第一个工单的处理按钮
        workOrderPage1.click_first_deal_button(driver=driver)
        driver.implicitly_wait(20)
        # 填写审核表单
        workOrderPage1.input_audit_form(driver=driver,
                                        required_equipment=u'所需设备',
                                        required_materials=u'所需材料',
                                        repaired_plan=u'所需计划')
        driver.implicitly_wait(20)
        sleep(1)
        # 点击第一个工单的处理按钮
        workOrderPage1.click_first_deal_button(driver=driver)
        # 填写处理表单
        driver.implicitly_wait(20)
        workOrderPage1.input_deal_form(driver=driver, deal_result=u'处理结果')
        sleep(1)
        driver.implicitly_wait(20)
        # 退出登陆
        logoutPage1.test_user_logout(driver=driver)
        sleep(1)
        driver.implicitly_wait(20)
        """test登陆,走流程,验证--通过"""
        # test登陆
        loginPage1.test_user_login(driver=driver,
                                   username='******',
                                   password='******')
        sleep(1)
        driver.implicitly_wait(20)
        # 点击导航的工单按钮
        homePage1.click_work_order(driver=driver)
        # 点击工单中的我的待办
        workOrderPage1.click_my_to_do_button(driver=driver)
        sleep(1)
        driver.implicitly_wait(20)
        # 点击第一个工单的处理按钮
        workOrderPage1.click_first_deal_button(driver=driver)
        driver.implicitly_wait(20)
        # 填写验证表单
        workOrderPage1.input_verify_form(driver=driver,
                                         result_description=u'结果描述')
        # 验证表单中的通过按钮
        workOrderPage1.click_vertify_form_pass_button(driver=driver)
        sleep(1)

        # 浏览器退出
        driver.quit()
Пример #2
0
    def test_case_smoke1(self):
        """smoke1-BS全流程测试-通过场景"""
        # Chrome驱动
        driver = webdriver.Chrome()
        # 浏览器最大化
        driver.maximize_window()
        # 打开网址
        driver.get(URL.url)
        # 等待
        driver.implicitly_wait(20)
        # loginPage实例化
        loginPage1 = LoginPage()
        loginPage1.test_user_login(driver=driver,
                                   username='******',
                                   password=123456)
        sleep(3)
        # homePage实例化
        homePage1 = HomePage()
        # workOrder实例化
        workOrder1 = WorkOrderPage()
        """test登陆新建工单"""
        homePage1.click_work_order(driver=driver)
        """新增工单"""
        workOrder1.click_add_order(driver=driver)
        """抢修类型"""
        workOrder1.click_qiangxiu_button(driver=driver)
        sleep(1)
        driver.implicitly_wait(20)
        """请选择派发流程_第2个抢修流程"""
        workOrder1.click_dispatch_flow_select(driver=driver)
        sleep(1)
        driver.implicitly_wait(20)
        sleep(1)
        driver.implicitly_wait(20)
        """选择第一个派发"""
        workOrder1.click_dispatch_flow_selected_one(driver=driver)
        sleep(1)
        driver.implicitly_wait(20)
        """填写项目名称"""
        workOrder1.input_project_name(driver=driver, project_name=u'test项目名称')
        sleep(1)
        driver.implicitly_wait(20)
        """填写项目地点"""
        workOrder1.input_project_place(driver=driver,
                                       project_place=u'test项目地点')
        sleep(1)
        driver.implicitly_wait(20)
        """选择负责人"""
        workOrder1.click_principal_select(driver=driver)
        sleep(1)
        driver.implicitly_wait(20)
        """选择第1个负责人"""
        workOrder1.click_principal_selected_one(driver=driver)
        sleep(1)
        driver.implicitly_wait(20)
        """选择验证人"""
        workOrder1.click_identifier_select(driver=driver)
        sleep(1)
        driver.implicitly_wait(20)
        """选择第1个验证人"""
        workOrder1.click_identifier_selected_one(driver=driver)
        sleep(1)
        driver.implicitly_wait(20)
        """选择客户"""
        workOrder1.click_customer_select(driver=driver)
        sleep(1)
        driver.implicitly_wait(20)
        """选择第2个客户"""
        workOrder1.click_customer_selected_one(driver=driver)
        sleep(1)
        driver.implicitly_wait(20)
        """输入客户联系人"""
        workOrder1.input_customer_linkman(driver=driver,
                                          customer_linkman=u'许臻')
        sleep(1)
        driver.implicitly_wait(20)
        """输入联系电话"""
        workOrder1.input_linkman_tel(driver=driver, linkman_tel='15609100803')
        sleep(1)
        driver.implicitly_wait(20)
        """输入工单内容描述"""
        workOrder1.input_work_order_content_description(
            driver=driver, work_order_content_description=u'工单内容描述')
        sleep(1)
        driver.implicitly_wait(20)
        """输入计划开始时间"""
        workOrder1.select_plan_start_time(driver=driver,
                                          plan_start_time='2018-04-20 00:00')
        sleep(1)
        driver.implicitly_wait(20)
        """输入计划结束时间"""
        workOrder1.select_plan_end_time(driver=driver,
                                        plan_end_time='2018-04-20 22:00')
        """输入班组"""
        workOrder1.input_group(driver=driver, group=u'巡检一班')
        """点击派单按钮"""
        workOrder1.click_dispatch_button(driver=driver)
        sleep(1)
        driver.implicitly_wait(20)
        """******************"""
        """点击我的待办按钮"""
        workOrder1.click_my_to_do_button(driver=driver)
        sleep(1)
        driver.implicitly_wait(20)
        """点击第一个处理按钮"""
        workOrder1.click_first_deal_button(driver=driver)

        sleep(10)
        # 浏览器退出
        driver.quit()