Skip to content

Commit c5f1800

Browse files
authored
Merge pull request #6 from browserstack/new_sample_app
Changes for new sample app
2 parents f85e0aa + fdae347 commit c5f1800

File tree

3 files changed

+18
-22
lines changed

3 files changed

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

ios/features/single.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Feature: Search in WordPress App
1+
Feature: Verify if displayed text matches entered text
22

33
Background:
4-
Given I try to login using WordPress App
4+
Given I try to find Text Button in Sample App
55

6-
Scenario: Login for a User
7-
When I type in "[email protected]" in the email field
8-
Then I should get a registration error
6+
Scenario: Type a term
7+
When I type in "[email protected]" in the Text Input field
8+
Then I should get the entered text in the Text Output field
Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
1-
When /^I try to login using WordPress App/ do
2-
$wait.until { $driver.find_element(:accessibility_id, "Log In").displayed? }
3-
$driver.find_element(:accessibility_id, "Log In").click
1+
When /^I try to find Text Button in Sample App/ do
2+
$wait.until { $driver.find_element(:accessibility_id, "Text Button").displayed? }
3+
$driver.find_element(:accessibility_id, "Text Button").click
44
end
55

6-
When("I type in {string} in the email field") do |search_keyword|
7-
$wait.until { $driver.find_element(:accessibility_id, "Email address").displayed? }
8-
search_box = $driver.find_element(:accessibility_id, "Email address")
9-
search_box.send_keys(search_keyword)
10-
11-
$wait.until { $driver.find_element(:accessibility_id, "Next").displayed? }
12-
$driver.find_element(:accessibility_id, "Next").click
6+
When("I type in {string} in the Text Input field") do |text|
7+
puts "Received #{text}"
8+
$wait.until { $driver.find_element(:accessibility_id, "Text Input").displayed? }
9+
text_input = $driver.find_element(:accessibility_id, "Text Input")
10+
text_input.send_keys(text+"\n")
11+
sleep 5
1312
end
1413

15-
Then /^I should get a registration error$/ do
14+
Then /^I should get the entered text in the Text Output field$/ do
1615
sleep 5
17-
text_elements = $driver.find_elements(:xpath, "//XCUIElementTypeStaticText")
18-
text_elements.size.should > 0
19-
20-
error_element = text_elements.select { |element| !element.nil? && element.text.match(/not registered/) }.first
21-
error_element.text.should include("not registered on WordPress.com")
16+
text_output = $driver.find_element(:accessibility_id, "Text Output")
17+
text_output.text.should eq("[email protected]")
2218
end

0 commit comments

Comments
 (0)