Пример #1
0
 def test_order_status_changed(self):
     target_url = "%s/admin/order_manager/order/%s" % (
         self.configuration['base_url'], self.order_id)
     order_edit_page = OrderEdit(self.browser, target_url)
     order_fields = order_edit_page.get_fields()
     self.validate(
         (order_fields['status'] == 2),
         error_message=
         "Order status was not changed to 'Payment Received'. %s" %
         order_fields['status'])
Пример #2
0
    def testEditOrder(self):
        alt_quantity = self.configuration['order_tests']['alt_quantity']

        # Edit the order's first name
        target_url = "%s/admin/order_manager/order/%s" % (self.configuration['base_url'], self.order_id)
        edit_page = OrderEdit(self.browser, target_url)
        edit_page.change_input_field_by_id(field_id='id_quantity', new_value=alt_quantity)
        edit_page.save_changes()

        # Verify that the changes were saved
        edit_page.refresh()
        fields = edit_page.get_fields()
        self.validate((fields['quantity'] == alt_quantity), "Edit was not successfully saved.")
Пример #3
0
    def testDeleteOrder(self):
        # Get a count of the orders before the deletion
        target_url = self.configuration['base_url'] + "/admin/order_manager/order/"
        index_page = OrderIndex(self.browser, target_url)
        num_orders_before_deletion = index_page.count_orders()

        # Delete the order
        target_url = "%s/admin/order_manager/order/%s" % (self.configuration['base_url'], self.order_id)
        edit_page = OrderEdit(self.browser, target_url)
        edit_page.delete_order()

        # Wait for index page to load
        edit_page.wait_for_text_to_load_in_element(css_selector="div#content > h1",
                                                   text_to_wait_for="Select order to change")

        num_orders_after_deletion = index_page.count_orders()
        # Verify that the order is gone from the index page
        self.validate((num_orders_after_deletion == num_orders_before_deletion - 1),
                      error_message="Could not verify that order was deleted.")
Пример #4
0
    def testEditOrder(self):
        alt_quantity = self.configuration['order_tests']['alt_quantity']

        # Edit the order's first name
        target_url = "%s/admin/order_manager/order/%s" % (self.configuration['base_url'], self.order_id)
        edit_page = OrderEdit(self.browser, target_url)
        edit_page.change_input_field_by_id(field_id='id_quantity', new_value=alt_quantity)
        edit_page.save_changes()

        # Verify that the changes were saved
        edit_page.refresh()
        fields = edit_page.get_fields()
        self.validate((fields['quantity'] == alt_quantity), "Edit was not successfully saved.")
Пример #5
0
    def testDeleteOrder(self):
        # Get a count of the orders before the deletion
        target_url = self.configuration['base_url'] + "/admin/order_manager/order/"
        index_page = OrderIndex(self.browser, target_url)
        num_orders_before_deletion = index_page.count_orders()

        # Delete the order
        target_url = "%s/admin/order_manager/order/%s" % (self.configuration['base_url'], self.order_id)
        edit_page = OrderEdit(self.browser, target_url)
        edit_page.delete_order()

        # Wait for index page to load
        edit_page.wait_for_text_to_load_in_element(css_selector="div#content > h1",
                                                   text_to_wait_for="Select order to change")

        num_orders_after_deletion = index_page.count_orders()
        # Verify that the order is gone from the index page
        self.validate((num_orders_after_deletion == num_orders_before_deletion - 1),
                      error_message="Could not verify that order was deleted.")
 def test_order_status_changed(self):
     target_url = "%s/admin/order_manager/order/%s" % (self.configuration['base_url'], self.order_id)
     order_edit_page = OrderEdit(self.browser, target_url)
     order_fields = order_edit_page.get_fields()
     self.validate((order_fields['status'] == 2),
                   error_message="Order status was not changed to 'Payment Received'. %s" % order_fields['status'])
 def test_order_status_changed(self):
     page = OrderEdit(self.browser, self.configuration['base_url'])
     page.open(self.order_id)
     fields = page.get_fields()
     assert fields['status'] == 2, "Order status was not changed to 'Payment Received'. %s" % fields['status']