javascript - Finding the mouse position in Cypress - Stack Overflow

ProblemDesireIm currently trying to find the position of my mouse when testing in Cypress. I'm tr

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
Add a ment  | 

1 Answer 1

Reset to default 5

It 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745639921a4637626.html

相关推荐

  • javascript - Finding the mouse position in Cypress - Stack Overflow

    ProblemDesireIm currently trying to find the position of my mouse when testing in Cypress. I'm tr

    22天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信