def setup_class(self):
        self.login = LoginDepend('easHost', 'user')
        self.easIndexPage = EasIndexPage(self.login.driver)
        self.easIndexPage.open_menuMyInvoice()
        self.easMyInvoiceIndexPage = EasMyInvoiceIndexPage(self.login.driver)

        self.invoiceQueryPage = InvoiceQueryPage(self.login.driver)
class TestEasMyInvoicePage(object):
    def setup_class(self):
        self.login = LoginDepend('easHost', 'user')
        self.easIndexPage = EasIndexPage(self.login.driver)
        self.easIndexPage.open_menuMyInvoice()
        self.easMyInvoiceIndexPage = EasMyInvoiceIndexPage(self.login.driver)

        self.invoiceQueryPage = InvoiceQueryPage(self.login.driver)

    def teardown_class(self):
        pass

    def test_addInvoice(self):

        logger.info("当前窗口为:{}".format(
            self.easIndexPage.getCurrentWindowHandle()))
        windowsList = self.easIndexPage.getWindowHandles()
        self.easIndexPage.switchToWin(windowsList[1])
        logger.info("当前窗口为:{}".format(
            self.easIndexPage.getCurrentWindowHandle()))

        self.easMyInvoiceIndexPage.open_manualInvoiceEntry()
        self.easMyInvoiceIndexPage.click_invoiceType()

        sleep(1)
        self.easMyInvoiceIndexPage.open_addInvoiceWindow('增值税普通发票')

        self.easMyInvoiceIndexPage.input_invoiceNo('810000000006')
        self.easMyInvoiceIndexPage.input_invoiceCode('81000006')
        self.easMyInvoiceIndexPage.selectInvoiceDate()

        self.easMyInvoiceIndexPage.input_feeTotal('100.10')
        self.easMyInvoiceIndexPage.input_tax('10.10')
        self.easMyInvoiceIndexPage.input_checkCode('123456')

        self.easMyInvoiceIndexPage.click_invoiceSubmitButton()

        self.easMyInvoiceIndexPage.input_billingCode('81000006')
        self.easMyInvoiceIndexPage.click_myInvoiceQueryButton()

        sleep(1)
        assert self.easMyInvoiceIndexPage.invoiceQueryResult == True

        self.easMyInvoiceIndexPage.gotoInvoiceQueryPage()

        self.invoiceQueryPage.open_invoiceQueryTab()

        sleep(3)
        self.invoiceQueryPage.open_subInvoiceQueryTab('增值税普票')
        self.invoiceQueryPage.input_billingNoQuery('810000000006')
        self.invoiceQueryPage.input_billingCodeQuery('81000006')
        self.invoiceQueryPage.click_invoiceQueryButton()

        print(self.invoiceQueryPage.invoiceQueryResult())
Exemple #3
0
 def __init__(self, driver):
     EasIndexPage.__init__(self, driver)
Exemple #4
0
 def __init__(self, boeNum):
     self.boeNum = boeNum
     self.login = LoginDepend('easHost', 'leader')
     self._easIndexPage = EasIndexPage(self.login.driver)
Exemple #5
0
class BusinessApprove():
    def __init__(self, boeNum):
        self.boeNum = boeNum
        self.login = LoginDepend('easHost', 'leader')
        self._easIndexPage = EasIndexPage(self.login.driver)

    def boeBusinessApprove(self):
        try:

            self._easIndexPage.click_myWaitApprove()
            sleep(1)
            self._easIndexPage.click_moreButton()

            sleep(1)
            self._easIndexPage.input_boeNo(self.boeNum)
            sleep(1)
            self._easIndexPage.click_boeNoSelectButton()

            sleep(1)
            status = self._easIndexPage.selectResultIsOrNotBusiness(
                self.boeNum)
            if status == True:
                pass
            else:
                logger.error("boeNum do not exist")
                raise Exception("boeNum do not exist")

            sleep(1)
            self._easIndexPage.click_boeBusinessApprove()
            sleep(1)
            self._easIndexPage.click_boeBusinessTipConfirm()

            sleep(1)
            if self._easIndexPage.getToastBoxText() == '操作成功':
                content = '审批成功'
                logger.info("审批状态为:{}".format(content))
                self.login.driver.quit()
                return content
            else:
                content = '审批失败'
                logger.info("审批状态为:{}".format(content))
                self.login.driver.quit()
                return content

        except Exception as e:
            logger.error("业务审批出现异常,异常信息为:{}".format(type(e)))
            self.login.driver.quit()