Tobias Gritschacher has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/64047


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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/47/64047/1

diff --git a/repo/tests/selenium/special/entity_search_spec.rb 
b/repo/tests/selenium/special/entity_search_spec.rb
index 752f6d8..389973f 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: newchange
Gerrit-Change-Id: I08d37b9f39a400420637fa0c96e45cc384b71544
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to