Merge branch 'master' of https://github.com/SVG-Edit/svgedit into V7-preview
This commit is contained in:
@@ -623,12 +623,12 @@ exports[`use various parts of svg-edit > check tool_star #0`] = `
|
||||
point="5"
|
||||
r="66.66666666666667"
|
||||
radialshift="0"
|
||||
r2="13.333333333333334"
|
||||
r2="22.222222222222225"
|
||||
orient="point"
|
||||
fill="#ffff00"
|
||||
strokecolor="#000000"
|
||||
strokewidth="0"
|
||||
points="370,135.33333333333331 377.83713669723295,191.21310674166736 433.40376775301024,181.39886704167017 382.68075355060205,206.12022659166595 409.18568348616486,255.93446629166317 370,215.33333333333334 330.81431651383514,255.93446629166317 357.31924644939795,206.12022659166595 306.59623224698976,181.39886704167017 362.16286330276705,191.21310674166736 370,135.33333333333331 377.83713669723295,191.21310674166736 "
|
||||
points="370,135.33333333333331 383.0618944953883,184.02184456944562 433.40376775301024,181.39886704167017 391.13458925100343,208.86704431944327 409.18568348616486,255.93446629166317 370,224.22222222222223 330.81431651383514,255.93446629166317 348.86541074899657,208.86704431944327 306.59623224698976,181.39886704167017 356.9381055046117,184.02184456944562 370,135.33333333333331 383.0618944953883,184.02184456944562 "
|
||||
stroke="#000000"
|
||||
stroke-width="0"
|
||||
>
|
||||
@@ -713,12 +713,12 @@ exports[`use various parts of svg-edit > check tool_polygon #0`] = `
|
||||
point="5"
|
||||
r="66.66666666666667"
|
||||
radialshift="0"
|
||||
r2="13.333333333333334"
|
||||
r2="22.222222222222225"
|
||||
orient="point"
|
||||
fill="#ffff00"
|
||||
strokecolor="#000000"
|
||||
strokewidth="0"
|
||||
points="370,135.33333333333331 377.83713669723295,191.21310674166736 433.40376775301024,181.39886704167017 382.68075355060205,206.12022659166595 409.18568348616486,255.93446629166317 370,215.33333333333334 330.81431651383514,255.93446629166317 357.31924644939795,206.12022659166595 306.59623224698976,181.39886704167017 362.16286330276705,191.21310674166736 370,135.33333333333331 377.83713669723295,191.21310674166736 "
|
||||
points="370,135.33333333333331 383.0618944953883,184.02184456944562 433.40376775301024,181.39886704167017 391.13458925100343,208.86704431944327 409.18568348616486,255.93446629166317 370,224.22222222222223 330.81431651383514,255.93446629166317 348.86541074899657,208.86704431944327 306.59623224698976,181.39886704167017 356.9381055046117,184.02184456944562 370,135.33333333333331 383.0618944953883,184.02184456944562 "
|
||||
stroke="#000000"
|
||||
stroke-width="0"
|
||||
fill-opacity="1"
|
||||
|
||||
@@ -13,10 +13,10 @@ describe('UI - Accessibility', function () {
|
||||
cy.configureAxe({
|
||||
// Todo: Reenable when have time to fix
|
||||
// See https://www.deque.com/axe/axe-for-web/documentation/api-documentation/#user-content-parameters-1
|
||||
rules: [{
|
||||
rules: [ {
|
||||
id: 'meta-viewport',
|
||||
enabled: false
|
||||
}]
|
||||
} ]
|
||||
/*
|
||||
branding: {
|
||||
brand: String,
|
||||
@@ -32,10 +32,10 @@ describe('UI - Accessibility', function () {
|
||||
{},
|
||||
{
|
||||
rules: {
|
||||
'label-title-only': {enabled: false},
|
||||
'page-has-heading-one': {enabled: false},
|
||||
region: {enabled: false},
|
||||
'scrollable-region-focusable': {enabled: false}
|
||||
'label-title-only': { enabled: false },
|
||||
'page-has-heading-one': { enabled: false },
|
||||
region: { enabled: false },
|
||||
'scrollable-region-focusable': { enabled: false }
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -11,13 +11,13 @@ describe('UI - Clipboard', function () {
|
||||
cy.get('#tool_source').click();
|
||||
|
||||
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">
|
||||
<g class="layer">
|
||||
<title>Layer 1</title>
|
||||
<circle cx="100" cy="100" r="50" fill="#FF0000" id="testCircle" stroke="#000000" stroke-width="5"/>
|
||||
</g>
|
||||
</svg>`, {force: true, parseSpecialCharSequences: false});
|
||||
</svg>`, { force: true, parseSpecialCharSequences: false });
|
||||
cy.get('#tool_source_save').click();
|
||||
cy.get('#testCircle').should('exist');
|
||||
cy.get('#svg_1').should('not.exist');
|
||||
@@ -25,20 +25,20 @@ describe('UI - Clipboard', function () {
|
||||
|
||||
// Copy.
|
||||
cy.get('#testCircle').click().rightclick();
|
||||
cy.get('#cmenu_canvas a[href="#copy"]').click({force: true});
|
||||
cy.get('#cmenu_canvas a[href="#copy"]').click({ force: true });
|
||||
|
||||
// Paste.
|
||||
// Scrollbars fail to recenter in Cypress test. Works fine in reality.
|
||||
// Thus forcing click is needed since workspace is mostly offscreen.
|
||||
cy.get('#svgroot').rightclick({force: true});
|
||||
cy.get('#cmenu_canvas a[href="#paste"]').click({force: true});
|
||||
cy.get('#svgroot').rightclick({ force: true });
|
||||
cy.get('#cmenu_canvas a[href="#paste"]').click({ force: true });
|
||||
cy.get('#testCircle').should('exist');
|
||||
cy.get('#svg_1').should('exist');
|
||||
cy.get('#svg_2').should('not.exist');
|
||||
|
||||
// Cut.
|
||||
cy.get('#testCircle').click().rightclick();
|
||||
cy.get('#cmenu_canvas a[href="#cut"]').click({force: true});
|
||||
cy.get('#cmenu_canvas a[href="#cut"]').click({ force: true });
|
||||
cy.get('#testCircle').should('not.exist');
|
||||
cy.get('#svg_1').should('exist');
|
||||
cy.get('#svg_2').should('not.exist');
|
||||
@@ -46,17 +46,17 @@ describe('UI - Clipboard', function () {
|
||||
// Paste.
|
||||
// Scrollbars fail to recenter in Cypress test. Works fine in reality.
|
||||
// Thus forcing click is needed since workspace is mostly offscreen.
|
||||
cy.get('#svgroot').rightclick({force: true});
|
||||
cy.get('#cmenu_canvas a[href="#paste"]').click({force: true});
|
||||
cy.get('#svgroot').rightclick({ force: true });
|
||||
cy.get('#cmenu_canvas a[href="#paste"]').click({ force: true });
|
||||
cy.get('#testCircle').should('not.exist');
|
||||
cy.get('#svg_1').should('exist');
|
||||
cy.get('#svg_2').should('exist');
|
||||
|
||||
// Delete.
|
||||
cy.get('#svg_2').click().rightclick();
|
||||
cy.get('#cmenu_canvas a[href="#delete"]').click({force: true});
|
||||
cy.get('#cmenu_canvas a[href="#delete"]').click({ force: true });
|
||||
cy.get('#svg_1').click().rightclick();
|
||||
cy.get('#cmenu_canvas a[href="#delete"]').click({force: true});
|
||||
cy.get('#cmenu_canvas a[href="#delete"]').click({ force: true });
|
||||
cy.get('#svg_1').should('not.exist');
|
||||
cy.get('#svg_2').should('not.exist');
|
||||
});
|
||||
|
||||
@@ -11,23 +11,23 @@ describe('UI - Control Points', function () {
|
||||
const randomOffset = () => 2 + Math.round(10 + Math.random() * 40);
|
||||
cy.get('#tool_source').click();
|
||||
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">
|
||||
<g class="layer">
|
||||
<title>Layer 1</title>
|
||||
<path d="m187,194a114,62 0 1 0 219,2" id="svg_1" fill="#FF0000" stroke="#000000" stroke-width="5"/>
|
||||
</g>
|
||||
</svg>`, {force: true, parseSpecialCharSequences: false});
|
||||
cy.get('#tool_source_save').click({force: true});
|
||||
</svg>`, { force: true, parseSpecialCharSequences: false });
|
||||
cy.get('#tool_source_save').click({ force: true });
|
||||
|
||||
cy.get('#svg_1').click({force: true}).click({force: true});
|
||||
cy.get('#svg_1').click({ force: true }).click({ force: true });
|
||||
|
||||
cy.get('#pathpointgrip_0').trigger('mousedown', {which: 1, force: true})
|
||||
.trigger('mousemove', randomOffset(), randomOffset(), {force: true})
|
||||
.trigger('mouseup', {force: true});
|
||||
cy.get('#pathpointgrip_1').trigger('mousedown', {which: 1, force: true})
|
||||
.trigger('mousemove', randomOffset(), randomOffset(), {force: true})
|
||||
.trigger('mouseup', {force: true});
|
||||
cy.get('#pathpointgrip_0').trigger('mousedown', { which: 1, force: true })
|
||||
.trigger('mousemove', randomOffset(), randomOffset(), { force: true })
|
||||
.trigger('mouseup', { force: true });
|
||||
cy.get('#pathpointgrip_1').trigger('mousedown', { which: 1, force: true })
|
||||
.trigger('mousemove', randomOffset(), randomOffset(), { force: true })
|
||||
.trigger('mouseup', { force: true });
|
||||
|
||||
cy.get('#svg_1[d]').should('not.contain', 'NaN');
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ describe('UI - Export tests', function () {
|
||||
|
||||
it('Editor - No parameters: Export button clicking; dialog opens', () => {
|
||||
openMainMenu();
|
||||
cy.get('#tool_export').click({force: true});
|
||||
cy.get('#tool_export').click({ force: true });
|
||||
cy.get('#dialog_content select');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,13 +11,13 @@ describe('Fix issue 359', function () {
|
||||
it('can undo without throwing', function () {
|
||||
cy.get('#tool_source').click();
|
||||
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">
|
||||
<g class="layer">
|
||||
<title>Layer 1</title>
|
||||
<rect fill="#ffff00" height="70" width="165" x="179.5" y="146.5"/>
|
||||
</g>
|
||||
</svg>`, {parseSpecialCharSequences: false, force: true});
|
||||
</svg>`, { parseSpecialCharSequences: false, force: true });
|
||||
cy.get('#tool_source_save').click();
|
||||
cy.get('#tool_undo').click();
|
||||
cy.get('#tool_redo').click(); // test also redo to make the test more comprehensive
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('Fix issue 407', function () {
|
||||
it('can enter edit on text child', function () {
|
||||
cy.get('#tool_source').click();
|
||||
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">
|
||||
<g class="layer">
|
||||
<title>Layer 1</title>
|
||||
@@ -20,16 +20,16 @@ describe('Fix issue 407', function () {
|
||||
<text fill="#000000" id="a_text" text-anchor="middle" x="260.5" xml:space="preserve" y="192.5">hello</text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>`, {force: true, parseSpecialCharSequences: false});
|
||||
</svg>`, { force: true, parseSpecialCharSequences: false });
|
||||
cy.get('#tool_source_save').click();
|
||||
cy.get('#svg_1').click().dblclick();
|
||||
cy.get('#a_text').should('exist');
|
||||
cy.get('#a_text')
|
||||
.trigger('mousedown', {which: 1, force: true})
|
||||
.trigger('mouseup', {force: true})
|
||||
.dblclick({force: true});
|
||||
.trigger('mousedown', { which: 1, force: true })
|
||||
.trigger('mouseup', { force: true })
|
||||
.dblclick({ force: true });
|
||||
// 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('#a_text').should('have.text', 'he1234llo');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('Fix issue 408', function () {
|
||||
it('should not throw when showing/saving svg content', function () {
|
||||
cy.get('#tool_source').click();
|
||||
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">
|
||||
<g class="layer">
|
||||
<title>Layer 1</title>
|
||||
@@ -20,7 +20,7 @@ describe('Fix issue 408', function () {
|
||||
<circle cx="117.5" cy="87.5" fill="#ffff00" r="19.84943" stroke="#000000" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>`, {force: true, parseSpecialCharSequences: false});
|
||||
</svg>`, { force: true, parseSpecialCharSequences: false });
|
||||
cy.get('#tool_source_save').click();
|
||||
cy.get('#svg_6').click().dblclick(); // change context
|
||||
cy.get('#tool_source').click(); // reopen tool_source
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('Fix issue 423', function () {
|
||||
it('should not throw when undoing the move', function () {
|
||||
cy.get('#tool_source').click();
|
||||
cy.get('#svg_source_textarea')
|
||||
.type('{selectall}', {force: true})
|
||||
.type('{selectall}', { force: true })
|
||||
.type(`<svg width="300" height="300" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<g class="layer">
|
||||
<title>Layer 1</title>
|
||||
@@ -22,12 +22,12 @@ describe('Fix issue 423', function () {
|
||||
<rect clip-path="url(#svg_2)" fill="#0033b5" height="174.9" id="TANK1" width="78" x="77.5" y="29"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>`, {parseSpecialCharSequences: false, force: true});
|
||||
cy.get('#tool_source_save').click({force: true});
|
||||
</svg>`, { parseSpecialCharSequences: false, force: true });
|
||||
cy.get('#tool_source_save').click({ force: true });
|
||||
cy.get('#TANK1')
|
||||
.trigger('mousedown', {force: true})
|
||||
.trigger('mousemove', 50, 0, {force: true})
|
||||
.trigger('mouseup', {force: true});
|
||||
cy.get('#tool_undo').click({force: true});
|
||||
.trigger('mousedown', { force: true })
|
||||
.trigger('mousemove', 50, 0, { force: true })
|
||||
.trigger('mouseup', { force: true });
|
||||
cy.get('#tool_undo').click({ force: true });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -12,79 +12,97 @@ describe('use various parts of svg-edit', function () {
|
||||
});
|
||||
|
||||
it('check tool_source', function () {
|
||||
cy.get('#tool_source').click({force: true});
|
||||
cy.get('#tool_source').click({ force: true });
|
||||
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">
|
||||
<g class="layer">
|
||||
<title>Layer 1</title>
|
||||
<rect id="rect" fill="#FF0000" height="70" stroke="#000000" stroke-width="5" width="94" x="69.5" y="51.5"/>
|
||||
</g>
|
||||
</svg>`, {force: true, parseSpecialCharSequences: false});
|
||||
cy.get('#tool_source_save').click({force: true});
|
||||
</svg>`, { force: true, parseSpecialCharSequences: false });
|
||||
cy.get('#tool_source_save').click({ force: true });
|
||||
testSnapshot();
|
||||
});
|
||||
it('check tool_fhpath', function () {
|
||||
cy.get('#tool_fhpath')
|
||||
.click({force: true});
|
||||
.click({ force: true });
|
||||
cy.get('#rect')
|
||||
.trigger('mousemove', 200, 200, {force: true})
|
||||
.trigger('mousedown', 200, 200, {force: true})
|
||||
.trigger('mousemove', 20, 20, {force: true})
|
||||
.trigger('mouseup', {force: true});
|
||||
.trigger('mousemove', 200, 200, { force: true })
|
||||
.trigger('mousedown', 200, 200, { force: true })
|
||||
.trigger('mousemove', 20, 20, { force: true })
|
||||
.trigger('mouseup', { force: true });
|
||||
cy.get('#svgcontent').toMatchSnapshot();
|
||||
});
|
||||
it('check tool_text', function () {
|
||||
cy.get('#tool_text')
|
||||
.click({force: true});
|
||||
.click({ force: true });
|
||||
cy.get('#rect')
|
||||
.trigger('mousedown', 46, 35, {force: true})
|
||||
.trigger('mouseup', {force: true});
|
||||
.trigger('mousedown', 46, 35, { force: true })
|
||||
.trigger('mouseup', { force: true });
|
||||
// svgedit use the #text text field to capture the text
|
||||
cy.get('#text').type('AB', {force: true});
|
||||
cy.get('#text').type('AB', { force: true });
|
||||
testSnapshot();
|
||||
});
|
||||
|
||||
it('check tool_clone', function () {
|
||||
cy.get('#svg_1').click({force: true});
|
||||
cy.get('#svg_1').click({ force: true });
|
||||
cy.get('#tool_clone')
|
||||
.click({force: true});
|
||||
.click({ force: true });
|
||||
testSnapshot();
|
||||
});
|
||||
it('check tool_italic', function () {
|
||||
cy.get('#svg_1').click({force: true});
|
||||
cy.get('#svg_1').click({ force: true });
|
||||
cy.get('#tool_italic')
|
||||
.click({force: true});
|
||||
.click({ force: true });
|
||||
testSnapshot();
|
||||
});
|
||||
it('check tool_bold', function () {
|
||||
cy.get('#svg_1').click({force: true});
|
||||
cy.get('#svg_1').click({ force: true });
|
||||
cy.get('#tool_bold')
|
||||
.click({force: true});
|
||||
.click({ force: true });
|
||||
testSnapshot();
|
||||
});
|
||||
it('check change color', function () {
|
||||
cy.get('#svg_1').click({force: true});
|
||||
cy.get('#svg_1').click({ force: true });
|
||||
cy.get('[data-rgb="#ffff00"]')
|
||||
.click({force: true});
|
||||
.click({ force: true });
|
||||
testSnapshot();
|
||||
});
|
||||
it('check tool_text_anchor_start', function () {
|
||||
cy.get('#svg_1').click({force: true});
|
||||
cy.get('#svg_1').click({ force: true });
|
||||
cy.get('#tool_text_anchor_start')
|
||||
.click({force: true});
|
||||
.click({ force: true });
|
||||
testSnapshot();
|
||||
});
|
||||
it('check tool_text_anchor_middle', function () {
|
||||
cy.get('#svg_1').click({force: true});
|
||||
cy.get('#svg_1').click({ force: true });
|
||||
cy.get('#tool_text_anchor_middle')
|
||||
.click({force: true});
|
||||
.click({ force: true });
|
||||
testSnapshot();
|
||||
});
|
||||
it('check tool_text_anchor_end', function () {
|
||||
cy.get('#svg_1').click({force: true});
|
||||
cy.get('#svg_1').click({ force: true });
|
||||
cy.get('#tool_text_anchor_end')
|
||||
.click({force: true});
|
||||
.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_polygon', function () {
|
||||
cy.get('#tool_polygon')
|
||||
.click({ force: true });
|
||||
cy.get('#svgcontent')
|
||||
.trigger('mousedown', 350, 250, { force: true })
|
||||
.trigger('mousemove', 350, 370, { force: true })
|
||||
.trigger('mouseup', { force: true });
|
||||
testSnapshot();
|
||||
});
|
||||
it('check tool_star', function () {
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('UI - Tool selection', function () {
|
||||
cy.get('#tools_rect')
|
||||
.should('not.have.attr', 'pressed');
|
||||
cy.get('#tools_rect')
|
||||
.trigger('click', {force: true})
|
||||
.trigger('click', { force: true })
|
||||
.should('have.attr', 'pressed');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user