mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
test: Add data mapping test (#5372)
* test: add tests for pinning * test: add test for value * test: add pinned data tests * test: refactor into ndv * refactor: move to ndv * refactor: rename node * test: fix test * test: fix refactor * test: remove unused id * test: update test * test: chain rename input * test: refactor invoking text * test: fix ndv tests * test: move test id * test: add tests for mapping * test: update selectors * test: add mapping * test: remove wait * test: add back line removed by mistake * test: refactor to support both in/output displays * test: add display mode switching * test: fix drop * chore: clean up change * refactor: add draganddrop * fix: fix drag and drop * test: add mapping test for second value * test: update text * test: update param
This commit is contained in:
@@ -173,7 +173,8 @@ Cypress.Commands.add('paste', { prevSubject: true }, (selector, pastePayload) =>
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('drag', (selector, xDiff, yDiff) => {
|
||||
Cypress.Commands.add('drag', (selector, pos) => {
|
||||
const [xDiff, yDiff] = pos;
|
||||
const element = cy.get(selector);
|
||||
element.should('exist');
|
||||
|
||||
@@ -188,3 +189,21 @@ Cypress.Commands.add('drag', (selector, xDiff, yDiff) => {
|
||||
});
|
||||
element.trigger('mouseup');
|
||||
});
|
||||
|
||||
Cypress.Commands.add('draganddrop', (draggableSelector, droppableSelector) => {
|
||||
cy.get(draggableSelector).should('exist');
|
||||
cy.get(droppableSelector).should('exist');
|
||||
|
||||
const droppableEl = Cypress.$(droppableSelector)[0];
|
||||
const coords = droppableEl.getBoundingClientRect();
|
||||
|
||||
const pageX = coords.left + coords.width / 2;
|
||||
const pageY = coords.top + coords.height / 2;
|
||||
|
||||
cy.get(draggableSelector).realMouseDown();
|
||||
cy.get(droppableSelector).realMouseMove(pageX, pageY)
|
||||
.realHover()
|
||||
.realMouseUp();
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user