#603 image tool added for cypress test cases

master
agriyadev5 2021-08-24 19:01:51 +05:30
parent f908f9b8a1
commit b0006d84b5
2 changed files with 104 additions and 10 deletions

View File

@ -175,3 +175,89 @@ exports[`use all parts of svg-edit > check mode_connect #0`] = `
</g> </g>
</svg> </svg>
`; `;
exports[`use all parts of svg-edit > check tool_image #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<line
fill="none"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
x1="200"
y1="200"
x2="220"
y2="220"
id="svg_1"
fill-opacity="1"
stroke-opacity="1"
transform="rotate(43.2643 210 210)"
></line>
<path
fill="#FF0000"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
d="m309.60653833763354,262.7975086895094 c37.05917105721012,-106.31729401658639 182.2582183141481,0 0,136.6936637356111 c-182.2582183141481,-136.6936637356111 -37.05917105721012,-243.0109577521975 0,-136.6936637356111 z"
id="svg_2"
fill-opacity="1"
stroke-opacity="1"
></path>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
x="296"
y="136"
width="150"
height="120"
id="svg_3"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
x="446"
y="76"
width="180"
height="180"
id="svg_4"
fill-opacity="1"
stroke-opacity="1"
></rect>
<image
x="296"
y="176"
width="20"
height="20"
id="svg_5"
opacity="0.5"
style="pointer-events:inherit"
xlink:href="./images/logo.svg"
>
<animate
attributeName="opacity"
begin="indefinite"
dur="0.2"
fill="freeze"
to="1"
></animate>
</image>
</g>
</svg>
`;

View File

@ -49,7 +49,7 @@ describe('use all parts of svg-edit', function () {
.trigger('mouseup', { force: true }); .trigger('mouseup', { force: true });
cy.get('#svgcontent').toMatchSnapshot(); cy.get('#svgcontent').toMatchSnapshot();
}); });
/* it('check mode_connect', function () { it('check mode_connect', function () {
cy.get('#tool_rect').click({ force: true }); cy.get('#tool_rect').click({ force: true });
cy.get('#svgcontent') cy.get('#svgcontent')
.trigger('mousedown', 100, -60, { force: true }) .trigger('mousedown', 100, -60, { force: true })
@ -60,24 +60,32 @@ describe('use all parts of svg-edit', function () {
.trigger('mousedown', 250, -60, { force: true }) .trigger('mousedown', 250, -60, { force: true })
.trigger('mousemove', 430, 120, { force: true }) .trigger('mousemove', 430, 120, { force: true })
.trigger('mouseup', { force: true }); .trigger('mouseup', { force: true });
cy.get('#tool_select').click({ force: true }); cy.get('#tool_select')
cy.get('#mode_connect').click({ force: true }); .click({ force: true });
cy.get('#mode_connect')
.click({ force: true });
cy.get('#svgcontent') cy.get('#svgcontent')
.trigger('mousedown', -10, -10, { force: true }) .trigger('mousemove', 220, 80, { force: true })
.trigger('mousemove', -180, -180, { force: true }) .trigger('mousedown', 220, 80, { force: true })
.trigger('mouseup', { force: true }); .trigger('mouseup', 220, 80, { force: true });
cy.get('#svgcontent')
.trigger('mousemove', 410, 80, { force: true })
.trigger('mousedown', 410, 80, { force: true })
.trigger('mouseup', 410, 80, { force: true });
cy.get('#svgcontent').toMatchSnapshot(); cy.get('#svgcontent').toMatchSnapshot();
}); });
it('check tool_image', function () { it('check tool_image', function () {
cy.get('#tool_image').click({ force: true }); cy.get('#tool_image').click({ force: true });
cy.get('#svgcontent') cy.get('#svgcontent')
.trigger('mousemove', 100, 100, { force: true })
.trigger('mousedown', 100, 100, { force: true }) .trigger('mousedown', 100, 100, { force: true })
.trigger('mousemove', 120, 120, { force: true })
.trigger('mouseup', { force: true }); .trigger('mouseup', { force: true });
cy.on('window:confirm', () => true); cy.window().then(($win) => {
cy.stub($win, 'prompt').returns('./images/logo.svg');
cy.contains('OK');
});
cy.get('#svgcontent').toMatchSnapshot(); cy.get('#svgcontent').toMatchSnapshot();
}); */ });
}); });