Ejemplo n.º 1
0
 def __init__(self,driver):
     self.manual_handle = ManualHandle(driver)
     self.home_handle = HomeHandle(driver)
     self.detail_handle = DetailHandle(driver)
     self.wallet_handle = WalletPagePage
     # 获取当前目录
     current_dir = os.path.dirname(__file__)
     # 获取当前目录的父级目录
     parent_dir = os.path.dirname(current_dir)
     path = parent_dir + '\config\dataConfig.ini'
     self.readIni = ReadIni(path)
Ejemplo n.º 2
0
 def __init__(self, driver):
     self.wallet_handle = WalletHandle(driver)
     self.detail_handle = DetailHandle(driver)
     self.manual_handle = ManualHandle(driver)
     self.home_handle = HomeHandle(driver)
Ejemplo n.º 3
0
class WalletBusiness:
    def __init__(self, driver):
        self.wallet_handle = WalletHandle(driver)
        self.detail_handle = DetailHandle(driver)
        self.manual_handle = ManualHandle(driver)
        self.home_handle = HomeHandle(driver)

    def get_invoice_num(self):
        num_text = self.wallet_handle.get_invoice_num()
        num_text = re.findall('累计发票:(.*)张', num_text)[0]
        num = int(num_text)

        return num

    def swipe_invoice_delete(self, n):
        """滑动增值税发票删除"""
        for i in range(0, n):
            self.wallet_handle.get_sales_party_coordinate()

    def choose_paperInvoice_delete(self):
        """筛选出增值税纸票删除"""
        self.wallet_handle.click_invoiceClass()
        self.wallet_handle.click_paperInvoice()
        time.sleep(4)
        self.swipe_invoice_delete(2)
        self.wallet_handle.click_paperInvoice()
        self.wallet_handle.click_allInvoice()
        time.sleep(2)

    def choose_electricInvoice_delete(self):
        """筛选出增值税电票删除"""
        self.wallet_handle.click_invoiceClass()
        self.wallet_handle.click_electricInvoice()
        time.sleep(4)
        self.swipe_invoice_delete(2)
        self.wallet_handle.click_electricInvoice()
        self.wallet_handle.click_allInvoice()
        time.sleep(2)

    def batchIcon_open_close(self):
        """批量操作按钮弹出 收起"""
        self.wallet_handle.click_batchOpenIcon()
        self.wallet_handle.click_batchCloseIcon()

    def batch_class(self):
        """批量选择分类"""
        self.wallet_handle.click_batchOpenIcon()
        self.wallet_handle.click_batchClassIcon()
        self.wallet_handle.click_selectButton()
        self.manual_handle.click_determine()
        #选择分类烟酒
        self.detail_handle.click_tobaccoButton()
        #点击保存
        self.detail_handle.click_peservationButton()
        #点击确定
        self.manual_handle.click_determine()
        time.sleep(2)

    def batch_todo(self):
        """批量选择待办"""
        self.wallet_handle.click_batchOpenIcon()
        self.wallet_handle.click_batchTodoIcon()
        self.wallet_handle.click_selectButton()
        self.manual_handle.click_determine()
        #选择待办报销
        self.detail_handle.click_reimbButton()
        #点击保存
        self.detail_handle.click_peservationButton()
        #点击确定
        #self.manual_handle.click_determine()
        time.sleep(2)

    def batch_print(self):
        """批量打印"""
        self.wallet_handle.click_batchOpenIcon()
        self.wallet_handle.click_batchPrintIcon()
        self.wallet_handle.click_selectButton()
        self.manual_handle.click_determine()
        time.sleep(12)

    def printpage_print(self):
        """批量打印页面点击打印"""
        self.wallet_handle.click_printInvoice()
        self.home_handle.click_confirm()

    def send_email(self):
        """批量打印页面发送邮箱"""
        self.detail_handle.click_sendEmail()
        self.detail_handle.send_email('*****@*****.**')
        self.home_handle.click_confirm()
        time.sleep(3)

    def eInvoice_choose_all(self):
        """票夹电票页面筛选全部发票"""
        self.wallet_handle.click_electricInvoice()
        self.wallet_handle.click_allInvoice()
        time.sleep(4)

    def paper_choose_all(self):
        """票夹纸票页面筛选全部发票"""
        self.wallet_handle.click_paperInvoice()
        self.wallet_handle.click_allInvoice()
        time.sleep(4)

    def taxi_choose_all(self):
        """票夹打车票页面筛选全部发票"""
        self.wallet_handle.click_taxi()
        self.wallet_handle.click_allInvoice()
        time.sleep(4)

    def train_choose_all(self):
        """票夹火车票页面筛选全部发票"""
        self.wallet_handle.click_train()
        self.wallet_handle.click_allInvoice()
        time.sleep(4)

    def choose_eInvoice_enter(self):
        """筛选出电票,点击进入一张电票"""
        self.wallet_handle.click_invoiceClass()
        self.wallet_handle.click_electricInvoice()
        time.sleep(4)
        self.wallet_handle.click_invoice()

    def choose_paperInvoice_enter(self):
        """筛选出纸票,点击进入一张纸票"""
        self.wallet_handle.click_invoiceClass()
        self.wallet_handle.click_paperInvoice()
        time.sleep(4)
        self.wallet_handle.click_invoice()

    def choose_train_enter(self):
        """筛选出火车票,点击进入一张火车票"""
        self.wallet_handle.click_invoiceClass()
        self.wallet_handle.click_train()
        time.sleep(4)
        self.wallet_handle.click_train_invoice()

    def choose_taxi_enter(self):
        """筛选出打车票,点击进入一张打车票"""
        self.wallet_handle.click_invoiceClass()
        self.wallet_handle.click_taxi()
        time.sleep(4)
        self.wallet_handle.click_taxi_invoice()
Ejemplo n.º 4
0
class ManualBusiness:
    def __init__(self,driver):
        self.manual_handle = ManualHandle(driver)
        self.home_handle = HomeHandle(driver)
        self.detail_handle = DetailHandle(driver)
        self.wallet_handle = WalletPagePage
        # 获取当前目录
        current_dir = os.path.dirname(__file__)
        # 获取当前目录的父级目录
        parent_dir = os.path.dirname(current_dir)
        path = parent_dir + '\config\dataConfig.ini'
        self.readIni = ReadIni(path)

    def enter_manualAdd(self):
        """进入手动新增页面"""
        self.home_handle.click_plusIcon()
        time.sleep(1)
        self.manual_handle.click_manualAdd()

    def manual_add_invoice(self):
        """手动新增增值税发票"""
        # 专票|普票|卷票|红票
        invoice_data = self.readIni.get_value('invoice_data','vatInvoice')
        datas = invoice_data.split('|')
        for data in datas:
            data = data.split(',')
            self.manual_handle.send_invoice_code(data[0])
            self.manual_handle.send_invoice_number(data[1])
            try:
                self.manual_handle.send_invoice_CheckCode(data[2])
            except:
                self.manual_handle.send_invoice_nonTaxPrice(data[2])
            self.manual_handle.click_invoice_data()
            self.manual_handle.send_date(data[3],data[4],data[5])
            #点击确定
            self.manual_handle.click_determine()
            self.manual_handle.click_determine()
            time.sleep(3)
            assert self.detail_handle.isDisplay_reimbButton() == True,"手动新增发票未进入发票详情页"
            self.manual_handle.back()

    def enter_add_train(self):
        """进入手动新增火车票页面"""
        self.manual_handle.click_trainTicket()

    def enter_add_taxi(self):
        """进入手动新增打车票页面"""
        self.manual_handle.click_taxiTicket()

    def manual_add_train(self):
        """手动新增火车票"""
        invoice_data = self.readIni.get_value('invoice_data', 'trainTicket')
        datas = invoice_data.split('|')
        for data in datas:
            data = data.split(',')
            self.manual_handle.send_trainNum(data[0])
            self.manual_handle.click_trainDate()
            self.manual_handle.click_determine()
            self.manual_handle.send_startStation(data[1])
            self.manual_handle.send_endStation(data[2])
            self.manual_handle.send_trainMoney(data[3])
            self.manual_handle.send_trainName(data[4])
            self.manual_handle.click_determine()
            time.sleep(3)
            assert self.detail_handle.isDisplay_reimbButton() == True,"手动新增发票未进入发票详情页"
            self.manual_handle.back()

    def manual_add_taxi(self):
        """手动新增打车票"""
        invoice_data = self.readIni.get_value('invoice_data', 'taxiTicket')
        datas = invoice_data.split('|')
        for data in datas:
            self.manual_handle.send_trainMoney(data)
            self.manual_handle.click_trainDate()
            self.manual_handle.click_determine()
            self.manual_handle.click_determine()
            time.sleep(3)
            assert self.detail_handle.isDisplay_reimbButton() == True, "手动新增发票未进入发票详情页"
            self.manual_handle.back()

    def enter_manualCheck(self):
        """进入手动查验页面"""
        self.home_handle.click_service()
        self.home_handle.click_plusIcon()
        time.sleep(1)
        self.manual_handle.click_manualCheck()

    def manual_check_invoice(self):
        """手动查验增值税发票"""
        # 专票|普票|卷票|红票
        invoice_data = self.readIni.get_value('invoice_data','vatInvoice')
        datas = invoice_data.split('|')
        for data in datas:
            data = data.split(',')
            self.manual_handle.send_invoice_code(data[0])
            self.manual_handle.send_invoice_number(data[1])
            try:
                self.manual_handle.send_invoice_CheckCode(data[2])
            except:
                self.manual_handle.send_invoice_nonTaxPrice(data[2])
            self.manual_handle.click_invoice_data()
            self.manual_handle.send_date(data[3],data[4],data[5])
            #点击确定
            self.manual_handle.click_determine()
            time.sleep(1)
            self.manual_handle.click_CheckButton()
            time.sleep(30)
            #assert self.detail_handle.isDisplay_invoiceDetail() == True,"手动查验发票未进入发票查验页"
            self.manual_handle.back()
Ejemplo n.º 5
0
class DetailBusiness:
    def __init__(self, driver):
        self.driver = driver
        self.detail_handle = DetailHandle(driver)
        self.wallet_handle = WalletHandle(driver)
        self.home_handle = HomeHandle(driver)
        self.manual_handle = ManualHandle(driver)

    def enter_preview_download(self):
        """进入预览下载页面"""
        self.detail_handle.click_previewDownload()

    def ele_invoice_print(self):
        """电票打印"""
        self.detail_handle.click_print_()
        self.home_handle.click_confirm()

    def send_email(self):
        """电票发送邮箱"""
        self.detail_handle.click_sendEmail()
        self.detail_handle.send_email('*****@*****.**')
        self.home_handle.click_confirm()
        time.sleep(3)

    def eleInvoice_check(self):
        """电票查验"""
        self.detail_handle.click_invoiceCheck()
        time.sleep(10)
        assert self.detail_handle.isDisplay_checkPageText() == True, "进入查验页面失败"
        self.driver.back()

    def invoice_remarks(self):
        """发票备注"""
        self.detail_handle.click_remarks()
        self.detail_handle.send_remarksEidx('备注发票Invoice')
        self.detail_handle.click_peservation()
        e = self.driver.find_elements_by_xpath(
            "//*[contains(@text,备注发票Invoice)]")
        assert e.is_displayed() == True, "添加备注失败"

    def customer_need_do(self):
        """新建自定待办"""
        self.detail_handle.click_customer()
        self.detail_handle.send_customerEidx('1234')
        self.manual_handle.click_determine()
        e = self.driver.find_elements_by_xpath("//*[contains(@text,1234)]")
        assert e.is_displayed() == True, "添加自定义待办失败"

    def cusromer_delete(self):
        """删除自定义待办"""
        self.detail_handle.click_deleteText()
        self.detail_handle.click_deleteButton()
        self.manual_handle.click_determine()
        e = self.driver.find_elements_by_xpath("//*[contains(@text,1234)]")
        assert e.is_displayed() == False, "删除自定义待办失败"

    def add_jiyiji(self):
        """添加记一记"""
        self.detail_handle.click_reminding()
        self.manual_handle.click_determine()
        self.detail_handle.swipe_date()
        self.manual_handle.click_determine()
        jiyiji_text = ("xpath", "//*[contains(@text,您有一张)]")
        WebDriverWait(self.driver, 180,
                      0.1).until(EC.presence_of_element_located(jiyiji_text))
        self.detail_handle.click_quxiao()

    def delete_invoice(self):
        """详情页删除发票"""
        self.detail_handle.click_deleteButton()
        self.manual_handle.click_determine()