Functional tests are not running on circleCI 2

I have been trying to run my functional tests on circleCI 2 for a while now. I’m using circleci/node:10.1.0-browsers as image as it should have running Xvfb and browsers installed. Every time the error I’m getting:

Running "intern:functional" (intern) task
Listening on
Running FieldAware Functional Test Suites...
⚠️ Some suites are temporarily disabled pending fixes to FieldAware module loading within the test cases
Tunnel started
>> Suite chrome on any platform FAILED
UnknownError: [POST http://localhost:4444/wd/hub/session / {"desiredCapabilities":{"selenium-version":"2.53.1","name":"/app/dist/tests/intern-functional.js","idle-timeout":60,"browserName":"chrome"}}] An unknown server-side error occurred while processing the command.
  at Server.createSession  <node_modules/leadfoot/Server.js:362:15>
  at <node_modules/intern/lib/executors/Runner.js:198:23>
  at retry  <node_modules/intern/lib/util.js:818:13>
  at <node_modules/dojo/Promise.ts:393:15>
  at runCallbacks  <node_modules/dojo/Promise.ts:11:11>
  at <node_modules/dojo/Promise.ts:317:4>
  at run  <node_modules/dojo/Promise.ts:237:7>
  at <node_modules/dojo/nextTick.ts:44:3>
  at process._tickCallback  <internal/process/next_tick.js:61:11>

>> TOTAL: tested 0 platforms, 0/0 tests failed; fatal error occurred

Error: Run failed due to one or more suite errors
  at emitLocalCoverage  <node_modules/intern/lib/executors/Executor.js:363:18>
  at finishSuite  <node_modules/intern/lib/executors/Executor.js:380:15>
  at <node_modules/intern/lib/executors/Executor.js:388:8>
  at <node_modules/intern/browser_modules/dojo/Promise.ts:393:15>
  at runCallbacks  <node_modules/intern/browser_modules/dojo/Promise.ts:11:11>
  at <node_modules/intern/browser_modules/dojo/Promise.ts:317:4>
  at run  <node_modules/intern/browser_modules/dojo/Promise.ts:237:7>
  at <node_modules/intern/browser_modules/dojo/nextTick.ts:44:3>
  at process._tickCallback  <internal/process/next_tick.js:61:11>
Warning: Test failure; check output above for details.a Use --force to continue.

Aborted due to warnings.

Which I’m pretty sure it is because it cannot open the browser.
here is my circle.yml

version: 2


    working_directory: ~/fieldaware/fieldaware-frontend
    parallelism: 1
    shell: /bin/bash --login
        - /release\/.*/
        - /feature\/.*/
        - /hotfix\/.*/
      - image: circleci/node:10.1.0-browsers
      - checkout
      # Validate package.json (no dependencies -> script can be run before install)
      - run: npm run validate:package
      - run:
          name: Install bower and grunt
          command: sudo npm -g install bower@1.8.4 grunt-cli@1.3.1
      - run:
          name: Install ruby
          command: |
            make ruby
            echo 'export PATH=$PATH:~/fieldaware/fieldaware-frontend/build/rbenv/versions/2.2.2/bin' >> $BASH_ENV
      - run: make install
      # Test
      - run: grunt lint
      - run:
          name: Run unit tests
          command: npm test
      - run:
          name: functional tests
          command: grunt test:functional
      - run: npm run release
      - run: grunt fa-package

I’m using internjs with the following config:

// The port on which the instrumenting proxy will listen
    proxyPort: 8889,

    // A fully qualified URL to the Intern proxy
    proxyUrl: 'http://localhost:8889/',

    // Default desired capabilities for all environments. Individual capabilities can be overridden by any of the
    // specified browser environments in the `environments` array below as well. See
    // for standard Selenium capabilities and
    // for Sauce Labs capabilities.
    // Note that the `build` capability will be filled in with the current commit ID from the Travis CI environment
    // automatically
    capabilities: {
        'selenium-version': '2.53.1'

    // Browsers to run integration testing against. Note that version numbers must be strings if used with Sauce
    // OnDemand. Options that will be permutated are browserName, version, platform, and platformVersion; any other
    // capabilities options specified for an environment will be copied as-is
    environments: [
        { browserName: 'chrome'}

    // Maximum number of simultaneous integration tests that should be executed on the remote WebDriver service
    maxConcurrency: 1,

    // Whether or not to start Sauce Connect before running tests
    tunnel: 'NullTunnel',

Tests are running OK locally but Xvfb does not seem to run the browser.

thank you

There is probably some logs that explain this somewhere, I suspect from Xvfb. Get an SSH session and have a scout around for them.

Hi halfer. thanks for your answer.

I have not been able to find any logs so I have decided to kill the Xvfb instance running on my image by default and run a new instance redirecting the stderr to a file:

- run: sudo pkill Xvfb
      - run:
          name: Running X virtual framebuffer
          command: sudo Xvfb -ac :99 -screen 0 1280x1024x16 +extension RANDR > 2>/tmp/Xvfb_logs
          background: true

I got the same error on my tests and nothing in the log file.

I have finally sort my problem. Xvfb was not working at all. I don’t know the reason. What I did was to update the instance of chrome and chromedriver in the docker image I was using. Uninstall Xvfb completely and use chrome with the --headless option

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.