jenkins-bot has submitted this change and it was merged.

Change subject: QA#1211 External links and images test
......................................................................


QA#1211 External links and images test

Change-Id: Iec5a1cc1e3bd233776745ed0470441b265efb9e6
---
A tests/acceptance/features/external_links.feature
A tests/acceptance/features/image_resolves.feature
M tests/acceptance/features/search.feature
A tests/acceptance/features/step_definitions/external_links_steps.rb
A tests/acceptance/features/step_definitions/image_resolves_page.rb
A tests/acceptance/features/support/pages/article_page.rb
6 files changed, 53 insertions(+), 1 deletion(-)

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



diff --git a/tests/acceptance/features/external_links.feature 
b/tests/acceptance/features/external_links.feature
new file mode 100644
index 0000000..e1d0711
--- /dev/null
+++ b/tests/acceptance/features/external_links.feature
@@ -0,0 +1,7 @@
+Feature: Validate External Links
+
+  Scenario: External Links resolve
+    Given I am on the Barack_Obama article
+     When I expand External Links Section
+      And I click on the White House official website link
+     Then I receive White House official website page
diff --git a/tests/acceptance/features/image_resolves.feature 
b/tests/acceptance/features/image_resolves.feature
new file mode 100644
index 0000000..16c2531
--- /dev/null
+++ b/tests/acceptance/features/image_resolves.feature
@@ -0,0 +1,7 @@
+Feature: Image Resolves to the correct place
+
+  Scenario: Image link resolves
+    Given I am on the Barack_Obama article
+     When I expand Presidential Campaign Section
+     When I click on this image
+     Then I go to the image's page
diff --git a/tests/acceptance/features/search.feature 
b/tests/acceptance/features/search.feature
index 74d4de6..a3bf112 100644
--- a/tests/acceptance/features/search.feature
+++ b/tests/acceptance/features/search.feature
@@ -1,6 +1,6 @@
 Feature: Search
 
-  Scenario: Seach for partial text
+  Scenario: Search for partial text
     Given I am on the home page
      When I click the placeholder search box
        And I type into search box bara
diff --git a/tests/acceptance/features/step_definitions/external_links_steps.rb 
b/tests/acceptance/features/step_definitions/external_links_steps.rb
new file mode 100644
index 0000000..4d532a7
--- /dev/null
+++ b/tests/acceptance/features/step_definitions/external_links_steps.rb
@@ -0,0 +1,15 @@
+Given /^I am on the (.+) article$/ do |article|
+  visit(ArticlePage, :using_params => {:article_name => article})
+end
+
+When /^I expand External Links Section$/ do
+  on(ArticlePage).external_links_section_element.when_present.click
+end
+
+When /^I click on the White House official website link$/ do
+  on(ArticlePage).ext_whitehouse_link_element.when_present.click
+end
+
+Then /^I receive White House official website page$/ do
+  @browser.url.should match Regexp.escape('whitehouse.gov')
+end
diff --git a/tests/acceptance/features/step_definitions/image_resolves_page.rb 
b/tests/acceptance/features/step_definitions/image_resolves_page.rb
new file mode 100644
index 0000000..307b60e
--- /dev/null
+++ b/tests/acceptance/features/step_definitions/image_resolves_page.rb
@@ -0,0 +1,11 @@
+When /^I click on this image$/ do
+  on(ArticlePage).springfield_image_element.when_present.click
+end
+
+When /^I expand Presidential Campaign Section$/ do
+  on(ArticlePage).pres_campaign_section_element.when_present.click
+end
+
+Then /^I go to the image's page$/ do
+  @browser.url.should match 
Regexp.escape('File:Flickr_Obama_Springfield_01.jpg')
+end
diff --git a/tests/acceptance/features/support/pages/article_page.rb 
b/tests/acceptance/features/support/pages/article_page.rb
new file mode 100644
index 0000000..d45e41f
--- /dev/null
+++ b/tests/acceptance/features/support/pages/article_page.rb
@@ -0,0 +1,12 @@
+class ArticlePage
+  include PageObject
+
+  include URL
+  page_url URL.url('<%=params[:article_name]%>')
+
+  span(:external_links_section, id:'External_links')
+  span(:pres_campaign_section, id:'Presidential_campaigns')
+  a(:ext_whitehouse_link, href: 
'http://www.whitehouse.gov/administration/president_obama/')
+  a(:springfield_image, href: '/wiki/File:Flickr_Obama_Springfield_01.jpg')
+
+end

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iec5a1cc1e3bd233776745ed0470441b265efb9e6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Mgrover <[email protected]>
Gerrit-Reviewer: Cmcmahon <[email protected]>
Gerrit-Reviewer: Dr0ptp4kt <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to