mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-18 11:35:54 +00:00
e888b487f4
Logic is moved from server to client. Config is added via getSkinConfigVariables (e.g. passed to mw.config ) and a JavaScript if statement. The IIFE in watchstar and talk files is replaced with a module.exports function to avoid refactoring at this point and added risk. The file contents remain the same. skins.minerva.options is left as is, given the code is more experimental and used in the beta mode - should not be sent to all clients. Additional change: * Remove skins.minerva.toggling (that module has been empty for a week now and functionality moved to mobile.init module) Depends-On: Ie71adbe18e8dbeb661ddb9d7d3d1d0897891d515 Bug: T233048 Change-Id: Ife777e76d9d77894fb5d09e7c8f0238b00596a7a
75 lines
2.6 KiB
JavaScript
75 lines
2.6 KiB
JavaScript
const assert = require( 'assert' );
|
|
const { iSeeAnOverlay, waitForPropagation } = require( './common_steps' );
|
|
const ArticlePageWithEditorOverlay = require( '../support/pages/article_page_with_editor_overlay' );
|
|
const { ArticlePage } = require( '../support/world.js' );
|
|
|
|
const iClickTheTalkButton = () => {
|
|
ArticlePage.waitUntilResourceLoaderModuleReady( 'skins.minerva.scripts' );
|
|
ArticlePage.talk_element.waitForVisible();
|
|
ArticlePage.talk_element.click();
|
|
};
|
|
|
|
const iAddATopic = ( subject ) => {
|
|
ArticlePageWithEditorOverlay.continue_element.waitForVisible();
|
|
ArticlePageWithEditorOverlay.continue_element.click();
|
|
ArticlePageWithEditorOverlay.editor_overlay_element.waitForExist();
|
|
const overlay = ArticlePageWithEditorOverlay.editor_overlay_element;
|
|
overlay.element( '.overlay input' ).waitForExist();
|
|
overlay.element( '.overlay input' ).setValue( subject );
|
|
overlay.element( '.overlay textarea' ).setValue( 'Topic body is a really long text.' );
|
|
browser.waitUntil( () =>
|
|
!ArticlePageWithEditorOverlay.submit_element.getAttribute( 'disabled' )
|
|
);
|
|
ArticlePageWithEditorOverlay.submit_element.click();
|
|
waitForPropagation( 5000 );
|
|
};
|
|
|
|
const iSeeTheTalkOverlay = () => {
|
|
iSeeAnOverlay();
|
|
};
|
|
|
|
const thereShouldBeASaveDiscussionButton = () => {
|
|
const submit = ArticlePageWithEditorOverlay.submit_element;
|
|
submit.waitForExist();
|
|
assert.strictEqual( submit.isVisible(), true );
|
|
};
|
|
|
|
const noTopicIsPresent = () => {
|
|
ArticlePageWithEditorOverlay.editor_overlay_element.waitForExist();
|
|
const overlay = ArticlePageWithEditorOverlay.editor_overlay_element;
|
|
overlay.element( '.content-header' ).waitForExist();
|
|
assert.strictEqual(
|
|
overlay.element( '.content-header' ).getText(),
|
|
'There are no conversations about this page.'
|
|
);
|
|
};
|
|
|
|
const thereShouldBeAnAddDiscussionButton = () => {
|
|
ArticlePageWithEditorOverlay.continue_element.waitForVisible();
|
|
};
|
|
|
|
const thereShouldBeNoTalkButton = () => {
|
|
assert.strictEqual( ArticlePage.talk_element.isVisible(), false );
|
|
};
|
|
|
|
const iShouldSeeTheTopicInTheListOfTopics = ( subject ) => {
|
|
ArticlePageWithEditorOverlay.editor_overlay_element.waitForExist();
|
|
ArticlePageWithEditorOverlay.editor_overlay_element.element( '.topic-title-list li' ).waitForExist();
|
|
const firstItem = ArticlePageWithEditorOverlay.editor_overlay_element.element( '.topic-title-list li' );
|
|
assert.strictEqual(
|
|
firstItem.getText().indexOf( subject ) > -1,
|
|
true
|
|
);
|
|
};
|
|
|
|
module.exports = {
|
|
iAddATopic,
|
|
iSeeTheTalkOverlay,
|
|
thereShouldBeASaveDiscussionButton,
|
|
noTopicIsPresent,
|
|
thereShouldBeAnAddDiscussionButton,
|
|
thereShouldBeNoTalkButton,
|
|
iShouldSeeTheTopicInTheListOfTopics,
|
|
iClickTheTalkButton
|
|
};
|