appId: com.toughra.ustadmobile2
---
#this flow add a new content inside a course as a content block
# Test parameters needs to provide for this test :
# 1) TESTFILENAME : provide the content name inside the 'test-files/content' folder
# 2) TESTCONTENTNAME : provide the content title, it should be a string
# 3) CONTROLSERVER: ${CONTROLSERVER} : provides the test-control-server address
# 4) TESTSERIAL: ${TESTSERIAL} : provides the device serial number
# 5) TESTRESULTSDIR : ${TESTRESULTSDIR} : provides the path to store test results
# push the test file to the downloads
- evalScript: ${http.get(CONTROLSERVER + "pushcontent?test-file-name=" + TESTFILENAME +"&device=" + TESTSERIAL)}
# edit the course to add blocks
- tapOn:
    id: "floating_action_button"
- scrollUntilVisible:
    element:
      text: "Add block"
    direction: DOWN
# add new content block inside course
- tapOn: "Add block"
- tapOn: "Content"
- tapOn: "Import from file"
- runFlow:
      when:
          notVisible: "Downloads"
      file: redirect_to_downloads.yaml
- tapOn: ${TESTFILENAME}
- tapOn: "Next"
- tapOn: "Done"
- tapOn: "SAVE"
- takeScreenshot: "${TESTRESULTSDIR}/screenshots/able_to_add_new_content_block_inside_course"