AutorÃa | Ultima modificación | Ver Log |
@core @core_searchFeature: Use global search interfaceIn order to search for thingsAs a userI need to be able to type search queries and see resultsBackground:Given the following config values are set as admin:| enableglobalsearch | 1 || searchengine | simpledb |And the following "courses" exist:| shortname | fullname || F1 | Amphibians |And the following "activities" exist:| activity | name | intro | course | idnumber || page | PageName1 frogs amphibians | PageDesc1 | F1 | PAGE1 || forum | ForumName1 toads amphibians | ForumDesc1 | F1 | FORUM1 |And I update the global search indexAnd I log in as "admin"@javascriptScenario: Search from header search box with one resultWhen I search for "frogs" using the header global search boxThen I should see "PageName1"And I should see "PageDesc1"# Check the link works.And I follow "PageName1"And I should see "PageName1" in the ".breadcrumb" "css_element"@javascriptScenario: Search from search page with two resultsWhen I search for "zombies" using the header global search boxThen I should see "No results"And I set the field "id_q" to "amphibians"# You cannot press "Search" because there's a fieldset with the same name that gets in the way.And I press "id_submitbutton"And I should see "ForumName1"And I should see "ForumDesc1"And I should see "PageName1"And I should see "PageDesc1"# Check the link works.And I follow "ForumName1"And I should see "ForumName1" in the ".breadcrumb" "css_element"@javascriptScenario: Search from search page with quotesGiven I search for "zombies" using the header global search boxAnd I should see "No results"When I set the field "id_q" to "\"amphibians\""# You cannot press "Search" because there's a fieldset with the same name that gets in the way.And I press "id_submitbutton"Then I should see "ForumName1"And I should see "ForumDesc1"And I should see "PageName1"And I should see "PageDesc1"# Check the link works.And I follow "ForumName1"And I should see "ForumName1" in the ".breadcrumb" "css_element"@javascriptScenario: Search starting from site context (no within option)When I search for "frogs" using the header global search boxAnd I expand all fieldsetsThen I should not see "Search within"And I should see "Courses" in the "region-main" "region"@javascriptScenario: Search starting from course context (within option lists course)When I am on "Amphibians" course homepageAnd I search for "frogs" using the header global search boxAnd I expand all fieldsetsThen I should see "Search within"And I select "Everywhere you can access" from the "Search within" singleselectAnd I should see "Courses" in the "region-main" "region"And I select "Course: Amphibians" from the "Search within" singleselectAnd I should not see "Courses" in the "region-main" "region"@javascriptScenario: Search starting from forum context (within option lists course and forum)Given I am on the "ForumName1 toads amphibians" "Forum activity" pageWhen I search for "frogs" using the header global search boxThen I expand all fieldsetsAnd I should see "Search within"And I select "Everywhere you can access" from the "Search within" singleselectAnd I should see "Courses" in the "region-main" "region"And I select "Course: Amphibians" from the "Search within" singleselectAnd I should not see "Courses" in the "region-main" "region"And I select "Forum: ForumName1" from the "Search within" singleselectAnd I should not see "Courses" in the "region-main" "region"@javascriptScenario: Check that groups option in search form appears when intended# Switch to mocked Solr search because simpledb doesn't support groups.Given solr is installedAnd the following config values are set as admin:| searchengine | solr |And the following "groups" exist:| name | course | idnumber || A Group | F1 | G1 || B Group | F1 | G2 |And the following "activities" exist:| activity | name | course | idnumber | groupmode || forum | ForumSG | F1 | FORUM2 | 1 |When I am on the ForumSG "Forum activity" pageAnd global search expects the query "frogs" and will return:| type | idnumber || activity | PAGE1 |And I search for "frogs" using the header global search boxAnd I expand all fieldsetsThen I should not see "All groups" in the "region-main" "region"And I select "Course: Amphibians" from the "Search within" singleselectAnd I should see "All groups" in the "region-main" "region"And I set the field "Groups" to "A Group"And I select "Forum: ForumSG" from the "Search within" singleselectAnd I should see "A Group" in the "region-main" "region"And I am on the "ForumName1 toads amphibians" "Forum activity" pageAnd global search expects the query "frogs" and will return:| type | idnumber || activity | PAGE1 |And I search for "frogs" using the header global search boxAnd I expand all fieldsetsThen I should not see "All groups" in the "region-main" "region"And I select "Course: Amphibians" from the "Search within" singleselectAnd I should see "All groups" in the "region-main" "region"And I select "Forum: ForumName1" from the "Search within" singleselectAnd I should not see "All groups" in the "region-main" "region"