[cypress] Streamline the WT2017 tests

Using a bit more methods from the utils to reduce duplication.

Bug: T373787
Change-Id: Iead8ac8ba18370414dda16270c9b26f9c15db743
This commit is contained in:
WMDE-Fisch 2024-09-27 22:11:54 +02:00
parent d341b3f4fc
commit 58d1880ae8
2 changed files with 4 additions and 18 deletions

View file

@ -78,12 +78,9 @@ describe( 'Re-using refs in Visual Editor using templates', () => {
cy.get( '.ve-ui-mwParameterPage-field' ).type( 'test' );
// Click on insert button
cy.get( '.ve-ui-mwTemplateDialog .oo-ui-processDialog-actions-primary .oo-ui-buttonElement-button' ).click();
cy.get( '.ve-ui-toolbar-saveButton' ).click();
// Click save changes button
cy.get( '.ve-ui-mwSaveDialog .oo-ui-processDialog-navigation .oo-ui-flaggedElement-primary .oo-ui-buttonElement-button' ).click();
// Success notification should be visible
cy.get( '.mw-notification-visible .oo-ui-icon-success' ).should( 'be.visible' );
// Save changes
veHelper.saveEdits();
// Ref has been added to references section and has correct content
helper.getRefFromReferencesSection( 2 ).find( '.reference-text' ).should( 'have.text', 'Template:Internetquelle' );

View file

@ -57,12 +57,7 @@ describe( 'Visual Editor Wt 2017 Cite Integration', () => {
cy.get( '.ve-ui-mwWikitextSurface' ).should( 'contain.text', '<ref>Basic ref</ref>' );
// Save changes
cy.get( '.ve-ui-toolbar-saveButton' ).click();
cy.wait( 500 );
cy.get( '.oo-ui-labelElement-label' ).contains( 'Save changes' ).click( { force: true } );
// Success notification should be visible
cy.get( '.mw-notification-visible .oo-ui-icon-success' ).should( 'be.visible' );
veHelper.saveEdits();
// Ref has been added to references section and has correct content
helper.getRefFromReferencesSection( 1 ).find( '.reference-text' ).should( 'have.text', 'Basic ref' );
@ -91,18 +86,12 @@ describe( 'Visual Editor Wt 2017 Cite Integration', () => {
cy.get( '.ve-ui-mwParameterPage-field' ).type( 't' );
// Click on insert button
cy.get( '.ve-ui-mwTemplateDialog .oo-ui-processDialog-actions-primary .oo-ui-buttonElement-button' ).click();
cy.get( '.ve-ui-toolbar-saveButton' ).click();
// Ref tag with template and added parameter has been created
cy.get( '.ve-ui-mwWikitextSurface' ).should( 'contain.text', '<ref>{{Internetquelle|t=t}}</ref>' );
// Save changes
cy.get( '.ve-ui-toolbar-saveButton' ).click();
cy.wait( 500 );
cy.get( '.oo-ui-labelElement-label' ).contains( 'Save changes' ).click( { force: true } );
// Success notification should be visible
cy.get( '.mw-notification-visible .oo-ui-icon-success' ).should( 'be.visible' );
veHelper.saveEdits();
// Ref has been added to references section and has correct content
helper.getRefFromReferencesSection( 1 ).find( '.reference-text' ).should( 'have.text', 'Template:Internetquelle' );