-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fix ios build and ui test script
- Loading branch information
Showing
5 changed files
with
72 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,10 @@ | |
|
||
from alttester import AltDriver, By | ||
|
||
from test import TestConfig | ||
|
||
sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'src')) | ||
from fetch_otp import EMAIL, fetch_code | ||
from fetch_otp import fetch_code | ||
|
||
# To run this test on an actual Android device: appium --base-path /wd/hub --allow-insecure chromedriver_autodownload | ||
class TestBase(unittest.TestCase): | ||
|
@@ -24,9 +26,7 @@ class TestBase(unittest.TestCase): | |
def setUpClass(cls): | ||
# https://appium.github.io/appium-xcuitest-driver/latest/preparation/real-device-config/ | ||
options = XCUITestOptions() | ||
options.app = "./Payload.ipa" | ||
options.show_xcode_log = True | ||
options.xcode_org_id = "APPLE_TEAM_ID" # Replace with Apple Team ID | ||
options.auto_accept_alerts = True | ||
|
||
cls.appium_driver = webdriver.Remote('https://hub-cloud.browserstack.com/wd/hub/', options=options) | ||
|
@@ -75,14 +75,14 @@ def test_1_pkce_login(self): | |
# Found email | ||
target_context = context | ||
|
||
email_field.send_keys("[email protected]") | ||
email_field.send_keys(TestConfig.EMAIL) | ||
submit_button = driver.find_element(by=AppiumBy.XPATH, value="//form/div/div/div[2]/button") | ||
submit_button.click() | ||
|
||
time.sleep(10) # Wait for OTP | ||
|
||
code = fetch_gmail_code() | ||
assert code, "Failed to fetch OTP from Gmail" | ||
code = fetch_code() | ||
assert code, "Failed to fetch OTP from MailSlurp" | ||
print(f"Successfully fetched OTP: {code}") | ||
|
||
# Unlike on Android, each digit must be entered into a separate input field on iOS. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters