mediawiki-extensions-Echo/tests/selenium/specs/mention.js
ephemeralwaves dd4539b522 Selenium: Test that checks for user mention alerts
Check that a user gets an alert when their username is mentioned by another user.

Bug: T224894
Change-Id: I303e10a40d1092e4b9f81deef0f1ac2af6f7a435
2019-06-19 10:23:22 +00:00

28 lines
936 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var assert = require( 'assert' ),
EchoPage = require( '../pageobjects/echo.page' ),
UserLoginPage = require( 'wdio-mediawiki/LoginPage' ),
Util = require( 'wdio-mediawiki/Util' ),
Api = require( 'wdio-mediawiki/Api' );
describe( 'Mention test for Echo', function () {
it( 'checks if admin gets alert when mentioned', function () {
var username = Util.getTestString( 'NewUser-' );
var password = Util.getTestString();
browser.call( function () {
return Api.createAccount( username, password
).then( function () {
return Api.edit( `User:${username}`, `Hello [[User:${browser.options.username}]] ~~~~`, username, password );
} );
} );
UserLoginPage.login( browser.options.username, browser.options.password );
EchoPage.alerts.click();
EchoPage.alertMessage.waitForVisible();
let regexp = /.* mentioned you on User:.*./;
assert( regexp.test( EchoPage.alertMessage.getText() ) );
} );
} );