Skip to content

Commit

Permalink
all tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
ericderegt committed May 1, 2018
1 parent dabbe45 commit c88aba8
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 2 deletions.
62 changes: 62 additions & 0 deletions features/orders.feature
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,65 @@ Scenario: Delete an order
And I press the "search" order Button
And I press the "delete" order button
Then I should see the message "Order has been Deleted!"

Scenario: Update an item
When I visit the "Home Page"
And I set the "item_name" to "laptop"
And I press the "search" item button
And I press the "Retrieve" item button
Then I should see "1" in the "item_quantity" field
When I change "item_quantity" to "3"
And I press the "Update" item button
Then I should see the message "Success"
When I press the "Clear" item button
And I set the "item_name" to "laptop"
And I press the "search" item button
And I press the "Retrieve" item button
Then I should see "3" in the "item_quantity" field

Scenario: Update an order
When I visit the "Home Page"
And I set the "order_customer_id" to "11"
And I press the "search" order Button
And I press the "Retrieve" order button
Then I should see "processing" in the "order_status" field
When I change "order_status" to "shipped"
And I press the "Update" order button
Then I should see the message "Success"
When I press the "Clear" order button
And I set the "order_customer_id" to "11"
And I press the "search" order Button
And I press the "Retrieve" order button
Then I should see "shipped" in the "order_status" field

Scenario: Create a order
When I visit the "Home Page"
And I set the "item_product_id" to "214"
And I set the "item_name" to "banana"
And I set the "item_quantity" to "10"
And I set the "item_price" to "20.34"
When I press the "Create" item button
And I set the "item_product_id" to "78"
And I set the "item_name" to "laptop"
And I set the "item_quantity" to "1"
And I set the "item_price" to "642.34"
When I press the "Create" item button
And I set the "item_product_id" to "28"
And I set the "item_name" to "apple"
And I set the "item_quantity" to "100"
And I set the "item_price" to "60.24"
When I press the "Create" item button
And I set the "order_customer_id" to "123"
And I set the time "order_date" to "2018-02-27T19:35"
And I set the "order_status" to "processing"
When I press the "Create" order button
Then I should see the message "Success"
And I should not see "404 Not Found"

Scenario: Cancel a order
When I visit the "Home Page"
And I set the "order_customer_id" to "11"
And I press the "search" order Button
And I press the "Cancel" order button
Then I should see "cancelled" in the "order_status" field
And I should see the message "Order has been Canceled!"
4 changes: 2 additions & 2 deletions features/steps/order_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def step_impl(context, message):
def step_impl(context, element_name, text_string):
element_id = element_name.lower()
element = context.driver.find_element_by_id(element_id)
element.clear()
# element.clear()
element.send_keys(text_string)

@when(u'I set the time "{element_name}" to "{text_string}"')
Expand Down Expand Up @@ -155,5 +155,5 @@ def step_impl(context, element_name, text_string):
element = WebDriverWait(context.driver, WAIT_SECONDS).until(
expected_conditions.presence_of_element_located((By.ID, element_id))
)
element.clear()
# element.clear()
element.send_keys(text_string)

0 comments on commit c88aba8

Please sign in to comment.