def test_flow_complete(self):
        '''自由流程结束流程'''
        name = '自由流程结束流程'
        comp = ProcessApproverPage(self.driver)
        # 判断是否要删除记录
        lp = ListViewPage(self.driver)
        if lp.get_rows_total() != 0:
            lp.delete_all_data()  # 删除所有数据

        comp.click_newbtn()  # 点击新建进入表单

        comp.input_reason(name)  # 录入请假原因
        comp.click_submit_star_flowbtn()  # 点击提交按钮
        comp.select_user('员工')  # 选择审批人
        comp.submit()  # 点击确认
        comp.wait_loading_hide()  # 等待视图loading消失
        lp.click_row()  # 点击第一条记录
        comp.click_end_flow()  # 点击结束流程按钮
        comp.wait_elem_visible(
            '#flowprocessDiv #div_button_place')  # 等待流程面板展开按钮可见
        comp.submit()  # 点击确认按钮
        #
        comp.wait_loading_hide()  # 等待视图loading消失
        lp.click_row()  # 点击第一条记录
        self.assertFalse(comp.is_flow_actbutton_exist('提交 _结束流程'),
                         msg=name + '校验不通过')
Esempio n. 2
0
    def test_timeout_submit_case(self):
        """超时自动提交"""
        name = "审批超时自动提交"
        #time.sleep(0.5)
        comp = ProcessApproverPage(self.driver)
        #把消息关掉
        self.driver.switch_to_default_content()
        comp.close_message()  #关闭消息中心提示
        comp.switch_to_formiframe()
        # 判断是否要删除记录
        lp = ListViewPage(self.driver)
        lp.judge_delete(name)
        # 点击新建进入表单
        comp.click_newbtn()
        # 录入请假原因
        comp.input_reason(name)
        # 点击提交按钮
        comp.click_flow_processbtn()
        comp.wait_elem_visible('div[data-type="nodeItem"]')  #等待提交节点显示
        # 点击确认提交
        comp.submit()
        # 再次相应记录
        comp.openagain_record(name)
        # 获取流程状态的处理人
        text = comp.get_approver()
        # 断言
        self.assertIn('王聪', text, msg=name + "检验不通过")
        #点击返回按钮
        comp.click_rebackbtn()
        time.sleep(60)  #等待系统超时自动提交,再验证是否已提交
        # 再次相应记录
        comp.openagain_record(name)
        #time.sleep(0.5)
        bool = comp.is_filed()
        self.assertIsNone(bool, msg=name + "检验不通过")

        def init(self):
            self.test_timeout_submit_case()
Esempio n. 3
0
 def lilingnew(self, name):
     """李玲新建单据"""
     comp = ProcessApproverPage(self.driver)
     # 点击新建进入表单
     comp.click_newbtn()
     # 录入请假原因
     if (comp.find_elem_visible(
             'span[id="11e7-6619-cde06435-8f1a-bfe936d3ae2a_divid"]>textarea'
     ) == None):
         comp.wait_elem_visible(
             'span[id="11e7-6619-cde06435-8f1a-bfe936d3ae2a_divid"]>textarea'
         )
         time.sleep(1)
         comp.find_elem_visible(
             'span[id="11e7-6619-cde06435-8f1a-bfe936d3ae2a_divid"]>textarea'
         ).send_keys(name)
     else:
         comp.find_elem_visible(
             'span[id="11e7-6619-cde06435-8f1a-bfe936d3ae2a_divid"]>textarea'
         ).send_keys(name)
     # 点击提交按钮
     comp.click_flow_processbtn()
     # 点击指定审批人选择框
     comp.find_elem_is_clickable('span.flowToPerson>img').click()
     # 回到主文档,没有iframe
     self.driver.switch_to.default_content()
     # 切到指定审批人iframe
     comp.switchto_designatedapprover()
     comp.wait_elem_visible('.contentDiv.on')  #等待审批人框显示
     # 勾选审批人伟强
     comp.find_elem_visible(
         '#rightcontent>div>input[name="伟强"]+span').click()
     if (comp.find_elem('#rightcontent>div>input[name="伟强"]').is_selected()
             == False):
         for i in range(10):
             print('次数 %s' % i)
             comp.find_elem_visible(
                 '#rightcontent>div>input[name="伟强"]+span').click()
             if (comp.find_elem(
                     '#rightcontent>div>input[name="伟强"]').is_selected()):
                 break
     comp.wait_elem_visible('#selectedUserDiv>span[title="点击删除"]')
     #等待用户选中
     comp.find_elem_is_clickable('input#doReturn').click()
     # 等待确认后的灰色锁屏消失
     self.driver.switch_to.default_content()
     comp.wait_elem_disappear('#lock_screen_div>div')  #等待确认后的灰色锁屏消失
     # 返回到表单所在的iframe
     comp.switch_to_formiframe()
     # 点击确认提交
     comp.submit()