diff --git a/ios/BrowserStackIOS.py b/ios/BrowserStackIOS.py index 9751ace..d728a44 100644 --- a/ios/BrowserStackIOS.py +++ b/ios/BrowserStackIOS.py @@ -15,24 +15,25 @@ driver = webdriver.Remote("http://" + userName + ":" + accessKey + "@hub-cloud.browserstack.com/wd/hub", desired_caps) -login_button = WebDriverWait(driver, 30).until( - EC.element_to_be_clickable((MobileBy.ACCESSIBILITY_ID, "Log In")) +text_button = WebDriverWait(driver, 30).until( + EC.element_to_be_clickable((MobileBy.ACCESSIBILITY_ID, "Text Button")) ) -login_button.click() +text_button.click() -email_input = WebDriverWait(driver, 30).until( - EC.element_to_be_clickable((MobileBy.ACCESSIBILITY_ID, "Email address")) +text_input = WebDriverWait(driver, 30).until( + EC.element_to_be_clickable((MobileBy.ACCESSIBILITY_ID, "Text Input")) ) -email_input.send_keys("hello@browserstack.com") - -driver.find_element_by_accessibility_id("Next").click() +text_input.send_keys("hello@browserstack.com"+"\n") + time.sleep(5) -text_elements = driver.find_elements_by_xpath("//XCUIElementTypeStaticText") -assert(len(text_elements) > 0) -elements = filter( - lambda x: x and x.__contains__("not registered on WordPress.com"), - [x.text for x in text_elements] +text_output = WebDriverWait(driver, 30).until( + EC.element_to_be_clickable((MobileBy.ACCESSIBILITY_ID, "Text Output")) ) -assert(len(elements) > 0) -driver.quit() + +if text_output!=None and text_output.text=="hello@browserstack.com": + assert True +else: + assert False + +driver.quit() \ No newline at end of file diff --git a/ios/README.md b/ios/README.md index d0e2442..e245246 100644 --- a/ios/README.md +++ b/ios/README.md @@ -15,7 +15,7 @@ $ pip install -r requirements.txt curl -u "username:accesskey" -X POST "https://api.browserstack.com/app-automate/upload" -F "file=@/path/to/app/file/Application-debug.ipa" ``` -- If you do not have an .ipa file and looking to simply try App Automate, you can download our [sample app](https://www.browserstack.com/app-automate/sample-apps/ios/WordPressSample.ipa) and upload to the BrowserStack servers using the above API. +- If you do not have an .ipa file and looking to simply try App Automate, you can download our [sample app](https://www.browserstack.com/app-automate/sample-apps/ios/BStackSampleApp.ipa) and upload to the BrowserStack servers using the above API. - For LocalSample tests, you can use our [local sample app](https://www.browserstack.com/app-automate/sample-apps/ios/LocalSample.ipa). - Update the desired capability "app" with the App URL returned from the above API call