focus on the svg content to test snapshots
This commit is contained in:
@@ -1,295 +1,51 @@
|
|||||||
exports[`use various parts of svg-edit > check tool_fhpath #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>
|
|
||||||
<rect
|
|
||||||
id="rect"
|
|
||||||
fill="#FF0000"
|
|
||||||
height="70"
|
|
||||||
stroke="#000000"
|
|
||||||
stroke-width="5"
|
|
||||||
width="94"
|
|
||||||
x="69.5"
|
|
||||||
y="51.5"
|
|
||||||
style="pointer-events:inherit"
|
|
||||||
></rect>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`use various parts of svg-edit > check tool_source #0`] = `
|
exports[`use various parts of svg-edit > check tool_source #0`] = `
|
||||||
<svg
|
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
<g class="layer">
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
<title>Layer 1</title>
|
||||||
width="640"
|
<rect fill="#FF0000" height="70" id="rect" stroke="#000000" stroke-width="5" width="94" x="69.5" y="51.5"/>
|
||||||
height="480"
|
</g>
|
||||||
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>
|
|
||||||
<rect
|
|
||||||
id="rect"
|
|
||||||
fill="#FF0000"
|
|
||||||
height="70"
|
|
||||||
stroke="#000000"
|
|
||||||
stroke-width="5"
|
|
||||||
width="94"
|
|
||||||
x="69.5"
|
|
||||||
y="51.5"
|
|
||||||
style="pointer-events:inherit"
|
|
||||||
></rect>
|
|
||||||
</g>
|
|
||||||
</svg>
|
</svg>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`use various parts of svg-edit > check tool_text #0`] = `
|
exports[`use various parts of svg-edit > check tool_text #0`] = `
|
||||||
<svg
|
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
<g class="layer">
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
<title>Layer 1</title>
|
||||||
width="640"
|
<rect fill="#FF0000" height="70" id="rect" stroke="#000000" stroke-width="5" width="94" x="69.5" y="51.5"/>
|
||||||
height="480"
|
<text fill="#000000" font-family="serif" font-size="24" id="svg_1" stroke="#000000" stroke-width="0" text-anchor="middle" x="116" xml:space="preserve" y="87">B</text>
|
||||||
id="svgcontent"
|
</g>
|
||||||
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>
|
|
||||||
<rect
|
|
||||||
id="rect"
|
|
||||||
fill="#FF0000"
|
|
||||||
height="70"
|
|
||||||
stroke="#000000"
|
|
||||||
stroke-width="5"
|
|
||||||
width="94"
|
|
||||||
x="69.5"
|
|
||||||
y="51.5"
|
|
||||||
style="pointer-events:inherit"
|
|
||||||
></rect>
|
|
||||||
<text
|
|
||||||
fill="#000000"
|
|
||||||
stroke="#000000"
|
|
||||||
stroke-width="0"
|
|
||||||
style="pointer-events: inherit; cursor: move;"
|
|
||||||
x="116"
|
|
||||||
y="87"
|
|
||||||
id="svg_1"
|
|
||||||
font-size="24"
|
|
||||||
font-family="serif"
|
|
||||||
text-anchor="middle"
|
|
||||||
xml:space="preserve"
|
|
||||||
fill-opacity="1"
|
|
||||||
stroke-opacity="1"
|
|
||||||
>
|
|
||||||
A
|
|
||||||
</text>
|
|
||||||
</g>
|
|
||||||
</svg>
|
</svg>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`use various parts of svg-edit > check tool_clone #0`] = `
|
exports[`use various parts of svg-edit > check tool_clone #0`] = `
|
||||||
<svg
|
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
<g class="layer">
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
<title>Layer 1</title>
|
||||||
width="640"
|
<rect fill="#FF0000" height="70" id="rect" stroke="#000000" stroke-width="5" width="94" x="69.5" y="51.5"/>
|
||||||
height="480"
|
<text fill="#000000" font-family="serif" font-size="24" id="svg_1" stroke="#000000" stroke-width="0" text-anchor="middle" x="116" xml:space="preserve" y="87">B</text>
|
||||||
id="svgcontent"
|
<text fill="#000000" font-family="serif" font-size="24" id="svg_2" stroke="#000000" stroke-width="0" text-anchor="middle" x="136" xml:space="preserve" y="107">B</text>
|
||||||
overflow="visible"
|
</g>
|
||||||
x="640"
|
|
||||||
y="480"
|
|
||||||
viewBox="0 0 640 480"
|
|
||||||
>
|
|
||||||
<g class="layer" style="pointer-events:all">
|
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
|
||||||
<rect
|
|
||||||
id="rect"
|
|
||||||
fill="#FF0000"
|
|
||||||
height="70"
|
|
||||||
stroke="#000000"
|
|
||||||
stroke-width="5"
|
|
||||||
width="94"
|
|
||||||
x="69.5"
|
|
||||||
y="51.5"
|
|
||||||
style="pointer-events:inherit"
|
|
||||||
></rect>
|
|
||||||
<text
|
|
||||||
fill="#000000"
|
|
||||||
stroke="#000000"
|
|
||||||
stroke-width="0"
|
|
||||||
style="pointer-events: inherit; cursor: move;"
|
|
||||||
x="116"
|
|
||||||
y="87"
|
|
||||||
id="svg_1"
|
|
||||||
font-size="24"
|
|
||||||
font-family="serif"
|
|
||||||
text-anchor="middle"
|
|
||||||
xml:space="preserve"
|
|
||||||
fill-opacity="1"
|
|
||||||
stroke-opacity="1"
|
|
||||||
>
|
|
||||||
A
|
|
||||||
</text>
|
|
||||||
<text
|
|
||||||
fill="#000000"
|
|
||||||
stroke="#000000"
|
|
||||||
stroke-width="0"
|
|
||||||
style="pointer-events: inherit; cursor: move;"
|
|
||||||
x="136"
|
|
||||||
y="107"
|
|
||||||
font-size="24"
|
|
||||||
font-family="serif"
|
|
||||||
text-anchor="middle"
|
|
||||||
xml:space="preserve"
|
|
||||||
fill-opacity="1"
|
|
||||||
stroke-opacity="1"
|
|
||||||
id="svg_2"
|
|
||||||
>
|
|
||||||
A
|
|
||||||
</text>
|
|
||||||
</g>
|
|
||||||
</svg>
|
</svg>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`use various parts of svg-edit > check tool_italic #0`] = `
|
exports[`use various parts of svg-edit > check tool_italic #0`] = `
|
||||||
<svg
|
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
<g class="layer">
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
<title>Layer 1</title>
|
||||||
width="640"
|
<rect fill="#FF0000" height="70" id="rect" stroke="#000000" stroke-width="5" width="94" x="69.5" y="51.5"/>
|
||||||
height="480"
|
<text fill="#000000" font-family="serif" font-size="24" font-style="italic" id="svg_1" stroke="#000000" stroke-width="0" text-anchor="middle" x="116" xml:space="preserve" y="87">B</text>
|
||||||
id="svgcontent"
|
<text fill="#000000" font-family="serif" font-size="24" id="svg_2" stroke="#000000" stroke-width="0" text-anchor="middle" x="136" xml:space="preserve" y="107">B</text>
|
||||||
overflow="visible"
|
</g>
|
||||||
x="640"
|
|
||||||
y="480"
|
|
||||||
viewBox="0 0 640 480"
|
|
||||||
>
|
|
||||||
<g class="layer" style="pointer-events:all">
|
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
|
||||||
<rect
|
|
||||||
id="rect"
|
|
||||||
fill="#FF0000"
|
|
||||||
height="70"
|
|
||||||
stroke="#000000"
|
|
||||||
stroke-width="5"
|
|
||||||
width="94"
|
|
||||||
x="69.5"
|
|
||||||
y="51.5"
|
|
||||||
style="pointer-events:inherit"
|
|
||||||
></rect>
|
|
||||||
<text
|
|
||||||
fill="#000000"
|
|
||||||
stroke="#000000"
|
|
||||||
stroke-width="0"
|
|
||||||
style="pointer-events: inherit; cursor: move;"
|
|
||||||
x="116"
|
|
||||||
y="87"
|
|
||||||
id="svg_1"
|
|
||||||
font-size="24"
|
|
||||||
font-family="serif"
|
|
||||||
text-anchor="middle"
|
|
||||||
xml:space="preserve"
|
|
||||||
fill-opacity="1"
|
|
||||||
stroke-opacity="1"
|
|
||||||
>
|
|
||||||
A
|
|
||||||
</text>
|
|
||||||
<text
|
|
||||||
fill="#000000"
|
|
||||||
stroke="#000000"
|
|
||||||
stroke-width="0"
|
|
||||||
style="pointer-events: inherit; cursor: move;"
|
|
||||||
x="136"
|
|
||||||
y="107"
|
|
||||||
font-size="24"
|
|
||||||
font-family="serif"
|
|
||||||
text-anchor="middle"
|
|
||||||
xml:space="preserve"
|
|
||||||
fill-opacity="1"
|
|
||||||
stroke-opacity="1"
|
|
||||||
id="svg_2"
|
|
||||||
font-style="italic"
|
|
||||||
>
|
|
||||||
A
|
|
||||||
</text>
|
|
||||||
</g>
|
|
||||||
</svg>
|
</svg>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`use various parts of svg-edit > check tool_bold #0`] = `
|
exports[`use various parts of svg-edit > check tool_bold #0`] = `
|
||||||
<svg
|
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
<g class="layer">
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
<title>Layer 1</title>
|
||||||
width="640"
|
<rect fill="#FF0000" height="70" id="rect" stroke="#000000" stroke-width="5" width="94" x="69.5" y="51.5"/>
|
||||||
height="480"
|
<text fill="#000000" font-family="serif" font-size="24" font-style="italic" font-weight="bold" id="svg_1" stroke="#000000" stroke-width="0" text-anchor="middle" x="116" xml:space="preserve" y="87">B</text>
|
||||||
id="svgcontent"
|
<text fill="#000000" font-family="serif" font-size="24" id="svg_2" stroke="#000000" stroke-width="0" text-anchor="middle" x="136" xml:space="preserve" y="107">B</text>
|
||||||
overflow="visible"
|
</g>
|
||||||
x="640"
|
|
||||||
y="480"
|
|
||||||
viewBox="0 0 640 480"
|
|
||||||
>
|
|
||||||
<g class="layer" style="pointer-events:all">
|
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
|
||||||
<rect
|
|
||||||
id="rect"
|
|
||||||
fill="#FF0000"
|
|
||||||
height="70"
|
|
||||||
stroke="#000000"
|
|
||||||
stroke-width="5"
|
|
||||||
width="94"
|
|
||||||
x="69.5"
|
|
||||||
y="51.5"
|
|
||||||
style="pointer-events:inherit"
|
|
||||||
></rect>
|
|
||||||
<text
|
|
||||||
fill="#000000"
|
|
||||||
stroke="#000000"
|
|
||||||
stroke-width="0"
|
|
||||||
style="pointer-events: inherit; cursor: move;"
|
|
||||||
x="116"
|
|
||||||
y="87"
|
|
||||||
id="svg_1"
|
|
||||||
font-size="24"
|
|
||||||
font-family="serif"
|
|
||||||
text-anchor="middle"
|
|
||||||
xml:space="preserve"
|
|
||||||
fill-opacity="1"
|
|
||||||
stroke-opacity="1"
|
|
||||||
>
|
|
||||||
A
|
|
||||||
</text>
|
|
||||||
<text
|
|
||||||
fill="#000000"
|
|
||||||
stroke="#000000"
|
|
||||||
stroke-width="0"
|
|
||||||
style="pointer-events: inherit; cursor: move;"
|
|
||||||
x="136"
|
|
||||||
y="107"
|
|
||||||
font-size="24"
|
|
||||||
font-family="serif"
|
|
||||||
text-anchor="middle"
|
|
||||||
xml:space="preserve"
|
|
||||||
fill-opacity="1"
|
|
||||||
stroke-opacity="1"
|
|
||||||
id="svg_2"
|
|
||||||
font-style="italic"
|
|
||||||
font-weight="bold"
|
|
||||||
>
|
|
||||||
A
|
|
||||||
</text>
|
|
||||||
</g>
|
|
||||||
</svg>
|
</svg>
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -2,13 +2,19 @@ import {
|
|||||||
visitAndApproveStorage
|
visitAndApproveStorage
|
||||||
} from '../../support/ui-test-helper.js';
|
} 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 () {
|
describe('use various parts of svg-edit', function () {
|
||||||
before(() => {
|
before(() => {
|
||||||
visitAndApproveStorage();
|
visitAndApproveStorage();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('check tool_source', function () {
|
it('check tool_source', function () {
|
||||||
cy.get('#tool_source').click();
|
cy.get('#tool_source').click({force: true});
|
||||||
cy.get('#svg_source_textarea')
|
cy.get('#svg_source_textarea')
|
||||||
.type('{selectall}', {force: true})
|
.type('{selectall}', {force: true})
|
||||||
.type(`<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
.type(`<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
@@ -17,8 +23,8 @@ describe('use various parts of svg-edit', function () {
|
|||||||
<rect id="rect" fill="#FF0000" height="70" stroke="#000000" stroke-width="5" width="94" x="69.5" y="51.5"/>
|
<rect id="rect" fill="#FF0000" height="70" stroke="#000000" stroke-width="5" width="94" x="69.5" y="51.5"/>
|
||||||
</g>
|
</g>
|
||||||
</svg>`, {parseSpecialCharSequences: false});
|
</svg>`, {parseSpecialCharSequences: false});
|
||||||
cy.get('#tool_source_save').click();
|
cy.get('#tool_source_save').click({force: true});
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
/*
|
/*
|
||||||
it('check tool_fhpath', function () {
|
it('check tool_fhpath', function () {
|
||||||
@@ -40,23 +46,26 @@ describe('use various parts of svg-edit', function () {
|
|||||||
.trigger('mouseup', {force: true});
|
.trigger('mouseup', {force: true});
|
||||||
// svgedit use the #text text field to capture the text
|
// svgedit use the #text text field to capture the text
|
||||||
// cy.get('#text').type('1234', {force: true});
|
// cy.get('#text').type('1234', {force: true});
|
||||||
cy.get('#text').type('A', {force: true});
|
cy.get('#text').type('B', {force: true});
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('check tool_clone', function () {
|
it('check tool_clone', function () {
|
||||||
|
cy.get('#svg_1').click({force: true});
|
||||||
cy.get('#tool_clone')
|
cy.get('#tool_clone')
|
||||||
.click({force: true});
|
.click({force: true});
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_italic', function () {
|
it('check tool_italic', function () {
|
||||||
|
cy.get('#svg_1').click({force: true});
|
||||||
cy.get('#tool_italic')
|
cy.get('#tool_italic')
|
||||||
.click({force: true});
|
.click({force: true});
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_bold', function () {
|
it('check tool_bold', function () {
|
||||||
|
cy.get('#svg_1').click({force: true});
|
||||||
cy.get('#tool_bold')
|
cy.get('#tool_bold')
|
||||||
.click({force: true});
|
.click({force: true});
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user