Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ember-cli test not working with phantomjs in docker

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"
  ]
};
like image 874
monty_lennie Avatar asked May 03 '17 19:05

monty_lennie


1 Answers

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.

like image 156
efx Avatar answered Nov 08 '22 17:11

efx