How to send a post request using CURL in nightwatch? #2796
Unanswered
Pverma96
asked this question in
Help Needed
Replies: 1 comment 1 reply
-
You can create a custom command which uses something like axios to perform the request and then invoke that in the global beforeEach hook, which will run before each testsuite. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a use case requirement where i have to send a post request using a curl command before running ANY test in Nightwatch. Example: "curl -X POST https://example.com/".
I am aware that there is something called globals in nightwatch where a "before" hook can be used but not sure about how to execute above curl command in that before hook. The manual way of doing it to invoke the terminal first and enter the command and then run the test. Can anybody please help and explain how to achieve this.
Beta Was this translation helpful? Give feedback.
All reactions