Mgrover has uploaded a new change for review.

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


Change subject: First pass at validation tests for mobile
......................................................................

First pass at validation tests for mobile

Change-Id: I304175cca70f97ae763f6c1b8807972f3f6b87ca
---
A tests/acceptance/features/step_definitions/validation_steps.rb
M tests/acceptance/features/support/pages/home_page.rb
M tests/acceptance/features/support/pages/random_page.rb
A tests/acceptance/features/validation.feature
4 files changed, 102 insertions(+), 0 deletions(-)


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

diff --git a/tests/acceptance/features/step_definitions/validation_steps.rb 
b/tests/acceptance/features/step_definitions/validation_steps.rb
new file mode 100644
index 0000000..3adc8be
--- /dev/null
+++ b/tests/acceptance/features/step_definitions/validation_steps.rb
@@ -0,0 +1,47 @@
+Then(/^I go to left nav menu$/) do
+  on(HomePage).mainmenu_button_element.when_present.click
+end
+
+Then (/^I have a Home Button$/) do
+  on(RandomPage).home_button_element.should be_visible
+end
+
+Then(/^a Random Button$/) do
+  on(RandomPage).random_button_element.should be_visible
+end
+
+Then(/^a Watchlist Button$/) do
+  on(RandomPage).watchlist_button_element.should be_visible
+end
+
+Then(/^an Uploads Button$/) do
+  on(RandomPage).uploads_button_element.should be_visible
+end
+
+Then(/^a Settings Button$/) do
+  on(RandomPage).settings_button_element.should be_visible
+end
+
+Then(/^a LogInOut Button$/) do
+  on(RandomPage).loginout_button_element.should be_visible
+end
+
+Then(/^a Nearby Button$/) do
+  on(RandomPage).nearby_button_element.should be_visible
+end
+
+Given(/^I change to alpha mode$/) do
+  visit(BetaPage) do |page|
+    p @browser.li(class: 'mw-mf-checkbox-css3')
+    page.alpha_element.click
+    page.save_settings
+  end
+end
+
+Then(/^I have the Language Selector$/) do
+ on(HomePage).language_selector_element.exists?
+end
+
+Then(/^wikipedia logo exists$/) do
+ @browser.img(alt: 'Wikipedia ®').should be_visible
+end
\ No newline at end of file
diff --git a/tests/acceptance/features/support/pages/home_page.rb 
b/tests/acceptance/features/support/pages/home_page.rb
index 9e90b8c..bde66c0 100644
--- a/tests/acceptance/features/support/pages/home_page.rb
+++ b/tests/acceptance/features/support/pages/home_page.rb
@@ -35,4 +35,5 @@
   form(:search_form, id: 'mw-mf-searchForm')
   a(:sign_up, text: 'Sign up')
   div(:main_page, id: 'mainpage')
+  div(:language_selector, id:'mw-mf-language-section')
 end
diff --git a/tests/acceptance/features/support/pages/random_page.rb 
b/tests/acceptance/features/support/pages/random_page.rb
index 36ffa5b..97d10f8 100644
--- a/tests/acceptance/features/support/pages/random_page.rb
+++ b/tests/acceptance/features/support/pages/random_page.rb
@@ -17,4 +17,6 @@
   li(:settings_button, class:'icon-settings')
   li(:uploads_button, class:'icon-uploads')
   li(:watchlist_button, class:'icon-watchlist')
+  li(:nearby_button, class:'icon-nearby')
+  li(:loginout_button, class:'icon-loginout')
 end
diff --git a/tests/acceptance/features/validation.feature 
b/tests/acceptance/features/validation.feature
new file mode 100644
index 0000000..810ae68
--- /dev/null
+++ b/tests/acceptance/features/validation.feature
@@ -0,0 +1,52 @@
+@firefox @user_agent
+Feature: Validate Items exist
+
+  Scenario: Left Navigation stable
+    Given that I am using Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac 
OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 
Safari/6533.18.5
+    When I go to random page
+      And wikipedia logo exists
+      And I have the Language Selector
+      And I am logged into the mobile website
+    Then I go to left nav menu
+      And I have a Home Button
+      And a Random Button
+      And a Watchlist Button
+      And an Uploads Button
+      And a Settings Button
+      And a LogInOut Button
+
+  Scenario: Left Navigation beta
+    Given that I am using Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac 
OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 
Safari/6533.18.5
+    When I go to random page
+      And wikipedia logo exists
+      And I have the Language Selector
+      And I am in beta mode
+      And I am logged into the mobile website
+    Then I go to left nav menu
+      And I have a Home Button
+      And a Random Button
+      And a Nearby Button
+      And a Watchlist Button
+      And an Uploads Button
+      And a Settings Button
+      And a LogInOut Button
+
+
+  #Scenario:  Left Navigation alpha
+#    Given that I am using Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like 
Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 
Mobile/8J2 Safari/6533.18.5
+#    When I go to random page
+#      And I am in beta mode
+#      And I change to alpha mode
+#    When I go to left nav menu
+#    Then I have a Home Button
+#      And a Random Button
+#      And a Nearby Button
+#      And a Watchlist Button
+#      And an Uploads Button
+#      And a Settings Button
+#      And a Log in Button
+#      And I have the Language Selector
+ #    And wikipedia logo exists
+
+
+

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

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

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

Reply via email to