jenkins-bot has submitted this change and it was merged. Change subject: Fix the suggest test. ......................................................................
Fix the suggest test. Add back a step definition that I accidentally blow away and add some additional test data to make the "noble prize" suggestion test case harder on elasticsearch such that the "Improve suggestion configuration." change is require for elasticsearch to get the right answer. Change-Id: Ib6c33852714c51725bf3aa758771e17ad40fbdf9 --- M tests/browser/features/full_text.feature M tests/browser/features/step_definitions/search_steps.rb M tests/browser/features/support/build_pages.rb M tests/browser/features/support/pages/search_results_page.rb 4 files changed, 18 insertions(+), 1 deletion(-) Approvals: Demon: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/browser/features/full_text.feature b/tests/browser/features/full_text.feature index 8776062..606ac3b 100644 --- a/tests/browser/features/full_text.feature +++ b/tests/browser/features/full_text.feature @@ -88,3 +88,4 @@ | term | suggestion | | popular culatur | popular culture | | noble prize | nobel prize | + | nobel prize | none | diff --git a/tests/browser/features/step_definitions/search_steps.rb b/tests/browser/features/step_definitions/search_steps.rb index d72a88b..6aae8d9 100644 --- a/tests/browser/features/step_definitions/search_steps.rb +++ b/tests/browser/features/step_definitions/search_steps.rb @@ -74,7 +74,7 @@ on(SearchPage).search_results_element.when_present.should exist end Then(/^(.+) is the first suggestion$/) do |title| - if (title == 'none') then + if title == 'none' then on(SearchPage).one_result_element.should_not exist else on(SearchPage).one_result.should == title @@ -129,6 +129,13 @@ step("#{title} is the first suggestion") end end +Then(/^(.*) is suggested$/) do |text| + if text == 'none' then + on(SearchResultsPage).suggestion_element.should_not exist + else + on(SearchResultsPage).suggestion.should == text + end +end def within(seconds) end_time = Time.new + Integer(seconds) diff --git a/tests/browser/features/support/build_pages.rb b/tests/browser/features/support/build_pages.rb index 7dab7ab..d1f54a8 100644 --- a/tests/browser/features/support/build_pages.rb +++ b/tests/browser/features/support/build_pages.rb @@ -33,6 +33,12 @@ And a page named Nobel Prize exists with contents nobel prize And a page named Noble Gasses exists with contents noble gasses And a page named Noble Somethingelse exists with contents noble somethingelse + And a page named Noble Somethingelse2 exists with contents noble somethingelse + And a page named Noble Somethingelse3 exists with contents noble somethingelse + And a page named Noble Somethingelse4 exists with contents noble somethingelse + And a page named Noble Somethingelse5 exists with contents noble somethingelse + And a page named Noble Somethingelse6 exists with contents noble somethingelse + And a page named Noble Somethingelse7 exists with contents noble somethingelse And a page named Template:Noble Pipe exists with contents pipes are so noble } $newsearch_setup_namespaces = true diff --git a/tests/browser/features/support/pages/search_results_page.rb b/tests/browser/features/support/pages/search_results_page.rb index 21e4399..8f738c5 100644 --- a/tests/browser/features/support/pages/search_results_page.rb +++ b/tests/browser/features/support/pages/search_results_page.rb @@ -12,6 +12,9 @@ def suggestion suggestion_wrapper_element.link_element.text end + def suggestion_element + suggestion_wrapper_element.link_element + end def results @browser.divs(:class => 'mw-search-result-heading') end -- To view, visit https://gerrit.wikimedia.org/r/78316 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib6c33852714c51725bf3aa758771e17ad40fbdf9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: master Gerrit-Owner: Manybubbles <never...@wikimedia.org> Gerrit-Reviewer: Cmcmahon <cmcma...@wikimedia.org> Gerrit-Reviewer: Demon <ch...@wikimedia.org> Gerrit-Reviewer: Zfilipin <zfili...@wikimedia.org> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits