admin管理员组文章数量:1434954
Problem/Desire
Im currently trying to find the position of my mouse when testing in Cypress. I'm trying to work with WebGL models and since I can't grab those individually to be able to grab the model and move them around I was thinking of using the page coordinates/mouse position so its close enough.
Found a possible solution
I had found a closed issue on Cypress' github about this, but it wouldn't install so if any of you know why it's throwing the attached error or an easier way to find out what the position is let me know! It will be greatly appreciated.
Cypress closed issue | Mouse position
Photo of error in terminal
(sorry for the bad pen marking; trying to scribble out my last name) I ran the code given in the closed issue which was:
npm i -D cypress-mouse-position
then added these in the two files:
cypress/plugins/index.js
module.exports = (on, config) => {
# ...
initCypressMousePositionPlugin(on);
# ...
}
cypress/support/index.js
import 'cypress-mouse-position/mands';
Problem/Desire
Im currently trying to find the position of my mouse when testing in Cypress. I'm trying to work with WebGL models and since I can't grab those individually to be able to grab the model and move them around I was thinking of using the page coordinates/mouse position so its close enough.
Found a possible solution
I had found a closed issue on Cypress' github about this, but it wouldn't install so if any of you know why it's throwing the attached error or an easier way to find out what the position is let me know! It will be greatly appreciated.
Cypress closed issue | Mouse position
Photo of error in terminal
(sorry for the bad pen marking; trying to scribble out my last name) I ran the code given in the closed issue which was:
npm i -D cypress-mouse-position
then added these in the two files:
cypress/plugins/index.js
module.exports = (on, config) => {
# ...
initCypressMousePositionPlugin(on);
# ...
}
cypress/support/index.js
import 'cypress-mouse-position/mands';
Share
Improve this question
edited May 22, 2019 at 8:42
Joshua
3,2063 gold badges26 silver badges41 bronze badges
asked May 20, 2019 at 22:20
HyeEunHyeEun
7072 gold badges9 silver badges19 bronze badges
1 Answer
Reset to default 5It looks like the author of cypress-mouse-position
never actually published his package to NPM, so I've done it for him.
You should now be able to do npm i -D cypress-mouse-position
without encountering any errors, since it is now published on NPM.
本文标签: javascriptFinding the mouse position in CypressStack Overflow
版权声明:本文标题:javascript - Finding the mouse position in Cypress - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745639921a2667791.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论