Restore category step for CI

Per T199939#5096023 use job runner to execute the job runner
as part of the test to ensure the API can return categories for
a page.

Bug: T219920
Change-Id: I467f6635fd0d80a01428f6b06a8c750430d63d6d
This commit is contained in:
jdlrobson 2019-04-09 12:43:39 -07:00
parent 1be4a9e55a
commit 6e9d56efa6
3 changed files with 12 additions and 13 deletions

View File

@ -24,7 +24,7 @@
"svgo": "0.7.2",
"wdio-cucumber-framework": "1.1.1",
"wdio-mocha-framework": "0.5.13",
"wdio-mediawiki": "0.2.0",
"wdio-mediawiki": "0.3.0",
"wdio-spec-reporter": "0.1.4",
"webdriverio": "4.13.1"
}

View File

@ -1,4 +1,5 @@
const { api, ArticlePage } = require( '../support/world' );
const RunJobs = require( 'wdio-mediawiki/RunJobs' );
const Api = require( 'wdio-mediawiki/Api' );
const Page = require( 'wdio-mediawiki/Page' );
const {
@ -33,9 +34,15 @@ const iAmInAWikiThatHasCategories = ( title ) => {
// A pause is necessary to let the categories register with database before trying to use
// them in an article
waitForPropagation( 5000 );
Api.edit( title, wikitext );
// categories are handled by a JobRunner so need extra time to appear via API calls!
waitForPropagation( 5000 );
browser.call( () => {
return Api.edit( title, wikitext );
} );
browser.call( () => {
// The category overlay uses the category API
// which will only return results if the job queue has completed.
// Run before continuing!
return RunJobs.run();
} );
};
const iAmOnAPageThatHasTheFollowingEdits = function ( table ) {

View File

@ -33,14 +33,6 @@ describe( 'Categories', function () {
// Then I should see the categories overlay
iShouldSeeTheCategoriesOverlay();
// FIXME: This check is partially skipped as there is no way to lower $wgJobRunRate
// See: T199939#5095838
try {
iShouldSeeAListOfCategories();
} catch ( e ) {
// pass.
// eslint-disable-next-line no-console
console.warn( 'Unable to check the list of the categories. Is wgJobRunRate set correctly?' );
}
iShouldSeeAListOfCategories();
} );
} );