From 92ec863fbc535d2665e6268baf6509b28974262c Mon Sep 17 00:00:00 2001 From: agriyadev5 Date: Fri, 27 Aug 2021 14:11:11 +0530 Subject: [PATCH 01/11] #623 line missing test case added --- .../ui/__snapshots__/scenario5.js.snap | 424 +++++++++++++++++- cypress/integration/ui/scenario5.js | 52 ++- 2 files changed, 471 insertions(+), 5 deletions(-) diff --git a/cypress/integration/ui/__snapshots__/scenario5.js.snap b/cypress/integration/ui/__snapshots__/scenario5.js.snap index 947b63a5..a9135fb8 100644 --- a/cypress/integration/ui/__snapshots__/scenario5.js.snap +++ b/cypress/integration/ui/__snapshots__/scenario5.js.snap @@ -252,7 +252,7 @@ exports[`use all parts of svg-edit > check tool_line_clone #0`] = ` `; -exports[`use all parts of svg-edit > check tool_fhrect_change_x_y_coordinate #0`] = ` +exports[`use all parts of svg-edit > check tool_line_bring_to_back #0`] = ` check tool_fhrect_change_x_y_coordinate #0` stroke="#000000" stroke-width="5" opacity="0.5" - x1="225" + x1="200" y1="200" - x2="475" - y2="425" + x2="450" + y2="450" id="svg_2" fill-opacity="1" stroke-opacity="1" @@ -310,3 +310,419 @@ exports[`use all parts of svg-edit > check tool_fhrect_change_x_y_coordinate #0` `; + +exports[`use all parts of svg-edit > check tool_line_bring_to_front #0`] = ` + + + Layer 1 + + + + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_line_change_x_y_coordinate #0`] = ` + + + Layer 1 + + + + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_line_change_stroke_width #0`] = ` + + + Layer 1 + + + + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_line_change_stroke_style #0`] = ` + + + Layer 1 + + + + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_line_change_line_cap #0`] = ` + + + Layer 1 + + + + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_line_align_to_page #0`] = ` + + + Layer 1 + + + + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_line_change_stoke_color #0`] = ` + + + Layer 1 + + + + + + + + + + + +`; diff --git a/cypress/integration/ui/scenario5.js b/cypress/integration/ui/scenario5.js index 4fd22c95..ce20994d 100644 --- a/cypress/integration/ui/scenario5.js +++ b/cypress/integration/ui/scenario5.js @@ -94,7 +94,17 @@ describe('use all parts of svg-edit', function () { cy.get('#tool_clone').click({ force: true }); cy.get('#svgcontent').toMatchSnapshot(); }); - it('check tool_fhrect_change_x_y_coordinate', function () { + it('check tool_line_bring_to_back', function () { + cy.get('#svg_2').click({ force: true }); + cy.get('#tool_move_bottom').click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_line_bring_to_front', function () { + cy.get('#svg_2').click({ force: true }); + cy.get('#tool_move_top').click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_line_change_x_y_coordinate', function () { cy.get('#svg_2').click({ force: true }); for(let n = 0; n < 25; n ++){ cy.get('#line_x1').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) @@ -114,4 +124,44 @@ describe('use all parts of svg-edit', function () { } cy.get('#svgcontent').toMatchSnapshot(); }); + it('check tool_line_change_stroke_width', function () { + cy.get('#svg_2').click({ force: true }); + for(let n = 0; n < 10; n ++){ + cy.get('#stroke_width').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + } + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_line_change_stroke_style', function () { + cy.get('#svg_2').click({ force: true }); + cy.get('#stroke_style').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); + cy.get('#stroke_style').find('se-list-item').eq(3).shadow().find('elix-option').eq(0) + .click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_line_change_line_cap', function () { + cy.get('#svg_2').click({ force: true }); + cy.get('#stroke_linecap').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); + cy.get('#stroke_linecap').find('se-list-item').eq(1).shadow().find('elix-option').eq(0) + .click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_line_align_to_page', function () { + cy.get('#svg_3').click({ force: true }); + cy.get('#tool_position').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); + cy.get('#tool_position').find('se-list-item').eq(2).shadow().find('elix-option').eq(0) + .click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_line_change_stoke_color', function () { + cy.get('#svg_3').click({ force: true }); + cy.get('#stroke_color').shadow().find('#picker').eq(0).click({ force: true }); + cy.get('#stroke_color').shadow().find('#color_picker').eq(0) + .find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0) + .find('.QuickColor').eq(9).click({ force: true }); + cy.get('#stroke_color').shadow().find('#color_picker').eq(0) + .find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0) + .find('#Ok').eq(0).click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); }); From a905f02c763269f68abd3c71a998f8b851d4a5c7 Mon Sep 17 00:00:00 2001 From: agriyadev5 Date: Fri, 27 Aug 2021 16:34:07 +0530 Subject: [PATCH 02/11] #623 tool text cypress test cases added --- .../ui/__snapshots__/scenario.js.snap | 844 ++++++++++++------ cypress/integration/ui/scenario.js | 132 ++- 2 files changed, 664 insertions(+), 312 deletions(-) diff --git a/cypress/integration/ui/__snapshots__/scenario.js.snap b/cypress/integration/ui/__snapshots__/scenario.js.snap index 33621388..e515aa6e 100644 --- a/cypress/integration/ui/__snapshots__/scenario.js.snap +++ b/cypress/integration/ui/__snapshots__/scenario.js.snap @@ -10,19 +10,7 @@ exports[`use various parts of svg-edit > check tool_source #0`] = ` y="480" viewBox="0 0 640 480" > - - Layer 1 - - + Layer 1 `; @@ -37,22 +25,11 @@ exports[`use various parts of svg-edit > check tool_fhpath #0`] = ` x="640" y="480" viewBox="0 0 640 480" + fill-opacity="1" + stroke-opacity="1" > Layer 1 - `; @@ -68,27 +45,17 @@ exports[`use various parts of svg-edit > check tool_text #0`] = ` x="640" y="480" viewBox="0 0 640 480" + fill-opacity="1" + stroke-opacity="1" > Layer 1 - check tool_clone #0`] = ` x="640" y="480" viewBox="0 0 640 480" + fill-opacity="1" + stroke-opacity="1" > Layer 1 - check tool_clone #0`] = ` fill="#000000" stroke="#000000" stroke-width="0" - x="136" - y="107" + x="66" + y="55" font-size="24" font-family="Serif" text-anchor="middle" @@ -176,27 +133,17 @@ exports[`use various parts of svg-edit > check tool_italic #0`] = ` x="640" y="480" viewBox="0 0 640 480" + fill-opacity="1" + stroke-opacity="1" > Layer 1 - check tool_italic #0`] = ` fill="#000000" stroke="#000000" stroke-width="0" - x="136" - y="107" + x="66" + y="55" font-size="24" font-family="Serif" text-anchor="middle" @@ -239,27 +186,17 @@ exports[`use various parts of svg-edit > check tool_bold #0`] = ` x="640" y="480" viewBox="0 0 640 480" + fill-opacity="1" + stroke-opacity="1" > Layer 1 - check tool_bold #0`] = ` fill="#000000" stroke="#000000" stroke-width="0" - x="136" - y="107" + x="66" + y="55" font-size="24" font-family="Serif" text-anchor="middle" @@ -292,7 +229,7 @@ exports[`use various parts of svg-edit > check tool_bold #0`] = ` `; -exports[`use various parts of svg-edit > check change color #0`] = ` +exports[`use various parts of svg-edit > check tool_text_change_x_y_coordinate #0`] = ` check change color #0`] = ` x="640" y="480" viewBox="0 0 640 480" + fill-opacity="1" + stroke-opacity="1" > - - Layer 1 - + + Layer 1 check change color #0`] = ` xml:space="preserve" fill-opacity="1" stroke-opacity="1" - font-="" + font-style="italic" font-weight="bold" > AB @@ -340,8 +267,279 @@ exports[`use various parts of svg-edit > check change color #0`] = ` fill="#000000" stroke="#000000" stroke-width="0" - x="136" - y="107" + x="91" + y="80" + font-size="24" + font-family="Serif" + text-anchor="middle" + xml:space="preserve" + fill-opacity="1" + stroke-opacity="1" + id="svg_2" + > + AB + + + +`; + +exports[`use various parts of svg-edit > check tool_text_change_font_size #0`] = ` + + + Layer 1 + + AB + + + AB + + + +`; + +exports[`use various parts of svg-edit > check tool_text_change_font_family #0`] = ` + + + Layer 1 + + AB + + + AB + + + +`; + +exports[`use various parts of svg-edit > check tool_text_change_stroke_width #0`] = ` + + + Layer 1 + + AB + + + AB + + + +`; + +exports[`use various parts of svg-edit > check tool_text_change_stroke_style #0`] = ` + + + Layer 1 + + AB + + + AB + + + +`; + +exports[`use various parts of svg-edit > check tool_text_change_stoke_fill_color #0`] = ` + + + Layer 1 + + AB + + check tool_text_anchor_start #0`] = ` x="640" y="480" viewBox="0 0 640 480" + fill-opacity="1" + stroke-opacity="1" > Layer 1 - AB @@ -404,8 +593,8 @@ exports[`use various parts of svg-edit > check tool_text_anchor_start #0`] = ` fill="#000000" stroke="#000000" stroke-width="0" - x="136" - y="107" + x="91" + y="80" font-size="24" font-family="Serif" text-anchor="middle" @@ -431,36 +620,27 @@ exports[`use various parts of svg-edit > check tool_text_anchor_middle #0`] = ` x="640" y="480" viewBox="0 0 640 480" + fill-opacity="1" + stroke-opacity="1" > Layer 1 - AB @@ -468,8 +648,8 @@ exports[`use various parts of svg-edit > check tool_text_anchor_middle #0`] = ` fill="#000000" stroke="#000000" stroke-width="0" - x="136" - y="107" + x="91" + y="80" font-size="24" font-family="Serif" text-anchor="middle" @@ -495,36 +675,27 @@ exports[`use various parts of svg-edit > check tool_text_anchor_end #0`] = ` x="640" y="480" viewBox="0 0 640 480" + fill-opacity="1" + stroke-opacity="1" > Layer 1 - AB @@ -532,8 +703,8 @@ exports[`use various parts of svg-edit > check tool_text_anchor_end #0`] = ` fill="#000000" stroke="#000000" stroke-width="0" - x="136" - y="107" + x="91" + y="80" font-size="24" font-family="Serif" text-anchor="middle" @@ -548,7 +719,7 @@ exports[`use various parts of svg-edit > check tool_text_anchor_end #0`] = ` `; -exports[`use various parts of svg-edit > check tool_star #0`] = ` +exports[`use various parts of svg-edit > check tool_text_change_rotation #0`] = ` check tool_star #0`] = ` x="640" y="480" viewBox="0 0 640 480" + fill-opacity="1" + stroke-opacity="1" > - - Layer 1 - + + Layer 1 AB @@ -596,8 +758,8 @@ exports[`use various parts of svg-edit > check tool_star #0`] = ` fill="#000000" stroke="#000000" stroke-width="0" - x="136" - y="107" + x="91" + y="80" font-size="24" font-family="Serif" text-anchor="middle" @@ -605,40 +767,15 @@ exports[`use various parts of svg-edit > check tool_star #0`] = ` fill-opacity="1" stroke-opacity="1" id="svg_2" + transform="rotate(25 91 72)" > AB - - - `; -exports[`use various parts of svg-edit > check tool_polygon #0`] = ` +exports[`use various parts of svg-edit > check tool_text_change_blur #0`] = ` check tool_polygon #0`] = ` x="640" y="480" viewBox="0 0 640 480" + fill-opacity="1" + stroke-opacity="1" > - - Layer 1 - + + Layer 1 AB @@ -686,8 +814,8 @@ exports[`use various parts of svg-edit > check tool_polygon #0`] = ` fill="#000000" stroke="#000000" stroke-width="0" - x="136" - y="107" + x="91" + y="80" font-size="24" font-family="Serif" text-anchor="middle" @@ -695,52 +823,186 @@ exports[`use various parts of svg-edit > check tool_polygon #0`] = ` fill-opacity="1" stroke-opacity="1" id="svg_2" + transform="rotate(25 91 72)" + filter="url(#svg_2_blur)" > AB - - - - + + + + + + +`; + +exports[`use various parts of svg-edit > check tool_text_change_opacity #0`] = ` + + + Layer 1 + + AB + + + AB + + + + + + + + +`; + +exports[`use various parts of svg-edit > check tool_text_align_to_page #0`] = ` + + + Layer 1 + + AB + + + AB + + + + + + + + +`; + +exports[`use various parts of svg-edit > check tool_text_delete #0`] = ` + + + Layer 1 + + AB + + + + + + + `; diff --git a/cypress/integration/ui/scenario.js b/cypress/integration/ui/scenario.js index df1eec6a..0eb7ce25 100644 --- a/cypress/integration/ui/scenario.js +++ b/cypress/integration/ui/scenario.js @@ -18,7 +18,6 @@ describe('use various parts of svg-edit', function () { .type(` Layer 1 - `, { force: true, parseSpecialCharSequences: false }); cy.get('#tool_source_save').click({ force: true }); @@ -27,7 +26,7 @@ describe('use various parts of svg-edit', function () { it('check tool_fhpath', function () { cy.get('#tool_fhpath') .click({ force: true }); - cy.get('#rect') + cy.get('#svgcontent') .trigger('mousemove', 200, 200, { force: true }) .trigger('mousedown', 200, 200, { force: true }) .trigger('mousemove', 20, 20, { force: true }) @@ -37,7 +36,7 @@ describe('use various parts of svg-edit', function () { it('check tool_text', function () { cy.get('#tool_text') .click({ force: true }); - cy.get('#rect') + cy.get('#svgcontent') .trigger('mousedown', 46, 35, { force: true }) .trigger('mouseup', { force: true }); // svgedit use the #text text field to capture the text @@ -63,11 +62,64 @@ describe('use various parts of svg-edit', function () { .click({ force: true }); testSnapshot(); }); - it('check change color', function () { + it('check tool_text_change_x_y_coordinate', function () { + cy.get('#svg_2').click({ force: true }); + for(let n = 0; n < 25; n ++){ + cy.get('#selected_x').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + } + for(let n = 0; n < 25; n ++){ + cy.get('#selected_y').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + } + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_text_change_font_size', function () { cy.get('#svg_1').click({ force: true }); - cy.get('[data-rgb="#ffff00"]') + for(let n = 0; n < 10; n ++){ + cy.get('#font_size').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + } + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_text_change_font_family', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#tool_font_family').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); + cy.get('#tool_font_family').find('se-list-item').eq(2).shadow().find('elix-option').eq(0) .click({ force: true }); - testSnapshot(); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_text_change_stroke_width', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#stroke_width').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_text_change_stroke_style', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#stroke_style').shadow().find('elix-dropdown-list').eq(0) + .invoke('attr', 'opened', 'opened'); + cy.get('#stroke_style').find('se-list-item').eq(3).shadow().find('elix-option').eq(0) + .click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_text_change_stoke_fill_color', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#stroke_color').shadow().find('#picker').eq(0).click({ force: true }); + cy.get('#stroke_color').shadow().find('#color_picker').eq(0) + .find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0) + .find('.QuickColor').eq(51).click({ force: true }); + cy.get('#stroke_color').shadow().find('#color_picker').eq(0) + .find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0) + .find('#Ok').eq(0).click({ force: true }); + cy.get('#fill_color').shadow().find('#picker').eq(0).click({ force: true }); + cy.get('#fill_color').shadow().find('#color_picker').eq(0) + .find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0) + .find('.QuickColor').eq(3).click({ force: true }); + cy.get('#fill_color').shadow().find('#color_picker').eq(0) + .find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0) + .find('#Ok').eq(0).click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); }); it('check tool_text_anchor_start', function () { cy.get('#svg_1').click({ force: true }); @@ -87,22 +139,60 @@ describe('use various parts of svg-edit', function () { .click({ force: true }); testSnapshot(); }); - it('check tool_star', function () { - cy.get('#tool_star') - .click({ force: true }); - cy.get('#svgcontent') - .trigger('mousedown', 300, 150, { force: true }) - .trigger('mousemove', 300, 250, { force: true }) - .trigger('mouseup', { force: true }); - testSnapshot(); + it('check tool_text_change_rotation', function () { + cy.get('#svg_2').click({ force: true }); + for(let n = 0; n < 5; n ++){ + cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + } + cy.get('#svgcontent').toMatchSnapshot(); }); - it('check tool_polygon', function () { - cy.get('#tool_polygon') + it('check tool_text_change_blur', function () { + cy.get('#svg_2').click({ force: true }); + for(let n = 0; n < 10; n ++){ + cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + } + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_text_change_opacity', function () { + cy.get('#svg_2').click({ force: true }); + for(let n = 0; n < 10; n ++){ + cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0) + .click({ force: true }); + } + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_text_align_to_page', function () { + cy.get('#svg_2').click({ force: true }); + cy.get('#tool_position').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); + cy.get('#tool_position').find('se-list-item').eq(2).shadow().find('elix-option').eq(0) .click({ force: true }); - cy.get('#svgcontent') - .trigger('mousedown', 350, 250, { force: true }) - .trigger('mousemove', 350, 370, { force: true }) - .trigger('mouseup', { force: true }); - testSnapshot(); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_text_change_class', function () { + cy.get('#svg_2').click({ force: true }); + cy.get('#elem_class').shadow().find('elix-input').eq(0).shadow().find('#inner').eq(0) + .type('svg_2_class{enter}', { force: true }); + cy.get('#svg_2') + .should('satisfy', ($el) => { + const classList = Array.from($el[0].classList); + return classList.includes('svg_2_class'); + }); + }); + it('check tool_text_change_id', function () { + cy.get('#svg_2').click({ force: true }).click({ force: true }); + cy.get('#elem_id').shadow().find('elix-input').eq(0).shadow().find('#inner').eq(0) + .type('_id{enter}', { force: true }); + cy.get('#svg_2_id') + .should('satisfy', ($el) => { + const classList = Array.from($el[0].classList); + return classList.includes('svg_2_class'); + }); + }); + it('check tool_text_delete', function () { + cy.get('#svg_2_id').click({ force: true }); + cy.get('#tool_delete').click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); }); }); From 41dbec29afe5ad2267e2e9ccf97788c14964fc95 Mon Sep 17 00:00:00 2001 From: agriyadev5 Date: Fri, 27 Aug 2021 18:35:33 +0530 Subject: [PATCH 03/11] #623 tool_polygon cyper test cases added --- .../ui/__snapshots__/scenario6.js.snap | 690 ++++++++++++++++++ cypress/integration/ui/scenario6.js | 164 +++++ 2 files changed, 854 insertions(+) create mode 100644 cypress/integration/ui/__snapshots__/scenario6.js.snap create mode 100644 cypress/integration/ui/scenario6.js diff --git a/cypress/integration/ui/__snapshots__/scenario6.js.snap b/cypress/integration/ui/__snapshots__/scenario6.js.snap new file mode 100644 index 00000000..51b74f87 --- /dev/null +++ b/cypress/integration/ui/__snapshots__/scenario6.js.snap @@ -0,0 +1,690 @@ +exports[`use all parts of svg-edit > check tool_source_set #0`] = ` + + Layer 1 + +`; + +exports[`use all parts of svg-edit > check tool_polygon #0`] = ` + + + Layer 1 + + + + + +`; + +exports[`use all parts of svg-edit > check tool_polygon_clone #0`] = ` + + + Layer 1 + + + + +`; + +exports[`use all parts of svg-edit > check tool_polygon_change_rotation #0`] = ` + + + Layer 1 + + + + +`; + +exports[`use all parts of svg-edit > check tool_polygon_change_blur #0`] = ` + + + Layer 1 + + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_polygon_change_opacity #0`] = ` + + + Layer 1 + + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_polygon_bring_to_back #0`] = ` + + + Layer 1 + + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_polygon_bring_to_front #0`] = ` + + + Layer 1 + + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_polygon_delete #0`] = ` + + + Layer 1 + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_polygon_align_to_page #0`] = ` + + + Layer 1 + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_polygon_change_stroke_width #0`] = ` + + + Layer 1 + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_polygon_change_stroke_style #0`] = ` + + + Layer 1 + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_polygon_change_line_cap #0`] = ` + + + Layer 1 + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_polygon_change_stoke_fill_color #0`] = ` + + + Layer 1 + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_polygon_change_sides #0`] = ` + + + Layer 1 + + + + + + + + +`; diff --git a/cypress/integration/ui/scenario6.js b/cypress/integration/ui/scenario6.js new file mode 100644 index 00000000..8b814730 --- /dev/null +++ b/cypress/integration/ui/scenario6.js @@ -0,0 +1,164 @@ +import { + visitAndApproveStorage +} from '../../support/ui-test-helper.js'; + +const testSnapshot = () => { + cy.get('#svgcontent').cleanSnapshot(); +}; + +describe('use all parts of svg-edit', function () { + before(() => { + visitAndApproveStorage(); + }); + + it('check tool_source_set', function () { + cy.get('#tool_source').click({ force: true }); + cy.get('#svg_source_textarea') + .type('{selectall}', { force: true }) + .type(` + + Layer 1 + + `, { force: true, parseSpecialCharSequences: false }); + cy.get('#tool_source_save').click({ force: true }); + testSnapshot(); + }); + it('check tool_polygon', function () { + cy.get('#tool_polygon') + .click({ force: true }); + cy.get('#svgcontent') + .trigger('mousedown', 325, 250, { force: true }) + .trigger('mousemove', 325, 345, { force: true }) + .trigger('mouseup', { force: true }); + testSnapshot(); + }); + it('check tool_polygon_clone', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#tool_clone').click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_polygon_change_class', function () { + cy.get('#svg_2').click({ force: true }); + cy.get('#elem_class').shadow().find('elix-input').eq(0).shadow().find('#inner').eq(0) + .type('svg_2_class{enter}', { force: true }); + cy.get('#svg_2') + .should('satisfy', ($el) => { + const classList = Array.from($el[0].classList); + return classList.includes('svg_2_class'); + }); + }); + it('check tool_polygon_change_id', function () { + cy.get('#svg_2').click({ force: true }).click({ force: true }); + cy.get('#elem_id').shadow().find('elix-input').eq(0).shadow().find('#inner').eq(0) + .type('_id{enter}', { force: true }); + cy.get('#svg_2_id') + .should('satisfy', ($el) => { + const classList = Array.from($el[0].classList); + return classList.includes('svg_2_class'); + }); + }); + it('check tool_polygon_change_rotation', function () { + cy.get('#svg_2_id').click({ force: true }); + for(let n = 0; n < 5; n ++){ + cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + } + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_polygon_change_blur', function () { + cy.get('#svg_2_id').click({ force: true }); + for(let n = 0; n < 10; n ++){ + cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + } + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_polygon_change_opacity', function () { + cy.get('#svg_2_id').click({ force: true }); + for(let n = 0; n < 10; n ++){ + cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0) + .click({ force: true }); + } + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_polygon_bring_to_back', function () { + cy.get('#svg_2_id').click({ force: true }); + cy.get('#tool_move_bottom').click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_polygon_bring_to_front', function () { + cy.get('#svg_2_id').click({ force: true }); + cy.get('#tool_move_top').click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_polygon_delete', function () { + cy.get('#svg_2_id').click({ force: true }); + cy.get('#tool_delete').click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_polygon_align_to_page', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#tool_position').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); + cy.get('#tool_position').find('se-list-item').eq(0).shadow().find('elix-option').eq(0) + .click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + /* it('check tool_polygon_change_x_y_coordinate', function () { + cy.get('#svg_1').click({ force: true }); + for(let n = 0; n < 25; n ++){ + cy.get('#selected_x').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + } + for(let n = 0; n < 25; n ++){ + cy.get('#selected_y').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + } + cy.get('#svgcontent').toMatchSnapshot(); + }); */ + it('check tool_polygon_change_stroke_width', function () { + cy.get('#svg_1').click({ force: true }); + for(let n = 0; n < 10; n ++){ + cy.get('#stroke_width').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + } + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_polygon_change_stroke_style', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#stroke_style').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); + cy.get('#stroke_style').find('se-list-item').eq(3).shadow().find('elix-option').eq(0) + .click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_polygon_change_line_cap', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#stroke_linecap').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); + cy.get('#stroke_linecap').find('se-list-item').eq(1).shadow().find('elix-option').eq(0) + .click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_polygon_change_stoke_fill_color', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#stroke_color').shadow().find('#picker').eq(0).click({ force: true }); + cy.get('#stroke_color').shadow().find('#color_picker').eq(0) + .find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0) + .find('.QuickColor').eq(51).click({ force: true }); + cy.get('#stroke_color').shadow().find('#color_picker').eq(0) + .find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0) + .find('#Ok').eq(0).click({ force: true }); + cy.get('#fill_color').shadow().find('#picker').eq(0).click({ force: true }); + cy.get('#fill_color').shadow().find('#color_picker').eq(0) + .find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0) + .find('.QuickColor').eq(3).click({ force: true }); + cy.get('#fill_color').shadow().find('#color_picker').eq(0) + .find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0) + .find('#Ok').eq(0).click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_polygon_change_sides', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#polySides').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); +}); From 427b09ca6a279e60a5bf6271a9afee485a117003 Mon Sep 17 00:00:00 2001 From: agriyadev5 Date: Fri, 27 Aug 2021 19:26:07 +0530 Subject: [PATCH 04/11] #623 tool_star cypress test cases added --- .../ui/__snapshots__/scenario1.js.snap | 230 +----- .../ui/__snapshots__/scenario7.js.snap | 750 ++++++++++++++++++ cypress/integration/ui/scenario1.js | 36 - cypress/integration/ui/scenario7.js | 164 ++++ 4 files changed, 923 insertions(+), 257 deletions(-) create mode 100644 cypress/integration/ui/__snapshots__/scenario7.js.snap create mode 100644 cypress/integration/ui/scenario7.js diff --git a/cypress/integration/ui/__snapshots__/scenario1.js.snap b/cypress/integration/ui/__snapshots__/scenario1.js.snap index ee4d81cd..5a8ea21f 100644 --- a/cypress/integration/ui/__snapshots__/scenario1.js.snap +++ b/cypress/integration/ui/__snapshots__/scenario1.js.snap @@ -14,44 +14,6 @@ exports[`use all parts of svg-edit > check tool_source_set #0`] = ` `; -exports[`use all parts of svg-edit > check tool_line #0`] = ` - - - Layer 1 - - - - - -`; - exports[`use all parts of svg-edit > check tool_shape #0`] = ` check tool_shape #0`] = ` > Layer 1 - - - - - - -`; - -exports[`use all parts of svg-edit > check tool_rect_square #0`] = ` - - - Layer 1 - - - - - - - - - - `; @@ -217,75 +57,23 @@ exports[`use all parts of svg-edit > check tool_image #0`] = ` > Layer 1 - - - - check tool_source_set #0`] = ` + + Layer 1 + +`; + +exports[`use all parts of svg-edit > check tool_star #0`] = ` + + + Layer 1 + + + + + +`; + +exports[`use all parts of svg-edit > check tool_star_clone #0`] = ` + + + Layer 1 + + + + +`; + +exports[`use all parts of svg-edit > check tool_star_change_rotation #0`] = ` + + + Layer 1 + + + + +`; + +exports[`use all parts of svg-edit > check tool_star_change_blur #0`] = ` + + + Layer 1 + + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_star_change_opacity #0`] = ` + + + Layer 1 + + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_star_bring_to_back #0`] = ` + + + Layer 1 + + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_star_bring_to_front #0`] = ` + + + Layer 1 + + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_star_delete #0`] = ` + + + Layer 1 + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_star_align_to_page #0`] = ` + + + Layer 1 + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_star_change_stroke_width #0`] = ` + + + Layer 1 + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_star_change_stroke_style #0`] = ` + + + Layer 1 + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_star_change_line_cap #0`] = ` + + + Layer 1 + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_star_change_stoke_fill_color #0`] = ` + + + Layer 1 + + + + + + + + +`; + +exports[`use all parts of svg-edit > check tool_star_change_sides #0`] = ` + + + Layer 1 + + + + + + + + +`; diff --git a/cypress/integration/ui/scenario1.js b/cypress/integration/ui/scenario1.js index 9813aed0..a6567cc0 100644 --- a/cypress/integration/ui/scenario1.js +++ b/cypress/integration/ui/scenario1.js @@ -23,18 +23,6 @@ describe('use all parts of svg-edit', function () { cy.get('#tool_source_save').click({ force: true }); testSnapshot(); }); - it('check tool_line', function () { - cy.get('#tool_line') - .click({ force: true }); - cy.get('#svgcontent') - .trigger('mousemove', 200, 200, { force: true }) - .trigger('mousedown', 200, 200, { force: true }) - .trigger('mousemove', 20, 20, { force: true }) - .trigger('mouseup', { force: true }); - // cy.get('#angle').click({ force: true }).invoke('attr', 'value', '45'); - //.shadow().get('elix-number-spin-box').shadow().find('plain-repeat-button-0').click({ force: true }); - cy.get('#svgcontent').toMatchSnapshot(); - }); it('check tool_shape', function () { cy.get('#tool_shapelib').shadow().find('.overall').eq(0).click({ force: true }); cy.get('[data-shape="heart"]').click({ force: true }); @@ -49,30 +37,7 @@ describe('use all parts of svg-edit', function () { .trigger('mouseup', { force: true }); cy.get('#svgcontent').toMatchSnapshot(); }); - it('check tool_rect_square', function () { - cy.get('#tool_rect').click({ force: true }); - cy.get('#svgcontent') - .trigger('mousedown', 100, -60, { force: true }) - .trigger('mousemove', 250, 60, { force: true }) - .trigger('mouseup', { force: true }); - cy.get('#tool_square').click({ force: true }); - cy.get('#svgcontent') - .trigger('mousedown', 250, -60, { force: true }) - .trigger('mousemove', 430, 120, { force: true }) - .trigger('mouseup', { force: true }); - cy.get('#tool_fhrect') - .click({ force: true }); - cy.get('#svgcontent') - .trigger('mousedown', 20, 80, { force: true }) - .trigger('mousemove', 120, 80, { force: true }) - .trigger('mousemove', 120, 180, { force: true }) - .trigger('mousemove', 20, 180, { force: true }) - .trigger('mousemove', 20, 80, { force: true }) - .trigger('mouseup', 20, 80, { force: true }); - cy.get('#svgcontent').toMatchSnapshot(); - }); it('check tool_image', function () { - cy.get('#tool_image').click({ force: true }); cy.get('#svgcontent') .trigger('mousedown', 100, 100, { force: true }) @@ -87,5 +52,4 @@ describe('use all parts of svg-edit', function () { }); cy.get('#svgcontent').toMatchSnapshot(); }); - }); diff --git a/cypress/integration/ui/scenario7.js b/cypress/integration/ui/scenario7.js new file mode 100644 index 00000000..1ea808dc --- /dev/null +++ b/cypress/integration/ui/scenario7.js @@ -0,0 +1,164 @@ +import { + visitAndApproveStorage +} from '../../support/ui-test-helper.js'; + +const testSnapshot = () => { + cy.get('#svgcontent').cleanSnapshot(); +}; + +describe('use all parts of svg-edit', function () { + before(() => { + visitAndApproveStorage(); + }); + + it('check tool_source_set', function () { + cy.get('#tool_source').click({ force: true }); + cy.get('#svg_source_textarea') + .type('{selectall}', { force: true }) + .type(` + + Layer 1 + + `, { force: true, parseSpecialCharSequences: false }); + cy.get('#tool_source_save').click({ force: true }); + testSnapshot(); + }); + it('check tool_star', function () { + cy.get('#tool_star') + .click({ force: true }); + cy.get('#svgcontent') + .trigger('mousedown', 300, 150, { force: true }) + .trigger('mousemove', 300, 250, { force: true }) + .trigger('mouseup', { force: true }); + testSnapshot(); + }); + it('check tool_star_clone', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#tool_clone').click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_star_change_class', function () { + cy.get('#svg_2').click({ force: true }); + cy.get('#elem_class').shadow().find('elix-input').eq(0).shadow().find('#inner').eq(0) + .type('svg_2_class{enter}', { force: true }); + cy.get('#svg_2') + .should('satisfy', ($el) => { + const classList = Array.from($el[0].classList); + return classList.includes('svg_2_class'); + }); + }); + it('check tool_star_change_id', function () { + cy.get('#svg_2').click({ force: true }).click({ force: true }); + cy.get('#elem_id').shadow().find('elix-input').eq(0).shadow().find('#inner').eq(0) + .type('_id{enter}', { force: true }); + cy.get('#svg_2_id') + .should('satisfy', ($el) => { + const classList = Array.from($el[0].classList); + return classList.includes('svg_2_class'); + }); + }); + it('check tool_star_change_rotation', function () { + cy.get('#svg_2_id').click({ force: true }); + for(let n = 0; n < 5; n ++){ + cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + } + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_star_change_blur', function () { + cy.get('#svg_2_id').click({ force: true }); + for(let n = 0; n < 10; n ++){ + cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + } + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_star_change_opacity', function () { + cy.get('#svg_2_id').click({ force: true }); + for(let n = 0; n < 10; n ++){ + cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0) + .click({ force: true }); + } + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_star_bring_to_back', function () { + cy.get('#svg_2_id').click({ force: true }); + cy.get('#tool_move_bottom').click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_star_bring_to_front', function () { + cy.get('#svg_2_id').click({ force: true }); + cy.get('#tool_move_top').click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_star_delete', function () { + cy.get('#svg_2_id').click({ force: true }); + cy.get('#tool_delete').click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_star_align_to_page', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#tool_position').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); + cy.get('#tool_position').find('se-list-item').eq(0).shadow().find('elix-option').eq(0) + .click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + /* it('check tool_star_change_x_y_coordinate', function () { + cy.get('#svg_1').click({ force: true }); + for(let n = 0; n < 25; n ++){ + cy.get('#selected_x').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + } + for(let n = 0; n < 25; n ++){ + cy.get('#selected_y').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + } + cy.get('#svgcontent').toMatchSnapshot(); + }); */ + it('check tool_star_change_stroke_width', function () { + cy.get('#svg_1').click({ force: true }); + for(let n = 0; n < 10; n ++){ + cy.get('#stroke_width').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + } + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_star_change_stroke_style', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#stroke_style').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); + cy.get('#stroke_style').find('se-list-item').eq(3).shadow().find('elix-option').eq(0) + .click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_star_change_line_cap', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#stroke_linecap').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); + cy.get('#stroke_linecap').find('se-list-item').eq(1).shadow().find('elix-option').eq(0) + .click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_star_change_stoke_fill_color', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#stroke_color').shadow().find('#picker').eq(0).click({ force: true }); + cy.get('#stroke_color').shadow().find('#color_picker').eq(0) + .find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0) + .find('.QuickColor').eq(51).click({ force: true }); + cy.get('#stroke_color').shadow().find('#color_picker').eq(0) + .find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0) + .find('#Ok').eq(0).click({ force: true }); + cy.get('#fill_color').shadow().find('#picker').eq(0).click({ force: true }); + cy.get('#fill_color').shadow().find('#color_picker').eq(0) + .find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0) + .find('.QuickColor').eq(3).click({ force: true }); + cy.get('#fill_color').shadow().find('#color_picker').eq(0) + .find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0) + .find('#Ok').eq(0).click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); + it('check tool_star_change_sides', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#starNumPoints').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) + .click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); +}); From 93923c559fd8d31d544bd73a063db6e838ce5e78 Mon Sep 17 00:00:00 2001 From: agriyadev5 Date: Mon, 30 Aug 2021 11:15:46 +0530 Subject: [PATCH 05/11] #623 path issue fixed --- src/svgcanvas/path-actions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svgcanvas/path-actions.js b/src/svgcanvas/path-actions.js index 7087e685..daaa8a8a 100644 --- a/src/svgcanvas/path-actions.js +++ b/src/svgcanvas/path-actions.js @@ -443,7 +443,7 @@ export const pathActionsMethod = (function () { const newD = newpath.getAttribute('d'); const origD = path.elem.getAttribute('d'); path.elem.setAttribute('d', origD + newD); - newpath.parentNode.removeChild(); + newpath.parentNode.removeChild(newpath); if (path.matrix) { pathActionsContext_.recalcRotatedPath(); } From 19ddfba17e5503747e3f1fd304dfd0b817535071 Mon Sep 17 00:00:00 2001 From: agriyadev5 Date: Mon, 30 Aug 2021 11:42:06 +0530 Subject: [PATCH 06/11] #623 unwanted code removed --- cypress/integration/ui/scenario7.js | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/cypress/integration/ui/scenario7.js b/cypress/integration/ui/scenario7.js index 1ea808dc..5ba4cde1 100644 --- a/cypress/integration/ui/scenario7.js +++ b/cypress/integration/ui/scenario7.js @@ -103,18 +103,6 @@ describe('use all parts of svg-edit', function () { .click({ force: true }); cy.get('#svgcontent').toMatchSnapshot(); }); - /* it('check tool_star_change_x_y_coordinate', function () { - cy.get('#svg_1').click({ force: true }); - for(let n = 0; n < 25; n ++){ - cy.get('#selected_x').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) - .click({ force: true }); - } - for(let n = 0; n < 25; n ++){ - cy.get('#selected_y').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) - .click({ force: true }); - } - cy.get('#svgcontent').toMatchSnapshot(); - }); */ it('check tool_star_change_stroke_width', function () { cy.get('#svg_1').click({ force: true }); for(let n = 0; n < 10; n ++){ @@ -123,20 +111,6 @@ describe('use all parts of svg-edit', function () { } cy.get('#svgcontent').toMatchSnapshot(); }); - it('check tool_star_change_stroke_style', function () { - cy.get('#svg_1').click({ force: true }); - cy.get('#stroke_style').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); - cy.get('#stroke_style').find('se-list-item').eq(3).shadow().find('elix-option').eq(0) - .click({ force: true }); - cy.get('#svgcontent').toMatchSnapshot(); - }); - it('check tool_star_change_line_cap', function () { - cy.get('#svg_1').click({ force: true }); - cy.get('#stroke_linecap').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); - cy.get('#stroke_linecap').find('se-list-item').eq(1).shadow().find('elix-option').eq(0) - .click({ force: true }); - cy.get('#svgcontent').toMatchSnapshot(); - }); it('check tool_star_change_stoke_fill_color', function () { cy.get('#svg_1').click({ force: true }); cy.get('#stroke_color').shadow().find('#picker').eq(0).click({ force: true }); From 347cabddfd6450f10aed238de4d1b797f2dee82b Mon Sep 17 00:00:00 2001 From: agriyadev5 Date: Mon, 30 Aug 2021 11:45:56 +0530 Subject: [PATCH 07/11] #623 shapshot updated --- .../ui/__snapshots__/scenario7.js.snap | 91 ------------------- 1 file changed, 91 deletions(-) diff --git a/cypress/integration/ui/__snapshots__/scenario7.js.snap b/cypress/integration/ui/__snapshots__/scenario7.js.snap index 88efe9da..8f3a7b28 100644 --- a/cypress/integration/ui/__snapshots__/scenario7.js.snap +++ b/cypress/integration/ui/__snapshots__/scenario7.js.snap @@ -572,93 +572,6 @@ exports[`use all parts of svg-edit > check tool_star_change_stroke_width #0`] = `; -exports[`use all parts of svg-edit > check tool_star_change_stroke_style #0`] = ` - - - Layer 1 - - - - - - - - -`; - -exports[`use all parts of svg-edit > check tool_star_change_line_cap #0`] = ` - - - Layer 1 - - - - - - - - -`; - exports[`use all parts of svg-edit > check tool_star_change_stoke_fill_color #0`] = ` check tool_star_change_stoke_fill_color #0` stroke-width="15" fill-opacity="1" stroke-opacity="1" - stroke-dasharray="5,2,2,2" - stroke-linecap="square" > @@ -737,8 +648,6 @@ exports[`use all parts of svg-edit > check tool_star_change_sides #0`] = ` stroke-width="15" fill-opacity="1" stroke-opacity="1" - stroke-dasharray="5,2,2,2" - stroke-linecap="square" > From 47536f27d07e66dcdf565f3424f5b96c293cdf15 Mon Sep 17 00:00:00 2001 From: agriyadev5 Date: Mon, 30 Aug 2021 12:12:59 +0530 Subject: [PATCH 08/11] #623 unwanted things removed --- .../ui/__snapshots__/scenario6.js.snap | 85 ------------------- cypress/integration/ui/scenario6.js | 14 --- 2 files changed, 99 deletions(-) diff --git a/cypress/integration/ui/__snapshots__/scenario6.js.snap b/cypress/integration/ui/__snapshots__/scenario6.js.snap index 51b74f87..ab739f1c 100644 --- a/cypress/integration/ui/__snapshots__/scenario6.js.snap +++ b/cypress/integration/ui/__snapshots__/scenario6.js.snap @@ -524,87 +524,6 @@ exports[`use all parts of svg-edit > check tool_polygon_change_stroke_width #0`] `; -exports[`use all parts of svg-edit > check tool_polygon_change_stroke_style #0`] = ` - - - Layer 1 - - - - - - - - -`; - -exports[`use all parts of svg-edit > check tool_polygon_change_line_cap #0`] = ` - - - Layer 1 - - - - - - - - -`; - exports[`use all parts of svg-edit > check tool_polygon_change_stoke_fill_color #0`] = ` check tool_polygon_change_stoke_fill_color stroke-width="15" fill-opacity="1" stroke-opacity="1" - stroke-dasharray="5,2,2,2" - stroke-linecap="square" > @@ -677,8 +594,6 @@ exports[`use all parts of svg-edit > check tool_polygon_change_sides #0`] = ` stroke-width="15" fill-opacity="1" stroke-opacity="1" - stroke-dasharray="5,2,2,2" - stroke-linecap="square" > diff --git a/cypress/integration/ui/scenario6.js b/cypress/integration/ui/scenario6.js index 8b814730..1f6e749d 100644 --- a/cypress/integration/ui/scenario6.js +++ b/cypress/integration/ui/scenario6.js @@ -123,20 +123,6 @@ describe('use all parts of svg-edit', function () { } cy.get('#svgcontent').toMatchSnapshot(); }); - it('check tool_polygon_change_stroke_style', function () { - cy.get('#svg_1').click({ force: true }); - cy.get('#stroke_style').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); - cy.get('#stroke_style').find('se-list-item').eq(3).shadow().find('elix-option').eq(0) - .click({ force: true }); - cy.get('#svgcontent').toMatchSnapshot(); - }); - it('check tool_polygon_change_line_cap', function () { - cy.get('#svg_1').click({ force: true }); - cy.get('#stroke_linecap').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); - cy.get('#stroke_linecap').find('se-list-item').eq(1).shadow().find('elix-option').eq(0) - .click({ force: true }); - cy.get('#svgcontent').toMatchSnapshot(); - }); it('check tool_polygon_change_stoke_fill_color', function () { cy.get('#svg_1').click({ force: true }); cy.get('#stroke_color').shadow().find('#picker').eq(0).click({ force: true }); From 6aa086dbfb691c15aa965cda9b8ae27fc8fd8781 Mon Sep 17 00:00:00 2001 From: agriyadev5 Date: Mon, 30 Aug 2021 12:17:17 +0530 Subject: [PATCH 09/11] #623 unwanted things removed --- .../ui/__snapshots__/scenario5.js.snap | 123 ------------------ cypress/integration/ui/scenario5.js | 14 -- 2 files changed, 137 deletions(-) diff --git a/cypress/integration/ui/__snapshots__/scenario5.js.snap b/cypress/integration/ui/__snapshots__/scenario5.js.snap index a9135fb8..457adf33 100644 --- a/cypress/integration/ui/__snapshots__/scenario5.js.snap +++ b/cypress/integration/ui/__snapshots__/scenario5.js.snap @@ -488,125 +488,6 @@ exports[`use all parts of svg-edit > check tool_line_change_stroke_width #0`] = `; -exports[`use all parts of svg-edit > check tool_line_change_stroke_style #0`] = ` - - - Layer 1 - - - - - - - - - - - -`; - -exports[`use all parts of svg-edit > check tool_line_change_line_cap #0`] = ` - - - Layer 1 - - - - - - - - - - - -`; - exports[`use all parts of svg-edit > check tool_line_align_to_page #0`] = ` check tool_line_align_to_page #0`] = ` id="svg_2" fill-opacity="1" stroke-opacity="1" - stroke-dasharray="5,2,2,2" - stroke-linecap="square" > @@ -715,8 +594,6 @@ exports[`use all parts of svg-edit > check tool_line_change_stoke_color #0`] = ` id="svg_2" fill-opacity="1" stroke-opacity="1" - stroke-dasharray="5,2,2,2" - stroke-linecap="square" > diff --git a/cypress/integration/ui/scenario5.js b/cypress/integration/ui/scenario5.js index ce20994d..ee9ea836 100644 --- a/cypress/integration/ui/scenario5.js +++ b/cypress/integration/ui/scenario5.js @@ -132,20 +132,6 @@ describe('use all parts of svg-edit', function () { } cy.get('#svgcontent').toMatchSnapshot(); }); - it('check tool_line_change_stroke_style', function () { - cy.get('#svg_2').click({ force: true }); - cy.get('#stroke_style').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); - cy.get('#stroke_style').find('se-list-item').eq(3).shadow().find('elix-option').eq(0) - .click({ force: true }); - cy.get('#svgcontent').toMatchSnapshot(); - }); - it('check tool_line_change_line_cap', function () { - cy.get('#svg_2').click({ force: true }); - cy.get('#stroke_linecap').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); - cy.get('#stroke_linecap').find('se-list-item').eq(1).shadow().find('elix-option').eq(0) - .click({ force: true }); - cy.get('#svgcontent').toMatchSnapshot(); - }); it('check tool_line_align_to_page', function () { cy.get('#svg_3').click({ force: true }); cy.get('#tool_position').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); From bf7e7237a883955f92981987be44046348f19b39 Mon Sep 17 00:00:00 2001 From: agriyadev5 Date: Mon, 30 Aug 2021 12:37:06 +0530 Subject: [PATCH 10/11] #623 text cypress text cases changes --- .../ui/__snapshots__/scenario.js.snap | 178 +++++------------- cypress/integration/ui/scenario.js | 22 +-- 2 files changed, 59 insertions(+), 141 deletions(-) diff --git a/cypress/integration/ui/__snapshots__/scenario.js.snap b/cypress/integration/ui/__snapshots__/scenario.js.snap index e515aa6e..84f6b010 100644 --- a/cypress/integration/ui/__snapshots__/scenario.js.snap +++ b/cypress/integration/ui/__snapshots__/scenario.js.snap @@ -337,60 +337,6 @@ exports[`use various parts of svg-edit > check tool_text_change_font_size #0`] = `; -exports[`use various parts of svg-edit > check tool_text_change_font_family #0`] = ` - - - Layer 1 - - AB - - - AB - - - -`; - exports[`use various parts of svg-edit > check tool_text_change_stroke_width #0`] = ` check tool_text_change_stroke_width #0` y="35" id="svg_1" font-size="34" - font-family="Cursive" - text-anchor="middle" - xml:space="preserve" - fill-opacity="1" - stroke-opacity="1" - font-style="italic" - font-weight="bold" - > - AB - - - AB - - - -`; - -exports[`use various parts of svg-edit > check tool_text_change_stroke_style #0`] = ` - - - Layer 1 - @@ -523,14 +415,13 @@ exports[`use various parts of svg-edit > check tool_text_change_stoke_fill_color y="35" id="svg_1" font-size="34" - font-family="Cursive" + font-family="Serif" text-anchor="middle" xml:space="preserve" fill-opacity="1" stroke-opacity="1" font-style="italic" font-weight="bold" - stroke-dasharray="5,2,2,2" > AB @@ -578,14 +469,13 @@ exports[`use various parts of svg-edit > check tool_text_anchor_start #0`] = ` y="35" id="svg_1" font-size="34" - font-family="Cursive" + font-family="Serif" text-anchor="start" xml:space="preserve" fill-opacity="1" stroke-opacity="1" font-="" font-weight="bold" - stroke-dasharray="5,2,2,2" > AB @@ -633,14 +523,13 @@ exports[`use various parts of svg-edit > check tool_text_anchor_middle #0`] = ` y="35" id="svg_1" font-size="34" - font-family="Cursive" + font-family="Serif" text-anchor="middle" xml:space="preserve" fill-opacity="1" stroke-opacity="1" font-="" font-weight="bold" - stroke-dasharray="5,2,2,2" > AB @@ -688,14 +577,13 @@ exports[`use various parts of svg-edit > check tool_text_anchor_end #0`] = ` y="35" id="svg_1" font-size="34" - font-family="Cursive" + font-family="Serif" text-anchor="end" xml:space="preserve" fill-opacity="1" stroke-opacity="1" font-="" font-weight="bold" - stroke-dasharray="5,2,2,2" > AB @@ -743,14 +631,13 @@ exports[`use various parts of svg-edit > check tool_text_change_rotation #0`] = y="35" id="svg_1" font-size="34" - font-family="Cursive" + font-family="Serif" text-anchor="end" xml:space="preserve" fill-opacity="1" stroke-opacity="1" font-style="italic" font-weight="bold" - stroke-dasharray="5,2,2,2" > AB @@ -799,14 +686,13 @@ exports[`use various parts of svg-edit > check tool_text_change_blur #0`] = ` y="35" id="svg_1" font-size="34" - font-family="Cursive" + font-family="Serif" text-anchor="end" xml:space="preserve" fill-opacity="1" stroke-opacity="1" font-style="italic" font-weight="bold" - stroke-dasharray="5,2,2,2" > AB @@ -861,14 +747,13 @@ exports[`use various parts of svg-edit > check tool_text_change_opacity #0`] = ` y="35" id="svg_1" font-size="34" - font-family="Cursive" + font-family="Serif" text-anchor="end" xml:space="preserve" fill-opacity="1" stroke-opacity="1" font-style="italic" font-weight="bold" - stroke-dasharray="5,2,2,2" > AB @@ -924,14 +809,13 @@ exports[`use various parts of svg-edit > check tool_text_align_to_page #0`] = ` y="35" id="svg_1" font-size="34" - font-family="Cursive" + font-family="Serif" text-anchor="end" xml:space="preserve" fill-opacity="1" stroke-opacity="1" font-style="italic" font-weight="bold" - stroke-dasharray="5,2,2,2" > AB @@ -987,14 +871,56 @@ exports[`use various parts of svg-edit > check tool_text_delete #0`] = ` y="35" id="svg_1" font-size="34" - font-family="Cursive" + font-family="Serif" + text-anchor="end" + xml:space="preserve" + fill-opacity="1" + stroke-opacity="1" + font-style="italic" + font-weight="bold" + > + AB + + + + + + + + +`; + +exports[`use various parts of svg-edit > check tool_text_change_font_family #0`] = ` + + + Layer 1 + AB diff --git a/cypress/integration/ui/scenario.js b/cypress/integration/ui/scenario.js index 0eb7ce25..51424509 100644 --- a/cypress/integration/ui/scenario.js +++ b/cypress/integration/ui/scenario.js @@ -82,27 +82,12 @@ describe('use various parts of svg-edit', function () { } cy.get('#svgcontent').toMatchSnapshot(); }); - it('check tool_text_change_font_family', function () { - cy.get('#svg_1').click({ force: true }); - cy.get('#tool_font_family').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); - cy.get('#tool_font_family').find('se-list-item').eq(2).shadow().find('elix-option').eq(0) - .click({ force: true }); - cy.get('#svgcontent').toMatchSnapshot(); - }); it('check tool_text_change_stroke_width', function () { cy.get('#svg_1').click({ force: true }); cy.get('#stroke_width').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0) .click({ force: true }); cy.get('#svgcontent').toMatchSnapshot(); }); - it('check tool_text_change_stroke_style', function () { - cy.get('#svg_1').click({ force: true }); - cy.get('#stroke_style').shadow().find('elix-dropdown-list').eq(0) - .invoke('attr', 'opened', 'opened'); - cy.get('#stroke_style').find('se-list-item').eq(3).shadow().find('elix-option').eq(0) - .click({ force: true }); - cy.get('#svgcontent').toMatchSnapshot(); - }); it('check tool_text_change_stoke_fill_color', function () { cy.get('#svg_1').click({ force: true }); cy.get('#stroke_color').shadow().find('#picker').eq(0).click({ force: true }); @@ -195,4 +180,11 @@ describe('use various parts of svg-edit', function () { cy.get('#tool_delete').click({ force: true }); cy.get('#svgcontent').toMatchSnapshot(); }); + it('check tool_text_change_font_family', function () { + cy.get('#svg_1').click({ force: true }); + cy.get('#tool_font_family').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); + cy.get('#tool_font_family').find('se-list-item').eq(6).shadow().find('elix-option').eq(0) + .click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); }); From 7b6aab13b4e754ae5b4543babc77399eec883b3d Mon Sep 17 00:00:00 2001 From: agriyadev5 Date: Mon, 30 Aug 2021 13:00:29 +0530 Subject: [PATCH 11/11] #623 line issue test cases changes --- .../integration/ui/__snapshots__/scenario5.js.snap | 10 +++++----- cypress/integration/ui/scenario5.js | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cypress/integration/ui/__snapshots__/scenario5.js.snap b/cypress/integration/ui/__snapshots__/scenario5.js.snap index 457adf33..2f0869fa 100644 --- a/cypress/integration/ui/__snapshots__/scenario5.js.snap +++ b/cypress/integration/ui/__snapshots__/scenario5.js.snap @@ -488,7 +488,7 @@ exports[`use all parts of svg-edit > check tool_line_change_stroke_width #0`] = `; -exports[`use all parts of svg-edit > check tool_line_align_to_page #0`] = ` +exports[`use all parts of svg-edit > check tool_line_change_stoke_color #0`] = ` check tool_line_align_to_page #0`] = ` Layer 1 check tool_line_align_to_page #0`] = ` `; -exports[`use all parts of svg-edit > check tool_line_change_stoke_color #0`] = ` +exports[`use all parts of svg-edit > check tool_line_align_to_page #0`] = ` check tool_line_change_stoke_color #0`] = ` stroke="#bf5f00" stroke-width="5" opacity="0.25" - x1="387.5" + x1="220" y1="220" - x2="637.5" + x2="470" y2="470" fill-opacity="1" stroke-opacity="1" diff --git a/cypress/integration/ui/scenario5.js b/cypress/integration/ui/scenario5.js index ee9ea836..efa7eb78 100644 --- a/cypress/integration/ui/scenario5.js +++ b/cypress/integration/ui/scenario5.js @@ -132,13 +132,6 @@ describe('use all parts of svg-edit', function () { } cy.get('#svgcontent').toMatchSnapshot(); }); - it('check tool_line_align_to_page', function () { - cy.get('#svg_3').click({ force: true }); - cy.get('#tool_position').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); - cy.get('#tool_position').find('se-list-item').eq(2).shadow().find('elix-option').eq(0) - .click({ force: true }); - cy.get('#svgcontent').toMatchSnapshot(); - }); it('check tool_line_change_stoke_color', function () { cy.get('#svg_3').click({ force: true }); cy.get('#stroke_color').shadow().find('#picker').eq(0).click({ force: true }); @@ -150,4 +143,11 @@ describe('use all parts of svg-edit', function () { .find('#Ok').eq(0).click({ force: true }); cy.get('#svgcontent').toMatchSnapshot(); }); + it('check tool_line_align_to_page', function () { + cy.get('#svg_3').click({ force: true }); + cy.get('#tool_position').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened'); + cy.get('#tool_position').find('se-list-item').eq(2).shadow().find('elix-option').eq(0) + .click({ force: true }); + cy.get('#svgcontent').toMatchSnapshot(); + }); });