Contents

Filters

@users

In order to ensure filtering works on works and bookmarks As a humble user I want to filter on a user's works and bookmarks

Background:

  • Given a canonical fandom "The Hobbit"
  • And a canonical fandom "Harry Potter"
  • And a canonical fandom "Legend of Korra"
  • And the work "A Hobbit's Meandering" by "meatloaf" with fandom "The Hobbit"
  • And the work "Bilbo Does the Thing" by "meatloaf" with fandom "The Hobbit, Legend of Korra"
  • And the work "Roonal Woozlib and the Ferrets of Nimh" by "meatloaf" with fandom "Harry Potter"
  • And all indexing jobs have been run
  • And the dashboard counts have expired
  • And I am logged in as "meatloaf"

Scenario: You can filter through a user's works using inclusion filters

@javascript

  • When I go to meatloaf's user page
  • And I follow "Works (3)"
  • Then I should see "A Hobbit's Meandering"
  • And I should see "Bilbo Does the Thing"
  • And I should see "Roonal Woozlib and the Ferrets of Nimh"
  • And I should see "Include"
  • And I should see "Exclude"
  • When I press "Fandoms" within "dd.include"
  • Then I should see "The Hobbit (2)" within "#include_fandom_tags"
  • And I should see "Harry Potter (1)" within "#include_fandom_tags"
  • And I should see "Legend of Korra (1)" within "#include_fandom_tags"
  • When I check "The Hobbit (2)" within "#include_fandom_tags"
  • And I press "Sort and Filter"
  • Then I should see "A Hobbit's Meandering"
  • And I should see "Bilbo Does the Thing"
  • And I should not see "Roonal Woozlib and the Ferrets of Nimh"
  • When I press "Fandoms" within "dd.include"
  • Then I should see "The Hobbit (2)" within "#include_fandom_tags"
  • And I should see "Legend of Korra (1)" within "#include_fandom_tags"
  • And I should not see "Harry Potter (1)" within "#include_fandom_tags"
  • When I check "Legend of Korra (1)" within "#include_fandom_tags"
  • And press "Sort and Filter"
  • Then I should see "Bilbo Does the Thing"
  • And I should not see "A Hobbit's Meandering"
  • And I should not see "Roonal Woozlib and the Ferrets of Nimh"
  • When I follow "Clear Filters"
  • Then I should see "3 Works by meatloaf"
  • And I should see "A Hobbit's Meandering"
  • And I should see "Bilbo Does the Thing"
  • And I should see "Roonal Woozlib and the Ferrets of Nimh"
  • When I press "Fandoms" within "dd.include"
  • Then the "The Hobbit (2)" checkbox within "#include_fandom_tags" should not be checked
  • And the "Legend of Korra (1)" checkbox within "#include_fandom_tags" should not be checked

Scenario: You can filter through a user's works using exclusion filters

@javascript

  • When I go to meatloaf's user page
  • And I follow "Works (3)"
  • When I press "Fandoms" within "dd.exclude"
  • Then I should see "The Hobbit (2)" within "#exclude_fandom_tags"
  • And I should see "Harry Potter (1)" within "#exclude_fandom_tags"
  • And I should see "Legend of Korra (1)" within "#exclude_fandom_tags"
  • When I check "Harry Potter (1)" within "#exclude_fandom_tags"
  • And I press "Sort and Filter"
  • Then I should see "Bilbo Does the Thing"
  • And I should see "A Hobbit's Meandering"
  • And I should not see "Roonal Woozlib and the Ferrets of Nimh"
  • When I press "Fandoms" within "dd.exclude"
  • Then I should see "The Hobbit (2)" within "#exclude_fandom_tags"
  • And I should see "Legend of Korra (1)" within "#exclude_fandom_tags"
  • And I should see "Harry Potter (0)" within "#exclude_fandom_tags"
  • When I check "Legend of Korra (1)" within "#exclude_fandom_tags"
  • And I press "Sort and Filter"
  • Then I should see "A Hobbit's Meandering"
  • And I should not see "Bilbo Does the Thing"
  • And I should not see "Roonal Woozlib and the Ferrets of Nimh"
  • When I follow "Clear Filters"
  • Then I should see "3 Works by meatloaf"
  • And I should see "A Hobbit's Meandering"
  • And I should see "Bilbo Does the Thing"
  • And I should see "Roonal Woozlib and the Ferrets of Nimh"
  • When I press "Fandoms" within "dd.exclude"
  • Then the "Legend of Korra (1)" checkbox within "#exclude_fandom_tags" should not be checked
  • And the "Harry Potter (1)" checkbox within "#exclude_fandom_tags" should not be checked

Scenario: Filter through a user's works with non-existent tags

@javascript

  • Given the tag "legend korra" does not exist
  • And all indexing jobs have been run
  • When I go to meatloaf's works page
  • And I fill in "Other tags to include" with "legend korra"
  • And I press "Sort and Filter"
  • Then I should see "1 Work by meatloaf"
  • And I should see "Bilbo Does the Thing"
  • And I should not see "A Hobbit's Meandering"
  • And I should not see "Roonal Woozlib and the Ferrets of Nimh"
  • When I go to meatloaf's works page
  • And I fill in "Other tags to exclude" with "legend korra"
  • And I press "Sort and Filter"
  • Then I should see "2 Works by meatloaf"
  • And I should not see "Bilbo Does the Thing"
  • And I should see "A Hobbit's Meandering"
  • And I should see "Roonal Woozlib and the Ferrets of Nimh"

Scenario: You can filter through a user's bookmarks using inclusion filters

@javascript

  • Given I am logged in as "recengine"
  • And I bookmark the work "Bilbo Does the Thing"
  • And I bookmark the work "A Hobbit's Meandering"
  • And I bookmark the work "Roonal Woozlib and the Ferrets of Nimh"
  • And the dashboard counts have expired
  • When I go to recengine's user page
  • And I follow "Bookmarks (3)"
  • Then I should see "Bilbo Does the Thing"
  • And I should see "A Hobbit's Meandering"
  • And I should see "Roonal Woozlib and the Ferrets of Nimh"
  • And I should see "Include"
  • And I should see "Exclude"
  • When I press "Fandoms" within "dd.include"
  • Then I should see "The Hobbit (2)" within "#include_fandom_tags"
  • And I should see "Harry Potter (1)" within "#include_fandom_tags"
  • And I should see "Legend of Korra (1)" within "#include_fandom_tags"
  • When I check "The Hobbit (2)" within "#include_fandom_tags"
  • And I press "Sort and Filter"
  • Then I should see "A Hobbit's Meandering"
  • And I should see "Bilbo Does the Thing"
  • And I should not see "Roonal Woozlib and the Ferrets of Nimh"
  • When I press "Fandoms" within "dd.include"
  • Then I should see "The Hobbit (2)" within "#include_fandom_tags"
  • And I should see "Legend of Korra (1)" within "#include_fandom_tags"
  • And I should not see "Harry Potter (1)" within "#include_fandom_tags"
  • When I check "Legend of Korra (1)" within "#include_fandom_tags"
  • And press "Sort and Filter"
  • Then I should see "Bilbo Does the Thing"
  • And I should not see "A Hobbit's Meandering"
  • And I should not see "Roonal Woozlib and the Ferrets of Nimh"

Scenario: You can filter through a user's bookmarks using exclusion filters

@javascript

  • Given I am logged in as "recengine"
  • And I bookmark the work "Bilbo Does the Thing"
  • And I bookmark the work "A Hobbit's Meandering"
  • And I bookmark the work "Roonal Woozlib and the Ferrets of Nimh"
  • And the dashboard counts have expired
  • When I go to recengine's user page
  • And I follow "Bookmarks (3)"
  • When I press "Fandoms" within "dd.exclude"
  • Then the "The Hobbit (2)" checkbox within "#exclude_fandom_tags" should not be checked
  • And the "Harry Potter (1)" checkbox within "#exclude_fandom_tags" should not be checked
  • And the "Legend of Korra (1)" checkbox within "#exclude_fandom_tags" should not be checked
  • When I check "Harry Potter (1)" within "#exclude_fandom_tags"
  • And I press "Sort and Filter"
  • Then I should see "Bilbo Does the Thing"
  • And I should see "A Hobbit's Meandering"
  • And I should not see "Roonal Woozlib and the Ferrets of Nimh"
  • When I press "Fandoms" within "dd.exclude"
  • Then the "The Hobbit (2)" checkbox within "#exclude_fandom_tags" should not be checked
  • And the "Legend of Korra (1)" checkbox within "#exclude_fandom_tags" should not be checked
  • And the "Harry Potter (0)" checkbox within "#exclude_fandom_tags" should be checked
  • When I check "Legend of Korra (1)" within "#exclude_fandom_tags"
  • And I press "Sort and Filter"
  • Then I should see "A Hobbit's Meandering"
  • And I should not see "Bilbo Does the Thing"
  • And I should not see "Roonal Woozlib and the Ferrets of Nimh"

Scenario: Filter a user's bookmarks by "Search within results" and "Search bookmarker's tags and notes"

@javascript

  • Given I am logged in as "recengine"
  • And I bookmark the work "Bilbo Does the Thing" with the tags "hobbit"
  • And I bookmark the work "A Hobbit's Meandering" with the tags "bilbo"
  • And all indexing jobs have been run
  • And the dashboard counts have expired
  • When I go to recengine's bookmarks page
  • And I fill in "Search within results" with "bilbo"
  • And I press "Sort and Filter"
  • Then I should see "1 Bookmark found by recengine"
  • And I should see "Bilbo Does the Thing"
  • And I should not see "A Hobbit's Meandering"
  • When I go to recengine's bookmarks page
  • And I fill in "Search bookmarker's tags and notes" with "bilbo"
  • And I press "Sort and Filter"
  • Then I should see "1 Bookmark found by recengine"
  • And I should see "A Hobbit's Meandering"
  • And I should not see "Bilbo Does the Thing"

Scenario: Filter a user's bookmarks by bookmarker's tags

@javascript

  • Given I am logged in as "recengine"
  • And I bookmark the work "Bilbo Does the Thing" with the tags "to read,been here"
  • And I bookmark the work "A Hobbit's Meandering" with the tags "to read"
  • And I bookmark the work "Roonal Woozlib and the Ferrets of Nimh" with the tags "been here"
  • And all indexing jobs have been run
  • And the dashboard counts have expired
  • When I go to recengine's bookmarks page
  • And I press "Bookmarker's Tags" within "dd.include"
  • Then the "to read (2)" checkbox within "#include_tag_tags" should not be checked
  • And the "been here (2)" checkbox within "#include_tag_tags" should not be checked
  • When I check "to read (2)" within "#include_tag_tags"
  • And I press "Sort and Filter"
  • Then I should see "2 Bookmarks by recengine"
  • And the "to read (2)" checkbox within "#include_tag_tags" should be checked
  • And I should see "Bilbo Does the Thing"
  • And I should see "A Hobbit's Meandering"
  • And I should not see "Roonal Woozlib and the Ferrets of Nimh"
  • When I check "been here (1)" within "#include_tag_tags"
  • And I press "Sort and Filter"
  • Then I should see "1 Bookmark by recengine"
  • And I should see "Bilbo Does the Thing"
  • When I go to recengine's bookmarks page
  • And I press "Bookmarker's Tags" within "dd.exclude"
  • Then the "to read (2)" checkbox within "#exclude_tag_tags" should not be checked
  • And the "been here (2)" checkbox within "#exclude_tag_tags" should not be checked
  • When I check "to read (2)" within "#exclude_tag_tags"
  • And I press "Sort and Filter"
  • Then I should see "1 Bookmark by recengine"
  • And the "to read (0)" checkbox within "#exclude_tag_tags" should be checked
  • And I should not see "Bilbo Does the Thing"
  • And I should not see "A Hobbit's Meandering"
  • And I should see "Roonal Woozlib and the Ferrets of Nimh"
  • When I check "been here (1)" within "#exclude_tag_tags"
  • And I press "Sort and Filter"
  • Then I should see "0 Bookmarks by recengine"
  • When I go to recengine's bookmarks page
  • And I fill in "Other bookmarker's tags to include" with "to read"
  • And I press "Sort and Filter"
  • Then I should see "2 Bookmarks by recengine"
  • And I should see "Bilbo Does the Thing"
  • And I should see "A Hobbit's Meandering"
  • And I should not see "Roonal Woozlib and the Ferrets of Nimh"
  • When I go to recengine's bookmarks page
  • And I fill in "Other bookmarker's tags to exclude" with "to read"
  • And I press "Sort and Filter"
  • Then I should see "1 Bookmark by recengine"
  • And I should not see "Bilbo Does the Thing"
  • And I should not see "A Hobbit's Meandering"
  • And I should see "Roonal Woozlib and the Ferrets of Nimh"

Scenario: Filter bookmarks by a tag that appears both on bookmarked works and in bookmarker's tags

  • Given I am logged in as "recengine"
  • And I bookmark the work "Bilbo Does the Thing"
  • And I bookmark the work "Roonal Woozlib and the Ferrets of Nimh" with the tags "The Hobbit"
  • And the dashboard counts have expired
  • When I go to recengine's bookmarks page
  • Then the "The Hobbit (1)" checkbox within "#exclude_fandom_tags" should not be checked
  • And the "The Hobbit (1)" checkbox within "#exclude_tag_tags" should not be checked
  • When I check "The Hobbit (1)" within "#exclude_fandom_tags"
  • And I press "Sort and Filter"
  • Then I should see "1 Bookmark by recengine"
  • And I should not see "Bilbo Does the Thing"
  • And I should see "Roonal Woozlib and the Ferrets of Nimh"
  • And the "The Hobbit (0)" checkbox within "#exclude_fandom_tags" should be checked
  • And the "The Hobbit (1)" checkbox within "#exclude_tag_tags" should not be checked
  • When I go to recengine's bookmarks page
  • And I check "The Hobbit (1)" within "#exclude_tag_tags"
  • And I press "Sort and Filter"
  • Then I should see "1 Bookmark by recengine"
  • And I should see "Bilbo Does the Thing"
  • And I should not see "Roonal Woozlib and the Ferrets of Nimh"
  • And the "The Hobbit (0)" checkbox within "#exclude_tag_tags" should be checked
  • And the "The Hobbit (1)" checkbox within "#exclude_fandom_tags" should not be checked
  • When I go to recengine's bookmarks page
  • And I check "The Hobbit (1)" within "#exclude_fandom_tags"
  • And I check "The Hobbit (1)" within "#exclude_tag_tags"
  • And I press "Sort and Filter"
  • Then I should see "0 Bookmarks by recengine"
  • And I should not see "Bilbo Does the Thing"
  • And I should not see "Roonal Woozlib and the Ferrets of Nimh"
  • And the "The Hobbit (0)" checkbox within "#exclude_fandom_tags" should be checked
  • And the "The Hobbit (0)" checkbox within "#exclude_tag_tags" should be checked

Scenario: Filter a user's bookmarks by non-existent tags

@javascript

  • Given the tag "legend korra" does not exist
  • And the tag "fun crossover" does not exist
  • And I am logged in as "recengine"
  • And I bookmark the work "A Hobbit's Meandering" with the tags "fun"
  • And I bookmark the work "Bilbo Does the Thing" with the tags "fun little crossover"
  • And all indexing jobs have been run
  • And the dashboard counts have expired
  • When I go to recengine's bookmarks page
  • And I fill in "Other work tags to include" with "legend korra"
  • And I press "Sort and Filter"
  • Then I should see "1 Bookmark by recengine"
  • And I should not see "A Hobbit's Meandering"
  • And I should see "Bilbo Does the Thing"
  • When I go to recengine's bookmarks page
  • And I fill in "Other work tags to exclude" with "legend korra"
  • And I press "Sort and Filter"
  • Then I should see "1 Bookmark by recengine"
  • And I should see "A Hobbit's Meandering"
  • And I should not see "Bilbo Does the Thing"
  • When I go to recengine's bookmarks page
  • And I fill in "Other bookmarker's tags to include" with "fun crossover"
  • And I press "Sort and Filter"
  • Then I should see "1 Bookmark by recengine"
  • And I should not see "A Hobbit's Meandering"
  • And I should see "Bilbo Does the Thing"
  • When I go to recengine's bookmarks page
  • And I fill in "Other bookmarker's tags to exclude" with "fun crossover"
  • And I press "Sort and Filter"
  • Then I should see "1 Bookmark by recengine"
  • And I should see "A Hobbit's Meandering"
  • And I should not see "Bilbo Does the Thing"

Scenario: Tag bookmark pages should display bookmarked items instead of bookmarks, and the sidebar counts should reflect that.

@javascript

  • Given I am logged in as "meatloaf"
  • And I bookmark the work "Bilbo Does the Thing"
  • And I bookmark the work "A Hobbit's Meandering"
  • And I am logged out
  • And I am logged in as "anothermeatloaf"
  • And I bookmark the work "Bilbo Does the Thing"
  • And I bookmark the work "A Hobbit's Meandering"
  • And all indexing jobs have been run
  • When I go to the bookmarks tagged "The Hobbit"
  • Then I should see "2 Bookmarked Items in The Hobbit"
  • When I follow "Fandoms"
  • Then I should see "The Hobbit (2)"

Scenario: Tag bookmark pages should be sortable by bookmarked item word count

  • Given bookmarks with various word counts in fandom "Yay a fandom" to search
  • When I go to the bookmarks tagged "Yay a fandom"
  • Then I should see "4 Bookmarked Items in Yay a fandom"
  • When I select "Word Count" from "Sort by"
  • And I press "Sort and Filter"
  • Then "Word Count" should be selected within "Sort by"
  • And "Twenty" should appear before "Fifteen"
  • And "Fifteen" should appear before "Ten"
  • And "Ten" should appear before "Five"

Scenario: Filtering with an invalid query while excluding a tag

  • When I go to meatloaf's user page
  • And I follow "Works (3)"
  • When I check "Harry Potter (1)" within "#exclude_fandom_tags"
  • And I press "Sort and Filter"
  • Then I should see "Bilbo Does the Thing"
  • When I fill in "work_search_query" with "bad~query!!!"
  • And I press "Sort and Filter"
  • Then I should see "Your search failed because of a syntax error"

Scenario: Filtering under a too-large word count

using words_to

  • When I go to meatloaf's user page
  • And I follow "Works (3)"
  • When I fill in "work_search_words_to" with "10000000000000000000"
  • And I press "Sort and Filter"
  • Then I should see "Bilbo Does the Thing"
  • And I should not see "Your search failed because of a syntax error"
  • When I go to meatloaf's user page
  • And I follow "Works (3)"
  • When I fill in "work_search_query" with "words:1-10000000000000000000"
  • And I press "Sort and Filter"
  • Then I should see "Bilbo Does the Thing"
  • And I should not see "Your search failed because of a syntax error"

Scenario: Filtering over a too-large word count

using words_from

  • When I go to meatloaf's user page
  • And I follow "Works (3)"
  • When I fill in "work_search_words_from" with "10000000000000000000"
  • And I press "Sort and Filter"
  • Then I should see "0 Works"
  • And I should not see "Your search failed because of a syntax error"
  • When I go to meatloaf's user page
  • And I follow "Works (3)"
  • When I fill in "work_search_query" with "words:>10000000000000000000"
  • And I press "Sort and Filter"
  • Then I should see "0 Works"
  • And I should not see "Your search failed because of a syntax error"

Source: features/search/filters.feature at commit f09caa86, Otwarchive (GPL license).