Skip to content

Commit

Permalink
init project
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen Zonneveld committed Jan 5, 2020
1 parent e4c02b1 commit 0645d1e
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 0 deletions.
35 changes: 35 additions & 0 deletions settings.robot
@@ -0,0 +1,35 @@
*** Settings ***
Library AppiumLibrary
Library Collections

** Variables **

${AUTOMATION_NAME_IOS} XCUITest
${AUTOMATION_NAME_ANDROID} UiAutomator2
${APPLEDEVELOPERTEAMID} XXXXXXXXXXX

# Device to run the test on
${DEVICE} A50
${APPIUM_SERVER} http://0.0.0.0:4723/wd/hub
${PLATFORM} ${${DEVICE}_PLATFORM}
${VERSION} ${${DEVICE}_VERSION}
${DEVICENAME} ${${DEVICE}_DEVICENAME}
${UDID} ${${DEVICE}_UDID}
${APPNAME} ${${DEVICE}_APPNAME}
${AUTOMATION_NAME} ${${DEVICE}_AUTOMATION_NAME}

#iPhone Xr
${iPhoneXr_DEVICENAME} iPhoneXr
${iPhoneXr_UDID} SET_UDID_HERE
${iphoneXr_PLATFORM} iOS
${iPhoneXr_VERSION} 13.3
${iPhoneXr_APPNAME} dev.zonneveld.exampleapp
${iPhoneXr_AUTOMATION_NAME} ${AUTOMATION_NAME_IOS}

#Galaxy A50
${A50_DEVICENAME} A50
${A50_UDID} SET_UDID_HERE
${A50_PLATFORM} android
${A50_VERSION} 9
${A50_APPNAME} apk/nameofyourapp.apk
${A50_AUTOMATION_NAME} ${AUTOMATION_NAME_ANDROID}
6 changes: 6 additions & 0 deletions settings/setup.robot
@@ -0,0 +1,6 @@
*** Settings ***
#Declaring all the resource files
Resource ../settings.robot
Resource ../testsuites/keywords/general_keywords.robot
Resource ../testsuites/keywords/${TESTSUITE}_keywords.robot
Resource ../testsuites/elements/${TESTSUITE}_elements.robot
6 changes: 6 additions & 0 deletions testsuites/elements/login_elements.robot
@@ -0,0 +1,6 @@
*** Variables ***

${LOGIN_BUTTON} xpath=//*[@resource-id='package.id:id/login_button' or @name="login_button"]
${TEXTFIELD_USERNAME} xpath=//*[@resource-id='package.id:id/username_field' or @name="username_field"]
${TEXTFIELD_PASSWORD} xpath=//*[@resource-id='package.id:id/password_field' or @name="password_field"]
${LOGIN_BUTTON_SUBMIT} xpath=//*[@resource-id='package.id:id/login_button_submit' or @name="login_button_submit"]
13 changes: 13 additions & 0 deletions testsuites/keywords/general_keywords.robot
@@ -0,0 +1,13 @@
# Keywords for the authentication test cases
*** Keywords ***

Setup and open app
Open Application ${APPIUM_SERVER} udid=${UDID} platformName=${PLATFORM}
... xcodeorgid=${APPLEDEVELOPERTEAMID} xcodesigningid=iPhone Developer automationName=${AUTOMATION_NAME} deviceName=${DEVICENAME}
... app=${APPNAME} wdaStartupRetries=4 iosInstallPause=8000 wdaStartupRetryInterval=20000 maxTypingFrequency=3000

Close app
Close Application

Reset App
Reset Application
6 changes: 6 additions & 0 deletions testsuites/keywords/login_keywords.robot
@@ -0,0 +1,6 @@
# Keywords for the authentication test cases
*** Keywords ***

Go to login
Wait Until Page Contains Element ${LOGIN_BUTTON}
Tap ${LOGIN_BUTTON}
23 changes: 23 additions & 0 deletions testsuites/login.robot
@@ -0,0 +1,23 @@
*** Variables ***
${TESTSUITE} login

*** Settings ***
Resource ../settings/setup.robot

#What to do on test/suite setup/teardown
Suite Setup Setup and open app
Suite Teardown Close App
Test Setup Reset App

*** Test Cases ***

Validate invalid password
Go to login

Wait Until Page Contains Element ${TEXTFIELD_USERNAME}

Input Text ${TEXTFIELD_USERNAME} j.zonneveld
Input Text ${TEXTFIELD_PASSWORD} fakep@ssword99

Tap ${LOGIN_BUTTON_SUBMIT}

0 comments on commit 0645d1e

Please sign in to comment.