[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Add browser tests for geaosearch features
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/326891 ) Change subject: Add browser tests for geaosearch features .. Add browser tests for geaosearch features Adds browser tests for neartitle:, nearcoord: and their boost-* companions. Change-Id: I04bf9684de4f63d88de202757213f8e322c11844 --- A tests/browser/features/geosearch.feature M tests/browser/features/support/hooks.rb 2 files changed, 74 insertions(+), 0 deletions(-) Approvals: Cindy-the-browser-test-bot: Looks good to me, but someone else must approve jenkins-bot: Verified DCausse: Looks good to me, approved diff --git a/tests/browser/features/geosearch.feature b/tests/browser/features/geosearch.feature new file mode 100644 index 000..45ccc65 --- /dev/null +++ b/tests/browser/features/geosearch.feature @@ -0,0 +1,58 @@ +#* neartitle:Shanghai +#* neartitle:50km,Seoul +#* nearcoord:1.2345,-5.4321 +#* nearcoord:17km,54.321,-12.345 +#* boost-neartitle:"San Francisco" +#* boost-neartitle:50km,Kampala +#* boost-nearcoord:-12.345,87.654 +#* boost-nearcoord:77km,34.567,76.543 + +@clean @api @geo +Feature: Geographical searches + Scenario: neartitle: with title +When I api search for neartitle:10km,San_Jose +Then Santa Clara is the first api search result + + Scenario: neartitle: with title and default radius +When I api search for neartitle:Cupertino +Then there are no api search results + + Scenario Outline: nearcoord: with coordinate +When I api search for nearcoord: +Then is the first api search result + Examples: +| coordinate | city| +|37.33,-121.9 | San Jose| +|37.35,-121.969167 | Santa Clara | +|37.3175,-122.041944 | Cupertino | + + Scenario Outline: nearcoord: with coordinate and radius +When I api search for nearcoord:10km, +Then there are api search results +Examples: + | coordinate | count | + |37.33,-121.9 | 2 | + |37.35,-121.969167 | 3 | + |37.3175,-122.041944 | 2 | + + + Scenario Outline: Title proximity boost +When I api search for boost-neartitle:km,Cupertino nice city +Then Cupertino is the first api search result +And there are 3 api search results + Examples: +| distance | +| 1| +| 5| +| 10 | +| 100 | + + Scenario Outline: Coordinate proximity boost +When I api search for boost-nearcoord: nice city +Then is the first api search result +And there are 3 api search results +Examples: + | coordinate | city| + |37.33,-121.9 | San Jose| + |37.35,-121.969167 | Santa Clara | + |37.3175,-122.041944 | Cupertino | diff --git a/tests/browser/features/support/hooks.rb b/tests/browser/features/support/hooks.rb index acd6252..b0ca163 100644 --- a/tests/browser/features/support/hooks.rb +++ b/tests/browser/features/support/hooks.rb @@ -681,6 +681,19 @@ end end +geo = false +setup_geo = lambda do |world| + unless geo +world.steps %( +Given a page named San Jose exists with contents San Jose is a nice city located at {{#coordinates:primary|37.33|-121.9}}. + And a page named Santa Clara exists with contents Santa Clara is a nice city located at {{#coordinates:primary|37.35|-121.969167}}. + And a page named Cupertino exists with contents Cupertino is a nice city located at {{#coordinates:primary|37.3175|-122.041944}}. +) +geo = true + end +end + + ruwiki = false setup_ruwiki = lambda do |world| unless ruwiki @@ -935,3 +948,6 @@ Before("@ru") do setup_ruwiki.call(self) end +Before("@geo") do + setup_geo.call(self) +end -- To view, visit https://gerrit.wikimedia.org/r/326891 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I04bf9684de4f63d88de202757213f8e322c11844 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: master Gerrit-Owner: SmalyshevGerrit-Reviewer: Cindy-the-browser-test-bot Gerrit-Reviewer: DCausse Gerrit-Reviewer: EBernhardson Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Add browser tests for geaosearch features
Smalyshev has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/326891 ) Change subject: Add browser tests for geaosearch features .. Add browser tests for geaosearch features Adds browser tests for neartitle:, nearcoord: and their boost-* companions. Change-Id: I04bf9684de4f63d88de202757213f8e322c11844 --- A tests/browser/features/geosearch.feature M tests/browser/features/support/hooks.rb 2 files changed, 74 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch refs/changes/91/326891/1 diff --git a/tests/browser/features/geosearch.feature b/tests/browser/features/geosearch.feature new file mode 100644 index 000..45ccc65 --- /dev/null +++ b/tests/browser/features/geosearch.feature @@ -0,0 +1,58 @@ +#* neartitle:Shanghai +#* neartitle:50km,Seoul +#* nearcoord:1.2345,-5.4321 +#* nearcoord:17km,54.321,-12.345 +#* boost-neartitle:"San Francisco" +#* boost-neartitle:50km,Kampala +#* boost-nearcoord:-12.345,87.654 +#* boost-nearcoord:77km,34.567,76.543 + +@clean @api @geo +Feature: Geographical searches + Scenario: neartitle: with title +When I api search for neartitle:10km,San_Jose +Then Santa Clara is the first api search result + + Scenario: neartitle: with title and default radius +When I api search for neartitle:Cupertino +Then there are no api search results + + Scenario Outline: nearcoord: with coordinate +When I api search for nearcoord: +Then is the first api search result + Examples: +| coordinate | city| +|37.33,-121.9 | San Jose| +|37.35,-121.969167 | Santa Clara | +|37.3175,-122.041944 | Cupertino | + + Scenario Outline: nearcoord: with coordinate and radius +When I api search for nearcoord:10km, +Then there are api search results +Examples: + | coordinate | count | + |37.33,-121.9 | 2 | + |37.35,-121.969167 | 3 | + |37.3175,-122.041944 | 2 | + + + Scenario Outline: Title proximity boost +When I api search for boost-neartitle:km,Cupertino nice city +Then Cupertino is the first api search result +And there are 3 api search results + Examples: +| distance | +| 1| +| 5| +| 10 | +| 100 | + + Scenario Outline: Coordinate proximity boost +When I api search for boost-nearcoord: nice city +Then is the first api search result +And there are 3 api search results +Examples: + | coordinate | city| + |37.33,-121.9 | San Jose| + |37.35,-121.969167 | Santa Clara | + |37.3175,-122.041944 | Cupertino | diff --git a/tests/browser/features/support/hooks.rb b/tests/browser/features/support/hooks.rb index acd6252..b0ca163 100644 --- a/tests/browser/features/support/hooks.rb +++ b/tests/browser/features/support/hooks.rb @@ -681,6 +681,19 @@ end end +geo = false +setup_geo = lambda do |world| + unless geo +world.steps %( +Given a page named San Jose exists with contents San Jose is a nice city located at {{#coordinates:primary|37.33|-121.9}}. + And a page named Santa Clara exists with contents Santa Clara is a nice city located at {{#coordinates:primary|37.35|-121.969167}}. + And a page named Cupertino exists with contents Cupertino is a nice city located at {{#coordinates:primary|37.3175|-122.041944}}. +) +geo = true + end +end + + ruwiki = false setup_ruwiki = lambda do |world| unless ruwiki @@ -935,3 +948,6 @@ Before("@ru") do setup_ruwiki.call(self) end +Before("@geo") do + setup_geo.call(self) +end -- To view, visit https://gerrit.wikimedia.org/r/326891 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04bf9684de4f63d88de202757213f8e322c11844 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: master Gerrit-Owner: Smalyshev___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits