mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-17 11:13:34 +00:00
2d579183c9
Following up on Jon's POC, this will get rid of the talk board component in favor of linking to the server rendered talk page. Additional Changes: * Cleaned up talk selenium tests. Removed talk_steps.rb which doesn't appear to be used anymore. * Changed talk add button classes to a single class * Moved "Add discussion" button to postheadinghtml per design mock * Added "...talk-explained", "...talk-explained-empty" messages to postheadinghtml per design mock * Due to undesirable jumps in window scroll caused by the section anchor & Toggler.js code when opening the TalkSectionOverlay (read fixme in code), a Promise is always returned from OverlayManager route to reset the scroll position to the top when the section overlay is opened. * Moved "mobile-frontend-talk-fullpage", "mobile-frontend-talk-reply-success", "mobile-frontend-talk-topic-feedback", "mobile-frontend-talk-explained" "mobile-frontend-talk-explained-empty" messages to minerva as minerva is the one who initiates those messages now. * Limited $talk selector to only `.talk` elements since amc talk tab does not need to be targeted * After saving a reply from TalkSectionOverlay, the DOM that is not part of the overlay becomes out of sync since a new reply was created. To get around this, an `onSaveComplete` callback was passed (similar to the TalkSectionAddOverlay) to execute a full page refresh. Although this is clunky, it is the easiest way to resync. Bug: T230695 Depends-On: I80201394fd7015db6700446142b0b4b20829f12e Change-Id: I243f1193bce0da9fa710fc3b5379f90b2d079680
68 lines
2.1 KiB
JavaScript
68 lines
2.1 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 iClickTheAddTalkButton = () => {
|
|
ArticlePage.waitUntilResourceLoaderModuleReady( 'skins.minerva.scripts' );
|
|
ArticlePage.talk_add_element.waitForVisible();
|
|
ArticlePage.talk_add_element.click();
|
|
};
|
|
|
|
const iAddATopic = ( subject ) => {
|
|
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 = () => {
|
|
assert.strictEqual( ArticlePage.first_section_element.isExisting(), false );
|
|
};
|
|
|
|
const thereShouldBeAnAddDiscussionButton = () => {
|
|
assert.strictEqual( ArticlePage.talk_add_element.isVisible(), true );
|
|
};
|
|
|
|
const thereShouldBeATalkButton = () => {
|
|
assert.strictEqual( ArticlePage.talk_element.isVisible(), true );
|
|
};
|
|
|
|
const thereShouldBeNoTalkButton = () => {
|
|
assert.strictEqual( ArticlePage.talk_element.isVisible(), false );
|
|
};
|
|
|
|
const iShouldSeeTheTopicInTheListOfTopics = ( subject ) => {
|
|
assert.strictEqual(
|
|
ArticlePage.first_section_element.getText().indexOf( subject ) > -1,
|
|
true
|
|
);
|
|
};
|
|
|
|
module.exports = {
|
|
iAddATopic,
|
|
iSeeTheTalkOverlay,
|
|
thereShouldBeASaveDiscussionButton,
|
|
noTopicIsPresent,
|
|
thereShouldBeAnAddDiscussionButton,
|
|
thereShouldBeATalkButton,
|
|
thereShouldBeNoTalkButton,
|
|
iShouldSeeTheTopicInTheListOfTopics,
|
|
iClickTheAddTalkButton
|
|
};
|