browserstack/browserstack-local-nodejs

async afterEach with browser/session.end causes 500

Opened this issue · 0 comments

Expected Behavior

Another session to start up for the 2. test case.

Actual Behavior

  1. test case failes with errors:
   Response 500 POST http://hub-cloud.browserstack.com/wd/hub/session/a72b7db656837fb9ed3ae3529967ee8f1d5e359b/url (1121ms) 
 chrome { state: 'unhandled error', 
 chrome      sessionId: 'a72b7db656837fb9ed3ae3529967ee8f1d5e359b', 
 chrome      value: 
 chrome       { systemInformation: 
 chrome          'System info: host: \'185-200-100-56\', ip: \'185.200.100.56\', os.name: \'windows\', os.arch: \'x86\', os.version: \'6.3\', java.version: \'1.8.0_181\'', 
 chrome         message: 'Session ID is null. Using WebDriver after calling quit()?', 
 chrome         error: 
 chrome          [ 'Build info: version: \'2.53.0\', revision: \'35ae25b\', time: \'2016-03-15 17:00:58\'', 
 chrome            'System info: host: \'185-200-100-56\', ip: \'185.200.100.56\', os.name: \'windows\', os.arch: \'x86\', os.version: \'6.3\', java.version: \'1.8.0_181\'', 
 chrome            'Driver info: driver.version: EventFiringWebDriver' ] }, 
 chrome      status: 13 } 
 chrome Error while running .navigateTo() protocol action: Session ID is null. Using WebDriver after calling quit()?

Steps to Reproduce the Problem

  1. setup a test module with multiple tests cases
  2. setup a async afterEach that closes the session:
  afterEach: async (browser, done) => { 
    browser.end();
    ...
    done(); 
  }
  1. run

browserstack local arguments

no arguments. unmodified runner from:
https://www.browserstack.com/automate/nightwatch#running-local-test

Platform details

  1. browserstack-local-nodejs version: 1.4.0
  2. node version: v10.15.2
  3. os type and version: ubuntu 18

Details

This works fine when runing without bs_local, both running on browserstack against a publicly available web-page, and running locally with chromedriver.