mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-02 19:36:48 +00:00
05f3e66a9d
Changed `selenium-daily` npm script to only run tests tagged `@daily` and removed `it.skip` on tests failing in beta cluster. Bug:T227009 Change-Id: Id2edbfd941df098d326fa30ed9dc9f68e228f021
58 lines
1.5 KiB
JavaScript
58 lines
1.5 KiB
JavaScript
'use strict';
|
||
|
||
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( 'Echo', function () {
|
||
|
||
it( 'alerts and notices are visible after logging in @daily', function () {
|
||
|
||
UserLoginPage.login( browser.options.username, browser.options.password );
|
||
|
||
assert( EchoPage.alerts.isExisting() );
|
||
assert( EchoPage.notices.isExisting() );
|
||
|
||
} );
|
||
|
||
it( 'flyout for alert appears when clicked @daily', function () {
|
||
|
||
UserLoginPage.login( browser.options.username, browser.options.password );
|
||
EchoPage.alerts.click();
|
||
EchoPage.flyout.waitForVisible();
|
||
|
||
assert( EchoPage.flyout.isExisting() );
|
||
|
||
} );
|
||
|
||
it( 'flyout for notices appears when clicked @daily', function () {
|
||
|
||
UserLoginPage.login( browser.options.username, browser.options.password );
|
||
EchoPage.notices.click();
|
||
EchoPage.flyout.waitForVisible();
|
||
|
||
assert( EchoPage.flyout.isExisting() );
|
||
|
||
} );
|
||
|
||
it( 'checks for welcome message after signup', function () {
|
||
|
||
var username = Util.getTestString( 'NewUser-' );
|
||
var password = Util.getTestString();
|
||
browser.call( function () {
|
||
return Api.createAccount( username, password );
|
||
} );
|
||
UserLoginPage.login( username, password );
|
||
|
||
EchoPage.notices.click();
|
||
|
||
EchoPage.alertMessage.waitForVisible();
|
||
let regexp = /Welcome to .*, .*! We're glad you're here./;
|
||
assert( regexp.test( EchoPage.alertMessage.getText() ) );
|
||
|
||
} );
|
||
|
||
} );
|