Debian Codegraph @

tests/selenium/specs/watchlist.js

raw symbols SCIP
1 'use strict';
2
3 const Api = require( 'wdio-mediawiki/Api' );
4 const WatchlistPage = require( '../pageobjects/watchlist.page' );
5 const WatchablePage = require( '../pageobjects/watchable.page' );
6 const LoginPage = require( 'wdio-mediawiki/LoginPage' );
7 const BlankPage = require( 'wdio-mediawiki/BlankPage' );
8 const Util = require( 'wdio-mediawiki/Util' );
9
10 describe( 'Special:Watchlist', () => {
11 let bot;
12
13 before( async () => {
14 // Default bot is the admin that we also use for viewing via LoginPage.loginAdmin()
15 bot = await Api.bot();
16 } );
17
18 beforeEach( async () => {
19 await LoginPage.loginAdmin();
20 } );
21
22 // Skipped on 2022-12-07 in 865696 because of T324237
23 it.skip( 'should show page with new edit @daily', async function () {
24 const title = Util.getTestString( 'Title-' );
25
26 // First try to load a blank page, so the next command works.
27 await BlankPage.open();
28 // Don't try to run wikitext-specific tests if the test namespace isn't wikitext by default.
29 if ( await Util.isTargetNotWikitext( title ) ) {
30 this.skip();
31 }
32
33 // create
34 await bot.edit( title, Util.getTestString() );
35
36 await WatchablePage.watch( title );
37
38 // edit
39 await bot.edit( title, Util.getTestString() );
40
41 await WatchlistPage.open();
42
43 // We are viewing Special:Watchlist with the same account that made the edit,
44 // but by default Special:Watchlist includes both seen and unseen changes, so
45 // it'll show up anyway. The title we just edited will be first because the edit
46 // was the most recent.
47 await expect( await WatchlistPage.titles[ 0 ] ).toHaveText( title );
48 } );
49
50 } );