def test2(self): '''记所有类别的-支出''' transaction_page = TransactionPage(self.driver,'outcome') transaction_page.goToTransactionModule(BaseUrl) transaction_page.goToTransactionPage('记支出') wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '收支.xlsx') sh = wb.sheet_by_name(u'记支出测试数据') for i in range(1,sh.nrows): sourceRowList = sh.row_values(i) targetList = CategoryMap().outcomeCategeoryMapList(sourceRowList) transaction_page.recordTransaction(targetList[:3],targetList[3:]) transaction_page.goToTransactionModule(BaseUrl) self.assertEqual(BaseUrl + '/app/transaction/list',self.driver.current_url)
def test4(self): '''记收票-专票''' invoice_page = InvoicePage(self.driver,'input') invoice_page.goToInvoice(BaseUrl) wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '发票.xlsx') sh = wb.sheet_by_name(u'记收专票测试数据') invoiceNumList = GenerateRandom().invoiceNumList(sh.nrows-1) for i,invoiceNum in zip(range(1,sh.nrows),invoiceNumList): sourceRowList = sh.row_values(i) targetList = CategoryMap().inputInvoiceCategeorySpecMapList(sourceRowList) invoice_page.recordSpecialIncomeInvoice(targetList[:3],invoiceNum,targetList[3:]) invoice_page.goToInvoiceList(BaseUrl) self.assertEqual(BaseUrl + '/app/invoice/input-invoice',self.driver.current_url)
def test5(self): '''记收票-普票''' invoice_page = InvoicePage(self.driver,'input') invoice_page.goToInvoice(BaseUrl) wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '发票.xlsx') sh = wb.sheet_by_name(u'记收普票测试数据') for i in range(1,sh.nrows): sourceRowList = sh.row_values(i) targetList = CategoryMap().inputInvoiceCategeoryCommMapList(sourceRowList) invoice_page.recordCommonIncomeInvoice(targetList[:3],targetList[3:]) invoice_page.goToInvoiceList(BaseUrl) self.assertEqual(BaseUrl + '/app/invoice/input-invoice',self.driver.current_url)
def test2(self): '''成功记录多笔开票记录测试''' invoice_page = InvoicePage(self.driver, 'output') invoiceNumList = [] for i in range(0, 12): invoiceNumList.append(self.invoiceNum()) wb = xlrd.open_workbook( os.path.dirname(__file__) + '/' + '../../test_data/' + '发票.xlsx') sh = wb.sheet_by_name(u'记开票测试数据') for i, invoiceNum in zip(range(1, sh.nrows), invoiceNumList): sourceRowList = sh.row_values(i) targetList = CategoryMap().outputInvoiceCategeoryMapList( sourceRowList) invoice_page.recordOutputInvoice(targetList[:4], invoiceNum, targetList[4:]) invoice_page.goToInvoiceList(BaseUrl) self.assertEqual(BaseUrl + '/app/invoice/output-invoice', self.driver.current_url)