2019-11-23 13:02:51 +00:00
|
|
|
import {
|
2019-12-23 10:34:28 +00:00
|
|
|
visitAndApproveStorage
|
|
|
|
} from '../../support/ui-test-helper.js';
|
2019-11-23 13:02:51 +00:00
|
|
|
|
2019-12-23 10:34:28 +00:00
|
|
|
describe('UI - Control Points', function () {
|
2019-11-23 13:02:51 +00:00
|
|
|
beforeEach(() => {
|
2019-12-23 10:34:28 +00:00
|
|
|
visitAndApproveStorage();
|
2019-11-23 13:02:51 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('Editor - No parameters: Drag control point of arc path', () => {
|
|
|
|
const randomOffset = () => 2 + Math.round(10 + Math.random() * 40);
|
|
|
|
cy.get('#tool_source').click();
|
|
|
|
cy.get('#svg_source_textarea')
|
2020-11-11 10:38:45 +00:00
|
|
|
.type('{selectall}', {force: true})
|
2019-11-23 13:02:51 +00:00
|
|
|
.type(`<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg">
|
|
|
|
<g class="layer">
|
|
|
|
<title>Layer 1</title>
|
2020-11-11 10:38:45 +00:00
|
|
|
<path d="m187,194a114,62 0 1 0 219,2" id="svg_1" fill="#FF0000" stroke="#000000" stroke-width="5"/>
|
2019-11-23 13:02:51 +00:00
|
|
|
</g>
|
2020-02-21 02:33:56 +00:00
|
|
|
</svg>`, {force: true, parseSpecialCharSequences: false});
|
2021-05-09 17:29:45 +00:00
|
|
|
cy.get('#tool_source_save').click({force: true});
|
|
|
|
|
|
|
|
cy.get('#svg_1').click({force: true}).click({force: true});
|
2019-11-23 13:02:51 +00:00
|
|
|
|
2020-08-07 20:01:23 +00:00
|
|
|
cy.get('#pathpointgrip_0').trigger('mousedown', {which: 1, force: true})
|
2019-11-23 13:42:29 +00:00
|
|
|
.trigger('mousemove', randomOffset(), randomOffset(), {force: true})
|
2019-11-23 13:02:51 +00:00
|
|
|
.trigger('mouseup', {force: true});
|
2020-08-07 20:01:23 +00:00
|
|
|
cy.get('#pathpointgrip_1').trigger('mousedown', {which: 1, force: true})
|
2019-11-23 13:42:29 +00:00
|
|
|
.trigger('mousemove', randomOffset(), randomOffset(), {force: true})
|
2019-11-23 13:02:51 +00:00
|
|
|
.trigger('mouseup', {force: true});
|
|
|
|
|
|
|
|
cy.get('#svg_1[d]').should('not.contain', 'NaN');
|
|
|
|
});
|
|
|
|
});
|