mediawiki-skins-MinervaNeue/tests/selenium/specs/category.js
Ed Sanders a32999e641 build: Update eslint-config-wikimedia to 0.16.0
Change-Id: Icabf6e065ed5685207731262db72faf848a0a04d
2020-06-04 08:39:32 -07:00

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();
} );
} );