Skip to content

Commit 123fd6d

Browse files
authored
Merge pull request #7 from browserstack/new_sample_app
Changes for new sample app
2 parents 95e2bfe + d6b9606 commit 123fd6d

File tree

2 files changed

+16
-32
lines changed

2 files changed

+16
-32
lines changed

ios/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $ npm install wd
1414
curl -u "username:accesskey" -X POST "https://api.browserstack.com/app-automate/upload" -F "file=@/path/to/app/file/Application-debug.ipa"
1515
```
1616

17-
- 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.
17+
- 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.
1818
- For LocalSample tests, you can use our [local sample app](https://www.browserstack.com/app-automate/sample-apps/ios/LocalSample.ipa).
1919
- Update the desired capability "app" with the App URL returned from the above API call
2020

ios/singleTest.js

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,43 +18,27 @@ driver = wd.promiseRemote("http://hub-cloud.browserstack.com/wd/hub");
1818
driver
1919
.init(desiredCaps)
2020
.then(function () {
21-
return driver.waitForElementById('Log In', asserters.isDisplayed && asserters.isEnabled, 30000);
21+
return driver.waitForElementById('Text Button', asserters.isDisplayed && asserters.isEnabled, 30000);
2222
})
23-
.then(function (loginButton) {
24-
return loginButton.click();
23+
.then(function (textButton) {
24+
return textButton.click();
2525
})
2626
.then(function () {
27-
return driver.waitForElementById('Email address', asserters.isDisplayed && asserters.isEnabled, 30000);
27+
return driver.waitForElementById('Text Input', asserters.isDisplayed && asserters.isEnabled, 30000);
2828
})
29-
.then(function (emailInput) {
30-
return emailInput.sendKeys("[email protected]");
29+
.then(function (textInput) {
30+
return textInput.sendKeys("[email protected]"+"\n");
3131
})
3232
.then(function () {
33-
return driver.waitForElementById('Next', asserters.isDisplayed, 30000);
34-
})
35-
.then(function (nextButton) {
36-
return nextButton.click().then(function() {
37-
sleep.sleep(5);
33+
return driver.waitForElementById('Text Output', asserters.isDisplayed && asserters.isEnabled, 30000);
34+
})
35+
.then(function (textOutput) {
36+
return textOutput.text().then(function(value) {
37+
if (value === "[email protected]")
38+
assert(true);
39+
else
40+
assert(false);
3841
});
3942
})
40-
.then(function() {
41-
return driver.waitForElementsByXPath("//XCUIElementTypeStaticText", asserters.isDisplayed, 30000);
42-
})
43-
.then(function (textElements) {
44-
return Q().then(function () {
45-
return textElements.map(function (textElement) {
46-
if (textElement === null) {
47-
return;
48-
} else {
49-
return textElement.text().then(function(value) {
50-
if (value.indexOf('not registered') !== -1) {
51-
console.log(value);
52-
assert(value.indexOf('This email address is not registered on WordPress.com') !== -1);
53-
}
54-
});
55-
}
56-
})
57-
}).all()
58-
})
5943
.fin(function() { return driver.quit(); })
60-
.done();
44+
.done();

0 commit comments

Comments
 (0)