1 const assert
= require( 'assert' ),
2 Api
= require( 'wdio-mediawiki/Api' ),
3 WatchlistPage
= require( '../pageobjects/watchlist.page' ),
4 WatchablePage
= require( '../pageobjects/watchable.page' ),
5 LoginPage
= require( 'wdio-mediawiki/LoginPage' ),
6 Util
= require( 'wdio-mediawiki/Util' );
8 describe( 'Special:Watchlist', function () {
9 let username
, password
;
12 username
= Util
.getTestString( 'user-' );
13 password
= Util
.getTestString( 'password-' );
15 browser
.call( function () {
16 return Api
.createAccount( username
, password
);
20 beforeEach( function () {
21 browser
.deleteCookie();
22 LoginPage
.login( username
, password
);
25 it( 'should show page with new edit', function () {
26 const title
= Util
.getTestString( 'Title-' );
28 browser
.call( function () {
29 return Api
.edit( title
, Util
.getTestString() ); // create
31 WatchablePage
.watch( title
);
32 browser
.call( function () {
33 return Api
.edit( title
, Util
.getTestString() ); // edit
38 assert
.strictEqual( WatchlistPage
.titles
[ 0 ].getText(), title
);