mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-17 03:08:12 +00:00
26e413e04d
Porting first selenium test from Ruby to Node.js using the mocha framework. Starting with `category.feature` test. Tests are placed in a new `tests/selenium` folder with their own eslint config. Bug: T190710 Change-Id: Iad954405a5ae0608fd5dc90dd5dfa434b3781037
47 lines
1.3 KiB
JavaScript
47 lines
1.3 KiB
JavaScript
const { iClickOnTheCategoryButton,
|
|
iShouldSeeTheCategoriesOverlay,
|
|
iShouldSeeAListOfCategories
|
|
} = require( '../features/step_definitions/category_steps' ),
|
|
{
|
|
iAmInAWikiThatHasCategories
|
|
} = require( '../features/step_definitions/create_page_api_steps' ),
|
|
{
|
|
iAmUsingTheMobileSite,
|
|
iAmOnPage, iAmInBetaMode
|
|
} = require( '../features/step_definitions/common_steps' );
|
|
|
|
// Feature: Categories
|
|
describe( 'Categories', function () {
|
|
// Scenario: I can view categories
|
|
it( 'I can view categories', function () {
|
|
const title = 'Selenium categories test page';
|
|
// Given I am in a wiki that has categories
|
|
iAmInAWikiThatHasCategories( title );
|
|
|
|
// And I am using the mobile site
|
|
iAmUsingTheMobileSite();
|
|
|
|
// And I am in beta mode
|
|
iAmInBetaMode();
|
|
|
|
// And I am on the "Selenium categories test page" page
|
|
iAmOnPage( title );
|
|
|
|
// When I click on the category button
|
|
iClickOnTheCategoryButton();
|
|
|
|
// 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?' );
|
|
}
|
|
} );
|
|
} );
|