feat: robotframework ios and android test suites are added
ADD
sample-code/robotframework/README.md
+Robot Framework Sample Code
+===========================
+
+Setup
+-----
+`pip install -r requirements.txt`
+
+Run Tests
+---------
+Test cases are located in the ``tests`` folder. They can be
+executed using the ``robot`` command::
+
+ robot tests/*.test.robot
+
+You can also run an iOS or Android case file/test::
+
+ robot tests/android_basic_interactions.test.robot
+ robot --test "Should find elements by ID" tests/android_*.test.robot
+
+Further Examples on how to prepare environment and run
+can be found at:
+
+ - [Robot Framework Appium Sample](https://github.com/serhatbolsu/robotframework-appium-sample)
+
+Run Tests in Sauce Labs::
+
+ export SAUCE_LABS=True
+ export SAUCE_USERNAME=<username>
+ export SAUCE_ACCESS_KEY=<access_key>
+ robot tests/android_basic_interactions.test.robot
+
+
+Generated Results
+-----------------
+After running tests you will get report and log in HTML format. Example
+files are also visible online in case you are not interested in running
+the sample yourself:
+
+- [report.html](https://serhatbolsu.github.io/robotframework-appium-sample/docs/report.html)
+- [log.html](https://serhatbolsu.github.io/robotframework-appium-sample/docs/log.html)
\ No newline at end of file

ADD
sample-code/robotframework/requirements.txt
+robotframework >= 3.1.1
+robotframework-appiumlibrary >= 1.5.0

ADD
sample-code/robotframework/resources/resource.robot
+*** Settings ***
+Library AppiumLibrary
+Library BuiltIn
+Library String
+Library OperatingSystem
+
+*** Variables ***
+${ANDROID_AUTOMATION_NAME} UIAutomator2
+${ANDROID_APP} ${CURDIR}/../../apps/ApiDemos-debug.apk
+${ANDROID_PLATFORM_NAME} Android
+${ANDROID_PLATFORM_VERSION} %{ANDROID_PLATFORM_VERSION=8.0}
+${ANDROID_APP_PACKAGE} io.appium.android.apis
+${ANDROID_DEVICE_NAME} %{ANDROID_DEVICE_NAME=Android Emulator}
+
+${IOS_AUTOMATION_NAME} XCUITest
+${IOS_APP} ${CURDIR}/../../apps/TestApp.app.zip
+${IOS_PLATFORM_NAME} iOS
+${IOS_PLATFORM_VERSION} %{IOS_PLATFORM_VERSION=12.2}
+${IOS_DEVICE_NAME} %{IOS_DEVICE_NAME=iPhone 8 Simulator}
+${EXECUTOR} http://127.0.0.1:4723/wd/hub
+
+
+*** Keywords ***
+Set Local Executor
+ return from keyword http://127.0.0.1:4723/wd/hub
+
+Set Sauce Executor
+ set suite variable ${IOS_APP} http://appium.github.io/appium/assets/TestApp9.4.app.zip
+ set suite variable ${ANDROID_APP} http://appium.github.io/appium/assets/ApiDemos-debug.apk
+ ${url} format string http://{}:{}@ondemand.saucelabs.com:80/wd/hub %{SAUCE_USERNAME} %{SAUCE_ACCESS_KEY}
+ return from keyword ${url}
+
+Set Executor
+ ${sauce_labs} get environment variable SAUCE_LABS ${EMPTY}
+ ${sauce_username} get environment variable SAUCE_USERNAME ${EMPTY}
+ ${sauce_password} get environment variable SAUCE_PASSWORD ${EMPTY}
+ ${ex} run keyword if '${sauce_labs}' != '${EMPTY}' and '${sauce_username}' != '${EMPTY}' and '${sauce_password}' != '${EMPTY}}' Set Sauce Executor
+ ... ELSE Set Local Executor
+ set test variable ${EXECUTOR} ${ex}
+ return from keyword ${executor}
+
+Open Android Test App
+ [Arguments] ${appActivity}=${EMPTY}
+ ${executor} set executor
+ open application ${executor} automationName=${ANDROID_AUTOMATION_NAME}
+ ... app=${ANDROID_APP} platformName=${ANDROID_PLATFORM_NAME} platformVersion=${ANDROID_PLATFORM_VERSION}
+ ... appPackage=${ANDROID_APP_PACKAGE} appActivity=${appActivity}
+ ... deviceName=${ANDROID_DEVICE_NAME}
+
+
+Open iOS Test App
+ ${executor} set executor
+ open application ${executor} automationName=${IOS_AUTOMATION_NAME}
+ ... app=${IOS_APP} platformName=${IOS_PLATFORM_NAME} platformVersion=${IOS_PLATFORM_VERSION}
+ ... deviceName=${IOS_DEVICE_NAME}
\ No newline at end of file

ADD
sample-code/robotframework/tests/android_basic_interactions.test.robot
+*** Settings ***
+Documentation Android Basic Interactions
+Resource ../resources/resource.robot
+Test Teardown Close Application
+
+*** Test Cases ***
+Should send keys to search box and then check the value
+ Open Android Test App .app.SearchInvoke
+ input text txt_query_prefill Hello world!
+ click element btn_start_search
+ wait until page contains element android:id/search_src_text
+ element text should be android:id/search_src_text Hello world!
+
+Should click a button that opens an alert and then dismisses it
+ Open Android Test App .app.AlertDialogSamples
+ click element two_buttons
+ wait until page contains element android:id/alertTitle
+ element should contain text android:id/alertTitle Lorem ipsum dolor sit aie consectetur adipiscing
+ ${close_dialog_button} get webelement android:id/button1
+ click element ${close_dialog_button}

ADD
sample-code/robotframework/tests/android_create_session.test.robot
+*** Settings ***
+Documentation Android Create Native Test Session
+Resource ../resources/resource.robot
+
+*** Test Cases ***
+Should Create and Destroy Android Session
+ open application http://127.0.0.1:4723/wd/hub automationName=${ANDROID_AUTOMATION_NAME}
+ ... platformName=${ANDROID_PLATFORM_NAME} platformVersion=${ANDROID_PLATFORM_VERSION}
+ ... app=${ANDROID_APP} appPackage=${ANDROID_APP_PACKAGE}
+ ${activity} get activity
+ should be equal ${activity} .ApiDemos
+ close application
+ sleep 3s
+ run keyword and expect error No application is open get activity
\ No newline at end of file

ADD
sample-code/robotframework/tests/android_create_web_session.test.robot
+*** Settings ***
+Documentation Android Web Session
+Resource ../resources/resource.robot
+
+*** Test Cases ***
+Should Create and Destroy Android Web Session
+ open application http://127.0.0.1:4723/wd/hub automationName=${ANDROID_AUTOMATION_NAME}
+ ... platformName=${ANDROID_PLATFORM_NAME} platformVersion=${ANDROID_PLATFORM_VERSION}
+ ... browserName=Chrome
+ go to url https://www.google.com
+ ${page_title} execute script return document.title
+ should be equal ${page_title} Google
+ close application
+ sleep 3s
+ run keyword and expect error No application is open execute script return document.title
\ No newline at end of file

ADD
sample-code/robotframework/tests/android_selectors.test.robot
+*** Settings ***
+Documentation Android Selectors
+Resource ../resources/resource.robot
+Test Setup Open Android Test App
+Test Teardown Close Application
+
+*** Test Cases ***
+Should find elements by Accessibility ID
+ ${element} get webelement accessibility_id=Content
+ element should be visible ${element}
+
+Should find elements by ID
+ page should contain element android:id/action_bar_container
+
+Should find elements by class name
+ @{elements} get webelements class=android.widget.FrameLayout
+ length should be ${elements} 3
+
+Should find elements by XPath
+ @{elements} get webelements //*[@class='android.widget.FrameLayout']
+ length should be ${elements} 3

ADD
sample-code/robotframework/tests/ios_basic_interactions.test.robot
+*** Settings ***
+Resource ../resources/resource.robot
+Test Setup Open iOS Test App
+Test Teardown Close Application
+
+*** Test Cases ***
+Should send keys to inputs
+ ${text_field_el} get webelement TextField1
+ ${value} get element attribute ${text_field_el} value
+ should be equal ${value} ${None}
+ input text ${text_field_el} Hello World!
+ ${value2} get element attribute ${text_field_el} value
+ should be equal ${value2} Hello World!
+
+Should click a button that opens an alert
+ click element show alert
+ ${alert_el} get webelement accessibility_id=Cool title
+ ${title} get element attribute ${alert_el} name
+ should be equal ${title} Cool title

ADD
sample-code/robotframework/tests/ios_create_session.test.robot
+*** Settings ***
+Resource ../resources/resource.robot
+
+*** Test Cases ***
+Should send keys to inputs
+ Open iOS Test App
+ ${attr} get element attribute class=XCUIElementTypeApplication name
+ should be equal ${attr} TestApp
+ close application
+ sleep 3s
+ run keyword and expect error No application is open get webelement class=XCUIElementTypeApplication
\ No newline at end of file

ADD
sample-code/robotframework/tests/ios_create_web_session.test.robot
+*** Settings ***
+Resource ../resources/resource.robot
+
+*** Test Cases ***
+Should send keys to inputs
+ open application http://127.0.0.1:4723/wd/hub automationName=${IOS_AUTOMATION_NAME}
+ ... platformName=${IOS_PLATFORM_NAME} platformVersion=${IOS_PLATFORM_VERSION}
+ ... deviceName=${IOS_DEVICE_NAME}
+ ... browserName=Safari
+ go to url https://www.google.com
+ ${page_title} execute script return document.title
+ should be equal ${page_title} Google
+ close application
+ sleep 3s
+ run keyword and expect error No application is open execute script return document.title

ADD
sample-code/robotframework/tests/ios_selectors.test.robot
+*** Settings ***
+Resource ../resources/resource.robot
+Test Setup Open iOS Test App
+Test Teardown Close Application
+
+*** Test Cases ***
+Should find elements by ID
+ ${element} get webelement ComputeSumButton
+ element should be visible ${element}
+
+Should find elements by class name
+ @{elements} get webelements class=XCUIElementTypeWindow
+ length should be ${elements} 2
+
+Should find elements by nspredicate
+ @{elements} get webelements nsp=visible = 1
+ should be true len('${elements}') >= 24
+
+Should find elements by class chain
+ @{elements} get webelements chain=XCUIElementTypeWindow[1]/*
+ length should be ${elements} 1
+
+Should find elements by XPath
+ @{elements} get webelements //XCUIElementTypeWindow//XCUIElementTypeButton
+ log len('${elements}')
+ should be true 7 <= len('${elements}') and len('${elements}') <= 8

feat: robotframework ios and android test suites are added (#14608)