Manybubbles has uploaded a new change for review.
https://gerrit.wikimedia.org/r/85910
Change subject: Tests for quotes turning of stemming.
......................................................................
Tests for quotes turning of stemming.
Note that these tests expose a new bug numbered 54526.
Bug: 54020
Change-Id: Id2002e7e9d90a42545a6bb2a5f5d70ea31d2104a
---
M tests/browser/features/full_text.feature
M tests/browser/features/full_text_highlighting.feature
M tests/browser/features/support/build_pages.rb
3 files changed, 80 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch
refs/changes/10/85910/1
diff --git a/tests/browser/features/full_text.feature
b/tests/browser/features/full_text.feature
index e7a28fc..edb71e0 100644
--- a/tests/browser/features/full_text.feature
+++ b/tests/browser/features/full_text.feature
@@ -12,6 +12,7 @@
| term | first_result
| two_words_is_in | image? |
| catapult | Catapult is in
| in | |
| pickles | Two Words is
| in | |
+ # Catches Bug 54399
| catapul* | Catapult is in
| in | |
| rdir | Two Words is
| not in | |
| intitle:catapult | Catapult is in
| not in | |
@@ -219,7 +220,52 @@
When I search for "Rescore" Words Test
Then Test Words Rescore Rescore is the first search result
- @setup_phrase_rescore
- Scenario: Searching for a quoted prefix search doesn't find any results
- When I search for "rescor*"
+ @setup_main @exact_quotes
+ Scenario: Searching for a word in quotes disbles stemming (can't find plural
with singular)
+ When I search for "pickle"
Then there are no search results
+
+ @setup_main @exact_quotes
+ Scenario: Searching for a word in quotes disbles stemming (can still find
plural with exact match)
+ When I search for "pickles"
+ Then Two Words is the first search result
+
+ @setup_main @exact_quotes
+ Scenario: Searching for a phrase in quotes disbles stemming (can't find
plural with singular)
+ When I search for "catapult pickle"
+ Then there are no search results
+
+ @setup_main @exact_quotes
+ Scenario: Searching for a phrase in quotes disbles stemming (can still find
plural with exact match)
+ When I search for "catapult pickles"
+ Then Two Words is the first search result
+
+ @exact_quotes
+ Scenario: Quoted phrases match stop words
+ When I search for "Contains A Stop Word"
+ Then Contains A Stop Word is the first search result
+
+ @setup_main @exact_quotes
+ Scenario: Adding a ~ to a phrase keeps stemming enabled
+ When I search for "catapult pickle"~
+ Then Two Words is the first search result
+
+ @exact_quotes
+ Scenario: Adding a ~ to a phrase stops it from matching stop words
+ When I search for "doesn't actually Contains A Stop Word"~
+ Then Doesn't Actually Contain Stop Words is the first search result
+
+ @setup_main @exact_quotes
+ Scenario: Adding a ~<a number>~ to a phrase keeps stemming enabled
+ When I search for "catapult pickle"~0~
+ Then Two Words is the first search result
+
+ @setup_main @exact_quotes
+ Scenario: Adding a ~<a number> to a phrase turns off because it is a
proximity search
+ When I search for "catapult pickle"~0
+ Then there are no search results
+
+ @exact_quotes
+ Scenario: Searching for a quoted * actually searches for a *
+ When I search for "pick*"
+ Then Pick* is the first search result
diff --git a/tests/browser/features/full_text_highlighting.feature
b/tests/browser/features/full_text_highlighting.feature
index 7b611e3..37a45c8 100644
--- a/tests/browser/features/full_text_highlighting.feature
+++ b/tests/browser/features/full_text_highlighting.feature
@@ -18,16 +18,31 @@
# Verify highlighting the presence of accent squashing
| Africa test | *África* | for *testing*
|
# Verify highlighting on large pages (Bug 52680). It is neat to see that
the stopwords aren't highlighted.
- | "discuss problems of social and cultural importance" | Rashidun
Caliphate | the faithful gathered to *discuss problems* of *social* and
*cultural importance*. During the caliphate of |
+ # Bug 54526
+ # | "discuss problems of social and cultural importance" | Rashidun
Caliphate | the faithful gathered to *discuss problems* of *social* and
*cultural importance*. During the caliphate of |
+ | "discuss problems of social and cultural importance"~ | Rashidun
Caliphate | the faithful gathered to *discuss problems* of *social* and
*cultural importance*. During the caliphate of |
+
+ # Bug 54526
+ # @setup_headings
+ # Scenario: Found words are highlighted in headings
+ # When I search for "i am a heading"
+ # Then *I* *am* a *heading* is the highlighted alttitle of the first
search result
+
+ # Bug 54526
+ # @setup_highlighting
+ # Scenario: Found words are highlighted in headings and text even in large
documents
+ # When I search for "Succession of Umar"
+ # Then *Succession* of *Umar* is the highlighted alttitle of the first
search result
+ # And *Succession* of *Umar* is in the highlighted text of the first
search result
@setup_headings
- Scenario: Found words are highlighted in headings
- When I search for "i am a heading"
+ Scenario: Found words are highlighted in headings when searching for a
non-strict phrase
+ When I search for "i am a heading"~
Then *I* *am* a *heading* is the highlighted alttitle of the first search
result
@setup_highlighting
- Scenario: Found words are highlighted in headings and text even in large
documents
- When I search for "Succession of Umar"
+ Scenario: Found words are highlighted in headings and text even in large
documents when searching in a non-strict phrase
+ When I search for "Succession of Umar"~
Then *Succession* of *Umar* is the highlighted alttitle of the first
search result
And *Succession* of *Umar* is in the highlighted text of the first search
result
diff --git a/tests/browser/features/support/build_pages.rb
b/tests/browser/features/support/build_pages.rb
index 9c2b648..c755109 100644
--- a/tests/browser/features/support/build_pages.rb
+++ b/tests/browser/features/support/build_pages.rb
@@ -128,3 +128,14 @@
end
$setup_phrase_rescore = true
end
+
+Before('@exact_quotes') do
+ if !$exact_quotes
+ steps %Q{
+ Given a page named Contains A Stop Word exists
+ And a page named Doesn't Actually Contain Stop Words exists
+ And a page named Pick* exists
+ }
+ end
+ $exact_quotes = true
+end
--
To view, visit https://gerrit.wikimedia.org/r/85910
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2002e7e9d90a42545a6bb2a5f5d70ea31d2104a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Manybubbles <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits