2017-07-28 12:05:35 +00:00
|
|
|
'use strict';
|
|
|
|
|
2020-06-12 22:13:31 +00:00
|
|
|
const assert = require( 'assert' ),
|
2017-07-28 12:05:35 +00:00
|
|
|
EchoPage = require( '../pageobjects/echo.page' ),
|
2019-03-05 19:25:47 +00:00
|
|
|
UserLoginPage = require( 'wdio-mediawiki/LoginPage' ),
|
|
|
|
Util = require( 'wdio-mediawiki/Util' ),
|
|
|
|
Api = require( 'wdio-mediawiki/Api' );
|
2017-07-28 12:05:35 +00:00
|
|
|
|
|
|
|
describe( 'Echo', function () {
|
2020-05-23 20:36:55 +00:00
|
|
|
let bot;
|
|
|
|
|
|
|
|
before( async () => {
|
|
|
|
bot = await Api.bot();
|
|
|
|
} );
|
2017-07-28 12:05:35 +00:00
|
|
|
|
2022-01-16 22:42:52 +00:00
|
|
|
it( 'alerts and notices are visible after logging in @daily', async function () {
|
2017-07-28 12:05:35 +00:00
|
|
|
|
2022-01-16 22:42:52 +00:00
|
|
|
await UserLoginPage.login( browser.config.mwUser, browser.config.mwPwd );
|
2017-07-28 12:05:35 +00:00
|
|
|
|
|
|
|
assert( EchoPage.alerts.isExisting() );
|
|
|
|
assert( EchoPage.notices.isExisting() );
|
|
|
|
|
|
|
|
} );
|
|
|
|
|
2022-01-16 22:42:52 +00:00
|
|
|
it( 'flyout for alert appears when clicked @daily', async function () {
|
2019-03-01 03:52:37 +00:00
|
|
|
|
2022-01-16 22:42:52 +00:00
|
|
|
await UserLoginPage.login( browser.config.mwUser, browser.config.mwPwd );
|
|
|
|
await EchoPage.alerts.click();
|
2020-05-23 20:36:55 +00:00
|
|
|
EchoPage.alertsFlyout.waitForDisplayed();
|
2019-03-01 03:52:37 +00:00
|
|
|
|
2020-05-23 20:36:55 +00:00
|
|
|
assert( EchoPage.alertsFlyout.isExisting() );
|
2019-03-01 03:52:37 +00:00
|
|
|
|
|
|
|
} );
|
|
|
|
|
2022-01-16 22:42:52 +00:00
|
|
|
it( 'flyout for notices appears when clicked @daily', async function () {
|
2019-03-05 19:15:59 +00:00
|
|
|
|
2022-01-16 22:42:52 +00:00
|
|
|
await UserLoginPage.login( browser.config.mwUser, browser.config.mwPwd );
|
|
|
|
await EchoPage.notices.click();
|
2020-05-23 20:36:55 +00:00
|
|
|
EchoPage.noticesFlyout.waitForDisplayed();
|
2019-03-05 19:15:59 +00:00
|
|
|
|
2020-05-23 20:36:55 +00:00
|
|
|
assert( EchoPage.noticesFlyout.isExisting() );
|
2019-03-05 19:15:59 +00:00
|
|
|
|
|
|
|
} );
|
|
|
|
|
2022-01-17 15:26:35 +00:00
|
|
|
it.skip( 'checks for welcome message after signup', async function () {
|
2019-03-05 19:25:47 +00:00
|
|
|
|
2020-06-12 22:13:31 +00:00
|
|
|
const username = Util.getTestString( 'NewUser-' );
|
|
|
|
const password = Util.getTestString();
|
2022-01-17 12:22:00 +00:00
|
|
|
|
|
|
|
await Api.createAccount( bot, username, password );
|
|
|
|
|
2022-01-16 22:42:52 +00:00
|
|
|
await UserLoginPage.login( username, password );
|
2019-03-05 19:25:47 +00:00
|
|
|
|
2022-01-16 22:42:52 +00:00
|
|
|
await EchoPage.notices.click();
|
2019-03-05 19:25:47 +00:00
|
|
|
|
2022-01-16 22:42:52 +00:00
|
|
|
await EchoPage.alertMessage.waitForDisplayed();
|
2022-01-28 16:50:09 +00:00
|
|
|
const regexp = /Welcome to .*, .*! We're glad you're here./;
|
2022-01-16 22:42:52 +00:00
|
|
|
assert( regexp.test( await EchoPage.alertMessage.getText() ) );
|
2019-03-05 19:25:47 +00:00
|
|
|
|
|
|
|
} );
|
|
|
|
|
2017-07-28 12:05:35 +00:00
|
|
|
} );
|