Cypress flow #330
Cypress flow
#330
-
Hi I would like to test moving with flow with some Cypress test. I am trying something like this on different divs, but so far, no one works. Have you some advice, or tips? Many thanks for any response. |
Beta Was this translation helpful? Give feedback.
Answered by
bcakmakoglu
Oct 13, 2022
Replies: 1 comment 1 reply
-
The way I do it is like this: cy.mount(VueFlow, {
props: {
id: 'test',
fitViewOnInit: true,
...props,
},
attrs: {
key: 'flowy',
style: {
height: '100vh',
width: '100vw',
},
...attrs,
},
}) describe('Viewpane test', () => {
// mounts vue flow component fresh on each test
beforeEach(() => {
// cy.vueFlow is a custom command
cy.vueFlow({
nodes,
})
})
it('drag pane', () => {
// wait for window obj
cy.window().then((win) => {
cy.get('.vue-flow__pane')
// use force and pass win as view to event
.trigger('mousedown', 'center', { force: true, view: win })
.trigger('mousemove', { force: true, clientX: 500, clientY: 250, view: win })
.trigger('mouseup', { force: true, view: win })
})
})
}) Main thing is passing |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
bcakmakoglu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The way I do it is like this: