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
|
|
|
|
|
2019-07-04 01:56:30 +00:00
|
|
|
|
it( 'alerts and notices are visible after logging in @daily', function () {
|
2017-07-28 12:05:35 +00:00
|
|
|
|
|
2020-05-23 20:36:55 +00:00
|
|
|
|
UserLoginPage.login( browser.config.mwUser, browser.config.mwPwd );
|
2017-07-28 12:05:35 +00:00
|
|
|
|
|
|
|
|
|
assert( EchoPage.alerts.isExisting() );
|
|
|
|
|
assert( EchoPage.notices.isExisting() );
|
|
|
|
|
|
|
|
|
|
} );
|
|
|
|
|
|
2019-07-04 01:56:30 +00:00
|
|
|
|
it( 'flyout for alert appears when clicked @daily', function () {
|
2019-03-01 03:52:37 +00:00
|
|
|
|
|
2020-05-23 20:36:55 +00:00
|
|
|
|
UserLoginPage.login( browser.config.mwUser, browser.config.mwPwd );
|
2019-03-01 03:52:37 +00:00
|
|
|
|
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
|
|
|
|
|
|
|
|
|
} );
|
|
|
|
|
|
2019-07-04 01:56:30 +00:00
|
|
|
|
it( 'flyout for notices appears when clicked @daily', function () {
|
2019-03-05 19:15:59 +00:00
|
|
|
|
|
2020-05-23 20:36:55 +00:00
|
|
|
|
UserLoginPage.login( browser.config.mwUser, browser.config.mwPwd );
|
2019-03-05 19:15:59 +00:00
|
|
|
|
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
|
|
|
|
|
|
|
|
|
} );
|
|
|
|
|
|
2019-07-04 01:56:30 +00:00
|
|
|
|
it( 'checks for welcome message after signup', 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();
|
2020-05-23 20:36:55 +00:00
|
|
|
|
browser.call( async () => {
|
|
|
|
|
await Api.createAccount( bot, username, password );
|
2019-03-05 19:25:47 +00:00
|
|
|
|
} );
|
|
|
|
|
UserLoginPage.login( username, password );
|
|
|
|
|
|
|
|
|
|
EchoPage.notices.click();
|
|
|
|
|
|
2020-05-23 20:36:55 +00:00
|
|
|
|
EchoPage.alertMessage.waitForDisplayed();
|
2019-11-15 17:26:44 +00:00
|
|
|
|
const regexp = /Welcome to .*, .*! We're glad you're here./;
|
2019-05-01 03:33:34 +00:00
|
|
|
|
assert( regexp.test( EchoPage.alertMessage.getText() ) );
|
2019-03-05 19:25:47 +00:00
|
|
|
|
|
|
|
|
|
} );
|
|
|
|
|
|
2017-07-28 12:05:35 +00:00
|
|
|
|
} );
|