diff --git a/package.json b/package.json index 5bc83d3b3..ab1aed72b 100644 --- a/package.json +++ b/package.json @@ -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" } diff --git a/tests/selenium/features/step_definitions/create_page_api_steps.js b/tests/selenium/features/step_definitions/create_page_api_steps.js index 7c45d9f50..22028631d 100644 --- a/tests/selenium/features/step_definitions/create_page_api_steps.js +++ b/tests/selenium/features/step_definitions/create_page_api_steps.js @@ -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 ) { diff --git a/tests/selenium/specs/category.js b/tests/selenium/specs/category.js index 64faf252d..152195bd5 100644 --- a/tests/selenium/specs/category.js +++ b/tests/selenium/specs/category.js @@ -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(); } ); } );