Henning Snater has submitted this change and it was merged.
Change subject: Selenium tests for entityselector paging
......................................................................
Selenium tests for entityselector paging
Bug: 48131
Change-Id: I08d37b9f39a400420637fa0c96e45cc384b71544
---
M repo/tests/selenium/special/entity_search_spec.rb
1 file changed, 38 insertions(+), 2 deletions(-)
Approvals:
Henning Snater: Verified; Looks good to me, approved
jenkins-bot: Verified
diff --git a/repo/tests/selenium/special/entity_search_spec.rb
b/repo/tests/selenium/special/entity_search_spec.rb
index 752f6d8..70747d1 100644
--- a/repo/tests/selenium/special/entity_search_spec.rb
+++ b/repo/tests/selenium/special/entity_search_spec.rb
@@ -7,7 +7,8 @@
require 'spec_helper'
-num_items = 1
+num_items = 8
+label_common_prefix = generate_random_string(4)
alias_a = generate_random_string(8)
alias_b = generate_random_string(8)
@@ -15,7 +16,7 @@
count = 0
items = Array.new
while count < num_items do
- items.push({"label"=>generate_random_string(10),
"description"=>generate_random_string(20)})
+ items.push({"label"=>label_common_prefix + generate_random_string(10),
"description"=>generate_random_string(20)})
count = count + 1
end
@@ -38,6 +39,15 @@
ajax_wait
page.wait_for_suggestions_list
page.entitySelectorSearchInput.should == items[0]["label"]
+ end
+ end
+ it "should check for multiple suggestions" do
+ visit_page(RepoMainPage) do |page|
+ page.entitySelectorSearchInput?.should be_true
+ page.entitySelectorSearchInput = label_common_prefix
+ ajax_wait
+ page.wait_for_suggestions_list
+ page.count_search_results.should == 9 # 7 suggestions, "more" &
"containing.."
end
end
end
@@ -149,4 +159,30 @@
end
end
end
+
+ context "Check more-button" do
+ it "should check existence of 'more'" do
+ visit_page(RepoMainPage) do |page|
+ page.entitySelectorSearchInput = label_common_prefix
+ ajax_wait
+ page.wait_for_suggestions_list
+ page.get_search_results[7].text.include?("more").should be_true
+ end
+ end
+ it "should check functionality of 'more'" do
+ visit_page(RepoMainPage) do |page|
+ page.entitySelectorSearchInput = label_common_prefix
+ ajax_wait
+ page.wait_for_suggestions_list
+ page.count_search_results.should == 9 # 7 suggestions, "more" &
"containing.."
+ page.get_search_results[7].click
+ ajax_wait
+ page.wait_for_suggestions_list
+ page.count_search_results.should == 9 # 8 suggestions, "containing.."
+ search_results = page.get_search_results
+ search_results[7].text.include?("more").should be_false
+ search_results[8].text.include?("more").should be_false
+ end
+ end
+ end
end
--
To view, visit https://gerrit.wikimedia.org/r/64047
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I08d37b9f39a400420637fa0c96e45cc384b71544
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: Daniel Werner <[email protected]>
Gerrit-Reviewer: Henning Snater <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits