2020-06-02 21:21:44 +00:00
|
|
|
'use strict';
|
|
|
|
|
2019-07-01 22:31:17 +00:00
|
|
|
const {
|
|
|
|
pageExists, iAmOnAPageThatDoesNotExist,
|
2019-04-05 21:09:47 +00:00
|
|
|
iAmLoggedIntoTheMobileWebsite
|
|
|
|
} = require( './../features/step_definitions/common_steps' ),
|
|
|
|
{
|
|
|
|
iClickTheEditButton, iSeeTheWikitextEditorOverlay, iClearTheEditor,
|
|
|
|
iDoNotSeeTheWikitextEditorOverlay,
|
|
|
|
iTypeIntoTheEditor, iClickContinue, iClickSubmit, iSayOkayInTheConfirmDialog,
|
|
|
|
theTextOfTheFirstHeadingShouldBe, thereShouldBeARedLinkWithText
|
|
|
|
} = require( './../features/step_definitions/editor_steps' );
|
|
|
|
|
|
|
|
// @test2.m.wikipedia.org @login
|
|
|
|
describe( 'Wikitext Editor (Makes actual saves)', () => {
|
|
|
|
|
|
|
|
beforeEach( () => {
|
|
|
|
iAmLoggedIntoTheMobileWebsite();
|
|
|
|
} );
|
|
|
|
|
|
|
|
// @editing @en.m.wikipedia.beta.wmflabs.org
|
|
|
|
it( 'Redirects', () => {
|
|
|
|
const title = 'Selenium wikitext editor test ' + Math.random();
|
|
|
|
pageExists( title );
|
|
|
|
iAmOnAPageThatDoesNotExist();
|
|
|
|
iClickTheEditButton();
|
|
|
|
iSeeTheWikitextEditorOverlay();
|
|
|
|
iClearTheEditor();
|
|
|
|
iTypeIntoTheEditor( `#REDIRECT [[${title}]]` );
|
|
|
|
iClickContinue();
|
|
|
|
iClickSubmit();
|
|
|
|
iSayOkayInTheConfirmDialog();
|
|
|
|
iDoNotSeeTheWikitextEditorOverlay();
|
|
|
|
theTextOfTheFirstHeadingShouldBe( title );
|
|
|
|
} );
|
|
|
|
|
|
|
|
// @editing @en.m.wikipedia.beta.wmflabs.org
|
|
|
|
it( 'Broken redirects', () => {
|
|
|
|
iAmOnAPageThatDoesNotExist();
|
|
|
|
iClickTheEditButton();
|
|
|
|
iSeeTheWikitextEditorOverlay();
|
|
|
|
iClearTheEditor();
|
|
|
|
iTypeIntoTheEditor( '#REDIRECT [[AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA]]' );
|
|
|
|
iClickContinue();
|
|
|
|
iClickSubmit();
|
|
|
|
iSayOkayInTheConfirmDialog();
|
|
|
|
iDoNotSeeTheWikitextEditorOverlay();
|
|
|
|
thereShouldBeARedLinkWithText( 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' );
|
|
|
|
} );
|
|
|
|
} );
|