Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions ios/BrowserStackIOS.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion ios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down