mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-12-03 18:26:16 +00:00
a32999e641
Change-Id: Icabf6e065ed5685207731262db72faf848a0a04d
55 lines
1.5 KiB
JavaScript
55 lines
1.5 KiB
JavaScript
'use strict';
|
|
|
|
const { iClickOnTheCategoryButton,
|
|
iShouldSeeTheCategoriesOverlay,
|
|
iShouldSeeAListOfCategories
|
|
} = require( '../features/step_definitions/category_steps' ),
|
|
path = require( 'path' ),
|
|
{
|
|
iAmInAWikiThatHasCategories
|
|
} = require( '../features/step_definitions/create_page_api_steps' ),
|
|
{
|
|
iAmUsingTheMobileSite,
|
|
iAmOnPage, iAmInBetaMode
|
|
} = require( '../features/step_definitions/common_steps' );
|
|
|
|
// Feature: Categories
|
|
describe( 'Categories', function () {
|
|
before( function () {
|
|
const config = require( path.resolve( `${__dirname}../../../../skin.json` ) ).config;
|
|
|
|
// See https://danielkorn.io/post/skipping-tests-in-mochajs/
|
|
// if categories is not enabled by default we won't test this feature.
|
|
// This test will thus need to be run manually
|
|
// or become valid when and if the feature is pushed.
|
|
if ( !config.MinervaShowCategoriesButton.stable ) {
|
|
this.skip();
|
|
}
|
|
} );
|
|
|
|
// 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();
|
|
|
|
iShouldSeeAListOfCategories();
|
|
} );
|
|
} );
|