Zfilipin has submitted this change and it was merged.

Change subject: Feature: PDF, Scenario: Click on Download as PDF link
......................................................................


Feature: PDF, Scenario: Click on Download as PDF link

Bug: 46224
Change-Id: I4b3a96fd7eefb85a1ba402b22c8b6ad922360550
---
M features/pdf.feature
M features/step_definitions/pdf_steps.rb
M features/support/env.rb
M features/support/pages/random_page.rb
4 files changed, 24 insertions(+), 2 deletions(-)

Approvals:
  Zfilipin: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/features/pdf.feature b/features/pdf.feature
index 1886b92..3422c2f 100644
--- a/features/pdf.feature
+++ b/features/pdf.feature
@@ -1,5 +1,10 @@
 Feature: PDF
 
-  Scenario: Check for Download as PDF ink
+  Scenario: Check for Download as PDF link
     Given I am at random page
     Then Download as PDF should be present
+
+  Scenario: Click on Download as PDF link
+    Given I am at random page
+    When I click on Download as PDF
+    Then Download the file link should be present
diff --git a/features/step_definitions/pdf_steps.rb 
b/features/step_definitions/pdf_steps.rb
index 4e05f1d..321f26c 100644
--- a/features/step_definitions/pdf_steps.rb
+++ b/features/step_definitions/pdf_steps.rb
@@ -1,3 +1,18 @@
 Then(/^Download as PDF should be present$/) do
   on(RandomPage).download_as_pdf_element.should exist
 end
+
+When(/^I click on Download as PDF$/) do
+  on(RandomPage) do |page|
+    page.print_or_export_element.when_present.click
+    page.download_as_pdf_element.when_present.click
+  end
+end
+
+Then(/^Download the file link should be present$/) do
+  on(RandomPage) do |page|
+    page.download_the_file_element.when_present(15)
+    page.download_the_file_element.should exist
+  end
+end
+
diff --git a/features/support/env.rb b/features/support/env.rb
index b053b93..76154a1 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -128,5 +128,5 @@
     sauce_api(%Q{{"passed": #{scenario.passed?}}}, saucelabs_username, 
saucelabs_key)
     sauce_api(%Q{{"public": true}}, saucelabs_username, saucelabs_key)
   end
-  @browser.close
+  #@browser.close
 end
diff --git a/features/support/pages/random_page.rb 
b/features/support/pages/random_page.rb
index ea3640e..1291237 100644
--- a/features/support/pages/random_page.rb
+++ b/features/support/pages/random_page.rb
@@ -13,6 +13,8 @@
 
   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_or_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/61257
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4b3a96fd7eefb85a1ba402b22c8b6ad922360550
Gerrit-PatchSet: 3
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Karim.rayani <karim.ray...@gmail.com>
Gerrit-Reviewer: Cmcmahon <cmcma...@wikimedia.org>
Gerrit-Reviewer: Karim.rayani <karim.ray...@gmail.com>
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

Reply via email to