{"action":"created","issue":{"url":"https://api.github.com/repos/angular/protractor/issues/2132","labels_url":"https://api.github.com/repos/angular/protractor/issues/2132/labels{/name}","comments_url":"https://api.github.com/repos/angular/protractor/issues/2132/comments","events_url":"https://api.github.com/repos/angular/protractor/issues/2132/events","html_url":"https://github.com/angular/protractor/issues/2132","id":75379341,"number":2132,"title":"Asserting $http request payloads without mocking them","user":{"login":"mpetrovich","id":1235062,"avatar_url":"https://avatars.githubusercontent.com/u/1235062?v=3","gravatar_id":"","url":"https://api.github.com/users/mpetrovich","html_url":"https://github.com/mpetrovich","followers_url":"https://api.github.com/users/mpetrovich/followers","following_url":"https://api.github.com/users/mpetrovich/following{/other_user}","gists_url":"https://api.github.com/users/mpetrovich/gists{/gist_id}","starred_url":"https://api.github.com/users/mpetrovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpetrovich/subscriptions","organizations_url":"https://api.github.com/users/mpetrovich/orgs","repos_url":"https://api.github.com/users/mpetrovich/repos","events_url":"https://api.github.com/users/mpetrovich/events{/privacy}","received_events_url":"https://api.github.com/users/mpetrovich/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/protractor/labels/type:%20question","name":"type: question","color":"f7c6c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-11T22:25:41Z","updated_at":"2015-05-13T21:19:26Z","closed_at":"2015-05-13T21:19:26Z","body":"I'm writing Protractor tests to verify the successful creation of reports in our application. A report is created via a series of complex UI interactions within a dialog and saved via an AJAX POST request to a REST API.\r\n\r\nI've written tests for the complex UI interactions within the modal, but I'm at a loss for how to test the POST request within the same Protractor tests. Ideally, I'd like to be able to make assertions against the payload of the POST request to verify that the UI is sending the correct data to the API.\r\n\r\nIt's important to note that I do *not* want to mock the HTTP call—I need it to go through, since subsequent protractor tests navigate to the report and perform additional checks. My first thought was to somehow hook into the `$httpBackend.passThrough()` method, but I haven't had any success with that.\r\n\r\nAny ideas how to accomplish this?"},"comment":{"url":"https://api.github.com/repos/angular/protractor/issues/comments/101818926","html_url":"https://github.com/angular/protractor/issues/2132#issuecomment-101818926","issue_url":"https://api.github.com/repos/angular/protractor/issues/2132","id":101818926,"user":{"login":"sjelin","id":4841675,"avatar_url":"https://avatars.githubusercontent.com/u/4841675?v=3","gravatar_id":"","url":"https://api.github.com/users/sjelin","html_url":"https://github.com/sjelin","followers_url":"https://api.github.com/users/sjelin/followers","following_url":"https://api.github.com/users/sjelin/following{/other_user}","gists_url":"https://api.github.com/users/sjelin/gists{/gist_id}","starred_url":"https://api.github.com/users/sjelin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjelin/subscriptions","organizations_url":"https://api.github.com/users/sjelin/orgs","repos_url":"https://api.github.com/users/sjelin/repos","events_url":"https://api.github.com/users/sjelin/events{/privacy}","received_events_url":"https://api.github.com/users/sjelin/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T21:19:26Z","updated_at":"2015-05-13T21:19:26Z","body":"You could probably do it with [`browser.executeAsyncScript`](http://angular.github.io/protractor/#/api?view=webdriver.WebDriver.prototype.executeAsyncScript).  Also, please ask this find of question on stackoverflow."}}