Karim.rayani has uploaded a new change for review.

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


Change subject: Feature: Print/export section expand collapse
......................................................................

Feature: Print/export section expand collapse

Tests have been failing because expanding and collapsing Print/export section 
does not work at times

Bug: 48225
Change-Id: I8f295e48f30efa0fa8d72c563b9809efd4e52582
---
A features/print_export_menu_readonly.feature
A features/step_definitions/print_export_menu_steps.rb
M features/support/pages/random_page.rb
3 files changed, 48 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests 
refs/changes/75/63275/1

diff --git a/features/print_export_menu_readonly.feature 
b/features/print_export_menu_readonly.feature
new file mode 100644
index 0000000..a564734
--- /dev/null
+++ b/features/print_export_menu_readonly.feature
@@ -0,0 +1,12 @@
+# Feature files that end with "_readonly.feature" should be read only, so they 
could be run at en.wikipedia.org
[email protected] @en.wikipedia.org @test2.wikipedia.org
+Feature: Print/Export menu Expand and Collapse
+
+  Scenario: Check for Print/export section Collapsed
+    Given I am at random page
+    Then Print/export section should be collapsed
+
+  Scenario: Check for Print/export section Expanded
+    Given I am at random page
+    When I click Print/export
+    Then Print/export section should be expanded
diff --git a/features/step_definitions/print_export_menu_steps.rb 
b/features/step_definitions/print_export_menu_steps.rb
new file mode 100644
index 0000000..8c9e1a2
--- /dev/null
+++ b/features/step_definitions/print_export_menu_steps.rb
@@ -0,0 +1,35 @@
+Then(/^Print\/export section should be collapsed$/) do
+  (@browser.div(id: 'p-coll-print_export').attribute_value "class").should == 
"portal collapsed"
+  (@browser.div(id: 'p-coll-print_export').div(class: 'body').style 
"display").should == "none"
+  hash_cookies = @browser.cookies.to_a
+  flag_print_export_cookie = false
+  flag_print_export_cookie_value = ""
+  if hash_cookies.size > 0
+    for i in 0...hash_cookies.size
+      if (hash_cookies[i][:name]).eql? "vector-nav-p-coll-print_export"
+        flag_print_export_cookie_value = hash_cookies[i][:value]
+      end
+    end
+  end
+  flag_print_export_cookie_value.should_not == "true"
+end
+
+Then(/^Print\/export section should be expanded$/) do
+  (@browser.div(id: 'p-coll-print_export').attribute_value "class").should == 
"portal expanded"
+  (@browser.div(id: 'p-coll-print_export').div(class: 'body').style 
"display").should == "block"
+  hash_cookies = @browser.cookies.to_a
+  flag_print_export_cookie = false
+  flag_print_export_cookie_value = false
+  if hash_cookies.size > 0
+    for i in 0...hash_cookies.size
+      if (hash_cookies[i][:name]).eql? "vector-nav-p-coll-print_export"
+        flag_print_export_cookie_value = hash_cookies[i][:value]
+      end
+    end
+  end
+  flag_print_export_cookie_value.should == "true"
+end
+
+When(/^I click Print\/export$/) do
+  on(RandomPage).print_export
+end
diff --git a/features/support/pages/random_page.rb 
b/features/support/pages/random_page.rb
index 375a2f3..928a982 100644
--- a/features/support/pages/random_page.rb
+++ b/features/support/pages/random_page.rb
@@ -7,6 +7,7 @@
   li(:main_page, id: 'n-mainpage-description')
   a(:download_as_pdf, text: 'Download as PDF')
   a(:download_the_file, text: 'Download the file')
+  a(:print_export, text: 'Print/export')
   a(:uls_trigger, class: 'uls-trigger')
   div(:search, id: 'search')
   text_field(:search_input, id: 'searchInput')

-- 
To view, visit https://gerrit.wikimedia.org/r/63275
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f295e48f30efa0fa8d72c563b9809efd4e52582
Gerrit-PatchSet: 1
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Karim.rayani <[email protected]>

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

Reply via email to