mediawiki-extensions-Echo/tests/selenium/specs/echo.js
Alexander Vorwerk 4c7726a9ec selenium: reenable skipping of flaky test
Bug: T299339
Change-Id: I4d0838bdd6f1d0e1e220d1d611ae3e6e5c2b80eb
2022-01-17 16:26:35 +01:00

63 lines
1.6 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 () {
let bot;
before( async () => {
bot = await Api.bot();
} );
it( 'alerts and notices are visible after logging in @daily', async function () {
await UserLoginPage.login( browser.config.mwUser, browser.config.mwPwd );
assert( EchoPage.alerts.isExisting() );
assert( EchoPage.notices.isExisting() );
} );
it( 'flyout for alert appears when clicked @daily', async function () {
await UserLoginPage.login( browser.config.mwUser, browser.config.mwPwd );
await EchoPage.alerts.click();
EchoPage.alertsFlyout.waitForDisplayed();
assert( EchoPage.alertsFlyout.isExisting() );
} );
it( 'flyout for notices appears when clicked @daily', async function () {
await UserLoginPage.login( browser.config.mwUser, browser.config.mwPwd );
await EchoPage.notices.click();
EchoPage.noticesFlyout.waitForDisplayed();
assert( EchoPage.noticesFlyout.isExisting() );
} );
it.skip( 'checks for welcome message after signup', async function () {
const username = Util.getTestString( 'NewUser-' );
const password = Util.getTestString();
await Api.createAccount( bot, username, password );
await UserLoginPage.login( username, password );
await EchoPage.notices.click();
await EchoPage.alertMessage.waitForDisplayed();
const regexp = /Welcome to .*, .*! We're glad you're here./;
assert( regexp.test( await EchoPage.alertMessage.getText() ) );
} );
} );