mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-04 20:28:49 +00:00
9ab351352f
Bug: T115845 Bug: T140900 Depends-On: Ic666540d70de52f Change-Id: I34e2736490319989a3a251a43fbe8080ab960b00
76 lines
1.8 KiB
Ruby
76 lines
1.8 KiB
Ruby
Given(/^all my notifications are read$/) do
|
|
clear_unread_notifications(@username)
|
|
end
|
|
|
|
Given(/^I refresh the page$/) do
|
|
on(ArticlePage) do |page|
|
|
page.refresh
|
|
end
|
|
end
|
|
|
|
Given(/^another user mentions me$/) do
|
|
message = '===Mention test===\nI am mentioning [[User:' + user(nil) +
|
|
']] in this page to test Echo notifications. ~~~~'
|
|
as_user(:b) do
|
|
api.create_page(
|
|
@data_manager.get('Echo_test_page'),
|
|
message
|
|
)
|
|
end
|
|
end
|
|
|
|
Given(/^another user writes on my talk page$/) do
|
|
talk_page = "User_talk:#{user}"
|
|
message = '===Talk page test===\n' +
|
|
'I am writing a message in your user page to test Echo notifications. ~~~~'
|
|
as_user(:b) do
|
|
api.create_page(talk_page, message)
|
|
end
|
|
end
|
|
|
|
Given(/^the alert badge is showing unseen notifications$/) do
|
|
on(ArticlePage) do |page|
|
|
page.refresh_until do
|
|
page.alerts.badge_unseen_element.visible?
|
|
end
|
|
end
|
|
end
|
|
|
|
Given(/^the notice badge is showing unseen notifications$/) do
|
|
on(ArticlePage) do |page|
|
|
page.refresh_until do
|
|
page.notices.badge_unseen_element.visible?
|
|
end
|
|
end
|
|
end
|
|
|
|
Given(/^the alert badge value is "(.+)"$/) do |num|
|
|
on(ArticlePage) do |page|
|
|
page.refresh_until do
|
|
page.alerts.badge_element.text == num
|
|
end
|
|
end
|
|
end
|
|
|
|
Given(/^the notice badge value is "(.+)"$/) do |num|
|
|
on(ArticlePage) do |page|
|
|
page.refresh_until do
|
|
page.notices.badge_element.text == num
|
|
end
|
|
end
|
|
end
|
|
|
|
Given(/^there are "(.+)" unread notifications in the notice popup$/) do |num|
|
|
on(ArticlePage) do |page|
|
|
page.notices.when_loaded
|
|
expect(page.notices.num_unread_notifications).to eq(num.to_i)
|
|
end
|
|
end
|
|
|
|
Given(/^there are "(.+)" unread notifications in the alert popup$/) do |num|
|
|
on(ArticlePage) do |page|
|
|
page.alerts.when_loaded
|
|
expect(page.alerts.num_unread_notifications).to eq(num.to_i)
|
|
end
|
|
end
|