title: access POST data from httpBackend in e2e test
body: <p>In this example, I have an e2e test doing a button click, which executes a function that does a POST</p>
  
  <p>I would like to be able to have access to the "data" object from testDev httpBackend callback,  in my e2e scenerios code, for verification.</p>
  
  <p>Is this possible in an e2e test? If so, could you point me in the right direction?</p>
  
  <p>thanks</p>
  
  <p>scenerio code</p>
  
  <pre><code>describe('test2 app', function() {
      beforeEach(function() {
          browser().navigateTo('/testbed/e2e/app/index2.html');
      });
      it('should run a POST',function() {
          element('#myButton2').click();
      });
  });
  </code></pre>
  
  <p>test module</p>
  
  <pre><code>var test2Dev = angular.module('test2Dev', ['test2App', 'ngMockE2E'])
  .run(function($httpBackend) {
      $httpBackend.whenPOST(/testpost/)
      .respond(function(method, url, data, headers){
          console.log(data);
          return [200, data, {}];
      });
  });
  </code></pre>
  
  <p>markup</p>
  
  <pre><code>&lt;html lang="en" ng-app="test2Dev" ng-controller="test2Ctrl"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Test click &lt;/title&gt;
      &lt;link rel="stylesheet" href="css/app.css"&gt;
      &lt;link rel="stylesheet" href="css/bootstrap.css"&gt;
      &lt;script src="lib/angular/angular.js"&gt;&lt;/script&gt;
      &lt;script src="lib/angular/angular-mocks.js"&gt;&lt;/script&gt;
      &lt;script src="/testbed/e2e/test/e2e/test2Dev.js"&gt;&lt;/script&gt;
      &lt;script src="js/controllers2.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;button id="myButton2" ng-click="runPost()"&gt;run post&lt;/button&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>controller</p>
  
  <pre><code>var test2App = angular.module('test2App', []);
  test2App.controller('test2Ctrl', function($scope,$http) {
      $scope.runPost = function() {
          $http.post('/testpost',{
              data1 : 'chevy',
              data2 : 'ford'
          });
      }
  });
  </code></pre>
  
  <p>runner</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
    &lt;head&gt;
      &lt;title&gt;End2end Test Runner&lt;/title&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;base href="../.."&gt;
      &lt;script src="app/lib/angular/angular-scenario.js" ng-autotest&gt;&lt;/script&gt;
      &lt;script src="app/lib/angular/angular-mocks.js" ng-autotest&gt;&lt;/script&gt;
      &lt;script src="/testbed/e2e/test/e2e/test2Dev.js"&gt;&lt;/script&gt;
      &lt;script src="/testbed/e2e/test/e2e/scenarios2.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>