Skip to content

Commit

Permalink
test: update imx register off-chain wait time
Browse files Browse the repository at this point in the history
  • Loading branch information
nattb8 committed Nov 10, 2024
1 parent 55c23d4 commit 7e15d1e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sample/Tests/src/fetch_otp.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

def get_mailslurp_client():
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = os.getenv('MAILSLURP_API_KEY')
configuration.api_key['x-api-key'] = '31750ed2e66c1fe56566877d5297fbdd6f8bba046942fab2909f495aeb7f1533' #os.getenv('MAILSLURP_API_KEY')
api_client = mailslurp_client.ApiClient(configuration)
waitfor_controller = WaitForControllerApi(api_client)
return waitfor_controller
Expand Down
13 changes: 11 additions & 2 deletions sample/Tests/test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,17 @@ def test_2_imx_functions(self):
# Register off-chain
self.altdriver.find_object(By.NAME, "RegisterOffchainBtn").tap()
self.assertEqual("Registering off-chain...", output.get_text())
time.sleep(20)
self.assertTrue("Passport account already registered" in output.get_text())

# Wait up to 3 times for "Passport account already registered" to appear
attempts = 0
while attempts < 3:
time.sleep(20)
if "Passport account already registered" in output.get_text():
break
attempts += 1

# Assert that the desired text is found after waiting
self.assertTrue("Passport account already registered" in output.get_text(), "Expected 'Passport account already registered' not found in output.")

# Get address
self.altdriver.find_object(By.NAME, "GetAddressBtn").tap()
Expand Down

0 comments on commit 7e15d1e

Please sign in to comment.