Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chromedriver with Karma [$100 awarded] #2229

Closed
mikemilano opened this issue Aug 21, 2014 · 38 comments
Closed

Chromedriver with Karma [$100 awarded] #2229

mikemilano opened this issue Aug 21, 2014 · 38 comments
Labels

Comments

@mikemilano
Copy link

Should I be able to use chromedriver2_server to test node-webkit apps with Karma or Protractor?

I'm building a front-end with AngularJS and access node modules directly in the app. I've downloaded the chromedriver2_server binary and directed karma & protractor to use it, but it just errors out saying that it can't locate the Chrome binary.

I suspect I'm going about it the wrong way though. If it's might be possible to run the recommended AngularJS testing frameworks (karma & protractor) in a node webkit instance, please let me know.

The $100 bounty on this issue has been claimed at Bountysource.

@rogerwang rogerwang changed the title Chromedriver with Karma Chromedriver with Karma [$50] Aug 21, 2014
@rogerwang
Copy link
Member

Where did you download chromedriver2_server? which version? Thanks

@mikemilano
Copy link
Author

I've tried the one bundled with v0.10.2-osx-x64 as well as 0.9.0 from the links listed on this page: https://github.com/rogerwang/node-webkit/wiki/Chromedriver

My initial testing was based on this article: http://www.ng-newsletter.com/posts/practical-protractor.html , replacing the chromeDriver file with one the driver downloads mentioned above. The test ran OK before I replaced them. When re-configured to the alt chromedrivers, I got the same errors when running: protractor conf.js

UnknownError: unknown error: cannot find Chrome binary

Based on the the chromedriver wiki page though, I'm pretty unsure I'm approaching this correctly.

@rogerwang rogerwang changed the title Chromedriver with Karma [$50] Chromedriver with Karma [$100] Aug 21, 2014
@pirog
Copy link

pirog commented Aug 21, 2014

+1 on this... added to the bounty via https://github.com/kalabox/kalabox

@mikemilano
Copy link
Author

Thanks Mike! ... That's the project Roger, in case you needed any context. Not much there yet. We're trying to get the angularjs testing architecture working with node-webkit before we get too much further.

@rogerwang
Copy link
Member

Haven't tried with Karma, but this python driver script works for me with 0.10.2:

import time
from selenium import webdriver

driver = webdriver.Chrome('/home/roger/Download/node-webkit-v0.10.2-linux-x64/chromedriver')  # Optional argument, if not specified will search path.
driver.get('http://www.google.com/xhtml');
time.sleep(5) # Let the user actually see something!
search_box = driver.find_element_by_name('q')
search_box.send_keys('ChromeDriver')
search_box.submit()
time.sleep(5) # Let the user actually see something!
driver.quit()

@pirog
Copy link

pirog commented Aug 22, 2014

very nice! we will def test this out.

@nDmitry
Copy link

nDmitry commented Aug 28, 2014

I have solved all the issues with node-webkit + Karma/Protractor I've run into yesterday, so I'll just share my experience.

Create a symlink to node-webkit.app/nw.exe/nw depending on your platform (you can create all of them and add to git, this way you'll get support for all platforms) along with node-webkit's chromedriver you have downloaded and it will find the binaries. I use this directory structure:

- node_modules/nodewebkit/nodewebkit/node-webkit.app
- support/chromedriver
- support/node-webkit.app -> ../node_modules/nodewebkit/nodewebkit/node-webkit.app
- karma.conf.js
// karma.conf.js

browsers: ['NodeWebkit']

And a custom launcher for node-webkit: https://github.com/nDmitry/karma-nodewebkit-launcher (you can install it from git as this fork isn't published on npm).

@nDmitry
Copy link

nDmitry commented Aug 28, 2014

Protractor works too, but it requires a bit of additional configuration:

'use strict';

exports.config = {
    chromeDriver: './support/chromedriver', // relative path to node-webkit's chromedriver
    chromeOnly: true, // starting Selenium server isn't required in our case
    specs: ['test/e2e/**/*.js'],
    baseUrl: 'file:///absolute/path/to/your/project/index.html',
    rootElement: 'html', // specify a correct element where you bootstrap your AngularJS app, 'body' by default

    onPrepare: function() {

        // By default, Protractor use data:text/html,<html></html> as resetUrl, but 
        // location.replace (see http://git.io/tvdSIQ) from the data: to the file: protocol is not allowed
        // (we'll get ‘not allowed local resource’ error), so we replace resetUrl with one
        // with the file: protocol (this particular one will open system's root folder)
        browser.resetUrl = 'file://';

        // This isn't required and used to avoid ‘Cannot extract package’ error showed
        // before Protractor have redirected node-webkit to resetUrl.
        browser.driver.get('file://');
    }
};

@mikemilano
Copy link
Author

@nDmitry Thanks for this! I am much closer now.

Are there any entries in karma.conf that you are defining the items in the support/ path? I'm not sure how karma knows to pick those up.

I've installed the plugin, and I get a webkit looking thing popping up (all white), but it hangs and times out with the error that it cannot start webkit.

@nDmitry
Copy link

nDmitry commented Aug 28, 2014

@mikemilano there are no such entries, AFAIR Karma don't need that driver at all, it is for WebDriver/Selenium only. Basically, launchers just define paths to binaries.

I get a webkit looking thing popping up (all white), but it hangs and times out with the error that it cannot start webkit

Don't know, here is my entire karma.conf.js:

'use strict';

module.exports = function(config) {
    config.set({

        // base path that will be used to resolve all patterns (eg. files, exclude)
        basePath: '',


        // frameworks to use
        // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
        frameworks: ['jasmine'],


        // list of files / patterns to load in the browser
        files: [
            // a lot of application files first
            'test/unit/**/*.js'
        ],


        // list of files to exclude
        exclude: [

        ],


        // preprocess matching files before serving them to the browser
        // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
        preprocessors: {
            'js/**/*.js': ['coverage']
        },


        // test results reporter to use
        // possible values: 'dots', 'progress'
        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
        reporters: ['progress', 'coverage'],


        // web server port
        port: 9876,


        // enable / disable colors in the output (reporters and logs)
        colors: true,


        // level of logging
        // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
        logLevel: config.LOG_INFO,


        // enable / disable watching file and executing tests whenever any file changes
        autoWatch: false,


        // start these browsers
        // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
        browsers: ['NodeWebkit'],


        // Continuous Integration mode
        // if true, Karma captures browsers, runs the tests and exits
        singleRun: false,

        coverageReporter: {
            type : 'html',
            dir : 'coverage/',
            subdir: function(browser) {
                return browser.toLowerCase().split(/[ /-]/)[0];
            }
        }
    });
};

Ensure that you have nodewebkit package installed from npm.

@mikemilano
Copy link
Author

Oh, so is the support/ directory just for protractor? That step was throwing me off in terms of karma. My testing showed it was loading webkit binary from the node_modules/webkit/... either way. It's 3am, I had to give it a shot before I could sleep. :) ... I'll post results once I spend a some more time with it. Thanks for posting your solution.

@nDmitry
Copy link

nDmitry commented Aug 28, 2014

Yeah, the support/ directory keeps chromedriver for Protractor and symbolic links to node-webkit binaries for chromedriver. It is explained on this page:

The only difference of the binary files from the official one is: chromedriver will search for node-webkit binaries (nw, nw.exe) in the same directory (on OSX it's the same directory with node-webkit.app).

That's why we need to place the binaries (or symlinks to them) along with chromedriver.

@mikemilano
Copy link
Author

@nDmitry I got Karma testing successfully, thanks!

Now I'm just trying to finish up by getting protractor working.

I setup my protractor config as in your example. The only difference is my baseUrl, which I have confirmed is definitely the correct path.

When I run protractor protractor.conf.js, it launches the window to: file://

It's definitely picking up the chromedriver and .app in support because it won't get that far if a change either one.

Can you think of anything else I may be missing?

@nDmitry
Copy link

nDmitry commented Aug 29, 2014

file:// is a reset URL (if you don't call browser.driver.get() as in my example), that means Protractor is waiting for Angular bootstrapping to redirect to a baseUrl and run your specs.

What's the output in your console, what does the first spec look like and how do you bootstrap your app (ng-app directive or manual bootstrapping)?

@mikemilano
Copy link
Author

baseUrl is getting stripped to file:/// when it gets to the test because protractor uses url.resolve to join baseUrl and the argument to browser.get(). (angular/protractor#508)

As a result, when I run browser.get('/dashboard') with a fully defined absolute baseUrl in my protractor config, I see protractor hang because it is attempting to load AngularJS at file:///dashboard.

The error is: "Error: Angular could not be found on the page file:///dashboard : retries looking for angular exceeded"

The app is bootstrapped with ng-app in the body element of index.html. The rootElement of the protractor config is set to body.

config: https://github.com/kalabox/kalabox/blob/master/test/protractor.conf.js
test: https://github.com/kalabox/kalabox/blob/master/src/modules/dashboard/test/e2e/main.spec.js

@mikemilano
Copy link
Author

I got it working by modifying how protractor joins the baseUrl with the destination.

I posted an issue about it here: angular/protractor#1266
Forked and fixed it here: https://github.com/mikemilano/protractor

I'm interested in what your tests look like if you had it working before. This was the only way I could see it working without muddying up my tests.

@nDmitry
Copy link

nDmitry commented Aug 30, 2014

Your baseUrl must be an absolute path like file:///Users/user/projects/project/index.html. Then Protractor will resolve it with what you pass to browser.get(), e.g. #/path.

@mikemilano
Copy link
Author

@nDmitry I'm using path.resolve() in the protractor config to convert a relative path to an absolute path so we don't need to change that value based on the environment you're working on. It renders the absolute path just fine and I get the same results as if I hard code the absolute path.

Protractor runs baseUrl through url.resolve() which strips the absolute path down to file:///. It does it in lib/protractor.js. That's how I don't understand how you have it working. If you log the value of url.resolve('file://your/absolute/path/index.html', '#/path') you will see what I mean.

But, you have it working so maybe it's an environment thing.

It looks like we're good to go. I really appreciate the help. We feel a lot better about using AngularJS with NodeWebkit.

@nDmitry
Copy link

nDmitry commented Aug 30, 2014

@mikemilano thanks, path.resolve() works like a charm, I've confirmed that and got rid of a hardcoded absolute path. Here's the beginning of my specs with comments:

it('foo', function() {

    // I need to test my authentication mechanism first before Angular has bootstrapped,
    // so I redirect WebDriver directly calling get() on a driver instance (otherwise
    // Protractor will start its initialization, which I don't want yet)
    browser.driver.get('file://' + path.resolve('./index.html'));

    // I do all further interactions using the driver and avoiding Protractor's methods
    // since they don't relate to Angular
    browser.driver.switchTo().frame(driver.findElement(by.css('.frame')));

    // more here

    // Now I switch back to the main context and call `browser.get()` to initialize
    // Protractor
    browser.driver.switchTo().defaultContent();
    browser.get('#/');

    // This one seems important
    browser.waitForAngular();

    // Now I use Protractor's methods as Angular has bootstrapped
    element(by.model('task.description')).getAttribute('placeholder').then(function(value) {
        expect(typeof value).toBe('string');
    });
});

I guess you should try to call browser.driver.get() with your baseUrl from onPrepare callback or inside the spec as I do.

@pirog
Copy link

pirog commented Sep 3, 2014

@nDmitry, we bounty-sourced this thing as well so please feel free to claim the bounty!

@nDmitry
Copy link

nDmitry commented Sep 3, 2014

@pirog thanks, I just did.

@pirog
Copy link

pirog commented Sep 3, 2014

Accepted the bounty as one of the backers. pinging @mikemilano to follow suit :)

@jandersonBB
Copy link

It is unclear from this thread, what actually fixed the error? I'm seeing the following:

UnknownError: unknown error: cannot find Chrome binary

The chromedriver binary was downloaded from http://dl.node-webkit.org/, and it has been manually placed in the same directory as my node-webkit binary.

My protractor configuration file:

// An example configuration file.
exports.config = {
// Do not start a Selenium Standalone sever - only run this using chrome.
chromeOnly: true,
chromeDriver: '/Users/janderson/Git/sena-offline/webkitbuilds/releases/sena-offline/mac/sena-offline.app/Contents/MacOS/chromedriver',

// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome'
},

// Spec patterns are relative to the current working directly when
// protractor is called.
specs: ['*/.js'],
baseUrl: 'file:///Users/janderson/Git/sena-offline/webkitbuilds/releases/sena-offline/mac/sena-offline.app/Contents/Resources/app.nw/index.html',
rootElement: 'html',
onPrepare: function() {

// By default, Protractor use data:text/html,<html></html> as resetUrl, but
// location.replace (see http://git.io/tvdSIQ) from the data: to the file: protocol is not allowed
// (we'll get ‘not allowed local resource’ error), so we replace resetUrl with one
// with the file: protocol (this particular one will open system's root folder)
browser.resetUrl = 'file://';

// This isn't required and used to avoid ‘Cannot extract package’ error showed
// before Protractor have redirected node-webkit to resetUrl.
browser.driver.get('file://');

},
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
};

@mikemilano
Copy link
Author

  1. nodewebkit needs to be a dependency of the project. i.e. installed in ./node_modules

  2. We used Dmitry's method of the support directory with the nw binary symlinked, then the chromedriver placed in that directory as well. See Dmitry's 2nd post here where he defines the path for chromedriver.

  3. We patched protractor to handle the file:// path. The patch was just accepted here: Modified protractor to support testing node-webkit by using string conca... angular/protractor#1270 .. I'm not sure how the versions work but it's in the master branch now.

The last piece is the grunt-protractor module. It has a dependency on protractor, so it also has to be using a version of protractor that has the patch. We ended forking both projects to use them until the normal dependencies resolve with the patches that fix it.

I think your problem is around 2. above though.

@nDmitry
Copy link

nDmitry commented Sep 6, 2014

it has been manually placed in the same directory as my node-webkit binary

It hasn't as far as I can see from this path: /Users/janderson/Git/sena-offline/webkitbuilds/releases/sena-offline/mac/sena-offline.app/Contents/MacOS/chromedriver.

In case you really want to use node-webkit from a build of your app, the proper path to place chromedriver will be /Users/janderson/Git/sena-offline/webkitbuilds/releases/sena-offline/mac/chromedriver. Also your .app file should be renamed to node-webkit.app.

But it's really better to install separate version of node-webkit somewhere and make a symlink.

@rogerwang rogerwang changed the title Chromedriver with Karma [$100] Chromedriver with Karma Sep 10, 2014
@merqlove
Copy link

Right, also here https://github.com/shama/nodewebkit. Nice point for external nw.

@samuelcastro
Copy link

Hi guys, my karma test is working, but protractor is not working, I'm with this error:
UnknownError: unknown error: automation extension cannot be found

Can you help me?

samuelcastro:test samuel$ grunt protractor --suite users
Running "protractor:functional" (protractor) task
Using ChromeDriver directly...

/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:113
var template = new Error(this.message);
^
UnknownError: unknown error: automation extension cannot be found
(Session info: chrome=content shell)
(Driver info: chromedriver=2.2,platform=Mac OS X 10.9.4 x86_64)
at new bot.Error (/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:113:18)
at Object.bot.response.checkResponse (/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/response.js:106:9)
at /Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:319:20
at /Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1582:15
at webdriver.promise.ControlFlow.runInNewFrame_ (/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1640:20)
at notify (/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:444:12)
at notifyAll (/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:422:7)
at resolve (/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:400:7)
at fulfill (/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:512:5)
at /Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1507:10
==== async task ====
WebDriver.manage().window().setSize(1300, 800)
at webdriver.WebDriver.schedule (/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:302:15)
at webdriver.WebDriver.Window.setSize (/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:1331:23)
at exports.config.onPrepare (/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/test/conf/protractor-e2e.conf.js:16:42)
at Runner.runFilenameOrFn_ (/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/lib/runner.js:62:27)
at Runner.runTestPreparers (/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/lib/runner.js:94:21)
at Object.exports.run (/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/lib/frameworks/jasmine.js:38:10)
at driverprovider_.setupEnv.then.then.then.testResult (/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/lib/runner.js:263:28)
at _fulfilled (/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/Volumes/DATA/DEVELOPMENTS/PROJECTS/app/desktop/node_modules/protractor/node_modules/q/q.js:826:30)

Test failed but keep the grunt process alive.

Done, without errors.

@rogerwang rogerwang changed the title Chromedriver with Karma Chromedriver with Karma [$100 awarded] Feb 21, 2015
@marnen
Copy link

marnen commented Mar 3, 2015

I'm still getting "cannot find Chrome binary" errors on Mac OS X 10.10 with Protractor. I've tried linking support/nw and support/nodewebkit to node_modules/.bin/nw and node_modules/nw/bin/nw, and support/node-webkit.app and support/nwjs.app to node_modules/nw/nwjs/nwjs.app, and so on. Nothing works with Protractor, although I've been able to get Karma to launch nw through Chromedriver by pointing it to ./node_modules/.bin/nw. Help?

@marnen
Copy link

marnen commented Mar 3, 2015

Ah...looks like the name of the Mac app that Chromedriver searches for didn't get changed from node-webkit.app to nwjs.app: https://github.com/nwjs/chromium.src/blob/nw12/chrome/test/chromedriver/chrome/chrome_finder.cc#L91

@marnen
Copy link

marnen commented Mar 3, 2015

Got it! You can specify the Chrome binary in protractor.conf.js:

'use strict';

exports.config = {
  chromeDriver: './support/chromedriver', // relative path to node-webkit's chromedriver
  chromeOnly: true, // starting Selenium server isn't required in our case
  capabilities: {
    browserName: 'chrome',
    chromeOptions: {
      // Path to NW.js binary goes here!
      binary: process.env.PWD + '/support/nwjs.app/Contents/MacOS/nwjs'
    }
  },
  specs: ['test/e2e/**/*.js'],
  baseUrl: 'file://' + process.env.PWD + '/build/',
  rootElement: 'html', // specify a correct element where you bootstrap your AngularJS app, 'body' by default

  onPrepare: function() {

      // By default, Protractor use data:text/html,<html></html> as resetUrl, but
      // location.replace (see http://git.io/tvdSIQ) from the data: to the file: protocol is not allowed
      // (we'll get ‘not allowed local resource’ error), so we replace resetUrl with one
      // with the file: protocol (this particular one will open system's root folder)
      browser.resetUrl = 'file://';

      // This isn't required and used to avoid ‘Cannot extract package’ error showed
      // before Protractor have redirected node-webkit to resetUrl.
      browser.driver.get('file://');
  }
};

@marnen
Copy link

marnen commented Mar 3, 2015

This should probably go in the wiki. I'll write something up if folks want it.

@brian-mann
Copy link

How are you guys dealing with logic that goes through require("nw.gui").App.manifest ? Unless I'm mistaken, all of the examples show protractor connecting to an external server. But usually when you launch your NW app it's through nw directly, which looks for your package.json, among other things.

When I run my tests, I'll get Unexpected end of input invoking App.manifest because naturally NW hasn't processed package.json. Am I missing something?

@marnen
Copy link

marnen commented Mar 25, 2015

@brian-mann If I understand you correctly, you're missing the use of the special NW version of Chromedriver.

@bhalajin
Copy link

I am facing the same issues reported by @samuelcastro (commented on Oct 22, 2014). What is the solution for the above issue?

Driver info: chromedriver=2.13, platform=Windows NT 6.1 SP1 x86_64

@anjanapaulose
Copy link

@brian-mann, where you able to solve the issue you faced? I am also not able to run protractor if I use require for nw or other node modules. I am using chrome driver for nw.

@anjanapaulose
Copy link

Actually, other node modules like fs, and my custom module which has methods to be invoked are working. When I try, var nw = require("nw.gui"), its also returns, The issue if I access nw.App or anything, the result is a json object which has only strings , the inner contents are not json objects anymore. eg: I get nw.App , but not nw.App.manifest.

@reynoldsalec
Copy link

reynoldsalec commented Jun 16, 2016

Note to anyone who is trying to run Protractor tests with NWJS 0.13+, with the change over to the chrome-extension:// protocol, I noticed I had to change a couple things:

  • Even if you've set baseUrl in the config file, that baseUrl doesn't seem to automatically append to the paths you call using browser.get():
browser.get('/dashboard'); // v0.12
browser.get(browser.baseUrl + '#/dashboard'); // v0.13+

Once I switched these over and made sure to replace any other references to the "file://" protocol, my tests ran as they did on v0.12.

@vsathyak
Copy link

vsathyak commented Sep 8, 2016

Hi @reynoldsalec

Can u please share your conf.js? I would like to refer it since my attempt to run protractor test with nwjs 0.15.4 is failing.

Please see my conf.js and let me know if there is anything wrong.(This was working fine with nwjs : 0.12.3).

exports.config = {
    directConnect: true,
    chromeDriver: '/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.23',

    capabilities: {
        browserName: 'chrome',
        chromeOptions: {
            binary: '/Applications/....../..../MacOS/nwjs'
        }
    },
    baseUrl: '',
    rootElement: 'html',
    onPrepare: function() {
        browser.resetUrl = '';
        // browser.driver.get('file://');
    },

    getPageTimeout: 150000,
    allScriptsTimeout: 150000,
    framework: 'jasmine2',
    specs: ['../test/abc/*_spec.js'],
    jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 150000
    }
};

And here is the error which I am getting :

dhcp-10-150-29-108:project test$ protractor conf.js
[12:04:10] I/direct - Using ChromeDriver directly...
[12:04:10] I/launcher - Running 1 instances of WebDriver
[12:05:10] E/launcher - unknown error: unable to discover open pages
  (Driver info: chromedriver=2.23.409710 (0c4084804897ac45b5ff65a690ec6583b97225c0),platform=Mac OS X 10.11.3 x86_64)

[12:05:10] E/launcher - WebDriverError: unknown error: unable to discover open pages
  (Driver info: chromedriver=2.23.409710 (0c4084804897ac45b5ff65a690ec6583b97225c0),platform=Mac OS X 10.11.3 x86_64)
    at WebDriverError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:5)
    at Object.checkLegacyResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:639:15)
    at parseHttpResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:538:13)
    at client_.send.then.response (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:472:11)
    at ManagedPromise.invokeCallback_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1379:14)
    at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
    at TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
    at asyncRun (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2820:25)
    at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:639:7
    at process._tickCallback (internal/process/next_tick.js:103:7)

From: Task: WebDriver.createSession()
    at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:329:24)
    at Driver (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/chrome.js:778:38)
    at Direct.getNewDriver (/usr/local/lib/node_modules/protractor/built/driverProviders/direct.js:68:26)
    at Runner.createBrowser (/usr/local/lib/node_modules/protractor/built/runner.js:190:43)
    at /usr/local/lib/node_modules/protractor/built/runner.js:264:30
    at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:796:13)
    at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:556:49
    at runSingle (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:137:13)
[12:05:10] E/launcher - Process exited with error code 199
dhcp-10-150-29-108:project test$ 

kierans added a commit to kierans/nw.js that referenced this issue May 1, 2018
If we're going to update the Helper app binary, why not the main app binary?

This relates to nwjs#2229
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests