From 9d32f3aff88b1b6ff22066331b8a6321ad0a5c09 Mon Sep 17 00:00:00 2001 From: Sheldon Regular Date: Thu, 7 Dec 2023 17:28:53 -0500 Subject: [PATCH] Debugging BCW Showcase failures in Pipeline Signed-off-by: Sheldon Regular --- .github/workflows/main.yml | 4 ++-- .github/workflows/run-test-harness/action.yml | 2 +- .../bc_showcase_issuer_agent_interface.py | 11 ++++++++++ .../bc_showcase_verifier_agent_interface.py | 21 +++++++++++++++++++ .../features/steps/bc_wallet/bc_showcase.py | 2 -- .../steps/bc_wallet/credential_offer.py | 6 ++++++ .../bc_wallet/credential_on_the_way.py | 2 +- 7 files changed, 42 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 403a659c..5c423741 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -100,7 +100,7 @@ jobs: with: username: ${{ secrets.SAUCE_USERNAME }} accessKey: ${{ secrets.SAUCE_ACCESS_KEY }} - directDomains: aries-mediator-agent.vonx.io,apple.com + directDomains: aries-mediator-agent.vonx.io,apple.com,*.apple.com,ppq.apple.com,bc-wallet-demo-dev.apps.silver.devops.gov.bc.ca # tunnelIdentifier: github-action-tunnel # region: us-west-1 @@ -223,7 +223,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: test-screenshots_from_main - path: aries-mobile-test-harness/aries-mobile-tests/*.png + path: *.png retention-days: 7 diff --git a/.github/workflows/run-test-harness/action.yml b/.github/workflows/run-test-harness/action.yml index 4e9b325f..1a4177b4 100644 --- a/.github/workflows/run-test-harness/action.yml +++ b/.github/workflows/run-test-harness/action.yml @@ -69,7 +69,7 @@ runs: uses: actions/upload-artifact@v3 with: name: test-screenshots_from_run_action - path: aries-mobile-test-harness/aries-mobile-tests/*.png + path: *.png retention-days: 7 branding: diff --git a/aries-mobile-tests/agent_factory/bc_showcase/bc_showcase_issuer_agent_interface.py b/aries-mobile-tests/agent_factory/bc_showcase/bc_showcase_issuer_agent_interface.py index 3e35c83a..2dcc64c7 100644 --- a/aries-mobile-tests/agent_factory/bc_showcase/bc_showcase_issuer_agent_interface.py +++ b/aries-mobile-tests/agent_factory/bc_showcase/bc_showcase_issuer_agent_interface.py @@ -3,6 +3,7 @@ """ import base64 import io +import time from agent_factory.issuer_agent_interface import IssuerAgentInterface from agent_test_utils import add_border_to_qr_code from sys import platform @@ -82,6 +83,8 @@ def send_credential(self, actor:str, credential_offer=None, version=1, schema=No self._who_do_you_want_to_be_page = self._bc_wallet_showcase_main_page.select_get_started() #self.driver.minimize_window() self.driver.maximize_window() + #pause 3 second to let page loads + time.sleep(3) self.driver.save_screenshot('who_do_you_want_to_be_page.png') if actor == "Student": self._who_do_you_want_to_be_page.select_student() @@ -91,14 +94,22 @@ def send_credential(self, actor:str, credential_offer=None, version=1, schema=No raise Exception(f"Unknown actor type {actor}") #self.driver.minimize_window() self.driver.maximize_window() + #pause 3 second to let page loads + time.sleep(3) self.driver.save_screenshot('who_do_you_want_to_be_page_actor_select.png') self._lets_get_started_page = self._who_do_you_want_to_be_page.select_next() + #pause 3 second to let page loads + time.sleep(3) self.driver.save_screenshot('lets_get_started_page.png') self._install_bc_wallet_page = self._lets_get_started_page.select_next() + #pause 3 second to let page loads + time.sleep(3) self.driver.save_screenshot('install_bc_wallet_page.png') self._connect_with_best_bc_college_page = self._install_bc_wallet_page.select_skip() #self.driver.minimize_window() self.driver.maximize_window() + #pause 3 second to let page loads + time.sleep(3) self.driver.save_screenshot('connect_with_best_bc_college_page.png') qrcode = self._connect_with_best_bc_college_page.get_qr_code() return add_border_to_qr_code(qrcode) diff --git a/aries-mobile-tests/agent_factory/bc_showcase/bc_showcase_verifier_agent_interface.py b/aries-mobile-tests/agent_factory/bc_showcase/bc_showcase_verifier_agent_interface.py index c6cd50c3..e7a96e0a 100644 --- a/aries-mobile-tests/agent_factory/bc_showcase/bc_showcase_verifier_agent_interface.py +++ b/aries-mobile-tests/agent_factory/bc_showcase/bc_showcase_verifier_agent_interface.py @@ -3,6 +3,7 @@ """ from asyncio import sleep +import time from agent_factory.verifier_agent_interface import VerifierAgentInterface from agent_test_utils import add_border_to_qr_code from sys import platform @@ -89,6 +90,8 @@ def connected(self): def send_proof_request(self, actor:str, proof:str, version=1, request_for_proof=None, connectionless=False): """create a proof request """ self._who_do_you_want_to_be_page = self._bc_wallet_showcase_main_page.select_get_started() + #pause 3 second to let page loads + time.sleep(3) self.driver.save_screenshot('Verifier_who_do_you_want_to_be_page.png') #self.driver.minimize_window() self.driver.maximize_window() @@ -101,34 +104,52 @@ def send_proof_request(self, actor:str, proof:str, version=1, request_for_proof= #self.driver.minimize_window() self.driver.maximize_window() self._lets_get_started_page = self._who_do_you_want_to_be_page.select_next() + #pause 3 second to let page loads + time.sleep(3) self.driver.save_screenshot('Verifier_lets_get_started_page.png') self._install_bc_wallet_page = self._lets_get_started_page.select_next() + #pause 3 second to let page loads + time.sleep(3) self.driver.save_screenshot('Verifier_install_bc_wallet_page.png') self._connect_with_best_bc_college_page = self._install_bc_wallet_page.select_skip() + #pause 3 second to let page loads + time.sleep(3) self.driver.save_screenshot('Verifier_connect_with_best_bc_college_page.png') #self.driver.minimize_window() self.driver.maximize_window() self._youre_all_set_page = self._connect_with_best_bc_college_page.select_i_already_have_my_credential() + #pause 3 second to let page loads + time.sleep(3) self.driver.save_screenshot('Verifier_youre_all_set_page.png') self._using_your_credentials_page = self._youre_all_set_page.select_finish() + #pause 3 second to let page loads + time.sleep(3) self.driver.save_screenshot('Verifier_using_your_credentials_page.png') if proof == "Cool Clothes Online": self._getting_a_student_discount_page = self._using_your_credentials_page.select_cool_clothes_online_start() + #pause 3 second to let page loads + time.sleep(3) self.driver.save_screenshot('Verifier_getting_a_student_discount_page.png') #self.driver.minimize_window() self.driver.maximize_window() self._start_proving_youre_a_student_page = self._getting_a_student_discount_page.select_start() + #pause 3 second to let page loads + time.sleep(3) self.driver.save_screenshot('Verifier_start_proving_youre_a_student_page.png') #self.driver.minimize_window() self.driver.maximize_window() qrcode = self._start_proving_youre_a_student_page.get_qr_code() elif proof == "BestBC College": self._book_a_study_room_page = self._using_your_credentials_page.select_bestbc_college_start() + #pause 3 second to let page loads + time.sleep(3) self.driver.save_screenshot('Verifier_book_a_study_room_page.png') #self.driver.minimize_window() self.driver.maximize_window() self._start_booking_the_room_page = self._book_a_study_room_page.select_start() + #pause 3 second to let page loads + time.sleep(3) self.driver.save_screenshot('Verifier_start_booking_the_room_page.png') #self.driver.minimize_window() self.driver.maximize_window() diff --git a/aries-mobile-tests/features/steps/bc_wallet/bc_showcase.py b/aries-mobile-tests/features/steps/bc_wallet/bc_showcase.py index 89ac46a8..c4eefeed 100644 --- a/aries-mobile-tests/features/steps/bc_wallet/bc_showcase.py +++ b/aries-mobile-tests/features/steps/bc_wallet/bc_showcase.py @@ -25,7 +25,6 @@ def step_impl(context): context.device_service_handler.inject_qrcode(qrcode) context.execute_steps(''' Given they Scan the credential offer QR Code - When 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 @@ -44,7 +43,6 @@ def step_impl(context): context.device_service_handler.inject_qrcode(qrcode) context.execute_steps(''' Given they Scan the proof request QR Code - When the holder opens the proof request Then holder is brought to the proof request ''') diff --git a/aries-mobile-tests/features/steps/bc_wallet/credential_offer.py b/aries-mobile-tests/features/steps/bc_wallet/credential_offer.py index de9aacf3..307c351e 100644 --- a/aries-mobile-tests/features/steps/bc_wallet/credential_offer.py +++ b/aries-mobile-tests/features/steps/bc_wallet/credential_offer.py @@ -205,6 +205,11 @@ def step_impl(context): @then('once the credential arrives they are informed that the Credential is added to your wallet') @when('once the credential arrives they are informed that the Credential is added to your wallet') def step_impl(context): + # Check if we are already on the credential added page. This happens if comms is fast enough. + context.thisCredentialAddedPage = CredentialAddedPage(context.driver) + if context.thisCredentialAddedPage.on_this_page(): + return + try: context.thisCredentialAddedPage = context.thisCredentialOnTheWayPage.wait_for_credential() assert context.thisCredentialAddedPage.on_this_page() @@ -212,6 +217,7 @@ def step_impl(context): if "Unable to accept credential offer" in str(e) or "TimeoutException" in str(e): raise e context.thisHomePage = context.thisCredentialOnTheWayPage.select_home() + #context.issuer.driver.save_screenshot('Didnt_get_credential.png') @then('they select Done') diff --git a/aries-mobile-tests/pageobjects/bc_wallet/credential_on_the_way.py b/aries-mobile-tests/pageobjects/bc_wallet/credential_on_the_way.py index 83ee90a5..5c3f75c0 100644 --- a/aries-mobile-tests/pageobjects/bc_wallet/credential_on_the_way.py +++ b/aries-mobile-tests/pageobjects/bc_wallet/credential_on_the_way.py @@ -32,7 +32,7 @@ def select_home(self): else: raise Exception(f"App not on the {type(self)} page") - def wait_for_credential(self, timeout=300): + def wait_for_credential(self, timeout=120): # Wait for the Credential On the way indicator to disappear try: