def testEditCustomer(self): alt_first_name = self.configuration['customer_tests']['alt_first_name'] # Edit the customer's first name target_url = "%s/admin/order_manager/customer/%d" % ( self.configuration['base_url'], self.customer_id) edit_page = CustomerEdit(self.browser, target_url) edit_page.change_input_field_by_id(field_id='id_first_name', new_value=alt_first_name) edit_page.save_changes() # Verify that the customer's first name was changed edit_page.refresh() first_name = edit_page.get_input_field_by_id('id_first_name') self.validate( (first_name == alt_first_name), error_message="Could not verify that customer was edited.")
def testDeleteCustomer(self): # Count the number of customers before creation. target_url = self.configuration[ 'base_url'] + "/admin/order_manager/customer/" index_page = CustomerIndex(self.browser, target_url) num_customers_before_deletion = index_page.count_customers() # Delete the customer target_url = "%s/admin/order_manager/customer/%d" % ( self.configuration['base_url'], self.customer_id) edit_page = CustomerEdit(self.browser, target_url) edit_page.delete_customer() edit_page.wait_for_text_to_load_in_element( css_selector="div#content > h1", text_to_wait_for="Select customer to change") # Verify that the customer is gone from the index page num_customers_after_deletion = index_page.count_customers() self.validate( (num_customers_after_deletion == num_customers_before_deletion - 1), error_message="Could not verify that customer was deleted.")