From: Jakob Warkotsch Date: Mon, 25 Jun 2018 10:14:25 +0000 (+0200) Subject: Browser tests: use Util.getTestString in specialwatchlist.js X-Git-Tag: 1.34.0-rc.0~4976 X-Git-Url: http://git.cyclocoop.org/data/%24oldEdit?a=commitdiff_plain;h=56b2412d6acc19807b8ca18e9e74897e7db25d34;p=lhc%2Fweb%2Fwiklou.git Browser tests: use Util.getTestString in specialwatchlist.js Follow-up on I5c5e9b22af5406f347636b22e68657b2674db6c9 and I0747c2d361e951f8b3765a3dca548e55edb72216 Change-Id: I35ad793e6d9fe4c3bf58df9b4fcf6471c0a81f70 --- diff --git a/tests/selenium/specs/specialwatchlist.js b/tests/selenium/specs/specialwatchlist.js index 1e33b2bfca..de36b90112 100644 --- a/tests/selenium/specs/specialwatchlist.js +++ b/tests/selenium/specs/specialwatchlist.js @@ -2,18 +2,15 @@ const assert = require( 'assert' ), Api = require( 'wdio-mediawiki/Api' ), WatchlistPage = require( '../pageobjects/watchlist.page' ), WatchablePage = require( '../pageobjects/watchable.page' ), - LoginPage = require( 'wdio-mediawiki/LoginPage' ); + LoginPage = require( 'wdio-mediawiki/LoginPage' ), + Util = require( 'wdio-mediawiki/Util' ); describe( 'Special:Watchlist', function () { let username, password; - function getTestString( prefix = '' ) { - return prefix + Math.random().toString() + '-öäü-♠♣♥♦'; - } - before( function () { - username = getTestString( 'user-' ); - password = getTestString( 'password-' ); + username = Util.getTestString( 'user-' ); + password = Util.getTestString( 'password-' ); browser.call( function () { return Api.createAccount( username, password ); @@ -26,14 +23,14 @@ describe( 'Special:Watchlist', function () { } ); it( 'should show page with new edit', function () { - const title = getTestString( 'Title-' ); + const title = Util.getTestString( 'Title-' ); browser.call( function () { - return Api.edit( title, getTestString() ); // create + return Api.edit( title, Util.getTestString() ); // create } ); WatchablePage.watch( title ); browser.call( function () { - return Api.edit( title, getTestString() ); // edit + return Api.edit( title, Util.getTestString() ); // edit } ); WatchlistPage.open();