diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fb8bf09..403a659 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: aries-mobile-test-harness/aries-mobile-tests/*.png retention-days: 7 diff --git a/.github/workflows/run-test-harness/action.yml b/.github/workflows/run-test-harness/action.yml index 934faff..4e9b325 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: aries-mobile-test-harness/aries-mobile-tests/*.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 92385d1..3e35c83 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 @@ -80,7 +80,7 @@ def connected(self): def send_credential(self, actor:str, credential_offer=None, version=1, schema=None, revokable=False): """send a credential to the holder, returns a qr code for holder to connect to""" self._who_do_you_want_to_be_page = self._bc_wallet_showcase_main_page.select_get_started() - self.driver.minimize_window() + #self.driver.minimize_window() self.driver.maximize_window() self.driver.save_screenshot('who_do_you_want_to_be_page.png') if actor == "Student": @@ -89,7 +89,7 @@ def send_credential(self, actor:str, credential_offer=None, version=1, schema=No self._who_do_you_want_to_be_page.select_lawyer() else: raise Exception(f"Unknown actor type {actor}") - self.driver.minimize_window() + #self.driver.minimize_window() self.driver.maximize_window() 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() @@ -97,7 +97,7 @@ def send_credential(self, actor:str, credential_offer=None, version=1, schema=No self._install_bc_wallet_page = self._lets_get_started_page.select_next() 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.minimize_window() self.driver.maximize_window() self.driver.save_screenshot('connect_with_best_bc_college_page.png') qrcode = self._connect_with_best_bc_college_page.get_qr_code() 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 5976021..c6cd50c 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 @@ -89,7 +89,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() - self.driver.minimize_window() + self.driver.save_screenshot('Verifier_who_do_you_want_to_be_page.png') + #self.driver.minimize_window() self.driver.maximize_window() if actor == "Student": self._who_do_you_want_to_be_page.select_student() @@ -97,35 +98,44 @@ def send_proof_request(self, actor:str, proof:str, version=1, request_for_proof= self._who_do_you_want_to_be_page.select_lawyer() else: raise Exception(f"Unknown actor type {actor}") - self.driver.minimize_window() + #self.driver.minimize_window() self.driver.maximize_window() self._lets_get_started_page = self._who_do_you_want_to_be_page.select_next() + self.driver.save_screenshot('Verifier_lets_get_started_page.png') self._install_bc_wallet_page = self._lets_get_started_page.select_next() + self.driver.save_screenshot('Verifier_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.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() + self.driver.save_screenshot('Verifier_youre_all_set_page.png') self._using_your_credentials_page = self._youre_all_set_page.select_finish() + 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() - self.driver.minimize_window() + 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() - self.driver.minimize_window() + 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() - self.driver.minimize_window() + 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() - self.driver.minimize_window() + self.driver.save_screenshot('Verifier_start_booking_the_room_page.png') + #self.driver.minimize_window() self.driver.maximize_window() qrcode = self._start_booking_the_room_page.get_qr_code() - return add_border_to_qr_code(qrcode) + return add_border_to_qr_code(qrcode, border_size=50) def proof_success(self, proof_result): diff --git a/aries-mobile-tests/agent_factory/bc_showcase/pageobjects/connect_with_best_bc_college_page.py b/aries-mobile-tests/agent_factory/bc_showcase/pageobjects/connect_with_best_bc_college_page.py index e33841c..d308b0b 100644 --- a/aries-mobile-tests/agent_factory/bc_showcase/pageobjects/connect_with_best_bc_college_page.py +++ b/aries-mobile-tests/agent_factory/bc_showcase/pageobjects/connect_with_best_bc_college_page.py @@ -18,6 +18,7 @@ class ConnectWithBestBCCollegePage(WebBasePage): def on_this_page(self): + self.wait_for_page_load_complete() return super().on_this_page(self.on_this_page_text_locator) def get_qr_code(self): diff --git a/aries-mobile-tests/agent_factory/candy_uvp/pageobjects/webbasepage.py b/aries-mobile-tests/agent_factory/candy_uvp/pageobjects/webbasepage.py index 5a50d5c..135b8ec 100644 --- a/aries-mobile-tests/agent_factory/candy_uvp/pageobjects/webbasepage.py +++ b/aries-mobile-tests/agent_factory/candy_uvp/pageobjects/webbasepage.py @@ -12,10 +12,18 @@ class WebBasePage(object): def on_this_page(self, locator, timeout=10): if type(locator) is tuple: - if self.find_by(locator, timeout): + # if self.find_by(locator, timeout): + # return True + # else: + # return False + try: + self.find_by(locator, timeout) return True - else: + except Exception as e: + # print the exception + print(e) return False + else: found_locator = False i = 0 @@ -57,4 +65,7 @@ def find_multiple_by(self, locator_tpl: tuple, timeout=20): f"Could not find elements {locator_tpl[0]} with Locator {locator_tpl[1]}") def get_page_source(self): - return self.driver.page_source \ No newline at end of file + return self.driver.page_source + + def wait_for_page_load_complete(self, timeout=10): + WebDriverWait(self.driver, timeout).until(lambda driver: driver.execute_script('return document.readyState') == 'complete') \ No newline at end of file diff --git a/aries-mobile-tests/features/steps/bc_wallet/proof.py b/aries-mobile-tests/features/steps/bc_wallet/proof.py index 35af9d2..da1a840 100644 --- a/aries-mobile-tests/features/steps/bc_wallet/proof.py +++ b/aries-mobile-tests/features/steps/bc_wallet/proof.py @@ -133,8 +133,11 @@ def step_impl(context): @then('holder is brought to the proof request') def step_impl(context): + # Sometimes the proof request comes in a goal code and the user never goes to the Contact Page. + # In this case check that the ProofRequestPage is in context and if not, create it. + if hasattr(context, 'thisProofRequestPage') == False: + context.thisProofRequestPage = ProofRequestPage(context.driver) - #context.thisProofRequestPage = ProofRequestPage(context.driver) assert context.thisProofRequestPage.on_this_page()