AutorÃa | Ultima modificación | Ver Log |
@repository @repository_contentbank @javascriptFeature: Search content bank files using the content bank files repositoryIn order to find the content I need to select in the file pickerAs a userI need to be able to search in the content bank files repository by content nameBackground:Given the following "users" exist:| username | firstname | lastname | email || student | Student | 1 | student@example.com || teacher | Teacher | 1 | teacher1@example.com |And the following "categories" exist:| name | category | idnumber || Category1 | 0 | CAT1 || Category2 | 0 | CAT2 |And the following "courses" exist:| fullname | shortname | category || Course1 | C1 | CAT1 || Course2 | C2 | CAT2 |And the following "contentbank content" exist:| contextlevel | reference | contenttype | user | contentname | filepath || Course | C1 | contenttype_h5p | admin | coursecontent1.h5p | /h5p/tests/fixtures/filltheblanks.h5p || Course | C2 | contenttype_h5p | admin | coursecontent2.h5p | /h5p/tests/fixtures/find-the-words.h5p || Category | CAT1 | contenttype_h5p | admin | categorycontent1.h5p | /h5p/tests/fixtures/ipsums.h5p || Category | CAT2 | contenttype_h5p | admin | categorycontent2.h5p | /h5p/tests/fixtures/multiple-choice-2-6.h5p || System | | contenttype_h5p | admin | systemcontent.h5p | /h5p/tests/fixtures/greeting-card.h5p |And the following "activities" exist:| activity | name | intro | introformat | course | idnumber || folder | Folder | FolderDesc | 1 | C1 | folder |And the following "course enrolments" exist:| user | course | role || teacher | C1 | editingteacher |Scenario: User can see a search field and reset search button in the content bank files repositoryGiven I am on the Folder "Folder activity" page logged in as adminAnd I click on "Edit" "button"And I click on "Add..." "button"And I should see "Content bank" in the ".fp-repo-area" "css_element"When I select "Content bank" repository in file pickerThen "Search repository" "field" should be visibleAnd "Refresh" "link" should be visibleScenario: User can see search results when there is content that matches the search criteriaGiven I am on the Folder "Folder activity" page logged in as adminAnd I click on "Edit" "button"And I click on "Add..." "button"And I should see "Content bank" in the ".fp-repo-area" "css_element"And I select "Content bank" repository in file pickerAnd I set the field "Search repository" to "content"When I press enterThen I should see "5" elements in repository content areaAnd I should see "systemcontent.h5p" "file" in repository content areaAnd I should see "categorycontent1.h5p" "file" in repository content areaAnd I should see "categorycontent2.h5p" "file" in repository content areaAnd I should see "coursecontent1.h5p" "file" in repository content areaAnd I should see "coursecontent2.h5p" "file" in repository content areaScenario: User can see search results when there is content that matches the search criteria ignoring case sensitivityGiven I am on the Folder "Folder activity" page logged in as adminAnd I click on "Edit" "button"And I click on "Add..." "button"And I should see "Content bank" in the ".fp-repo-area" "css_element"And I select "Content bank" repository in file pickerAnd I set the field "Search repository" to "COURSE"When I press enterThen I should see "2" elements in repository content areaAnd I should see "coursecontent1.h5p" "file" in repository content areaAnd I should see "coursecontent2.h5p" "file" in repository content areaScenario: User can not see any search results when there is not a content that matches the search criteriaGiven I am on the Folder "Folder activity" page logged in as adminAnd I click on "Edit" "button"And I click on "Add..." "button"And I should see "Content bank" in the ".fp-repo-area" "css_element"And I select "Content bank" repository in file pickerAnd I set the field "Search repository" to "somecontent"When I press enterThen I should see "0" elements in repository content areaAnd I should see "No files available" in the ".filepicker .fp-content" "css_element"Scenario: User can reset search criteria and see all content displayed prior the search actionGiven I am on the Folder "Folder activity" page logged in as adminAnd I click on "Edit" "button"And I click on "Add..." "button"And I should see "Content bank" in the ".fp-repo-area" "css_element"And I select "Content bank" repository in file pickerAnd I should see "1" elements in repository content areaAnd I should see "coursecontent1.h5p" "file" in repository content areaAnd I set the field "Search repository" to "category"And I press enterAnd I should see "2" elements in repository content areaAnd I should see "categorycontent1.h5p" "file" in repository content areaAnd I should see "categorycontent2.h5p" "file" in repository content areaWhen I click on "Refresh" "link"Then I should see "1" elements in repository content areaAnd I should see "coursecontent1.h5p" "file" in repository content areaScenario: Editing teacher can see search results when the content is available to him and matches the search criteriaGiven I am on the Folder "Folder activity" page logged in as teacherAnd I click on "Edit" "button"And I click on "Add..." "button"And I should see "Content bank" in the ".fp-repo-area" "css_element"And I select "Content bank" repository in file pickerAnd I set the field "Search repository" to "content"When I press enterThen I should see "3" elements in repository content areaAnd I should see "coursecontent1.h5p" "file" in repository content areaAnd I should see "categorycontent1.h5p" "file" in repository content areaAnd I should see "systemcontent.h5p" "file" in repository content area