Skip to content

Commit 6587b5e

Browse files
authored
Merge pull request #14 from browserstack/new_sample_app
Changes for new sample app
2 parents 2417cd6 + e590966 commit 6587b5e

File tree

2 files changed

+12
-21
lines changed

2 files changed

+12
-21
lines changed

ios/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
curl -u "username:accesskey" -X POST "https://api.browserstack.com/app-automate/upload" -F "file=@/path/to/app/file/Application-debug.ipa"
1111
```
1212

13-
* If you do not have an .ipa file and looking to simply try App Automate, [you can download our sample app and upload](https://www.browserstack.com/app-automate/sample-apps/ios/WordPressSample.ipa)
13+
* If you do not have an .ipa file and looking to simply try App Automate, [you can download our sample app and upload](https://www.browserstack.com/app-automate/sample-apps/ios/BStackSampleApp.ipa)
1414
to the BrowserStack servers using the above API.
1515
* Update the desired capability "app" with the App URL returned from the above API call
1616
* To run a single test, run `mvn test -P single`

ios/src/test/java/com/browserstack/SingleTest.java

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,18 @@ public class SingleTest extends BrowserStackJUnitTest {
1616

1717
@Test
1818
public void test() throws Exception {
19-
IOSElement loginButton = (IOSElement) new WebDriverWait(driver, 30).until(
20-
ExpectedConditions.elementToBeClickable(MobileBy.AccessibilityId("Log In")));
21-
loginButton.click();
22-
IOSElement emailTextField = (IOSElement) new WebDriverWait(driver, 30).until(
23-
ExpectedConditions.elementToBeClickable(MobileBy.AccessibilityId("Email address")));
24-
emailTextField.sendKeys("[email protected]");
25-
26-
driver.findElementByAccessibilityId("Next").click();
19+
IOSElement textButton = (IOSElement) new WebDriverWait(driver, 30).until(
20+
ExpectedConditions.elementToBeClickable(MobileBy.AccessibilityId("Text Button")));
21+
textButton.click();
22+
IOSElement textInput = (IOSElement) new WebDriverWait(driver, 30).until(
23+
ExpectedConditions.elementToBeClickable(MobileBy.AccessibilityId("Text Input")));
24+
textInput.sendKeys("[email protected]"+"\n");
25+
2726
Thread.sleep(5000);
2827

29-
List<IOSElement> textElements = driver.findElementsByXPath("//XCUIElementTypeStaticText");
30-
assertTrue(textElements.size() > 0);
31-
String matchedString = "";
32-
for(IOSElement textElement : textElements) {
33-
String textContent = textElement.getText();
34-
if(textContent != null && textContent.contains("not registered")) {
35-
matchedString = textContent;
36-
}
37-
}
38-
39-
System.out.println(matchedString);
40-
assertTrue(matchedString.contains("not registered on WordPress.com"));
28+
IOSElement textOutput = (IOSElement) new WebDriverWait(driver, 30).until(
29+
ExpectedConditions.elementToBeClickable(MobileBy.AccessibilityId("Text Output")));
30+
31+
assertEquals(textOutput.getText(),"[email protected]");
4132
}
4233
}

0 commit comments

Comments
 (0)