From 8ca6151a0a385fe7fef5df0293c1d3f59c8830fc Mon Sep 17 00:00:00 2001 From: Anca Lita <27920906+ancalita@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:35:13 +0100 Subject: [PATCH] adapt tests for corrections --- actions/ask_for_slot_action.py | 2 +- .../user_corrects_a_branching_slot.yml | 48 ++++ .../user_corrects_a_number_slot.yml | 44 ++++ ...ts_amount_of_money_in_the_next_message.yml | 44 ++++ ...er_corrects_mentioning_old_value_first.yml | 45 ++++ ...ser_corrects_mentioning_old_value_last.yml | 41 +++ ...corrects_recipient_in_the_next_message.yml | 44 ++++ .../user_corrects_recipient_late.yml | 44 ++++ ...r_corrects_slot_with_nlu_based_mapping.yml | 244 ++++++++++++++++++ .../corrections/user_corrects_string_slot.yml | 45 ++++ .../user_corrects_twice_in_row.yml | 29 +++ .../user_resets_a_slot_by_slot_name.yml | 38 +++ .../user_resets_a_slot_by_value.yml | 36 +++ 13 files changed, 703 insertions(+), 1 deletion(-) create mode 100644 e2e_tests_with_assertions/passing/corrections/user_corrects_a_branching_slot.yml create mode 100644 e2e_tests_with_assertions/passing/corrections/user_corrects_a_number_slot.yml create mode 100644 e2e_tests_with_assertions/passing/corrections/user_corrects_amount_of_money_in_the_next_message.yml create mode 100644 e2e_tests_with_assertions/passing/corrections/user_corrects_mentioning_old_value_first.yml create mode 100644 e2e_tests_with_assertions/passing/corrections/user_corrects_mentioning_old_value_last.yml create mode 100644 e2e_tests_with_assertions/passing/corrections/user_corrects_recipient_in_the_next_message.yml create mode 100644 e2e_tests_with_assertions/passing/corrections/user_corrects_recipient_late.yml create mode 100644 e2e_tests_with_assertions/passing/corrections/user_corrects_slot_with_nlu_based_mapping.yml create mode 100644 e2e_tests_with_assertions/passing/corrections/user_corrects_string_slot.yml create mode 100644 e2e_tests_with_assertions/passing/corrections/user_corrects_twice_in_row.yml create mode 100644 e2e_tests_with_assertions/passing/corrections/user_resets_a_slot_by_slot_name.yml create mode 100644 e2e_tests_with_assertions/passing/corrections/user_resets_a_slot_by_value.yml diff --git a/actions/ask_for_slot_action.py b/actions/ask_for_slot_action.py index 3b13b64..ed18f8b 100644 --- a/actions/ask_for_slot_action.py +++ b/actions/ask_for_slot_action.py @@ -47,7 +47,7 @@ def run( if len(restaurant_names) > 0: dispatcher.utter_message( - text="Do you know which restaurant you would like me to reverse a table at?", + text="Do you know which restaurant you would like me to reserve a table at?", buttons=[ {"title": r, "payload": f'/inform{{"restaurant_name":"{r}"}}'} for r in restaurant_names diff --git a/e2e_tests_with_assertions/passing/corrections/user_corrects_a_branching_slot.yml b/e2e_tests_with_assertions/passing/corrections/user_corrects_a_branching_slot.yml new file mode 100644 index 0000000..75958b9 --- /dev/null +++ b/e2e_tests_with_assertions/passing/corrections/user_corrects_a_branching_slot.yml @@ -0,0 +1,48 @@ +metadata: + - duplicate_msg_correction_1: + turn_idx: 1 + - duplicate_msg_correction_2: + turn_idx: 2 +test_cases: + - test_case: user_corrects_a_branching_slot + steps: + - user: I want to verify my account + assertions: + - slot_was_set: + - name: route_session_to_calm + value: True + - bot_uttered: + utter_name: utter_ask_verify_account_email + - user: It's birdie@example.com + assertions: + - bot_uttered: + utter_name: utter_ask_based_in_california + - user: "yes" + metadata: duplicate_msg_correction_1 + assertions: + - bot_uttered: + utter_name: utter_ask_verify_account_sufficient_california_income + - user: sorry, I need to correct the previous input + assertions: + - flow_started: pattern_correction + - bot_uttered: + utter_name: utter_ask_confirm_slot_correction + - user: /SetSlots(confirm_slot_correction=true) + assertions: + - bot_uttered: + utter_name: utter_corrected_previous_input + - slot_was_set: + - name: based_in_california + - bot_uttered: + utter_name: utter_ask_based_in_california + - user: "no" + assertions: + - bot_uttered: + utter_name: utter_ask_verify_account_confirmation + - user: "yes" + metadata: duplicate_msg_correction_2 + assertions: + - bot_uttered: + utter_name: utter_verify_account_success + - bot_uttered: + utter_name: utter_can_do_something_else diff --git a/e2e_tests_with_assertions/passing/corrections/user_corrects_a_number_slot.yml b/e2e_tests_with_assertions/passing/corrections/user_corrects_a_number_slot.yml new file mode 100644 index 0000000..d1f99d4 --- /dev/null +++ b/e2e_tests_with_assertions/passing/corrections/user_corrects_a_number_slot.yml @@ -0,0 +1,44 @@ +test_cases: + - test_case: user_corrects_a_number_slot + steps: + - user: I want to book a table + 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: + - action_executed: restaurant_form + - bot_uttered: + text_matches: "What cuisine are you looking for?" + - user: /inform{"cuisine":"Japanese"} + assertions: + - action_executed: restaurant_form + - bot_uttered: + text_matches: "Do you know which restaurant you would like me to reserve a table at?" + - user: /inform{"restaurant_name":"Yamazato Restaurant"} + assertions: + - bot_uttered: + utter_name: utter_ask_restaurant_form_num_people + - user: "4" + assertions: + - slot_was_set: + - name: num_people + value: 4 + - bot_uttered: + utter_name: utter_ask_restaurant_form_restaurant_time + - user: sorry, we are 6 people + assertions: + - slot_was_set: + - name: num_people + value: 6 + - bot_uttered: + utter_name: utter_ask_restaurant_form_restaurant_time + - user: tomorrow at 7pm + assertions: + - bot_uttered: + utter_name: utter_restaurant_form_submit + - bot_uttered: + utter_name: utter_restaurant_available \ No newline at end of file diff --git a/e2e_tests_with_assertions/passing/corrections/user_corrects_amount_of_money_in_the_next_message.yml b/e2e_tests_with_assertions/passing/corrections/user_corrects_amount_of_money_in_the_next_message.yml new file mode 100644 index 0000000..f7a67c2 --- /dev/null +++ b/e2e_tests_with_assertions/passing/corrections/user_corrects_amount_of_money_in_the_next_message.yml @@ -0,0 +1,44 @@ +test_cases: + - test_case: user_corrects_amount_of_money_in_the_next_message + steps: + - user: I want to transfer money + assertions: + - slot_was_set: + - name: route_session_to_calm + value: True + - bot_uttered: + utter_name: utter_ask_transfer_money_recipient + - user: John + assertions: + - slot_was_set: + - name: transfer_money_recipient + value: John + - bot_uttered: + utter_name: utter_ask_transfer_money_amount_of_money + - user: 100 USD + assertions: + - slot_was_set: + - name: transfer_money_amount_of_money + value: "100" + - bot_uttered: + utter_name: utter_ask_transfer_money_final_confirmation + - user: Ah, scratch that, I meant 110$ + assertions: + - flow_started: pattern_correction + - bot_uttered: + utter_name: utter_ask_confirm_slot_correction + - user: /SetSlots(confirm_slot_correction=true) + assertions: + - slot_was_set: + - name: transfer_money_amount_of_money + value: "110" + - bot_uttered: + utter_name: utter_corrected_previous_input + - bot_uttered: + utter_name: utter_ask_transfer_money_final_confirmation + - user: "yes" + assertions: + - bot_uttered: + utter_name: utter_transfer_complete + - flow_completed: + flow_id: transfer_money diff --git a/e2e_tests_with_assertions/passing/corrections/user_corrects_mentioning_old_value_first.yml b/e2e_tests_with_assertions/passing/corrections/user_corrects_mentioning_old_value_first.yml new file mode 100644 index 0000000..0b8851d --- /dev/null +++ b/e2e_tests_with_assertions/passing/corrections/user_corrects_mentioning_old_value_first.yml @@ -0,0 +1,45 @@ +test_cases: + - test_case: user_corrects_mentioning_old_value_first + steps: + - user: I want to transfer money + assertions: + - slot_was_set: + - name: route_session_to_calm + value: True + - bot_uttered: + utter_name: utter_ask_transfer_money_recipient + - user: John + assertions: + - slot_was_set: + - name: transfer_money_recipient + value: John + - bot_uttered: + utter_name: utter_ask_transfer_money_amount_of_money + - user: "50" + assertions: + - slot_was_set: + - name: transfer_money_amount_of_money + value: "50" + - bot_uttered: + utter_name: utter_ask_transfer_money_final_confirmation + - user: Ah, not 50, I meant 55 + assertions: + - flow_started: pattern_correction + - bot_uttered: + utter_name: utter_ask_confirm_slot_correction + - user: /SetSlots(confirm_slot_correction=true) + assertions: + - slot_was_set: + - name: transfer_money_amount_of_money + value: "55" + - bot_uttered: + utter_name: utter_corrected_previous_input + - bot_uttered: + utter_name: utter_ask_transfer_money_final_confirmation + - user: "yes" + assertions: + - bot_uttered: + utter_name: utter_transfer_complete + - flow_completed: + flow_id: transfer_money + - utter: utter_transfer_complete diff --git a/e2e_tests_with_assertions/passing/corrections/user_corrects_mentioning_old_value_last.yml b/e2e_tests_with_assertions/passing/corrections/user_corrects_mentioning_old_value_last.yml new file mode 100644 index 0000000..ae87f76 --- /dev/null +++ b/e2e_tests_with_assertions/passing/corrections/user_corrects_mentioning_old_value_last.yml @@ -0,0 +1,41 @@ +test_cases: + - test_case: user_corrects_mentioning_old_value_last + steps: + - user: I want to transfer money + assertions: + - slot_was_set: + - name: route_session_to_calm + value: True + - bot_uttered: + utter_name: utter_ask_transfer_money_recipient + - user: John + assertions: + - slot_was_set: + - name: transfer_money_recipient + value: John + - bot_uttered: + utter_name: utter_ask_transfer_money_amount_of_money + - user: Sorry, I meant to say Jimmy, not John + assertions: + - flow_started: pattern_correction + - bot_uttered: + utter_name: utter_ask_confirm_slot_correction + - user: /SetSlots(confirm_slot_correction=true) + assertions: + - slot_was_set: + - name: transfer_money_recipient + value: Jimmy + - bot_uttered: + utter_name: utter_corrected_previous_input + - bot_uttered: + utter_name: utter_ask_transfer_money_amount_of_money + - user: 50$ + assertions: + - bot_uttered: + utter_name: utter_ask_transfer_money_final_confirmation + - user: "yes" + assertions: + - bot_uttered: + utter_name: utter_transfer_complete + - flow_completed: + flow_id: transfer_money diff --git a/e2e_tests_with_assertions/passing/corrections/user_corrects_recipient_in_the_next_message.yml b/e2e_tests_with_assertions/passing/corrections/user_corrects_recipient_in_the_next_message.yml new file mode 100644 index 0000000..5e26f41 --- /dev/null +++ b/e2e_tests_with_assertions/passing/corrections/user_corrects_recipient_in_the_next_message.yml @@ -0,0 +1,44 @@ +test_cases: + - test_case: user_corrects_recipient_in_the_next_message + steps: + - user: I want to transfer money + assertions: + - slot_was_set: + - name: route_session_to_calm + value: True + - bot_uttered: + utter_name: utter_ask_transfer_money_recipient + - user: John + assertions: + - slot_was_set: + - name: transfer_money_recipient + value: John + - bot_uttered: + utter_name: utter_ask_transfer_money_amount_of_money + - user: Sorry, I meant to say Joe + assertions: + - flow_started: pattern_correction + - bot_uttered: + utter_name: utter_ask_confirm_slot_correction + - user: /SetSlots(confirm_slot_correction=true) + assertions: + - slot_was_set: + - name: transfer_money_recipient + value: Joe + - bot_uttered: + utter_name: utter_corrected_previous_input + - bot_uttered: + utter_name: utter_ask_transfer_money_amount_of_money + - user: "50" + assertions: + - slot_was_set: + - name: transfer_money_amount_of_money + value: "50" + - bot_uttered: + utter_name: utter_ask_transfer_money_final_confirmation + - user: "yes" + assertions: + - bot_uttered: + utter_name: utter_transfer_complete + - flow_completed: + flow_id: transfer_money diff --git a/e2e_tests_with_assertions/passing/corrections/user_corrects_recipient_late.yml b/e2e_tests_with_assertions/passing/corrections/user_corrects_recipient_late.yml new file mode 100644 index 0000000..29f90c5 --- /dev/null +++ b/e2e_tests_with_assertions/passing/corrections/user_corrects_recipient_late.yml @@ -0,0 +1,44 @@ +test_cases: + - test_case: user_corrects_recipient_late + steps: + - user: I want to transfer money + assertions: + - slot_was_set: + - name: route_session_to_calm + value: True + - bot_uttered: + utter_name: utter_ask_transfer_money_recipient + - user: John + assertions: + - slot_was_set: + - name: transfer_money_recipient + value: John + - bot_uttered: + utter_name: utter_ask_transfer_money_amount_of_money + - user: 50 USD + assertions: + - slot_was_set: + - name: transfer_money_amount_of_money + value: "50" + - bot_uttered: + utter_name: utter_ask_transfer_money_final_confirmation + - user: Oh wait, I want to send it to James! + assertions: + - flow_started: pattern_correction + - bot_uttered: + utter_name: utter_ask_confirm_slot_correction + - user: /SetSlots(confirm_slot_correction=true) + assertions: + - slot_was_set: + - name: transfer_money_recipient + value: James + - bot_uttered: + utter_name: utter_corrected_previous_input + - bot_uttered: + utter_name: utter_ask_transfer_money_final_confirmation + - user: "yes" + assertions: + - bot_uttered: + utter_name: utter_transfer_complete + - flow_completed: + flow_id: transfer_money diff --git a/e2e_tests_with_assertions/passing/corrections/user_corrects_slot_with_nlu_based_mapping.yml b/e2e_tests_with_assertions/passing/corrections/user_corrects_slot_with_nlu_based_mapping.yml new file mode 100644 index 0000000..b0f5495 --- /dev/null +++ b/e2e_tests_with_assertions/passing/corrections/user_corrects_slot_with_nlu_based_mapping.yml @@ -0,0 +1,244 @@ +test_cases: + - test_case: user_orders_pizza_stating_which_type_and_corrects_quantity_later + steps: + - user: I would like to order a diavola pizza. + assertions: + - slot_was_set: + - name: pizza + value: diavola + - bot_uttered: + utter_name: utter_ask_num_pizza + - user: 1 please + assertions: + - slot_was_set: + - name: num_pizza + value: 1 + - bot_uttered: + utter_name: utter_ask_address + - user: 30 Pine Road + assertions: + - slot_was_set: + - name: address + value: 30 Pine Road + - bot_uttered: + utter_name: utter_confirm + - user: /SetSlots(confirmation_order=True) + assertions: + - bot_uttered: + utter_name: utter_ask_payment_option + - user: actually can i get 2 pizzas instead + assertions: + - flow_started: pattern_correction + - bot_uttered: + utter_name: utter_ask_confirm_slot_correction + - user: /SetSlots(confirm_slot_correction=true) + assertions: + - slot_was_set: + - name: num_pizza + value: 2 + - bot_uttered: + utter_name: utter_corrected_previous_input + - bot_uttered: + utter_name: utter_confirm + - user: /SetSlots(confirmation_order=True) + assertions: + - bot_uttered: + utter_name: utter_ask_payment_option + + - test_case: user_orders_pizza_stating_which_type_and_corrects_pizza_type_later + steps: + - user: I would like to order a diavola pizza. + assertions: + - slot_was_set: + - name: pizza + value: diavola + - bot_uttered: + utter_name: utter_ask_num_pizza + - user: 1 please + assertions: + - slot_was_set: + - name: num_pizza + value: 1 + - bot_uttered: + utter_name: utter_ask_address + - user: 30 Pine Road + assertions: + - slot_was_set: + - name: address + value: 30 Pine Road + - bot_uttered: + utter_name: utter_confirm + - user: /SetSlots(confirmation_order=True) + assertions: + - bot_uttered: + utter_name: utter_ask_payment_option + - user: actually can i get a margherita instead + assertions: + - flow_started: pattern_correction + - bot_uttered: + utter_name: utter_ask_confirm_slot_correction + - user: /SetSlots(confirm_slot_correction=true) + assertions: + - slot_was_set: + - name: pizza + value: margherita + - bot_uttered: + utter_name: utter_corrected_previous_input + - bot_uttered: + utter_name: utter_confirm + - user: /SetSlots(confirmation_order=True) + assertions: + - bot_uttered: + utter_name: utter_ask_payment_option + + - test_case: user_orders_pizza_stating_which_type_and_corrects_address_later + steps: + - user: I would like to order a diavola pizza. + assertions: + - slot_was_set: + - name: pizza + value: diavola + - bot_uttered: + utter_name: utter_ask_num_pizza + - user: 1 please + assertions: + - slot_was_set: + - name: num_pizza + value: 1 + - bot_uttered: + utter_name: utter_ask_address + - user: 31 Pine Road + assertions: + - slot_was_set: + - name: address + value: 31 Pine Road + - bot_uttered: + utter_name: utter_confirm + - user: /SetSlots(confirmation_order=True) + assertions: + - bot_uttered: + utter_name: utter_ask_payment_option + - user: wait, i meant to say the pizza should be delivered to 13 Pine Road. + assertions: + - bot_uttered: + text_matches: "I'm sorry about that. Let's correct your address. Please confirm your new address?" + - slot_was_set: + - name: address + value: null + - bot_uttered: + utter_name: utter_ask_address + - user: 13 Pine Road + assertions: + - slot_was_set: + - name: address + value: 13 Pine Road + - bot_uttered: + utter_name: utter_confirm + - user: /SetSlots(confirmation_order=True) + assertions: + - bot_uttered: + utter_name: utter_ask_payment_option + + - test_case: user_orders_pizza_stating_which_type_and_corrects_payment_option_later + steps: + - user: I would like to order a diavola pizza. + assertions: + - slot_was_set: + - name: pizza + value: diavola + - bot_uttered: + utter_name: utter_ask_num_pizza + - user: 1 please + assertions: + - slot_was_set: + - name: num_pizza + value: 1 + - bot_uttered: + utter_name: utter_ask_address + - user: 30 Pine Road + assertions: + - slot_was_set: + - name: address + value: 30 Pine Road + - bot_uttered: + utter_name: utter_confirm + - user: /SetSlots(confirmation_order=True) + assertions: + - bot_uttered: + utter_name: utter_ask_payment_option + - user: loyalty points + assertions: + - slot_was_set: + - name: payment_option + value: membership_points + - flow_started: authenticate_user + - bot_uttered: + utter_name: utter_ask_user_name + - user: actually can i pay with a credit card + assertions: + - flow_started: pattern_correction + - bot_uttered: + utter_name: utter_ask_confirm_slot_correction + - user: /SetSlots(confirm_slot_correction=true) + assertions: + - slot_was_set: + - name: payment_option + value: card + - bot_uttered: + utter_name: utter_corrected_previous_input + - bot_uttered: + utter_name: utter_ask_card_details + + - test_case: user_orders_pizza_stating_which_type_and_corrects_order_details_later + steps: + - user: I would like to order a diavola pizza. + assertions: + - slot_was_set: + - name: pizza + value: diavola + - bot_uttered: + utter_name: utter_ask_num_pizza + - user: 1 please + assertions: + - slot_was_set: + - name: num_pizza + value: 1 + - bot_uttered: + utter_name: utter_ask_address + - user: 30 Pine Road + assertions: + - slot_was_set: + - name: address + value: 30 Pine Road + - bot_uttered: + utter_name: utter_confirm + - user: /SetSlots(confirmation_order=True) + assertions: + - bot_uttered: + utter_name: utter_ask_payment_option + - user: actually, i made a mistake and need to update my delivery address first. + assertions: + - bot_uttered: + text_matches: "I'm sorry about that. Let's correct your order. What would you like to change?" + buttons: + - title: Pizza + payload: /SetSlots(pizza=null) + - title: Quantity + payload: /SetSlots(num_pizza=null) + - title: Address + payload: /SetSlots(address=null) + - user: /SetSlots(address=null) + assertions: + - bot_uttered: + utter_name: utter_ask_address + - user: 3 Pine Road + assertions: + - slot_was_set: + - name: address + value: 3 Pine Road + - bot_uttered: + utter_name: utter_confirm + - user: /SetSlots(confirmation_order=True) + assertions: + - bot_uttered: + utter_name: utter_ask_payment_option diff --git a/e2e_tests_with_assertions/passing/corrections/user_corrects_string_slot.yml b/e2e_tests_with_assertions/passing/corrections/user_corrects_string_slot.yml new file mode 100644 index 0000000..3b2fce0 --- /dev/null +++ b/e2e_tests_with_assertions/passing/corrections/user_corrects_string_slot.yml @@ -0,0 +1,45 @@ +test_cases: + - test_case: user_corrects_string_slot + steps: + # NLUCommandAdapter should start the flow, so "Peter" is not detected as an entity + - user: I want to add Peter to my contacts + assertions: + - slot_was_set: + - name: route_session_to_calm + value: True + - bot_uttered: + utter_name: utter_ask_add_contact_handle + - user: It's @PeterPark + assertions: + - slot_was_set: + - name: add_contact_handle + value: "@PeterPark" + - bot_uttered: + utter_name: utter_ask_add_contact_name + - user: Peter + assertions: + - slot_was_set: + - name: add_contact_name + value: "Peter" + - bot_uttered: + utter_name: utter_ask_add_contact_confirmation + - user: Ah, please use Spidey as the name + assertions: + - flow_started: pattern_correction + - bot_uttered: + utter_name: utter_ask_confirm_slot_correction + - user: /SetSlots(confirm_slot_correction=true) + assertions: + - slot_was_set: + - name: add_contact_name + value: "Spidey" + - bot_uttered: + utter_name: utter_corrected_previous_input + - bot_uttered: + utter_name: utter_ask_add_contact_confirmation + - user: "yes" + assertions: + - bot_uttered: + utter_name: utter_contact_added + - flow_completed: + flow_id: add_contact diff --git a/e2e_tests_with_assertions/passing/corrections/user_corrects_twice_in_row.yml b/e2e_tests_with_assertions/passing/corrections/user_corrects_twice_in_row.yml new file mode 100644 index 0000000..7829888 --- /dev/null +++ b/e2e_tests_with_assertions/passing/corrections/user_corrects_twice_in_row.yml @@ -0,0 +1,29 @@ +test_cases: + - test_case: user_corrects_twice_in_row + steps: + - user: I want to send money to Joe + assertions: + - slot_was_set: + - name: route_session_to_calm + value: True + - bot_uttered: + utter_name: utter_ask_transfer_money_amount_of_money + - user: oh sorry I meant John + assertions: + - flow_started: pattern_correction + - bot_uttered: + utter_name: utter_ask_confirm_slot_correction + - user: damn, should be Alex + assertions: + - flow_started: pattern_correction + - bot_uttered: + utter_name: utter_ask_confirm_slot_correction + - user: /SetSlots(confirm_slot_correction=true) + assertions: + - slot_was_set: + - name: transfer_money_recipient + value: Alex + - bot_uttered: + utter_name: utter_corrected_previous_input + - bot_uttered: + utter_name: utter_ask_transfer_money_amount_of_money diff --git a/e2e_tests_with_assertions/passing/corrections/user_resets_a_slot_by_slot_name.yml b/e2e_tests_with_assertions/passing/corrections/user_resets_a_slot_by_slot_name.yml new file mode 100644 index 0000000..c34d597 --- /dev/null +++ b/e2e_tests_with_assertions/passing/corrections/user_resets_a_slot_by_slot_name.yml @@ -0,0 +1,38 @@ +test_cases: + - test_case: user_resets_a_slot_by_slot_name + steps: + - user: I want to send some money to John + assertions: + - slot_was_set: + - name: route_session_to_calm + value: True + - bot_uttered: + utter_name: utter_ask_transfer_money_amount_of_money + - user: "50" + assertions: + - bot_uttered: + utter_name: utter_ask_transfer_money_final_confirmation + - user: I want to change the recipient + assertions: + - flow_started: pattern_correction + - bot_uttered: + utter_name: utter_ask_confirm_slot_correction + - user: /SetSlots(confirm_slot_correction=true) + assertions: + - bot_uttered: + utter_name: utter_corrected_previous_input + - bot_uttered: + utter_name: utter_ask_transfer_money_recipient + - user: Eliza + assertions: + - slot_was_set: + - name: transfer_money_recipient + value: Eliza + - bot_uttered: + utter_name: utter_ask_transfer_money_final_confirmation + - user: "yes" + assertions: + - bot_uttered: + utter_name: utter_transfer_complete + - flow_completed: + flow_id: transfer_money diff --git a/e2e_tests_with_assertions/passing/corrections/user_resets_a_slot_by_value.yml b/e2e_tests_with_assertions/passing/corrections/user_resets_a_slot_by_value.yml new file mode 100644 index 0000000..947fd84 --- /dev/null +++ b/e2e_tests_with_assertions/passing/corrections/user_resets_a_slot_by_value.yml @@ -0,0 +1,36 @@ +test_cases: + - test_case: user_resets_a_slot_by_value + steps: + - user: I want to send some money to John + assertions: + - slot_was_set: + - name: route_session_to_calm + value: True + - bot_uttered: + utter_name: utter_ask_transfer_money_amount_of_money + - user: Sorry, I didn't mean John + assertions: + - flow_started: pattern_correction + - bot_uttered: + utter_name: utter_ask_confirm_slot_correction + - user: /SetSlots(confirm_slot_correction=true) + assertions: + - bot_uttered: + utter_name: utter_corrected_previous_input + - bot_uttered: + utter_name: utter_ask_transfer_money_recipient + - user: to Joe + assertions: + - slot_was_set: + - name: transfer_money_recipient + value: Joe + - bot_uttered: + utter_name: utter_ask_transfer_money_amount_of_money + - user: "50" + assertions: + - bot_uttered: + utter_name: utter_ask_transfer_money_final_confirmation + - user: "yes" + assertions: + - bot_uttered: + utter_name: utter_transfer_complete