theintern / intern

A next-generation code testing stack for JavaScript.
https://theintern.io/
Other
4.36k stars 309 forks source link

Intern fails to launch Chrome functional tests in 65 #888

Closed bthallion closed 6 years ago

bthallion commented 6 years ago

The newest major version of Chrome 65 is causing the chromedriver to fail with this error:

BUG: suiteEnd was received for invalid session
(ノಠ益ಠ)ノ彡┻━┻
JavaScriptError: [POST http://localhost:4444/wd/hub/session/c51f1452646870a948c1175b6c581630/execute / {"script":"return (function getCoverageData(coverageVariable) {\n        var coverageData = (function () {\n            return this;\n        })()[coverageVariable];\n        return coverageData && JSON.stringify(coverageData);\n    }).apply(this, arguments);","args":["__coverage__"]}] unknown error: call function result missing 'value'
  (Session info: chrome=65.0.3325.162)
  (Driver info: chromedriver=2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2),platform=Mac OS X 10.13.0 x86_64)
  at <src/lib/ProxiedSession.ts:143:16>

Expected behavior

Intern should be able to launch chromedriver successfully

Current behavior

It's failing to do so

Steps to reproduce (for bugs)

  1. Install Chrome 65.0.3325.162
  2. Use this configuration to run tests:
    {
    "browser": {
        "suites": "test/browser/**/*.js",
        "loader": {
            "script": "systemjs",
            "options": {
                "map": {
                    "plugin-babel": "node_modules/systemjs-plugin-babel/plugin-babel.js",
                    "systemjs-babel-build": "node_modules/systemjs-plugin-babel/systemjs-babel-browser.js"
                },
                "packages": {
                    "lib/js/store": {
                        "defaultExtension": "js"
                    }
                },
                "transpiler": "plugin-babel"
            }
        }
    },
    "node": {
        "plugins": [
            "test/helpers/serve-build.js"
        ]
    },
    "functionalSuites": "test/functional/**/*.js",
    "environments": "chrome",
    "capabilities": {},
    "leaveRemoteOpen": false,
    "filterErrorStack": true,
    "connectTimeout": 3000,
    "instrumenterOptions": {
        "esModules": true
    }
    }
  3. Run a simple test like this:
    
    const { suite, test } = intern.getPlugin('interface.tdd');
    const { assert } = intern.getPlugin('chai');
    const { URL } = require('url');
    const serverUrl = require('../helpers/serve-build').serverUrl;

suite('Functional smoke tests', () => { test('type email', async (t) => { await t.remote.setFindTimeout(5000); await t.remote.get(new URL('/index.html', serverUrl)); const email = await t.remote.findByCssSelector('#login-email'); await email.click(); await email.type('someone@hello.com'); assert.isTrue(true); }); });



## Environment
<!-- List the relevant software versions -->
Intern version: intern@4.1.5
Node version: 8.9.4
NPM version: 5.7.1
Browser version: Chrome 65.0.3325.162
jason0x43 commented 6 years ago

The issue is that Chrome 65 is no longer compatible with the version of chromedriver Intern (via Dig Dug) is downloading. A fix is in progress. For now, you can do the following:

  1. Set tunnelOptions
    "tunnelOptions": {
    "drivers": [
    { "name": "chrome", "version": "2.36" }
    ]
    }
  2. Delete any existing chromedriver in node_modules/@theintern/digdug/selenium-standalone
agubler commented 6 years ago

Hey @bthallion there is an incompatibility between the version of chromedriver that intern uses and version 65 of chrome. It has been updated in master of intern but until then you should be able to specify the chrome driver version in your intern config

            "tunnel": "selenium",
            "tunnelOptions": {
                "hostname": "localhost",
                "port": 4444,
                "drivers": [
                    {
                        "name": "chrome",
                        "version": "2.36"
                    }
                ]
bthallion commented 6 years ago

That worked, thanks!

jason0x43 commented 6 years ago

See https://github.com/theintern/digdug/issues/60 for some additional info

burashka commented 6 years ago

We are use v3, because v4 is not backward compatible. Can you bump chromedriver for v3 too, pls?

jason0x43 commented 6 years ago

Note to self: We would need to bump both the Intern 3.x minor version and digdug 1.x minor versions since simply having digdug use newer webdriver versions could break functionality for other users of Intern 3.

jason0x43 commented 6 years ago

This has been fixed in Intern 4.2 and Dig Dug 2.1.x