title: Protractor: commands in afterLaunch don't run
body: <p>I'm trying to send an email out with results after tests have finished running.
  When I put the sendgrid call in the onComplete section, then the email sends.  However, the report is empty since it hasn't finished saving.</p>
  
  <p>If I put the sendgrid call into the afterLaunch section, then the file is saved.  However, it doesn't seem to run the sendgrid command.</p>
  
  <p>This is the config that I am using:</p>
  
  <pre><code>var HtmlReporter = require ('protractor-jasmine2-html-reporter');
  var browser = "chrome";
  var environment = "dev";
  var pname = "";
  var pversion = "";
  var dname = "";
  var selenium_address = "http://localhost:4444/wd/hub";
  var folder_name = (new Date()).toString().split(' ').splice(0,3).join('');
  var report_folder = "./test/e2e/reports/" + folder_name + "_" + browser +   "_" + environment + "/";
  var reporter = new HtmlReporter({
    savePath: report_folder,
    takeScreenshots: false,
    cleanDestination: true,
    fileName: 'CE_Smoketest'
  });
  
  function test_function() {
     var report = report_folder + 'CE_Smoketest.html'
     var sendgrid = require('sendgrid')('xxxxx', 'xxxxxxxxx');
     var email = new sendgrid.Email();
     email.addTo("destination@mail.com");
     email.setFrom("Smoketest@mail.com");
     email.setSubject("Smoketest");
     email.setHtml("Smoketest results");
     email.addFile({filename: report});
     sendgrid.send(email);
  }
  
  exports.config = {
  //appium setup
  seleniumAddress: selenium_address,
  multiCapabilities: [
  {
      'browserName' : browser,
      platformName : pname,
      platformVersion : pversion,
      deviceName: dname
  }
  ],
  
  getPageTimeout: 50000,
  allScriptsTimeout: 50000,
  jasmineNodeOpts: {
    defaultTimeoutInterval: 50000,
    isVerbose: true
  },
  
  onPrepare: function() {
  
      jasmine.getEnv().addReporter(reporter);
        },
  onComplete: function(exitCode) {
      test_function();
  
  },
  afterLaunch: function(exitCode) {
      test_function();
  }
  }
  </code></pre>
  
  <p>Any ideas as to why afterLaunch doesn't send the email?</p>