MaxSem has uploaded a new change for review.
https://gerrit.wikimedia.org/r/90042
Change subject: Adding a selenium test for the notifications overlay
......................................................................
Adding a selenium test for the notifications overlay
Also fixing the Beta opt-in selector logic which was broken.
Change-Id: Ib64849b7cfb76cc320a77f7742d5152638adee7f
---
M includes/specials/SpecialMobileOptions.php
M tests/acceptance/features/notification.feature
M tests/acceptance/features/step_definitions/notification_steps.rb
M tests/acceptance/features/support/pages/beta_page.rb
M tests/acceptance/features/support/pages/home_page.rb
5 files changed, 17 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/42/90042/1
diff --git a/includes/specials/SpecialMobileOptions.php
b/includes/specials/SpecialMobileOptions.php
index 25291a0..ec5695d 100644
--- a/includes/specials/SpecialMobileOptions.php
+++ b/includes/specials/SpecialMobileOptions.php
@@ -86,7 +86,7 @@
$betaSetting = <<<HTML
<li>
{$betaEnableMsg}
- <div class="mw-mf-checkbox-css3">
+ <div class="mw-mf-checkbox-css3"
id="enable-beta-toggle">
<input type="checkbox" name="enableBeta"
{$imagesBeta}>{$onoff}
</div>
@@ -105,7 +105,7 @@
$alphaSetting .= <<<HTML
<li>
{$alphaEnableMsg}
- <div class="mw-mf-checkbox-css3">
+ <div class="mw-mf-checkbox-css3"
id="enable-alpha-toggle">
<input type="checkbox"
name="enableAlpha"
{$alphaChecked}>{$onoff}
</div>
@@ -123,7 +123,7 @@
<ul>
<li>
{$disableMsg}
- <span class="mw-mf-checkbox-css3">
+ <span class="mw-mf-checkbox-css3"
id="enable-images-toggle">
<input type="checkbox" name="enableImages"
{$imagesChecked}>{$onoff}
</span>
diff --git a/tests/acceptance/features/notification.feature
b/tests/acceptance/features/notification.feature
index 854f349..2ae645f 100644
--- a/tests/acceptance/features/notification.feature
+++ b/tests/acceptance/features/notification.feature
@@ -1,8 +1,13 @@
Feature: Notification
- Scenario: Notification Validation
+ Background:
Given I am logged into the mobile website
- When I click on the notification icon
- Then I go to the notifications page
+ Scenario: Notification Validation
+ When I click on the notification icon
+ Then I go to the notifications page
+ Scenario: Notification Overlay Validation
+ Given I am in beta mode
+ When I click on the notification icon
+ Then the notifications overlay appears
diff --git a/tests/acceptance/features/step_definitions/notification_steps.rb
b/tests/acceptance/features/step_definitions/notification_steps.rb
index dc49fe2..ec24c52 100644
--- a/tests/acceptance/features/step_definitions/notification_steps.rb
+++ b/tests/acceptance/features/step_definitions/notification_steps.rb
@@ -2,7 +2,10 @@
on(HomePage).notification_button_element.when_present.click
end
-Then /^I go to the notifications page$/ do
+Then /^I go to the notifications page$/ do
@browser.url.should match Regexp.escape('Special:Notifications')
end
+Then /^the notifications overlay appears$/ do
+ on(HomePage).notifications_archive_link_element.when_present.should exist
+end
diff --git a/tests/acceptance/features/support/pages/beta_page.rb
b/tests/acceptance/features/support/pages/beta_page.rb
index 1efe6ff..6361440 100644
--- a/tests/acceptance/features/support/pages/beta_page.rb
+++ b/tests/acceptance/features/support/pages/beta_page.rb
@@ -4,7 +4,7 @@
include URL
page_url URL.url('Special:MobileOptions/BetaOptIn')
- div(:beta_parent, class: 'mw-mf-checkbox-css3')
+ div(:beta_parent, id: 'enable-beta-toggle')
span(:beta) do |page|
page.beta_parent_element.span_element(class: 'mw-mf-settings-off')
end
diff --git a/tests/acceptance/features/support/pages/home_page.rb
b/tests/acceptance/features/support/pages/home_page.rb
index 0ce397a..8a37e9b 100644
--- a/tests/acceptance/features/support/pages/home_page.rb
+++ b/tests/acceptance/features/support/pages/home_page.rb
@@ -46,6 +46,7 @@
div(:rl_notification, id:'notifications')
a(:edit_history_link, id:'mw-mf-last-modified')
a(:notification_button, id:'secondary-button')
+ a(:notifications_archive_link, id:'notifications-archive-link')
a(:edit_icon_enabled, text:'Edit')
li(:mobile_view, id:'footer-places-mobileview')
end
--
To view, visit https://gerrit.wikimedia.org/r/90042
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib64849b7cfb76cc320a77f7742d5152638adee7f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: 1.22wmf21
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits