Skip to content

Commit

Permalink
adapt all happy_path test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ancalita committed Aug 6, 2024
1 parent 8ca6151 commit fb6f2b4
Show file tree
Hide file tree
Showing 19 changed files with 740 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
test_cases:
- test_case: user_adds_contact_to_their_list
steps:
- user: I want to add someone to my contact list
assertions:
- bot_uttered:
utter_name: utter_ask_add_contact_handle
- user: it's @barts
assertions:
- slot_was_set:
- name: add_contact_handle
value: "@barts"
- bot_uttered:
utter_name: utter_ask_add_contact_name
- user: just Bart
assertions:
- slot_was_set:
- name: add_contact_name
value: Bart
- bot_uttered:
utter_name: utter_ask_add_contact_confirmation
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
test_cases:
- test_case: user_books_a_restaurant
steps:
- user: book a restaurant
assertions:
- slot_was_set:
- name: route_session_to_calm
value: False
- bot_uttered:
utter_name: utter_ask_restaurant_form_city
- user: /inform{"location":"amsterdam"}
assertions:
- bot_uttered:
text_matches: "What cuisine are you looking for?"
- user: /inform{"cuisine":"Thai"}
assertions:
- slot_was_set:
- name: cuisine
value: Thai
- bot_uttered:
text_matches: "Do you know which restaurant you would like me to reserve a table at?"
- user: /inform{"restaurant_name":"Thai Spice"}
assertions:
- slot_was_set:
- name: restaurant_name
value: Thai Spice
- bot_uttered:
utter_name: utter_ask_restaurant_form_num_people
- user: "3"
assertions:
- bot_uttered:
utter_name: utter_ask_restaurant_form_restaurant_time
- user: Next Wednesday at 6pm
assertions:
- bot_uttered:
utter_name: utter_restaurant_form_submit
- bot_uttered:
utter_name: utter_restaurant_available
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
test_cases:
- test_case: user_books_a_restaurant_with_an_alternative_time
steps:
- user: I want to book a table for 3 people for tomorrow
assertions:
- bot_uttered:
utter_name: utter_ask_restaurant_form_city
- user: /inform{"location":"berlin"}
assertions:
- bot_uttered:
text_matches: "What cuisine are you looking for?"
- user: /inform{"cuisine":"Japanese"}
assertions:
- bot_uttered:
text_matches: "Do you know which restaurant you would like me to reserve a table at?"
- user: Ah, wait. John just texted me, we need to move the date to Wednesday, 6pm.
assertions:
- slot_was_set:
- name: restaurant_time
- bot_uttered:
text_matches: "Do you know which restaurant you would like me to reserve a table at?"
- user: /inform{"restaurant_name":"Sakura Sushi House"}
assertions:
- bot_uttered:
utter_name: utter_restaurant_form_submit
- bot_uttered:
utter_name: utter_restaurant_available
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
test_cases:
- test_case: user_books_restaurant_with_fixed_date_indirect
steps:
- user: I want to book a table for two 7pm tonight
assertions:
- bot_uttered:
utter_name: utter_ask_restaurant_form_city
- user: /inform{"location":"berlin"}
assertions:
- bot_uttered:
text_matches: "What cuisine are you looking for?"
- user: /inform{"cuisine":"French"}
assertions:
- bot_uttered:
text_matches: "Do you know which restaurant you would like me to reserve a table at?"
- user: /inform{"restaurant_name":"Le Gourmet"}
assertions:
- bot_uttered:
utter_name: utter_restaurant_form_submit
- bot_uttered:
utter_name: utter_restaurant_available
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test_cases:
- test_case: user_checks_balance
steps:
- user: Show my balance
assertions:
- bot_uttered:
utter_name: utter_current_balance
- bot_uttered:
utter_name: utter_can_do_something_else
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
test_cases:
- test_case: user_checks_balance_then_transactions
steps:
- user: Show my balance
assertions:
- bot_uttered:
utter_name: utter_current_balance
- bot_uttered:
utter_name: utter_can_do_something_else
- user: Show my transactions please
assertions:
- bot_uttered:
utter_name: utter_transactions
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
test_cases:
- test_case: user_checks_portfolio
steps:
- user: I want to check my portfolio
assertions:
- bot_uttered:
utter_name: utter_ask_user_name
- user: Max
assertions:
- bot_uttered:
utter_name: utter_ask_user_password
- user: "1234"
assertions:
- bot_uttered:
utter_name: utter_authentication_successful
- bot_uttered:
utter_name: utter_ask_portfolio_type
- user: mutual funds
assertions:
- slot_was_set:
- name: portfolio_type
value: mutual_funds
- name: portfolio_exists
value: True
- name: portfolio_options
- bot_uttered:
utter_name: utter_portfolio_options_found
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
test_cases:
- test_case: user_checks_portfolio_mentioning_type_upfront
steps:
- user: I want to check my bonds portfolio
assertions:
- slot_was_set:
- name: portfolio_type
value: bonds
- bot_uttered:
utter_name: utter_ask_user_name
- user: Max
assertions:
- bot_uttered:
utter_name: utter_ask_user_password
- user: "1234"
assertions:
- bot_uttered:
utter_name: utter_authentication_successful
- slot_was_set:
- name: portfolio_exists
value: True
- name: portfolio_options
- bot_uttered:
utter_name: utter_portfolio_options_found

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test_cases:
- test_case: user_checks_their_transactions
steps:
- user: Show my transactions please
assertions:
- bot_uttered:
utter_name: utter_transactions
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
test_cases:
- test_case: user_remove_contact
steps:
- user: Remove contact
assertions:
- bot_uttered:
text_matches: "What's the handle of the user you want to remove?"
- user: "@MaryLu"
assertions:
- slot_was_set:
- name: remove_contact_handle
value: "@MaryLu"
- bot_uttered:
utter_name: utter_ask_remove_contact_confirmation
- user: "Yes"
assertions:
- action_executed: remove_contact
- bot_uttered:
utter_name: utter_remove_contact_success
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
test_cases:
- test_case: user_remove_contact_from_list
steps:
- user: Please show my contacts
assertions:
- bot_uttered:
utter_name: utter_list_contacts
- bot_uttered:
utter_name: utter_can_do_something_else
# The NLUCommandAdapter predicts the StartFlow(remove_contact) so the contact handle is not yet detected
- user: Remove contact @MaryLu
assertions:
- flow_started: remove_contact
- bot_uttered:
text_matches: "What's the handle of the user you want to remove?"
- user: "@MaryLu"
assertions:
- slot_was_set:
- name: remove_contact_handle
value: "@MaryLu"
- bot_uttered:
utter_name: utter_ask_remove_contact_confirmation
- user: "yes"
assertions:
- action_executed: remove_contact
- bot_uttered:
utter_name: utter_remove_contact_success
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
test_cases:
- test_case: user_replace_card_incorrect_card
steps:
- user: I need to replace my card
assertions:
- bot_uttered:
utter_name: utter_ask_confirm_correct_card
- user: "no"
assertions:
- slot_was_set:
- name: confirm_correct_card
value: false
- bot_uttered:
utter_name: utter_relevant_card_not_linked
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
metadata:
- duplicate_replace_card_1:
turn_idx: 1
- duplicate_replace_card_2:
turn_idx: 2
test_cases:
- test_case: Replace lost card which was used fraudulently
steps:
- user: I need to replace my card
assertions:
- bot_uttered:
utter_name: utter_ask_confirm_correct_card
- user: "yes"
metadata: duplicate_replace_card_1
assertions:
- slot_was_set:
- name: confirm_correct_card
value: true
- bot_uttered:
utter_name: utter_ask_replacement_reason
- user: I lost my card
assertions:
- slot_was_set:
- name: replacement_reason
value: lost
- bot_uttered:
utter_name: utter_ask_was_card_used_fraudulently
- user: "yes"
metadata: duplicate_replace_card_2
assertions:
- slot_was_set:
- name: was_card_used_fraudulently
value: true
- bot_uttered:
utter_name: utter_report_fraud

- test_case: Replace lost card which was not used fraudulently
steps:
- user: I need to replace my card
assertions:
- bot_uttered:
utter_name: utter_ask_confirm_correct_card
- user: "yes"
assertions:
- slot_was_set:
- name: confirm_correct_card
value: true
- bot_uttered:
utter_name: utter_ask_replacement_reason
- user: I lost my card
assertions:
- slot_was_set:
- name: replacement_reason
value: lost
- bot_uttered:
utter_name: utter_ask_was_card_used_fraudulently
- user: "no"
assertions:
- slot_was_set:
- name: was_card_used_fraudulently
value: false
- bot_uttered:
utter_name: utter_will_cancel_and_send_new
- bot_uttered:
utter_name: utter_new_card_has_been_ordered

- test_case: Replace damaged card
steps:
- user: I need to replace my card
assertions:
- bot_uttered:
utter_name: utter_ask_confirm_correct_card
- user: "yes"
assertions:
- slot_was_set:
- name: confirm_correct_card
value: true
- bot_uttered:
utter_name: utter_ask_replacement_reason
- user: My card is damaged
assertions:
- slot_was_set:
- name: replacement_reason
value: damaged
- bot_uttered:
utter_name: utter_will_cancel_and_send_new
- bot_uttered:
utter_name: utter_new_card_has_been_ordered

- test_case: Replace card with unknown replacement reason
steps:
- user: I need to replace my card
assertions:
- bot_uttered:
utter_name: utter_ask_confirm_correct_card
- user: "yes"
assertions:
- slot_was_set:
- name: confirm_correct_card
value: true
- bot_uttered:
utter_name: utter_ask_replacement_reason
- user: some other reason
assertions:
- slot_was_set:
- name: replacement_reason
value: some other reason
- bot_uttered:
utter_name: utter_categorical_slot_rejection
- bot_uttered:
utter_name: utter_ask_replacement_reason
- user: ok, stop then
assertions:
- bot_uttered:
utter_name: utter_can_do_something_else
Loading

0 comments on commit fb6f2b4

Please sign in to comment.