Skip to content

Commit

Permalink
Merge pull request #217 from nodlesh/fix-connectionless-oob-tests
Browse files Browse the repository at this point in the history
fixes to the connectionless oob tests
  • Loading branch information
nodlesh authored Nov 29, 2023
2 parents 1836af7 + 6ad0deb commit 479d329
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
import base64
from agent_factory.issuer_agent_interface import IssuerAgentInterface
from agent_test_utils import add_border_to_qr_code
from sys import platform
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
Expand Down Expand Up @@ -103,7 +104,8 @@ def send_credential(self, version=1, schema=None, credential_offer=None, revokab

qrcode = self._connect_with_issuer_page.get_qr_code()
self._issuing_credential_page = IssuingCredentialPage(self.driver)
return qrcode
#return qrcode
return add_border_to_qr_code(qrcode)


def restart_issue_credential(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,23 @@ class ConnectWithIssuerPage(WebBasePage):
def on_this_page(self):
return super().on_this_page(self.on_this_page_text_locator)

def get_qr_code(self):
# if self.on_this_page():
qrcode_element = self.find_by(self.qr_code_locator, wait_condition=WaitCondition.VISIBILITY_OF_ELEMENT_LOCATED)
self.driver.save_screenshot("qrcode.png")
#qrcode = Image.open("qrcode.png")
qrcode = base64.b64encode(open("qrcode.png", "rb").read())
return qrcode.decode('utf-8')
# def get_qr_code(self):
# # if self.on_this_page():
# qrcode_element = self.find_by(self.qr_code_locator, wait_condition=WaitCondition.VISIBILITY_OF_ELEMENT_LOCATED)
# self.driver.save_screenshot("qrcode.png")
# #qrcode = Image.open("qrcode.png")
# qrcode = base64.b64encode(open("qrcode.png", "rb").read())
# return qrcode.decode('utf-8')

# else:
# raise Exception(f"App not on the {type(self)} page")
# # else:
# # raise Exception(f"App not on the {type(self)} page")

def get_qr_code(self):
try:
qr_code = self.find_by(self.qr_code_locator, wait_condition=WaitCondition.VISIBILITY_OF_ELEMENT_LOCATED)
except Exception as e:
if not self.on_this_page():
raise Exception(f"App not on the {type(self)} page")
else:
raise e
return qr_code
4 changes: 2 additions & 2 deletions aries-mobile-tests/features/bc_wallet/proof.feature
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Feature: Proof
| cred_data_unverified_person |


@T009.1-Proof @critical @AcceptanceTest @Connectionless
@T009.1-Proof @critical @AcceptanceTest @Connectionless @oob
Scenario Outline: Pan Canadian Trust Framework Member aquires access with a connectionless proof request
Given the PCTF Member has setup thier Wallet
And the PCTF member has an Unverified Person <credential>
Expand All @@ -282,7 +282,7 @@ Feature: Proof
| cred_data_unverified_person | pcft_connectionless_proof |


@T009.1.debug-Proof @critical @AcceptanceTest @Connectionless @wip
@T009.1.debug-Proof @critical @AcceptanceTest @Connectionless @wip @oob
Scenario Outline: Pan Canadian Trust Framework Member aquires access with a connectionless proof request
Given the user has a connectionless <proof> request for access to PCTF
| issuer_agent_type |
Expand Down
3 changes: 3 additions & 0 deletions aries-mobile-tests/features/steps/bc_wallet/proof.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ def step_impl(context, credential):
Given the Holder receives a credential offer of {credential}
And they Scan the credential offer QR Code
And the Connecting completes successfully
And the holder opens the credential offer
Then holder is brought to the credential offer screen
When they select Accept
And the holder is informed that their credential is on the way with an indication of loading
Expand Down Expand Up @@ -456,6 +457,8 @@ def step_impl(context, proof):

context.device_service_handler.inject_qrcode(qrcode)

if "thisNavBar" not in context:
context.thisNavBar = NavBar(context.driver)
context.thisConnectingPage = context.thisNavBar.select_scan()
# This is connectionless and the connecting page doesn't last long. Assume we move quickly to the Proof Request
context.thisProofRequestPage = ProofRequestPage(context.driver)
Expand Down

0 comments on commit 479d329

Please sign in to comment.