title: webdriver io crashes inside a jade template on rendered function
body: <p>I am testing my meteor app's UI with some browser tests. I use <a href="http://webdriver.io" rel="nofollow noreferrer">http://webdriver.io</a> and a selenium chrome <a href="https://hub.docker.com/r/selenium/standalone-chrome/" rel="nofollow noreferrer">https://hub.docker.com/r/selenium/standalone-chrome/</a> node.</p>
  
  <p>I use the webdriver.io testrunner for tests and mocha as the test framework.</p>
  
  <p>When I enter this block inside a jade template (by opening the corresponding page):</p>
  
  <pre><code>Template.boardBody.onRendered(function() {
  
    let imagePath = new ReactiveVar('');
  
    this.autorun(() =&gt; {
      imagePath.set(Meteor.settings.public.backgroundPath[1]);
      //document.getElementsByClassName('board-wrapper')[0].style.backgroundImage = "url('" + imagePath.get() + "')";
      $('.board-wrapper').css('background-image', "url('" + path + "')");
    });
  }
  </code></pre>
  
  <p>The headless chrome crashes with this error:</p>
  
  <pre><code>{ Error: An unknown server-side error occurred while processing the command.
  at BoardPage.open (tests/board.page.js:20:5)
  at Context.&lt;anonymous&gt; (tests/board.test.js:22:17)
  at Promise.F (node_modules/core-js/library/modules/_export.js:35:28)
  at execute(&lt;Function&gt;) - at BoardPage.open (tests/page.js:11:13)
  message: 'unknown error: session deleted because of page crash\nfrom tab crashed',
  type: 'RuntimeError',
  screenshot: 'Just a black page',
  seleniumStack:
  { status: 13,
  type: 'UnknownError',
  message: 'An unknown server-side error occurred while processing the command.',
  orgStatusMessage: 'unknown error: session deleted because of page crash\nfrom tab crashed\n (Session info: chrome=59.0.3071.115)\n (Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux 4.4.4-200.fc22.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)\nCommand duration or timeout: 4.13 seconds\nBuild info: version: \'3.4.0\', revision: \'unknown\', time: \'unknown\'\nSystem info: host: \'f362d8ab8951\', ip: \'172.17.0.1\', os.name: \'Linux\', os.arch: \'amd64\', os.version: \'4.4.4-200.fc22.x86_64\', java.version: \'1.8.0_131\'\nDriver info: org.openqa.selenium.chrome.ChromeDriver\nCapabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57), userDataDir=/tmp/.org.chromium.Chromium.NUsUeZ}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=59.0.3071.115, platform=LINUX, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]\nSession ID: f1e261ec57fde3697e98945af051d236' },
  shotTaken: true }
  </code></pre>
  
  <p>I use chai.expect for my assertion statements and i have a feeling that the promises are somehow messing up the headless chrome.</p>
  
  <p>Anyone knows why this is happening?</p>