Beispiel #1
0
    def setUp(self):
        browser = BrowserEngine(self)
        self.driver = browser.open_browser(self)  # 读取浏览器类型
        driver = self.driver
        # 调用登录函数,默认username='******',password='******'
        self.lg = login(driver)
        directory = DirectoryList(driver)

        # 考勤设置-考勤地点
        directory.two_level_select('考勤设置', '考勤地点')
        # 点击白金软件
        driver.find_element_by_xpath(
            '//section/main/div/div/div/div//span/span[contains(text(),"白金软件")]'
        ).click()
        sleep(0.2)
        # 零售公司
        driver.find_element_by_xpath(
            '//section/main/div/div/div/div//span/span[contains(text(),"零售公司")]'
        ).click()
        sleep(0.2)
        # 中国
        driver.find_element_by_xpath(
            '//section/main/div/div/div/div//span/span[contains(text(),"中国")]'
        ).click()
        sleep(0.2)
        # 上海
        driver.find_element_by_xpath(
            '//section/main/div/div/div/div//span/span[contains(text(),"上海")]'
        ).click()
        sleep(0.2)

        # 将滚动条拉到最底层
        js1 = "window.scrollTo(0,100)"
        driver.execute_script(js1)
Beispiel #2
0
 def setUp(self):
     browser = BrowserEngine(self)
     self.driver = browser.open_browser(self)  # 读取浏览器类型
     driver = self.driver
     # 调用登录函数,默认username='******',password='******'
     self.lg = login(driver)
     directory = DirectoryList(driver)
     # print('当前页url是:',url)
     # 考勤处理-排班管理
     directory.two_level_select("系统管理", '基本设置')
Beispiel #3
0
    def setUp(self):
        # 还原数据库
        # DataBase(1).database_restore()

        browser = BrowserEngine(self)
        self.driver = browser.open_browser(self)  # 读取浏览器类型
        driver = self.driver
        # 调用登录函数,默认username='******',password='******'
        login(driver, username='******', password='******')
        directory = DirectoryList(driver)
        # print('当前页url是:',url)
        # 流程-我的流程
        directory.two_level_select("流程", '我的流程')
 def setUp(self):
     browser = BrowserEngine(self)
     self.driver = browser.open_browser(self)  # 读取浏览器类型
     sleep(1)
     driver = self.driver
     directory = DirectoryList(driver)
     # 调用登录函数,默认username='******',password='******'
     self.lg = login(driver)
     # 考勤设置-考勤列表-加班类型
     directory.two_level_select('考勤设置', '审查自定义项')
     # 将滚动条拉到最底层
     js1 = "window.scrollTo(0,100)"
     driver.execute_script(js1)
     sleep(1)
    def setUp(self):
        browser = BrowserEngine(self)
        self.driver = browser.open_browser(self)  # 读取浏览器类型
        driver = self.driver
        # 调用登录函数,默认username='******',password='******'
        self.lg = login(driver)
        directory = DirectoryList(driver)

        # 考勤设置-考勤地点
        directory.two_level_select('系统管理', '预处理规则')

        # 将滚动条拉到最底层
        js1 = "window.scrollTo(0,100)"
        driver.execute_script(js1)
Beispiel #6
0
    def test06_eliminate_lateness_and_early_departure_application(self, data):
        """流程-我的流程-消迟到早退申请"""
        if data["skip"] == 'True':
            self.skipTest("跳过示例")
        driver = self.driver
        directory = DirectoryList(driver)
        my_flow = MyFlow(driver)
        my_apply = MyApply(driver)
        common = FlowCommon(driver)

        name = data['用例描述']
        flow = data['操作流程对象']

        reason = data['输入理由'].split('-')
        verify_path = data['验证路径'].split('-')
        expect = data['预期结果']
        # 数据库操作排班
        DataBase(2).execute_sql()

        directory.two_level_select('考勤处理', '考勤审查')
        # 点击审查按钮
        driver.find_element_by_xpath(
            "//section/header/div[2]/div[3]/button/span[contains(text(),'审查')]"
        ).click()
        sleep(5)
        driver.find_element_by_xpath(
            "//div/div[2]/div[1]/p/strong[contains(text(),'审查成功')]"
            "/../../../..//div[3]/button/span").click()
        sleep(2)
        directory.two_select('流程', '我的流程')

        # 选择要操作的流程
        my_flow.select_flow(flow)

        # 选取迟到信息
        driver.find_element_by_xpath(
            '//section/header/div//label/span[1]/span').click()

        # 理由
        common.input_(reason[0], reason[1])
        # 提交
        common.submit_btn()
        sleep(0.2)
        # ok
        common.ok_btn()
        sleep(0.5)

        # 前往我的申请查看结果
        directory.two_select(verify_path[0], verify_path[1])
        sleep(1)
        element = my_apply.application_name_list(verify_path[2])

        # 断言
        try:
            self.assertIn(expect, element)
            my_flow.capture_screen(name + '成功')
            print(name + '成功')

        except AssertionError as e:
            my_flow.error_screen(name + '失败')
            print(name + '失败')
            raise e
        print(
            "-------------------调岗申请test06_eliminate_lateness_and_early_departure_application运行完毕-------------------"
        )