Bmansurov has uploaded a new change for review.

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

Change subject: WIP: Add browser test that check the existence of links in the 
footer
......................................................................

WIP: Add browser test that check the existence of links in the footer

Bug: T108081
Change-Id: Id54f252323e64eb521f82f8720e13d55a3b0ce1a
---
M tests/browser/README.mediawiki
M tests/browser/features/step_definitions/ui_links_steps.rb
M tests/browser/features/support/pages/article_page.rb
M tests/browser/features/ui_links.feature
4 files changed, 15 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/89/230689/1

diff --git a/tests/browser/README.mediawiki b/tests/browser/README.mediawiki
index 1601146..8772fa8 100644
--- a/tests/browser/README.mediawiki
+++ b/tests/browser/README.mediawiki
@@ -19,8 +19,8 @@
 * In LocalSettings.php place the following code:
 <pre>
        # required for browser tests ui_links.feature
-       $wgRightsText = 'Creative Commons Attribution 3.0';
-       $wgRightsUrl = "http://creativecommons.org/licenses/by-sa/3.0/";;
+       $wgRightsText = 'Creative Commons Attribution-Share Alike 3.0';
+       $wgRightsUrl = "https://creativecommons.org/licenses/by-sa/3.0/";;
 </pre>
 
 Note a few caveats with browser tests:
diff --git a/tests/browser/features/step_definitions/ui_links_steps.rb 
b/tests/browser/features/step_definitions/ui_links_steps.rb
index aa8433b..cc09e39 100644
--- a/tests/browser/features/step_definitions/ui_links_steps.rb
+++ b/tests/browser/features/step_definitions/ui_links_steps.rb
@@ -1,9 +1,13 @@
 Then(/^I should see a link to the privacy page$/) do
   expect(on(ArticlePage).privacy_link_element).to be_visible
+  expect(on(ArticlePage).privacy_link_element.when_present.text).to match 
'Privacy'
+  # TODO: check the href //wikimediafoundation.org/wiki/Privacy_policy
 end
 
 Then(/^I should see a link to the terms of use$/) do
   expect(on(ArticlePage).terms_link_element).to be_visible
+  expect(on(ArticlePage).terms_link_element.when_present.text).to match 'Terms 
of Use'
+  # TODO: check the href //m.wikimediafoundation.org/wiki/Terms_of_Use
 end
 
 Then(/^I should see the history link$/) do
@@ -14,6 +18,11 @@
   expect(on(ArticlePage).last_modified_bar_history_link_element).to be_visible
 end
 
+Then(/^I should see the license text$/) do
+  expect(on(ArticlePage).license_text_element.when_present.text).to match 
'Content is available under CC BY-SA 3.0 unless otherwise noted.'
+  # TODO: check the href https://creativecommons.org/licenses/by-sa/3.0/
+end
+
 Then(/^I should see the license link$/) do
   expect(on(ArticlePage).license_link_element).to be_visible
 end
diff --git a/tests/browser/features/support/pages/article_page.rb 
b/tests/browser/features/support/pages/article_page.rb
index 46891b2..e00e8fe 100644
--- a/tests/browser/features/support/pages/article_page.rb
+++ b/tests/browser/features/support/pages/article_page.rb
@@ -140,8 +140,9 @@
   # footer
   a(:desktop_link, text: 'Desktop')
   a(:terms_link, css: '#footer-places-terms-use')
+  li(:license_text, css: '#footer-info-mobile-license')
   a(:license_link, css: '#footer-info-mobile-license a')
-  a(:privacy_link, text: 'Privacy')
+  a(:privacy_link, css: '#footer-places-privacy a')
 
   # pagelist
   ul(:page_list, css: '.page-list')
diff --git a/tests/browser/features/ui_links.feature 
b/tests/browser/features/ui_links.feature
index 0cd44fa..7886c1b 100644
--- a/tests/browser/features/ui_links.feature
+++ b/tests/browser/features/ui_links.feature
@@ -10,6 +10,7 @@
       And I am on the "Main Page" page
     Then I should see the history link
       And I should see the switch to desktop link
+      And I should see the license text
       And I should see the license link
       And I should see a link to the terms of use
       And I should see a link to the privacy page
@@ -20,6 +21,7 @@
       And I am on the "Selenium UI test" page
     Then I should see the last modified bar history link
       And I should see the switch to desktop link
+    And I should see the license text
       And I should see the license link
       And I should see a link to the terms of use
       And I should see a link to the privacy page

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id54f252323e64eb521f82f8720e13d55a3b0ce1a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Bmansurov <[email protected]>

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

Reply via email to