From abda9f24347d5575472c33e34ac3d2e2e3a13ca8 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Tue, 17 Sep 2024 20:28:56 +0100 Subject: [PATCH] ENG-1293: Add tests to verify that link to `pattern_human_handoff` is triggered in relevant conditions On these conditions: 1. When `pattern_clarification` is triggered twice 2. Or when login fails during check-portfolio at least 3 times --- ...ferred_to_human_after_2_clarifications.yml | 46 ++++++++++++++ ...man_after_3_portfolio_check_auth_fails.yml | 63 +++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 e2e_tests_with_assertions/passing/flow_guards/user_is_referred_to_human_after_2_clarifications.yml create mode 100644 e2e_tests_with_assertions/passing/flow_guards/user_is_referred_to_human_after_3_portfolio_check_auth_fails.yml diff --git a/e2e_tests_with_assertions/passing/flow_guards/user_is_referred_to_human_after_2_clarifications.yml b/e2e_tests_with_assertions/passing/flow_guards/user_is_referred_to_human_after_2_clarifications.yml new file mode 100644 index 0000000..bf3db35 --- /dev/null +++ b/e2e_tests_with_assertions/passing/flow_guards/user_is_referred_to_human_after_2_clarifications.yml @@ -0,0 +1,46 @@ +fixtures: + - route_to_calm: + - route_session_to_calm: True + +metadata: +- duplicate_message_1: + turn_idx: 1 +- duplicate_message_2: + turn_idx: 2 +- duplicate_message_3: + turn_idx: 3 + +test_cases: + - test_case: user_is_referred_to_human_after_2_clarifications + fixtures: + - route_to_calm + steps: + - user: cash + metadata: duplicate_message_1 + assertions: + - pattern_clarification_contains: + - 'transfer money' + - 'check your balance' + - slot_was_set: + - name: clarification_count + value: 1 + - bot_uttered: + utter_name: utter_clarification_options_rasa + - user: cash + metadata: duplicate_message_2 + assertions: + - pattern_clarification_contains: + - 'transfer money' + - 'check your balance' + - slot_was_set: + - name: clarification_count + value: 2 + - bot_uttered: + utter_name: utter_clarification_options_rasa + - user: cash + metadata: duplicate_message_3 + assertions: + - slot_was_set: + - name: clarification_count + value: 3 + - flow_started: pattern_human_handoff diff --git a/e2e_tests_with_assertions/passing/flow_guards/user_is_referred_to_human_after_3_portfolio_check_auth_fails.yml b/e2e_tests_with_assertions/passing/flow_guards/user_is_referred_to_human_after_3_portfolio_check_auth_fails.yml new file mode 100644 index 0000000..fd3826b --- /dev/null +++ b/e2e_tests_with_assertions/passing/flow_guards/user_is_referred_to_human_after_3_portfolio_check_auth_fails.yml @@ -0,0 +1,63 @@ +fixtures: + - route_to_calm: + - route_session_to_calm: True + +metadata: +- duplicate_message_1: + turn_idx: 1 +- duplicate_message_2: + turn_idx: 2 +- duplicate_message_3: + turn_idx: 3 + +test_cases: + - test_case: user_is_referred_to_human_after_3_portfolio_check_auth_fails + fixtures: + - route_to_calm + steps: + - user: I want to check my portfolio + assertions: + - bot_uttered: + utter_name: utter_ask_user_name + - user: John + metadata: duplicate_message_1 + assertions: + - bot_uttered: + utter_name: utter_ask_user_password + - user: "1234" + metadata: duplicate_message_1 + assertions: + - bot_uttered: + utter_name: utter_authentication_failed + - slot_was_set: + - name: login_failed_attempts + value: 1 + - bot_uttered: + utter_name: utter_ask_user_name + - user: John + metadata: duplicate_message_2 + assertions: + - bot_uttered: + utter_name: utter_ask_user_password + - user: "1234" + metadata: duplicate_message_2 + assertions: + - bot_uttered: + utter_name: utter_authentication_failed + - slot_was_set: + - name: login_failed_attempts + value: 2 + - bot_uttered: + utter_name: utter_ask_user_name + - user: John + metadata: duplicate_message_3 + assertions: + - bot_uttered: + utter_name: utter_ask_user_password + - user: "1234" + metadata: duplicate_message_3 + assertions: + - slot_was_set: + - name: login_failed_attempts + value: 3 + - flow_started: pattern_human_handoff