From 16598ec804cb22b5d485457ac71ea9ee8927ed30 Mon Sep 17 00:00:00 2001 From: Sheldon Regular Date: Thu, 30 Nov 2023 17:58:36 -0500 Subject: [PATCH] added a verified check to the agent after the connectionless proof request Signed-off-by: Sheldon Regular --- aries-mobile-tests/agent_controller_client.py | 16 +++++++++++++++- .../aath/aath_verifier_agent_interface.py | 12 ++++++++++-- .../features/bc_wallet/proof.feature | 2 +- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/aries-mobile-tests/agent_controller_client.py b/aries-mobile-tests/agent_controller_client.py index fc032ce0..e2676b41 100644 --- a/aries-mobile-tests/agent_controller_client.py +++ b/aries-mobile-tests/agent_controller_client.py @@ -107,7 +107,21 @@ def expected_agent_state(agent_url, protocol_txt, thread_id, status_txt, wait_ti return True sleep(sleep_time) - print("From", agent_url, "Expected state", status_txt, "but received", state, ", with a response status of", resp_status) +def expected_agent_proof_state(agent_url, thread_id, status_txt, wait_time=2.0, sleep_time=0.5): + sleep(sleep_time) + verified = "False" + if type(status_txt) != list: + status_txt = [status_txt] + for i in range(int(wait_time)): + (resp_status, resp_text) = agent_controller_GET(agent_url + "/agent/command/", "proof", id=thread_id) + if resp_status == 200: + resp_json = json.loads(resp_text) + verified = resp_json["verified"] + if verified in status_txt: + return True + sleep(sleep_time) + + print("From", agent_url, "Expected state", status_txt, "but received", verified, ", with a response status of", resp_status) return False def check_if_already_connected(context, sender, receiver): diff --git a/aries-mobile-tests/agent_factory/aath/aath_verifier_agent_interface.py b/aries-mobile-tests/agent_factory/aath/aath_verifier_agent_interface.py index b58085a0..5092e053 100644 --- a/aries-mobile-tests/agent_factory/aath/aath_verifier_agent_interface.py +++ b/aries-mobile-tests/agent_factory/aath/aath_verifier_agent_interface.py @@ -6,7 +6,7 @@ from agent_factory.aath.aath_agent_interface import AATHAgentInterface import json from agent_test_utils import get_qr_code_from_invitation -from agent_controller_client import agent_controller_GET, agent_controller_POST, expected_agent_state, setup_already_connected +from agent_controller_client import agent_controller_GET, agent_controller_POST, expected_agent_state, setup_already_connected, expected_agent_proof_state class AATHVerifierAgentInterface(VerifierAgentInterface, AATHAgentInterface): @@ -86,4 +86,12 @@ def send_proof_request(self, version=1, request_for_proof=None, connectionless=F qrcode = get_qr_code_from_invitation(self.proof_request_json, print_qr_code=False, save_qr_code=True) return qrcode - + def proof_request_verified(self): + """return true if proof request verified""" + thread_id = self.create_request_json["record"]["thread_id"] + return expected_agent_proof_state( + self.endpoint, + thread_id=thread_id, + status_txt=["true"], + wait_time=10.0, + ) \ No newline at end of file diff --git a/aries-mobile-tests/features/bc_wallet/proof.feature b/aries-mobile-tests/features/bc_wallet/proof.feature index 08901e8a..c532153b 100644 --- a/aries-mobile-tests/features/bc_wallet/proof.feature +++ b/aries-mobile-tests/features/bc_wallet/proof.feature @@ -242,7 +242,7 @@ Feature: Proof | cred_data_photo_id_revokable | proof_photo_id_revokable | now:now | - @T009-Proof @critical @AcceptanceTest @Connectionless + @T009-Proof @critical @AcceptanceTest @Connectionless @wip @depricated Scenario Outline: Pan Canadian Trust Framework Member aquires access to PCTF Chat with a connectionless proof request Given the PCTF Member has setup thier Wallet And the PCTF member has an Unverified Person