Except for Search & Watchlist, which need fixes in gated extensions first. Change-Id: I88d24dda4bc047868de3ff9dd4a5753b9c7b0f64
34 lines
989 B
JavaScript
34 lines
989 B
JavaScript
const { action, assert, utils } = require( 'api-testing' );
|
|
|
|
describe( "Testing site statistics' edits value", function () {
|
|
const siteStatsParams = {
|
|
meta: 'siteinfo',
|
|
siprop: 'statistics'
|
|
};
|
|
|
|
const variables = {};
|
|
let wikiuser;
|
|
|
|
before( async () => {
|
|
wikiuser = await action.alice();
|
|
} );
|
|
|
|
it( 'should GET site statistics', async () => {
|
|
const stats = await wikiuser.action( 'query', siteStatsParams );
|
|
variables.editsStats = parseInt( stats.query.statistics.edits, 10 );
|
|
assert.isNumber( variables.editsStats );
|
|
} );
|
|
|
|
it( 'should edit a page', async () => {
|
|
const title = utils.title( 'TestingSiteStats_' );
|
|
await wikiuser.edit( title, { text: 'testing site stats ...' } );
|
|
} );
|
|
|
|
it( 'should GET an increased site edits stat', async () => {
|
|
const stats = await wikiuser.action( 'query', siteStatsParams );
|
|
const edits = parseInt( stats.query.statistics.edits, 10 );
|
|
|
|
assert.isNumber( edits );
|
|
assert.isAbove( edits, variables.editsStats );
|
|
} );
|
|
} );
|