Merge "Remove Minerva talk pages Selenium tests"

This commit is contained in:
jenkins-bot 2022-09-30 19:46:34 +00:00 committed by Gerrit Code Review
commit bf72d032f9
4 changed files with 0 additions and 164 deletions

View file

@ -36,17 +36,6 @@ const { defineSupportCode } = require( '@cucumber/cucumber' ),
iClickASearchWatchstar,
iSeeTheSearchOverlay
} = require( './search_steps' ),
{
iClickTheAddTalkButton,
iAddATopic,
iSeeTheTalkOverlay,
thereShouldBeASaveDiscussionButton,
noTopicIsPresent,
thereShouldBeAnAddDiscussionButton,
thereShouldBeATalkButton,
thereShouldBeNoTalkButton,
iShouldSeeTheTopicInTheListOfTopics
} = require( './talk_steps' ),
{ iSeeALinkToAboutPage, iShouldSeeAUserPageLinkInMenu,
iClickOnTheMainNavigationButton,
iShouldSeeALinkInMenu, iShouldSeeALinkToDisclaimer
@ -116,18 +105,6 @@ defineSupportCode( function ( { Then, When, Given } ) {
Then( /after 1 seconds I should not see the notifications overlay/, iShouldNotSeeTheNotificationsOverlay );
Then( /I should see the notifications overlay/, iShouldSeeTheNotificationsOverlay );
// talk
When( /^I click the add talk button$/, iClickTheAddTalkButton );
When( /^I add a topic called "(.+)"$/, iAddATopic );
Then( /^I see the talk overlay$/, iSeeTheTalkOverlay );
Then( /^I should see the talk overlay$/, iSeeTheTalkOverlay );
Then( /^there should be a save discussion button$/, thereShouldBeASaveDiscussionButton );
Then( /^no topic is present$/, noTopicIsPresent );
Then( /^there should be an add discussion button$/, thereShouldBeAnAddDiscussionButton );
Then( /^there should be a talk button/, thereShouldBeATalkButton );
Then( /^there should be no talk button$/, thereShouldBeNoTalkButton );
Then( /^I should see the topic called "(.+)" in the list of topics$/, iShouldSeeTheTopicInTheListOfTopics );
// user page
Given( /^I visit my user page$/, iVisitMyUserPage );
When( /^I should be on my user page$/, iShouldBeOnMyUserPage );

View file

@ -1,72 +0,0 @@
'use strict';
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.waitForDisplayed();
ArticlePage.talk_add_element.click();
};
const iAddATopic = ( subject ) => {
const overlay = ArticlePageWithEditorOverlay.editor_overlay_element;
overlay.$( '.overlay input' ).waitForExist();
overlay.$( '.overlay input' ).setValue( subject );
overlay.$( '.overlay textarea' ).setValue( 'Topic body is a really long text.' );
ArticlePageWithEditorOverlay.submit_element.waitForEnabled();
ArticlePageWithEditorOverlay.submit_element.click();
waitForPropagation( 5000 );
};
const iSeeTheTalkOverlay = () => {
iSeeAnOverlay();
};
const thereShouldBeASaveDiscussionButton = () => {
const submit = ArticlePageWithEditorOverlay.submit_element;
submit.waitForExist();
assert.strictEqual( submit.isDisplayed(), true );
};
const noTopicIsPresent = () => {
assert.strictEqual( ArticlePage.first_section_element.isExisting(), false );
};
const thereShouldBeAnAddDiscussionButton = () => {
assert.strictEqual( ArticlePage.talk_add_element.isDisplayed(), true );
};
const thereShouldBeATalkButton = () => {
assert.strictEqual( ArticlePage.talk_element.isDisplayed(), true );
};
const thereShouldBeNoTalkButton = () => {
assert.strictEqual( ArticlePage.talk_element.isDisplayed(), false );
};
const iShouldSeeTheTopicInTheListOfTopics = ( subject ) => {
assert.strictEqual(
ArticlePage.first_section_element.getText().includes( subject ),
true
);
};
const thereShouldBeATalkTab = () => {
assert.strictEqual( ArticlePage.talk_tab_element.isDisplayed(), true );
};
module.exports = {
iAddATopic,
iSeeTheTalkOverlay,
thereShouldBeASaveDiscussionButton,
noTopicIsPresent,
thereShouldBeAnAddDiscussionButton,
thereShouldBeATalkTab,
thereShouldBeATalkButton,
thereShouldBeNoTalkButton,
iShouldSeeTheTopicInTheListOfTopics,
iClickTheAddTalkButton
};

View file

@ -18,13 +18,8 @@ class ArticlePage extends MinervaPage {
get reference_element() { return $( 'sup a' ); }
get drawer_reference_element() { return $( '.drawer sup a' ); }
get talk_tab_element() { return $( '.minerva__tab-container a[rel="discussion"]' ); }
get talk_element() { return $( '.talk ' ); }
get mask_element() { return $( '.mw-mf-page-center__mask' ); }
get drawer_mask_element() { return $( '.drawer-container__mask--visible' ); }
get talk_add_element() { return $( '.minerva-talk-add-button' ); }
get first_section_element() {
return $( '.section-heading' );
}
get watched_element() { return $( '.mw-ui-icon-wikimedia-unStar-progressive, .mw-ui-icon-mf-watched' ); }
get menu_button_element() { return $( '#mw-mf-main-menu-button' ); }
get search_icon_element() { return $( '#searchIcon' ); }

View file

@ -1,64 +0,0 @@
'use strict';
const
{
pageExists, iAmOnAPageThatDoesNotExist,
iAmUsingTheMobileSite,
iAmLoggedIntoTheMobileWebsite,
iAmOnPage
} = require( '../features/step_definitions/common_steps' ),
{
iClickTheAddTalkButton,
thereShouldBeASaveDiscussionButton,
thereShouldBeAnAddDiscussionButton,
thereShouldBeATalkTab,
thereShouldBeNoTalkButton
} = require( '../features/step_definitions/talk_steps' );
// @chrome @en.m.wikipedia.beta.wmflabs.org @firefox @test2.m.wikipedia.org @vagrant
describe( 'Talk', () => {
before( () => {
pageExists( 'Talk:Selenium talk test' );
pageExists( 'Selenium talk test' );
} );
beforeEach( () => {
iAmUsingTheMobileSite();
} );
it( 'Talk button not visible as logged out user', () => {
iAmOnPage( 'Selenium talk test' );
thereShouldBeNoTalkButton();
} );
// @login
it( 'Talk tab visible as logged in user', () => {
iAmLoggedIntoTheMobileWebsite();
iAmOnPage( 'Selenium talk test' );
thereShouldBeATalkTab();
} );
// @login
it( 'Talk on a page that doesn\'t exist (T66268)', () => {
iAmLoggedIntoTheMobileWebsite();
iAmOnAPageThatDoesNotExist();
thereShouldBeATalkTab();
} );
// @smoke @login
it.skip( 'Add discussion button shows on talk pages for logged in users', () => {
iAmLoggedIntoTheMobileWebsite();
iAmOnPage( 'Talk:Selenium talk test' );
thereShouldBeAnAddDiscussionButton();
} );
// @smoke @login
it.skip( 'Add discussion for talk page possible as logged in user', () => {
iAmLoggedIntoTheMobileWebsite();
iAmOnPage( 'Talk:Selenium talk test' );
iClickTheAddTalkButton();
thereShouldBeASaveDiscussionButton();
} );
} );