6

When running ember test --host 172.17.0.2 --test-port 4450, I'm getting the following error.

Error: Browser failed to connect within 30s. testem.js not loaded?

Since I'm using a docker container I'm assuming I need to update the host and port to the open docker host and port.

This is my testem.js file

/*jshint node:true*/
module.exports = {
  "framework": "qunit",
  "test_page": "tests/index.html?hidepassed",
  "phantomjs_debug_port": 4500,
  "disable_watching": true,
  "launch_in_ci": [
    "PhantomJS"
  ],
  "launch_in_dev": [
    "PhantomJS",
    "Chrome"
  ]
};
monty_lennie
  • 2,871
  • 2
  • 29
  • 49

1 Answers1

1

This is a general problem you'll see when testing an ember application in continuous integration environments. Multiple users have posted their experiences with the possible bug in this GitHub issue. 2 answers come to mind.

  1. Per Testem's author, you can increase the browser connection timeout.

  2. Compare your ember application's .travis.yml with the canonical version in the ember-new-output repository here. The ember-cli core team and community members have invested a lot of time refining and debugging that .travis.yml to make it work well with ember applications.

  • This is an ongoing concern even today using Headless Chrome and Github Actions. Setting the Testem option: `browser_start_timeout: 60` fixed it! – Matt Jensen Jan 08 '20 at 22:21