2020-06-12 22:13:31 +00:00
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
const assert = require( 'assert' ),
|
2019-05-01 03:33:34 +00:00
|
|
|
|
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 () {
|
2020-05-23 20:36:55 +00:00
|
|
|
|
let bot;
|
|
|
|
|
|
|
|
|
|
before( async () => {
|
|
|
|
|
bot = await Api.bot();
|
|
|
|
|
} );
|
2019-07-30 14:29:02 +00:00
|
|
|
|
it.skip( 'checks if admin gets alert when mentioned', function () {
|
2019-05-01 03:33:34 +00:00
|
|
|
|
|
2020-06-12 22:13:31 +00:00
|
|
|
|
const username = Util.getTestString( 'NewUser-' );
|
|
|
|
|
const password = Util.getTestString();
|
2020-05-23 20:36:55 +00:00
|
|
|
|
browser.call( async () => {
|
|
|
|
|
await Api.createAccount( bot, username, password );
|
|
|
|
|
await bot.edit( `User:${username}`, `Hello [[User:${browser.config.mwUser}]] ~~~~`, username, password );
|
2019-05-01 03:33:34 +00:00
|
|
|
|
} );
|
2020-05-23 20:36:55 +00:00
|
|
|
|
UserLoginPage.login( browser.config.mwUser, browser.config.mwPwd );
|
2019-05-01 03:33:34 +00:00
|
|
|
|
|
|
|
|
|
EchoPage.alerts.click();
|
|
|
|
|
|
2020-05-23 20:36:55 +00:00
|
|
|
|
EchoPage.alertMessage.waitForDisplayed();
|
2019-11-15 17:26:44 +00:00
|
|
|
|
const regexp = /.* mentioned you on User:.*./;
|
2019-05-01 03:33:34 +00:00
|
|
|
|
assert( regexp.test( EchoPage.alertMessage.getText() ) );
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
|
} );
|