Selenium: Drop dead code

All these tests and associated steps are skipped and apply to pages that
no longer exist - Special:MobileDiff and Special:MobileHistory and can
safely be removed.

Change-Id: I15edf8c2fc88fbc01585c2b7e1243daa6d9210b9
This commit is contained in:
Jon Robson 2024-04-26 10:13:09 -07:00
parent b01d9420a0
commit 14ca9d0ad9
7 changed files with 2 additions and 127 deletions

View file

@ -1,12 +0,0 @@
Feature: Page diff
Scenario: Added and removed content
Given I am logged into the mobile website
And I am on a page that has the following edits:
| text |
| ABC DEF |
| ABC GHI |
And I click on the history link in the last modified bar
And I open the latest diff
Then I should see "GHI" as added content
And I should see "DEF" as removed content

View file

@ -1,14 +0,0 @@
'use strict';
const assert = require( 'assert' ),
{ SpecialMobileDiffPage } = require( '../support/world.js' );
const iShouldSeeAddedContent = ( text ) => {
SpecialMobileDiffPage.inserted_content_element.waitForDisplayed();
assert.strictEqual( SpecialMobileDiffPage.inserted_content_element.getText(), text );
};
const iShouldSeeRemovedContent = ( text ) => {
assert.strictEqual( SpecialMobileDiffPage.deleted_content_element.getText(), text );
};
module.exports = { iShouldSeeAddedContent, iShouldSeeRemovedContent };

View file

@ -1,22 +0,0 @@
'use strict';
const assert = require( 'assert' ),
{ ArticlePage, SpecialHistoryPage,
SpecialMobileDiffPage } = require( '../support/world.js' );
const iClickOnTheHistoryLinkInTheLastModifiedBar = () => {
ArticlePage.last_modified_bar_history_link_element.waitForDisplayed();
ArticlePage.last_modified_bar_history_link_element.click();
assert.strictEqual( SpecialHistoryPage.side_list_element.isDisplayed(), true );
};
const iOpenTheLatestDiff = () => {
SpecialHistoryPage.last_contribution_link_element.waitForExist();
SpecialHistoryPage.last_contribution_link_element.click();
assert.strictEqual( SpecialMobileDiffPage.user_info_element.isDisplayed(), true );
};
module.exports = {
iOpenTheLatestDiff,
iClickOnTheHistoryLinkInTheLastModifiedBar
};

View file

@ -15,10 +15,6 @@ const { defineSupportCode } = require( '@cucumber/cucumber' ),
iAmOnPage, iAmInBetaMode
} = require( './common_steps' ),
{
iShouldSeeAddedContent, iShouldSeeRemovedContent
} = require( './diff_steps' ),
{
iOpenTheLatestDiff,
iClickTheEditButton, iSeeTheWikitextEditorOverlay, iClearTheEditor,
iDoNotSeeTheWikitextEditorOverlay,
iTypeIntoTheEditor, iClickContinue, iClickSubmit, iSayOkayInTheConfirmDialog,
@ -43,10 +39,7 @@ const { defineSupportCode } = require( '@cucumber/cucumber' ),
{ iHaveNoNotifications, iClickOnTheNotificationIcon,
iShouldSeeTheNotificationsOverlay, iClickTheNotificationsOverlayCloseButton,
iShouldNotSeeTheNotificationsOverlay
} = require( './notification_steps' ),
{
iClickOnTheHistoryLinkInTheLastModifiedBar
} = require( './history_steps' );
} = require( './notification_steps' );
defineSupportCode( function ( { Then, When, Given } ) {
@ -89,15 +82,6 @@ defineSupportCode( function ( { Then, When, Given } ) {
Given( /^I am viewing a watched page$/, iAmViewingAWatchedPage );
Given( /^I am viewing an unwatched page$/, iAmViewingAnUnwatchedPage );
// history steps
When( /^I open the latest diff$/, iOpenTheLatestDiff );
When( /^I click on the history link in the last modified bar$/,
iClickOnTheHistoryLinkInTheLastModifiedBar );
// diff steps
Then( /^I should see "(.*?)" as added content$/, iShouldSeeAddedContent );
Then( /^I should see "(.*?)" as removed content$/, iShouldSeeRemovedContent );
// notifications
Then( /I have no notifications/, iHaveNoNotifications );
When( /I click on the notification icon/, iClickOnTheNotificationIcon );

View file

@ -7,7 +7,5 @@
module.exports = {
ArticlePage: require( './article_page' ),
ArticlePageWithEditorOverlay: require( './article_page_with_editor_overlay' ),
SpecialHistoryPage: require( './special_history_page' ),
SpecialMobileDiffPage: require( './special_mobilediff_page' )
ArticlePageWithEditorOverlay: require( './article_page_with_editor_overlay' )
};

View file

@ -1,28 +0,0 @@
'use strict';
/**
* Represents the mobile-first Special:MobileDiff page
*
* @extends Page
* @example
* https://en.m.wikipedia.org/wiki/Special:MobileDiff/833886807
*/
const { Page } = require( './mw_core_pages' );
class SpecialMobileDiffPage extends Page {
get inserted_content_element() {
return $( 'ins' );
}
get deleted_content_element() {
return $( 'del' );
}
get user_info_element() {
return $( '#mw-mf-userinfo' );
}
}
module.exports = new SpecialMobileDiffPage();

View file

@ -1,31 +0,0 @@
'use strict';
const { iAmOnAPageThatHasTheFollowingEdits
} = require( '../features/step_definitions/create_page_api_steps' ),
{
iAmLoggedIntoTheMobileWebsite
} = require( '../features/step_definitions/common_steps' ),
{
iShouldSeeAddedContent, iShouldSeeRemovedContent
} = require( '../features/step_definitions/diff_steps' ),
{
iOpenTheLatestDiff,
iClickOnTheHistoryLinkInTheLastModifiedBar
} = require( '../features/step_definitions/history_steps' );
describe.skip( 'Page diff', () => {
it( 'Added and removed content', () => {
iAmLoggedIntoTheMobileWebsite();
iAmOnAPageThatHasTheFollowingEdits( {
rawTable: [
[ ' text ' ],
[ ' ABC DEF ' ],
[ ' ABC GHI ' ]
]
} );
iClickOnTheHistoryLinkInTheLastModifiedBar();
iOpenTheLatestDiff();
iShouldSeeAddedContent( 'GHI' );
iShouldSeeRemovedContent( 'DEF' );
} );
} );