appId: world.respect.app
tags:
  - basic
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_003_login_using_school_link_test"

onFlowComplete:
  - runFlow:
      file: "subflows/teardown.yaml"
      env:
        NAME: "db-final"
        TESTCONTROLLER_URL: ${TESTCONTROLLER_URL}
---
- launchApp:
    arguments:
      respect_directory: ${output.SCHOOL_URL}

- tapOn: "Get Started"
- tapOn: "Other options"

# link field verification
- tapOn: "Paste the link here"  # Blank link field
- tapOn: "Next"
- assertVisible: "Invalid link, try again"
- tapOn: "Paste the link here"
- inputText: "Test"  #Entering text instead of link
- tapOn: "Next"
- assertVisible: "Invalid app Url"
- runFlow:
    file: "subflows/erase_text.yaml"
    env:
      TEXT: "Paste the link here"
- inputText: ${output.SCHOOL_URL}
- tapOn: "Next"
- tapOn:
    id: "username"
- inputText: "admin"
- tapOn:
    id : "password"
- inputText: ${SCHOOL_ADMIN_PASSWORD}
- tapOn: "Login"
- runFlow:
    when:
      visible: "Save password for Respect?"
    file: "subflows/save_password_prompt_cancel.yaml"
- assertVisible: "Apps"

