diff --git a/cypress/integration/ui/__snapshots__/scenario.js.snap b/cypress/integration/ui/__snapshots__/scenario.js.snap index f3ed7473..7be0291e 100644 --- a/cypress/integration/ui/__snapshots__/scenario.js.snap +++ b/cypress/integration/ui/__snapshots__/scenario.js.snap @@ -1,295 +1,51 @@ -exports[`use various parts of svg-edit > check tool_fhpath #0`] = ` - - - Layer 1 - - - -`; - exports[`use various parts of svg-edit > check tool_source #0`] = ` - - - Layer 1 - - + + + Layer 1 + + `; exports[`use various parts of svg-edit > check tool_text #0`] = ` - - - Layer 1 - - - A - - + + + Layer 1 + + B + `; exports[`use various parts of svg-edit > check tool_clone #0`] = ` - - - Layer 1 - - - A - - - A - - + + + Layer 1 + + B + B + `; exports[`use various parts of svg-edit > check tool_italic #0`] = ` - - - Layer 1 - - - A - - - A - - + + + Layer 1 + + B + B + `; exports[`use various parts of svg-edit > check tool_bold #0`] = ` - - - Layer 1 - - - A - - - A - - + + + Layer 1 + + B + B + `; diff --git a/cypress/integration/ui/scenario.js b/cypress/integration/ui/scenario.js index b2ca2d1a..8418cabe 100644 --- a/cypress/integration/ui/scenario.js +++ b/cypress/integration/ui/scenario.js @@ -2,13 +2,19 @@ import { visitAndApproveStorage } from '../../support/ui-test-helper.js'; +const testSnapshot = () => { + cy.get('#tool_source').click({force: true}); + cy.get('#svg_source_textarea').invoke('val').toMatchSnapshot(); + cy.get('#tool_source_save').click({force: true}); +}; + describe('use various parts of svg-edit', function () { before(() => { visitAndApproveStorage(); }); it('check tool_source', function () { - cy.get('#tool_source').click(); + cy.get('#tool_source').click({force: true}); cy.get('#svg_source_textarea') .type('{selectall}', {force: true}) .type(` @@ -17,8 +23,8 @@ describe('use various parts of svg-edit', function () { `, {parseSpecialCharSequences: false}); - cy.get('#tool_source_save').click(); - cy.get('#svgcontent').toMatchSnapshot(); + cy.get('#tool_source_save').click({force: true}); + testSnapshot(); }); /* it('check tool_fhpath', function () { @@ -40,23 +46,26 @@ describe('use various parts of svg-edit', function () { .trigger('mouseup', {force: true}); // svgedit use the #text text field to capture the text // cy.get('#text').type('1234', {force: true}); - cy.get('#text').type('A', {force: true}); - cy.get('#svgcontent').toMatchSnapshot(); + cy.get('#text').type('B', {force: true}); + testSnapshot(); }); it('check tool_clone', function () { + cy.get('#svg_1').click({force: true}); cy.get('#tool_clone') .click({force: true}); - cy.get('#svgcontent').toMatchSnapshot(); + testSnapshot(); }); it('check tool_italic', function () { + cy.get('#svg_1').click({force: true}); cy.get('#tool_italic') .click({force: true}); - cy.get('#svgcontent').toMatchSnapshot(); + testSnapshot(); }); it('check tool_bold', function () { + cy.get('#svg_1').click({force: true}); cy.get('#tool_bold') .click({force: true}); - cy.get('#svgcontent').toMatchSnapshot(); + testSnapshot(); }); });