From 54a3248a4bdab9a70d06bfaf272a70a724b3fe81 Mon Sep 17 00:00:00 2001 From: srishti11010 Date: Wed, 2 May 2018 16:55:08 +0530 Subject: [PATCH] Changes for new sample app --- ios/README.md | 2 +- ios/single_test.rb | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ios/README.md b/ios/README.md index 54a5ef3..7626bac 100644 --- a/ios/README.md +++ b/ios/README.md @@ -14,7 +14,7 @@ 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) +- 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 running local 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 diff --git a/ios/single_test.rb b/ios/single_test.rb index 67be4f0..0b1d409 100644 --- a/ios/single_test.rb +++ b/ios/single_test.rb @@ -21,23 +21,23 @@ driver = appium_driver.start_driver wait = Selenium::WebDriver::Wait.new(:timeout => 30) -wait.until { driver.find_element(:accessibility_id, "Log In").displayed? } -login_button = driver.find_element(:accessibility_id, "Log In") -login_button.click - -wait.until { driver.find_element(:accessibility_id, "Email address").displayed? } -email_input = driver.find_element(:accessibility_id, "Email address") -email_input.send_keys("hello@browserstack.com") - -wait.until { driver.find_element(:accessibility_id, "Next").displayed? } -driver.find_element(:accessibility_id, "Next").click +wait.until { driver.find_element(:accessibility_id, "Text Button").displayed? } +textButton = driver.find_element(:accessibility_id, "Text Button") +textButton.click + +wait.until { driver.find_element(:accessibility_id, "Text Input").displayed? } +textInput = driver.find_element(:accessibility_id, "Text Input") +textInput.send_keys("hello@browserstack.com"+"\n") + sleep 5 + +wait.until { driver.find_element(:accessibility_id, "Text Output").displayed? } +result = driver.find_element(:accessibility_id, "Text Output") -results = driver.find_elements(:xpath, "//XCUIElementTypeStaticText") -if results.map(&:text).any?{|x| !x.nil? && x.match('not registered on WordPress.com')} +if (!result.nil?) && (result.text.eql? "hello@browserstack.com") puts "Test Passed" else puts "Test Failed" end -driver.quit +driver.quit \ No newline at end of file