appId: com.toughra.ustadmobile
tags:
  - contentEpub
  - contentTest
env:
  TESTRESULTSDIR: "build/reports/maestro/001_001_admin_can_add_content_002-epub/Screenshots"
onFlowStart:
  - startRecording: 001_001_admin_can_add_content_002-epub
  - runScript:
      file: "common/startserver.js"
      env:
        TESTCONTROLLER_URL: ${TESTCONTROLLER_URL}
  - clearState: com.toughra.ustadmobile
onFlowComplete:
  - stopRecording
  - runScript:
      file: "common/stopserver.js"
      env:
        TESTCONTROLLER_URL: ${TESTCONTROLLER_URL}
---
- runFlow:
    file: "common/clear_login_and_add_content.yaml"
    env:
      TESTFILENAME: Epub_Content1.epub
- tapOn: "SAVE"
- takeScreenshot: "${TESTRESULTSDIR}/content_add_to_library"
- tapOn: "E-book"
- extendedWaitUntil:
    notVisible: "Importing"
    timeout: 80000
- extendedWaitUntil:
    notVisible: "Uploading"
    timeout: 80000
- tapOn: Open
- runFlow:
    file: "common/login_download_and_open_content.yaml"
#Download and open content
- tapOn: "Library"
- extendedWaitUntil:
    visible: "E-book"
    timeout: 80000
- tapOn: "E-book"
- tapOn: Download
- tapOn: Open
- assertVisible: "Cover"
- takeScreenshot: "${TESTRESULTSDIR}/epub_content_download_and_open"
- tapOn: More options
- tapOn: Table of contents
- scrollUntilVisible:
    element:
      text: "THE FULL PROJECT GUTENBERG LICENSE"
    direction: DOWN
- tapOn: "THE FULL PROJECT GUTENBERG LICENSE"
- scroll
- tapOn: "Back"
- tapOn: "Attempts"
- assertVisible:
    text: "The Adopting of Rosa Marie / (A Sequel to Dandelion Cottage)"
    id: "app_title"
- assertVisible: "Admin User: Completed"
- assertVisible: "1 Attempts"
- assertVisible:
    id: "progress_bar"
- assertVisible: "100%"
- assertVisible: "Progress"
- tapOn: "Admin User: Completed"
- assertVisible:
    text: "Admin User - The Adopting of Rosa Marie / (A Sequel to Dandelion Cottage)"
    id: "app_title"
- assertVisible: "Completed"
- assertVisible:
    id: "progress_bar"
- assertVisible: "100%"
- assertVisible: "Progress"
- tapOn: "Completed"
- assertVisible:
    text: "The Adopting of Rosa Marie / (A Sequel to Dandelion Cottage)"
    id: "app_title"
- assertVisible: "Completed The Adopting of Rosa Marie / (A Sequel to Dandelion Cottage)"
- assertVisible:
    id: "progress_bar"
- assertVisible: "100%"
- assertVisible: "Progress"
- assertVisible: "Progressed"
- assertVisible: "Completed"    # filter is unselected
