[MediaWiki-commits] [Gerrit] Feature: PDF, Scenario: Click on Download as PDF link - change (qa/browsertests)

2013-04-29 Thread Zfilipin (Code Review)
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


[MediaWiki-commits] [Gerrit] Feature: PDF, Scenario: Click on Download as PDF link - change (qa/browsertests)

2013-04-28 Thread Karim.rayani (Code Review)
Karim.rayani has uploaded a new change for review.

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


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/pages/random_page.rb
3 files changed, 19 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests 
refs/changes/57/61257/1

diff --git a/features/pdf.feature b/features/pdf.feature
index 1886b92..51922cb 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..c1b2df3 100644
--- a/features/step_definitions/pdf_steps.rb
+++ b/features/step_definitions/pdf_steps.rb
@@ -1,3 +1,14 @@
 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).print_or_export_element.when_present.click
+  on(RandomPage).download_as_pdf_element.when_present.click
+end
+
+Then(/^Download the file link should be present$/) do
+  on(RandomPage).download_the_file_element.when_present(15)
+  on(RandomPage).download_the_file_element.should exist
+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: newchange
Gerrit-Change-Id: I4b3a96fd7eefb85a1ba402b22c8b6ad922360550
Gerrit-PatchSet: 1
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Karim.rayani karim.ray...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits