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" - 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: "ParentA" - 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: "Female" - tapOn: id: "role" - tapOn: "Parent" - tapOn: "Save" - assertVisible: id: "app_title" text: "ParentA User" - tapOn: id: "floating_action_button" # Edit button - assertVisible: id: "app_title" text: "Edit person" # Validate DOB field - tapOn: "Date of birth" - runScript: file: "scripts/setDate.js" - inputText: ${output.futureDate} - runFlow: when: notVisible: "Save" commands: - 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" - runFlow: when: notVisible: "Save" commands: - hideKeyboard - tapOn: "Save" - assertVisible: "Invalid" - eraseText - inputText: "21255543268" - runFlow: when: notVisible: "Save" commands: - hideKeyboard - tapOn: "Save" - assertVisible: "Invalid" - eraseText - inputText: "2125554326" - tapOn: "Email" - inputText: "ParentAuser@gm" - runFlow: when: notVisible: "Save" commands: - hideKeyboard - tapOn: "Save" - assertVisible: "Enter valid email address." - eraseText - inputText: "ParentAuser@gmail.com" - runFlow: when: notVisible: "Save" commands: - hideKeyboard - tapOn: "Save" - assertVisible: id: "app_title" text: "ParentA User" # Add Family member - as new person - tapOn: id: "floating_action_button" # Edit button - assertVisible: id: "app_title" text: "Edit person" - tapOn: "Family member" - tapOn: "Add person" - tapOn: "First names*" - inputText: "Child" - tapOn: "Last name*" - inputText: "User" - tapOn: "Gender*" - tapOn: "Female" - assertVisible: id: "app_title" text: "Add person" - tapOn: "Save" - assertVisible: "Child User" - tapOn: "Save" - assertVisible: id: "app_title" text: "ParentA User" - tapOn: "Child User" - assertVisible: id: "app_title" text: "Child User" - assertVisible: "Student" - assertVisible: "ParentA User" # Create account for Parent user -- only username and password fields available for parent user - tapOn: "People" - tapOn: "ParentA User" - tapOn: "Create account" - assertVisible: id: "app_title" text: "Create account" - tapOn: "Username" - inputText: "pa" - tapOn: "Save" - assertVisible: "Username must be at least 3 characters" - eraseText - inputText: "parentauser" - tapOn: "Password*" - inputText: "test" - tapOn: "Save" - assertVisible: "Password must be at least 6 characters" - eraseText - inputText: "test123" - tapOn: "Save" - assertVisible: "Manage account" # Create account for Child user - tapOn: "Child User" - tapOn: "Create account" - tapOn: "Username" - inputText: "childuser" - runFlow: file: "subflows/assign_qr_badge_flow.yaml" env: QR_BADGE_LINK: ${output.SCHOOL_URL} - assertVisible: "Invalid url, please try again" - eraseText - inputText: ${output.SCHOOL_URL}respect_qr_badge/id/123121 - tapOn: "Ok" - assertVisible: id: "app_title" text: "Manage account" - assertVisible: "QR code badge" - assertVisible: "Badge.*" - back # Create a student user for QR code validation - tapOn: "People" - 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: "Test" - tapOn: "Last name*" - inputText: "User" - tapOn: "Gender*" - tapOn: "Female" - tapOn: id: "role" - tapOn: "Student" - tapOn: "Save" - assertVisible: id: "app_title" text: "Test User" - tapOn: "Create account" - tapOn: "Username" - inputText: "testuser" - tapOn: "Set password" - tapOn: "Password*" - inputText: "test123" - tapOn: "Save" - assertVisible: id: "password_change_btn" # Change password button - assertVisible: "Last updated:.*" # Assign QR code badge for the user - runFlow: file: "subflows/assign_qr_badge_flow.yaml" env: QR_BADGE_LINK: ${output.SCHOOL_URL}respect_qr_badge/id/123121 #Validation to ensure that one QR badge is assigned to one, and only one, student. - assertVisible: id: "app_title" text: "Manage account" - assertVisible: "Assign QR code badge" - assertVisible: "This QR code is already assigned to another student" - runFlow: file: "subflows/assign_qr_badge_flow.yaml" env: QR_BADGE_LINK: ${output.SCHOOL_URL}respect_qr_badge/id/983123 #Unique QR - assertVisible: "QR code badge" - assertVisible: "Badge.*" - tapOn: id: "qr_change_btn" - assertVisible: "Assign new badge (replace)" - assertVisible: "Revoke badge" # Verify the button - Revoke badge, it should remove the assigned badge - tapOn: "Revoke badge" - assertVisible: id: "app_title" text: "Manage account" - assertVisible: "Assign QR code badge" - runFlow: file: "subflows/assign_qr_badge_flow.yaml" env: QR_BADGE_LINK: ${output.SCHOOL_URL}respect_qr_badge/id/983123 - assertVisible: id: "app_title" text: "Manage account" - assertVisible: "QR code badge" - assertVisible: "Badge.*" # Verify the button Assign new badge (replace) takes user to Scan QR code screen - tapOn: id: "qr_change_btn" - tapOn: "Assign new badge (replace)" - assertVisible: id: "app_title" text: "Scan QR code badge" - back - assertVisible: id: "app_title" text: "Manage account" - assertVisible: "QR code badge" # Validate Parent User Login using Username & 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: "parentauser" - tapOn: id : "password" - inputText: "test123" - tapOn: "Login" - runFlow: when: visible: "Save password for Respect?" file: "subflows/save_password_prompt_cancel.yaml" - assertVisible: "Apps" - tapOn: "People" - tapOn: "ParentA User" - tapOn: "Manage account" - assertVisible: "parentauser" - tapOn: id: "password_change_btn" # Change password button - 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" - assertVisible: "Child User" # Validate Child User QR Login using Scan QR/badge - clearState: world.respect.app - launchApp: arguments: respect_directory: ${output.SCHOOL_URL} - tapOn: "Get Started" - tapOn: "Scan QR code/badge" - assertVisible: id: "app_title" text: "Scan QR code badge" - tapOn: "More Info" - tapOn: "Paste URL" - tapOn: "Url" - inputText: ${output.SCHOOL_URL}respect_qr_badge/id/123121 - tapOn: "OK" - assertVisible: "Apps" - assertVisible: "Assignments"