appId: com.toughra.ustadmobile
---
# This test add a new teacher and create account on the course page
# test data required :
# 1) TESTCOURSENAME: provide course name of string type
# 2) STUDENTFIRSTNAME: provide STUDENT's first name of string type
# 3) STUDENTLASTNAME: provide STUDENT's last name of string type
# 4) GENDER: provide STUDENT's gender of string type
# 5) PASSWORD: provide STUDENT's account password of string type
# 6) TESTRESULTSDIR : provides the path to store test results

- tapOn: "Courses"
- repeat:
    while:
       notVisible: ${TESTCOURSENAME}
    commands:
        - tapOn: "Courses"
- tapOn: ${TESTCOURSENAME}
- tapOn: "MEMBERS"
- tapOn: "Add a student"
- tapOn: "Add a new person"
- tapOn: "First names"
- inputText: ${STUDENTFIRSTNAME}
- tapOn: "Last name"
- inputText: ${STUDENTLASTNAME}
- tapOn: "Gender"
- tapOn: ${GENDER}
- tapOn: "SAVE"
- tapOn: "SAVE"
# There is a known issue on maestro. Scroll functionality is not working for specific emulator using in jenkins
- swipe:
        start: 100,400
        end: 100,100
- tapOn: "${STUDENTFIRSTNAME} ${STUDENTLASTNAME}"
- tapOn: "VIEW PROFILE"
  # add account
- tapOn: "CREATE ACCOUNT"
- tapOn: "Username"
- inputText: ${STUDENTFIRSTNAME}
- tapOn: "New password"
- inputText: ${PASSWORD}
- tapOn: "Confirm password"
- inputText: ${PASSWORD}
- tapOn: "SAVE"
- takeScreenshot: "${TESTRESULTSDIR}/screenshots/added_account_for_new_student-${STUDENTFIRSTNAME} ${STUDENTLASTNAME}"
