Пример #1
0
 def select_industry( self, industry ):
     """
     :param industry:行业性质
     """
     public_page = PublicPage(self.driver)
     drop_loc = self.driver.find_element_by_name(industry_drop_elem)
     public_page.select_dropdown_item(drop_loc, industry)
Пример #2
0
 def select_accounting_standard( self, accounting_standard ):
     """
     选择会计制度
     :param accounting_standard:可选值(2013小企业会计准则、村集体经济组织会计制度)
     """
     publicPage = PublicPage(self.driver)
     drop_loc = self.driver.find_element_by_name(accounting_standard_elem)
     publicPage.select_dropdown_item(drop_loc, accounting_standard)
Пример #3
0
 def select_property( self, account_property ):
     """
     选择帐套性质
     :param account_property: 可选值(一般纳税人、小规模纳税人)
     """
     public_page = PublicPage(self.driver)
     drop_loc = self.driver.find_element_by_name(property_elem)
     public_page.select_dropdown_item(drop_loc, account_property)
Пример #4
0
 def select_sex(self, sex):
     try:
         publicPage = PublicPage(self.driver)
         drop_loc = self.driver.find_element_by_xpath(sex_drop_elem)
         publicPage.select_dropdown_item(drop_loc, sex)
     except Exception as e:
         print('[AddStuffPage] There was an exception when select_sex=>',
               str(e))
Пример #5
0
 def select_contact(self, contact_name):
     try:
         publicPage = PublicPage(self.driver)
         drop_loc = self.driver.find_element_by_xpath(
             page_base_xpath_elem + self.record_name +
             contact_drop_end_xpath_elem)
         publicPage.select_dropdown_item(drop_loc, contact_name)
     except Exception as e:
         print(
             '[RevenueAndExpenditurePage] There was an exception when select_contact=>',
             str(e))
Пример #6
0
 def select_contact_property(self, contact_property):
     """
     :param contact_property:往来性质,可选值( 单位、个人)
     """
     try:
         publicPage = PublicPage(self.driver)
         drop_loc = self.driver.find_element_by_xpath(contact_property_elem)
         publicPage.select_dropdown_item(drop_loc, contact_property)
     except Exception as e:
         print('[ContactPage]select_contact_property--设置往来性质失败--失败原因是=>',
               str(e))
Пример #7
0
    def select_prov(self, prov_name):
        """
		:param prov_name: 省份
		"""
        try:
            publicPage = PublicPage(self.driver)
            drop_loc = self.driver.find_element_by_xpath(priv_dropdown_elem)
            publicPage.select_dropdown_item(drop_loc, prov_name)
        except NoSuchElementException as e:
            logging.error('查找的页面元素不存在,异常堆栈信息:' + str(traceback.format_exc()))
        except Exception as e:
            print('[CompBillingPage]select_prov---选择省份失败,失败原因是', str(e))
Пример #8
0
    def select_distr(self, distr_name):
        """
		:param distr_name:区
		"""
        try:
            publicPage = PublicPage(self.driver)
            drop_loc = self.driver.find_element_by_xpath(dist_dropdown_elem)
            publicPage.select_dropdown_item(drop_loc, distr_name)
        except Exception as e:
            print(
                '[CompBillingPage] There was an exception when select_distr= %s',
                str(e))
Пример #9
0
    def select_department(self, department):
        """
		:param department: 部门名
		"""
        try:
            publicPage = PublicPage(self.driver)
            drop_loc = self.driver.find_element_by_xpath(
                record_invoice_base_xpath + self.invoice_io +
                department_drop_elem)
            publicPage.select_dropdown_item(drop_loc, department)
        except Exception as e:
            print('[RecordInvoicePage]--选择部门名称失败--失败原因是->', str(e))
Пример #10
0
    def select_industry(self, indus_name):
        """
		:param indus_name: 行业名称
		"""
        try:
            publicPage = PublicPage(self.driver)
            indust_loc = self.driver.find_element_by_name(
                industry_dropdown_name)
            publicPage.select_dropdown_item(indust_loc, indus_name)
        except Exception as e:
            print(
                '[CompBillingPage] There was an exception when select_industry= %s',
                str(e))
Пример #11
0
    def select_invoice_status(self, invoice_status):
        """
		:param invoice_status: 选择发票状态,可选值(税控自开,税务代开)
		"""
        try:
            publicPage = PublicPage(self.driver)
            drop_loc = self.driver.find_element_by_xpath(
                record_invoice_base_xpath + self.invoice_io +
                invoice_status_drop_elem)
            publicPage.select_dropdown_item(drop_loc, invoice_status)
        except Exception as e:
            print('[RecordInvoicePage]--选择发票状态失败--失败原因是->', str(e))
            self.driver.quit()
Пример #12
0
    def select_input_tax_category(self, input_tax_category):
        """
		:param input_tax_category: 进项税类别
		"""
        try:
            publicPage = PublicPage(self.driver)
            drop_loc = self.driver.find_element_by_xpath(
                record_invoice_base_xpath + self.invoice_io +
                input_tax_category_drop_elem)
            publicPage.select_dropdown_item(drop_loc, input_tax_category)
        except Exception as e:
            print('[RecordInvoicePage]--选择进项税类别失败--失败原因是->', str(e))
            self.driver.quit()
Пример #13
0
    def select_tax_rate(self, tax_rate):
        """
		:param tax_rate: 税率
		"""
        try:
            publicPage = PublicPage(self.driver)
            drop_loc = self.driver.find_element_by_xpath(
                record_invoice_base_xpath + self.invoice_io +
                tax_rate_drop_elem)
            publicPage.select_dropdown_item(drop_loc, tax_rate)
        except Exception as e:
            print('[RecordInvoicePage]--选择税率失败--失败原因是->', str(e))
            self.driver.quit()
Пример #14
0
    def select_transfer_account(self, output_account, input_account):
        try:
            public_page = PublicPage(self.driver)
            output_drop_loc = self.driver.find_element_by_xpath(
                page_base_xpath_elem + self.record_name +
                output_account_drop_elem)
            public_page.select_dropdown_item(output_drop_loc, output_account)

            input_drop_loc = self.driver.find_element_by_xpath(
                page_base_xpath_elem + self.record_name +
                input_account_drop_elem)
            public_page.select_dropdown_item(input_drop_loc, input_account)
        except Exception as e:
            print(
                '[RevenueAndExpenditurePage] There was an exception when select_transfer_account=>',
                str(e))
Пример #15
0
    def select_contact(self, contact):
        """
		:param contact: 对方信息名
		"""
        try:
            if self.invoice_io == 'input':
                contact_drop_elem = input_contact_drop_elem
            elif self.invoice_io == 'output':
                contact_drop_elem = output_contact_drop_elem
            publicPage = PublicPage(self.driver)
            drop_loc = self.driver.find_element_by_xpath(
                record_invoice_base_xpath + self.invoice_io +
                contact_drop_elem)
            publicPage.select_dropdown_item(drop_loc, contact)
        except Exception as e:
            print('[RecordInvoicePage]--选择对方信息失败--失败原因是->', str(e))
            self.driver.quit()
Пример #16
0
    def select_invoice_type(self, invoice_type):
        """
		:param invoice_type: 可选值(专票、普票、无票)
		"""
        global invoice_type_define
        invoice_type_define = invoice_type
        try:
            public_page = PublicPage(self.driver)
            is_disapeared = public_page.wait_until_loader_disapeared()
            if not is_disapeared:
                drop_loc = self.driver.find_element_by_xpath(
                    record_invoice_base_xpath + self.invoice_io +
                    invoice_type_drop_elem)
                public_page.select_dropdown_item(drop_loc, invoice_type)
                time.sleep(1)
        except NoSuchElementException as e:
            logging.error('查找的页面元素不存在,异常堆栈信息:' + str(traceback.format_exc()))

        except Exception as e:
            print('[RecordInvoicePage] --选择发票类型失败--失败原因是->', str(e))
            self.driver.quit()