Search code examples
nightwatch.js

NightwatchJS capture network traffic / network response


I have a ReactJS SPA that I'm testing, specifically I'm testing user signup.

This is a response value from the GET request that my SPA makes when a user has signs up.

{"data":{"id":1387,"token":"3f38cfd0-a392-11e7-8d24-130a2af7f20a"}}

How can I access the data returned from network requests made from my SPA within NightwatchJS?


Solution

  • I'm using a workaround, by adding code into my React SPA that console.warn's out the token when it's received.

    Then I'm using NightwatchJS getLog method to access the data. This isn't clean by any means.