mediawiki-extensions-Echo/tests/selenium/specs/echo.js
Ed Sanders ffe3363d09 build: Update eslint-config-wikimedia to 0.16.1
Change-Id: I2ce14429f9440e69e36fa349847f58fb32862f2a
2020-06-15 16:19:00 +01:00

58 lines
1.5 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
const 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 () {
const username = Util.getTestString( 'NewUser-' );
const password = Util.getTestString();
browser.call( function () {
return Api.createAccount( username, password );
} );
UserLoginPage.login( username, password );
EchoPage.notices.click();
EchoPage.alertMessage.waitForVisible();
const regexp = /Welcome to .*, .*! We're glad you're here./;
assert( regexp.test( EchoPage.alertMessage.getText() ) );
} );
} );