appId: com.toughra.ustadmobile
env:
  TESTRESULTSDIR: "${TESTRESULTSDIR}/002_007_admin_grant_permissions_test"
  TESTNAME:  "002_007_admin_grant_permissions_test"
---
# Admin login
- clearState: com.toughra.ustadmobile
- runFlow:
    file: "../common/startserver.yaml"
    env:
      CONTROLSERVER: ${CONTROLSERVER}
      TESTSERIAL: ${TESTSERIAL}
      TESTNAME: ${TESTNAME}
- runFlow: "../common/clear_state_and_learning_space_existing_userflow.yaml"
- runFlow: "../common/select_site.yaml"
- runFlow:
    file: "../common/user_login.yaml"
# add new course
- runFlow:
    file: "../common/add_course.yaml"
    env:
      TESTCOURSENAME: "Test Course Block"
# add new teacher using flow - add_new_teacher_inside_course ---------
- runFlow:
    file: "../common/add_new_teacher_inside_course.yaml"
    env:
      TESTCOURSENAME: ${TESTCOURSENAME}
      TEACHERFIRSTNAME: "Teacher"
      TEACHERLASTNAME: "1"
      USERNAME: "t1"
      GENDER: "Female"
      PASSWORD: "testt1"
# add students to the course through bulk import using .csv file
- runFlow:
    file: "../common/student_bulk_upload_csv.yaml"
    env:
      TESTFILENAME: "Ustad_Students_List.csv"
      CONTROLSERVER: ${CONTROLSERVER}
      TESTSERIAL: ${TESTSERIAL}

- runFlow: "../common/clear_state_and_learning_space_existing_userflow.yaml"
- runFlow: "../common/select_site.yaml"
- runFlow:
    file: "../common/user_login.yaml"
    env:
      USERNAME: "s1"
      PASSWORD: "tests1"
- tapOn: "Courses"
- tapOn: "Test Course Block"
- tapOn: "Members"
- assertVisible: "Student 2"

- runFlow: "../common/clear_state_and_learning_space_existing_userflow.yaml"
- runFlow: "../common/select_site.yaml"
- runFlow:
    file: "../common/user_login.yaml"
    env:
      USERNAME: "t1"
      PASSWORD: "testt1"
- tapOn: "Courses"
- tapOn: "Test Course Block"
- tapOn: "Permissions"
- tapOn: "Students"
- tapOn:
    id: "floating_action_button"
- tapOn: "View members"
- tapOn: "Save"

- runFlow: "../common/clear_state_and_learning_space_existing_userflow.yaml"
- runFlow: "../common/select_site.yaml"
- runFlow:
    file: "../common/user_login.yaml"
    env:
      USERNAME: "s1"
      PASSWORD: "tests1"
- tapOn: "Courses"
- tapOn: "Test Course Block"
- assertNotVisible:
    id: "ustad_screen_tabs"
    text: "Members"