Skip to content

Commit

Permalink
Merge pull request #218 from nodlesh/fix-connectionless-oob-tests
Browse files Browse the repository at this point in the history
BCW added a verified check to the agent after the connectionless proof
  • Loading branch information
nodlesh authored Nov 30, 2023
2 parents 479d329 + 16598ec commit 92d4104
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
16 changes: 15 additions & 1 deletion aries-mobile-tests/agent_controller_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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,
)
2 changes: 1 addition & 1 deletion aries-mobile-tests/features/bc_wallet/proof.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 <credential>
Expand Down

0 comments on commit 92d4104

Please sign in to comment.