Is it possbile to call a function in nodejs during e2e tests? #30166
Unanswered
leilengma
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, i am very new to cypress and still playing around with it.
In my case I need to test the pairing function from a website to an iot device.
So for me it is necessary to simulate a device in nodejs to send the correction information to the webservice when user clicks on "pair" button on the website.
I know there is a beforeEach hook, but it is already in the browser when this hook is getting called. I really need the node enviroment to support the azure-iot-device library.
So I would like to ask if there is a way to jump out of the browser and execute some code in node during the test execution?
My current idea is to start a server before test execution and provide apis to perform all necessary actions via calling apis.
Thanks a lot in advance!
Beta Was this translation helpful? Give feedback.
All reactions