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
2 changes: 1 addition & 1 deletion ios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $ npm install wd
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
46 changes: 15 additions & 31 deletions ios/singleTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,27 @@ driver = wd.promiseRemote("http://hub-cloud.browserstack.com/wd/hub");
driver
.init(desiredCaps)
.then(function () {
return driver.waitForElementById('Log In', asserters.isDisplayed && asserters.isEnabled, 30000);
return driver.waitForElementById('Text Button', asserters.isDisplayed && asserters.isEnabled, 30000);
})
.then(function (loginButton) {
return loginButton.click();
.then(function (textButton) {
return textButton.click();
})
.then(function () {
return driver.waitForElementById('Email address', asserters.isDisplayed && asserters.isEnabled, 30000);
return driver.waitForElementById('Text Input', asserters.isDisplayed && asserters.isEnabled, 30000);
})
.then(function (emailInput) {
return emailInput.sendKeys("hello@browserstack.com");
.then(function (textInput) {
return textInput.sendKeys("hello@browserstack.com"+"\n");
})
.then(function () {
return driver.waitForElementById('Next', asserters.isDisplayed, 30000);
})
.then(function (nextButton) {
return nextButton.click().then(function() {
sleep.sleep(5);
return driver.waitForElementById('Text Output', asserters.isDisplayed && asserters.isEnabled, 30000);
})
.then(function (textOutput) {
return textOutput.text().then(function(value) {
if (value === "hello@browserstack.com")
assert(true);
else
assert(false);
});
})
.then(function() {
return driver.waitForElementsByXPath("//XCUIElementTypeStaticText", asserters.isDisplayed, 30000);
})
.then(function (textElements) {
return Q().then(function () {
return textElements.map(function (textElement) {
if (textElement === null) {
return;
} else {
return textElement.text().then(function(value) {
if (value.indexOf('not registered') !== -1) {
console.log(value);
assert(value.indexOf('This email address is not registered on WordPress.com') !== -1);
}
});
}
})
}).all()
})
.fin(function() { return driver.quit(); })
.done();
.done();