Skip to content

Commit

Permalink
adapt digressions, flow_guards, skip_question
Browse files Browse the repository at this point in the history
  • Loading branch information
ancalita committed Aug 6, 2024
1 parent 4828705 commit a1c349d
Show file tree
Hide file tree
Showing 15 changed files with 354 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
test_cases:
- test_case: user makes an intermittent flow switch
steps:
- user: I need to transfer 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: How much do I have on my account?
assertions:
- bot_uttered:
utter_name: utter_current_balance
- bot_uttered:
utter_name: utter_flow_continue_interrupted
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
- user: ah, great, I owe him $500
assertions:
- bot_uttered:
utter_name: utter_ask_transfer_money_final_confirmation
- user: "yes"
assertions:
- bot_uttered:
utter_name: utter_transfer_complete
- bot_uttered:
utter_name: utter_can_do_something_else
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
test_cases:
- test_case: user answers and also asks a question
steps:
- user: I want to send 50$ to Justin
assertions:
- slot_was_set:
- name: route_session_to_calm
value: True
- bot_uttered:
utter_name: utter_ask_transfer_money_final_confirmation
- user: yes, and btw are there any fees associated with the sending?
assertions:
# not able to test the response of enterprise search yet
- bot_uttered:
utter_name: utter_transfer_complete
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
test_cases:
- test_case: user asks for a moment to think
steps:
- user: I want to send money to Yizhi
assertions:
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
- user: one moment
assertions:
- bot_uttered:
utter_name: utter_take_your_time
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
- user: "100"
assertions:
- bot_uttered:
utter_name: utter_ask_transfer_money_final_confirmation
- user: "Yes"
assertions:
- bot_uttered:
utter_name: utter_transfer_complete
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
test_cases:
- test_case: user asks what requested information is
steps:
# NLUCommandAdapter should start the flow, so "Peter" is not detected as an entity
- user: I want to add Kate to my contacts
assertions:
- slot_was_set:
- name: route_session_to_calm
value: True
- bot_uttered:
utter_name: utter_ask_add_contact_handle
- user: What's a contact handle?
assertions:
# not able to test the response of enterprise search
- bot_uttered:
utter_name: utter_ask_add_contact_handle
- user: Ah okay she sent it to me, it's @KatePurry
assertions:
- slot_was_set:
- name: add_contact_handle
value: "@KatePurry"
- bot_uttered:
utter_name: utter_ask_add_contact_name
- user: Kate
assertions:
- slot_was_set:
- name: add_contact_name
value: "Kate"
- bot_uttered:
utter_name: utter_ask_add_contact_confirmation
- user: "yes"
assertions:
- bot_uttered:
utter_name: utter_contact_added
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
test_cases:
- test_case: user asks why information is needed
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 [email protected]
assertions:
- bot_uttered:
utter_name: utter_ask_based_in_california
- user: Why do you need to know this?
assertions:
- bot_uttered:
utter_name: utter_california_compliance
- bot_uttered:
utter_name: utter_ask_based_in_california
- user: "No"
assertions:
- bot_uttered:
utter_name: utter_ask_verify_account_confirmation
- user: "Yes"
assertions:
- bot_uttered:
utter_name: utter_verify_account_success
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
test_cases:
- test_case: user refuses to provide information
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 [email protected]
assertions:
- bot_uttered:
utter_name: utter_ask_based_in_california
- user: "Yes"
assertions:
- bot_uttered:
utter_name: utter_ask_verify_account_sufficient_california_income
- user: Why is that your business?
assertions:
- bot_uttered:
utter_name: utter_california_compliance
- bot_uttered:
utter_name: utter_ask_verify_account_sufficient_california_income
- user: never mind then!!
assertions:
- bot_uttered:
utter_name: utter_can_do_something_else
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
test_cases:
- test_case: user starts multiple flows
steps:
- user: Show my transactions and send money
assertions:
- slot_was_set:
- name: route_session_to_calm
value: True
- bot_uttered:
utter_name: utter_transactions
- bot_uttered:
utter_name: utter_ask_transfer_money_recipient
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
test_cases:
- test_case: user starts with a very long message
steps:
- user: What's up dawg, my homie Steven got my back yesterday when we were out for drinks and my phone was out of batt, let me settle up with him.
assertions:
- slot_was_set:
- name: transfer_money_recipient
value: Steven
- name: route_session_to_calm
value: True
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
test_cases:
- test_case: validation too little money
steps:
- user: I want to send 5000$ to Martin
assertions:
- slot_was_set:
- name: route_session_to_calm
value: True
- bot_uttered:
utter_name: utter_transfer_money_insufficient_funds
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
- user: Oh, I thought I had more, then do 3000$ for now
assertions:
- bot_uttered:
utter_name: utter_ask_transfer_money_final_confirmation
- user: "yes"
assertions:
- bot_uttered:
utter_name: utter_transfer_complete
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
metadata:
- duplicate_msg_1:
turn_idx: 1
- duplicate_msg_2:
turn_idx: 2
- duplicate_msg_3:
turn_idx: 3

test_cases:

- test_case: user is based in california and wants to register to vote
steps:
- user: I would like to verify my account.
assertions:
- bot_uttered:
utter_name: utter_ask_verify_account_email
- user: [email protected]
assertions:
- bot_uttered:
utter_name: utter_ask_based_in_california
- user: "yes"
metadata: duplicate_msg_1
assertions:
- bot_uttered:
utter_name: utter_ask_verify_account_sufficient_california_income
- user: "yes"
metadata: duplicate_msg_2
assertions:
- bot_uttered:
utter_name: utter_ask_verify_account_confirmation
- user: "yes"
metadata: duplicate_msg_3
assertions:
- bot_uttered:
utter_name: utter_verify_account_success
- bot_uttered:
utter_name: utter_can_do_something_else
- user: I would like to register to vote in california.
assertions:
- bot_uttered:
utter_name: utter_register_to_vote_in_california
- bot_uttered:
utter_name: utter_can_do_something_else
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
test_cases:
- test_case: user tries to skip a question and then cancels the flow (easy)
steps:
- user: send money to John
assertions:
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
- user: skip this question
assertions:
- bot_uttered:
utter_name: utter_skip_question_answer
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
- user: cancel
assertions:
- bot_uttered:
utter_name: utter_flow_cancelled_rasa
- bot_uttered:
utter_name: utter_can_do_something_else
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
test_cases:
- test_case: user tries to skip a question and then cancels the flow (medium)
steps:
- user: send money to John
assertions:
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
- user: ask me something else
assertions:
- bot_uttered:
utter_name: utter_skip_question_answer
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
- user: one moment, stop that
assertions:
- bot_uttered:
utter_name: utter_flow_cancelled_rasa
- bot_uttered:
utter_name: utter_can_do_something_else
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
test_cases:
- test_case: user tries to skip a question multiple times (easy)
steps:
- user: send money to John
assertions:
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
- user: ask me something else
assertions:
- bot_uttered:
utter_name: utter_skip_question_answer
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
- user: proceed to the next one
assertions:
- bot_uttered:
utter_name: utter_skip_question_answer
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
- user: i want to answer next question first
assertions:
- bot_uttered:
utter_name: utter_skip_question_answer
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
- user: okay 50
assertions:
- bot_uttered:
utter_name: utter_ask_transfer_money_final_confirmation
- user: "yes"
assertions:
- bot_uttered:
utter_name: utter_transfer_complete
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
test_cases:
- test_case: user tries to skip a question once (easy)
steps:
- user: send money to John
assertions:
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
- user: skip this question
assertions:
- bot_uttered:
utter_name: utter_skip_question_answer
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
- user: okay 50
assertions:
- bot_uttered:
utter_name: utter_ask_transfer_money_final_confirmation
- user: "yes"
assertions:
- bot_uttered:
utter_name: utter_transfer_complete
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
test_cases:
- test_case: user tries to skip a question once (medium)
steps:
- user: send money to John
assertions:
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
- user: ask me something else
assertions:
- bot_uttered:
utter_name: utter_skip_question_answer
- bot_uttered:
utter_name: utter_ask_transfer_money_amount_of_money
- user: okay 50
assertions:
- bot_uttered:
utter_name: utter_ask_transfer_money_final_confirmation
- user: "yes"
assertions:
- bot_uttered:
utter_name: utter_transfer_complete

0 comments on commit a1c349d

Please sign in to comment.