mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-23 22:45:20 +00:00
[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:
parent
d341b3f4fc
commit
58d1880ae8
|
@ -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' );
|
||||
|
|
|
@ -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' );
|
||||
|
|
Loading…
Reference in a new issue