1

I'm new to testcafe and don't know if I am doing something wrong with my tests. When I call a post to my endpoint It seems the payload is lost somewhere in the proxy. Here is the request that is sent:

URL  http://10.0.2.15:51286/H1KOcXmZW/http://localhost:3000/api/user_token 
Request Method:POST
Remote Address:10.0.2.15:51286 
Request Payload: {"username": "user", "password": "pass"}

However, when it makes it to the rails backend, this is the log from the request

Started POST "/api/user_token" for 172.18.0.1 at 2017-05-24 15:45:20 +0000
| Processing by Api::V1::UserTokenController#create as JSON
| User Load (1.6ms)  SELECT  `users`.* FROM `users` WHERE 
    `users`.`username` IS NULL LIMIT 1
| Unpermitted parameter: :format
| Completed 404 Not Found in 471ms (ActiveRecord: 12.9ms)

Note that the request to find the user is trying to select where users.username is NULL It should be looking for where users.username is user. This call works when I am not running through testcafe but something, I'm assuming the webproxy, is not configured right or not playing nicely but I don't know how to fix it or even where to start to fix it. Any help is appreciated.

Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47
  • Ok, so I have done a bit more digging but still am running into issues. The webproxy seems to be fine. I was able to pause the testcafe tests midrun, leaving the temporary proxy server up. Then I ran postman and made calls to the endpoints that were giving me trouble through the proxy (it looked something like this: http://10.0.2.15:36224/HyKjYj7WZ/http://localhost:3000/api/user_token). Postman was able to complete the calls fine, the calls through testcafe still give 404s, and I still don't know why these calls cannot be completed. – user7631998 May 25 '17 at 01:34
  • 1
    I've created the issue on github - https://github.com/DevExpress/testcafe-hammerhead/issues/1151. – mlosev May 26 '17 at 13:12
  • You provided repository to reproduce the problem - https://github.com/lalibelamonk/example. But now, I cannot get access to this, I got 404 error. – mlosev Jun 03 '17 at 14:50

1 Answers1

0

We have created the corresponding GitHub issue to address the described behavior:

https://github.com/DevExpress/testcafe-hammerhead/issues/1151

Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47