appId: world.respect.app onFlowStart: - clearState: world.respect.app - runScript: file: "scripts/school_init.js" env: TESTCONTROLLER_URL: ${TESTCONTROLLER_URL} SCHOOL_ADMIN_PASSWORD: ${SCHOOL_ADMIN_PASSWORD} DIR_ADMIN_AUTH_HEADER: ${DIR_ADMIN_AUTH_HEADER} SCHOOL_URL: ${SCHOOL_URL} SCHOOL_NAME: ${SCHOOL_NAME} URL_SUBSTITUTION: ${URL_SUBSTITUTION} NAME: "001_002_add_user_direct_test" onFlowComplete: - runScript: file: "scripts/teardown.js" --- - runFlow: "subflows/school_admin_login_flow.yaml" - runFlow: "subflows/admin_add_class.yaml" - runFlow: "subflows/admin_add_student.yaml" - tapOn: "People" - assertVisible: id: "app_title" text: "People" - tapOn: id: "floating_action_button" # +Person button - assertVisible: id: "app_title" text: "Add person" - tapOn: "Save" - assertVisible: "Required field" # First names* field is mandatory - tapOn: "First names*" - inputText: "Test" - tapOn: "Save" - assertVisible: "Required field" # Last name* field is mandatory - tapOn: "Last name*" - inputText: "User" - tapOn: "Save" - assertVisible: "Required field" # Gender field is mandatory - tapOn: "Gender*" - tapOn: "Male" - tapOn: id: "role" - tapOn: "Student" - tapOn: "Save" - assertVisible: id: "app_title" text: "Test User" # Parent user adding 3 child users as Family members who added to the app in 3 different ways - tapOn: "People" - assertVisible: id: "app_title" text: "People" - tapOn: id: "floating_action_button" # +Person button - assertVisible: id: "app_title" text: "Add person" - tapOn: "First names*" - inputText: "Parent" - tapOn: "Last name*" - inputText: "User" - tapOn: "Gender*" - tapOn: "Female" - tapOn: id: "role" - tapOn: "Parent" # Add Family member - existing user - already added by admin - tapOn: "Family member" - assertVisible: id: "app_title" text: "Select person" - tapOn: "Test User" - assertVisible: id: "app_title" text: "Add person" - assertVisible: "Test User" - tapOn: "Save" - assertVisible: id: "app_title" text: "Parent User" - assertVisible: "Test User" - tapOn: id: "floating_action_button" # Edit button - assertVisible: id: "app_title" text: "Edit person" # Add Family member - existing user - already signup to a class using invite code from an admin - tapOn: "Family member" - assertVisible: id: "app_title" text: "Select person" - tapOn: "Student User" - assertVisible: id: "app_title" text: "Edit person" - assertVisible: "Student User" # Add Family member - as new person - tapOn: "Family member" - tapOn: "Add person" - tapOn: "First names*" - inputText: "Child" - tapOn: "Last name*" - inputText: "User" - tapOn: "Gender*" - tapOn: "Female" - tapOn: id: "role" - assertNotVisible: "Parent" - assertNotVisible: "Teacher" - assertNotVisible: "System administrator" - tapOn: "Student" - assertVisible: id: "app_title" text: "Edit person" # Parent user added 3 child users - verify 3 users are in the list - assertVisible: "Child User" - assertVisible: "Test User" - assertVisible: "Student User" - tapOn: "Save" - assertVisible: id: "app_title" text: "Parent User" - assertVisible: "Child User" - assertVisible: "Test User" - assertVisible: "Student User" - tapOn: "Test User" - assertVisible: id: "app_title" text: "Test User" - tapOn: id: "floating_action_button" # Edit button - assertVisible: id: "app_title" text: "Edit person" - assertVisible: "Parent User" # Validate DOB field - tapOn: "Date of birth" - runScript: file: "scripts/setDate.js" - inputText: ${output.tomorrowDate} - hideKeyboard - tapOn: "Save" - assertVisible: "Date of Birth cannot be in the future." - eraseText - tapOn: "Date of birth" - runScript: file: "scripts/setDate.js" - inputText: ${output.pastYearDateC} - hideKeyboard # Validate Phone number - tapOn: id: "phone_countrycode" - eraseText - inputText: "+1" - tapOn: "Phone number" - inputText: "23" - hideKeyboard - tapOn: "Save" - assertVisible: "Invalid" - tapOn: "Phone number" - eraseText - inputText: "21255543268" - hideKeyboard - tapOn: "Save" - assertVisible: "Invalid" - eraseText - inputText: "2125554326" - tapOn: "Email" - inputText: "Testuser@gm" - hideKeyboard - scrollUntilVisible: element: text: "Save" # or any other selector direction: UP timeout: 1000 - tapOn: "Save" - assertVisible: "Enter valid email address." - eraseText - inputText: "Testuser@gmail.com" - assertVisible: "Testuser@gmail.com" #- hideKeyboard - tapOn: "Save" - assertVisible: id: "app_title" text: "Test User" - tapOn: "Create account" - tapOn: "Username" - inputText: "2tes" - tapOn: "Password" # Password validations needs to be added - inputText: "test234" - tapOn: "Save" - assertVisible: "Username cannot start with a number" # 2tes not a valid username - tapOn: "Username" - eraseText - inputText: "test@user" - assertVisible: "testuser" # @ symbol won't get added to the username field - so "testuser" is expected result - tapOn: "Save" # Validate User login - clearState: world.respect.app - launchApp: arguments: respect_directory: ${output.SCHOOL_URL} - tapOn: "Get Started" - runFlow: file: "subflows/get_started_select_school_by_name.yaml" env: SCHOOL_NAME: ${SCHOOL_NAME} - tapOn: id: "username" - inputText: "testuser" - tapOn: id : "password" - inputText: "test234" - tapOn: "Login" - runFlow: when: visible: "Save password for Respect?" file: "subflows/save_password_prompt_cancel.yaml" - assertVisible: "Apps" - tapOn: "People" - tapOn: "Test User" - tapOn: "Manage account" - assertVisible: "testuser" - tapOn: "Change" - tapOn: "Old password*" - inputText: "test234" - tapOn: "New password*" - inputText: "t2" - tapOn: "Save" - assertVisible: "Password must be at least 6 characters" - tapOn: "New password*" - eraseText - inputText: "test123" - tapOn: "Save" - assertVisible: id: "app_title" text: "Manage account" # Validate User login after changing password - clearState: world.respect.app - launchApp: arguments: respect_directory: ${output.SCHOOL_URL} - tapOn: "Get Started" - runFlow: file: "subflows/get_started_select_school_by_name.yaml" env: SCHOOL_NAME: ${SCHOOL_NAME} - tapOn: id: "username" - inputText: "testuser" - tapOn: id : "password" - inputText: "test123" - tapOn: "Login" - runFlow: when: visible: "Save password for Respect?" file: "subflows/save_password_prompt_cancel.yaml" - assertVisible: "Apps"