示例#1
0
	def fill_out_options_schedule(self, dueDate):
		"""
		Note that the radio button here is ALWAYS
		set to 'Save as Draft' by default!
		"""
		self.driver.find_element_by_id(CreateInvoicePageLocators.get_save_as_draft_locator()).click()
		self.driver.find_element_by_id(CreateInvoicePageLocators.get_due_date_locator()).clear()
		self.driver.find_element_by_id(CreateInvoicePageLocators.get_due_date_locator()).send_keys(dueDate)
示例#2
0
	def fill_out_new_invoice(self):
		"""
		Fill out that massive, clunky table!
		Observe that .clear() can also be used for
		UPDATE operations.
		"""
		assert 'Xero | New Repeating Invoice' in self.driver.title

		count = self.driver.find_elements(By.XPATH, CreateInvoicePageLocators.get_paid_to_locator_regex())
		count[2].send_keys('Sherlock Holmes') # count[1] points to the label field!

		newForm = FillNewInvoiceForm(self.driver)
		newForm.fill_out_options_schedule('1')
		newForm.fill_out_description('The Hound of Baskervilles')
		newForm.fill_out_quantity('23.0000')
		newForm.fill_out_unitprice('99.0000')
		newForm.fill_out_account('200 - Sales')
		newForm.fill_out_tax_rate('15% GST on Income')
示例#3
0
	def fill_out_tax_rate(self, taxRate):
		self.driver.find_element_by_xpath(CreateInvoicePageLocators.get_invoice_form_table_data(8)).click()
		self.driver.find_element_by_id(CreateInvoicePageLocators.get_form_tax_rate_locator()).clear()
		self.driver.find_element_by_id(CreateInvoicePageLocators.get_form_tax_rate_locator()).send_keys(taxRate)
示例#4
0
	def fill_out_account(self, account):
		self.driver.find_element_by_xpath(CreateInvoicePageLocators.get_invoice_form_table_data(7)).click()
		self.driver.find_element_by_id(CreateInvoicePageLocators.get_form_account_locator()).clear()
		self.driver.find_element_by_id(CreateInvoicePageLocators.get_form_account_locator()).send_keys(account)
示例#5
0
	def fill_out_unitprice(self, unitprice):
		self.driver.find_element_by_xpath(CreateInvoicePageLocators.get_invoice_form_table_data(5)).click()
		self.driver.find_element_by_id(CreateInvoicePageLocators.get_form_unitprice_locator()).clear()
		self.driver.find_element_by_id(CreateInvoicePageLocators.get_form_unitprice_locator()).send_keys(unitprice)
示例#6
0
	def fill_out_quantity(self, quantity):
		self.driver.find_element_by_xpath(CreateInvoicePageLocators.get_invoice_form_table_data(4)).click()
		self.driver.find_element_by_id(CreateInvoicePageLocators.get_form_quantity_locator()).clear()
		self.driver.find_element_by_id(CreateInvoicePageLocators.get_form_quantity_locator()).send_keys(quantity)
示例#7
0
	def fill_out_description(self, description):
		self.driver.find_element_by_xpath(CreateInvoicePageLocators.get_invoice_form_table_data(3)).click()
		self.driver.find_element_by_id(CreateInvoicePageLocators.get_form_description_locator()).clear()
		self.driver.find_element_by_id(CreateInvoicePageLocators.get_form_description_locator()).send_keys(description)
示例#8
0
	def submit_invoice(self):
		self.driver.find_element_by_xpath(CreateInvoicePageLocators.get_invoice_submit_button()).click()