2017-07-28 12:05:35 +00:00
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
var assert = require( 'assert' ),
|
|
|
|
|
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 () {
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
UserLoginPage.login( browser.options.username, browser.options.password );
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
UserLoginPage.login( browser.options.username, browser.options.password );
|
|
|
|
|
EchoPage.alerts.click();
|
|
|
|
|
EchoPage.flyout.waitForVisible();
|
|
|
|
|
|
|
|
|
|
assert( EchoPage.flyout.isExisting() );
|
|
|
|
|
|
|
|
|
|
} );
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
UserLoginPage.login( browser.options.username, browser.options.password );
|
|
|
|
|
EchoPage.notices.click();
|
|
|
|
|
EchoPage.flyout.waitForVisible();
|
|
|
|
|
|
|
|
|
|
assert( EchoPage.flyout.isExisting() );
|
|
|
|
|
|
|
|
|
|
} );
|
|
|
|
|
|
2019-07-04 01:56:30 +00:00
|
|
|
|
it( 'checks for welcome message after signup', function () {
|
2019-03-05 19:25:47 +00:00
|
|
|
|
|
|
|
|
|
var username = Util.getTestString( 'NewUser-' );
|
|
|
|
|
var password = Util.getTestString();
|
|
|
|
|
browser.call( function () {
|
|
|
|
|
return Api.createAccount( username, password );
|
|
|
|
|
} );
|
|
|
|
|
UserLoginPage.login( username, password );
|
|
|
|
|
|
|
|
|
|
EchoPage.notices.click();
|
|
|
|
|
|
2019-05-01 03:33:34 +00:00
|
|
|
|
EchoPage.alertMessage.waitForVisible();
|
2019-03-05 19:25:47 +00:00
|
|
|
|
let 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
|
|
|
|
} );
|