Skip to content

Problem with the Local Bindings for Nodejs while using a Windows system locally. #29

Open

Description

@shanep2300

Started a ticket with support but I figured I'd add an issue here.

It's inconsistent but the error is: "[browserstack.local] is set to true but local testing through BrowserStack is not connected".

Activity

  1. nakula commented on Aug 23, 2017

    @nakula

    can you provide more details. ?

  2. silicakes commented on Nov 8, 2017

    @silicakes

    I'm having the same issue:

    system

    nodejs: 8.5.0
    os: MacOS sierra

    config

    const browserstack = require('browserstack-local');
    const baseConfig = require("./base.wdio.conf").config;
    
    const availableBrowsers = ['iPhone6', 'iPhone5', 'Chrome', 'Firefox', 'Safari'];
    
    const capabilities = availableBrowsers.map(browser => {
        const capability = {
            name: browser,
            build: "BUILD_ID",
            project: "PROJECT",
            'browserstack.local': true,
            'browserstack.debug': true
        };
    
        if(!browser.toLocaleLowerCase().includes("iphone")) {
            capability.resolution = '1920x1080';
            capability.browserName = browser.toLowerCase();
            
        }
        return capability;
    });
    
    exports.config = Object.assign({}, baseConfig, {
        user: BS_USER,
        key: BS_KEY,
        updateJob: false,
        browserstackLocal: true,
        maxInstances: 5,
        capabilities,
        services: ['browserstack'],
        jasmineNodeOpts: {
            defaultTimeoutInterval: 10000,
            expectationResultHandler: function (passed, assertion) {
            }
        },
        onPrepare: (config, capabilities) => {
            console.log("Connecting local");
            return new Promise(function (resolve, reject) {
                exports.bs_local = new browserstack.Local();
                exports.bs_local.start({ 'key': config.key}, function (error) {
                    if (error) return reject(error);
                    console.log('Connected. Now testing...');
                    resolve();
                });
            });
        },
        onComplete: (capabilties, specs) => {
            exports.bs_local.stop(function () { console.log("ARGS::",arguments) });
        },
        beforeSuite: () => {
            console.log("suite");
        },
        beforeTest: test => {
            console.log(test);
        }
    });
    
  3. patthiel commented on Aug 17, 2018

    @patthiel

    We're encountering the same issue when attempting to use wdio-browserstack-service with browserstack.local set to true on windows. Any updates on this?

  4. irbrownie commented on Oct 12, 2018

    @irbrownie

    I figured out that their documentation is wrong. the keys for this are actually

     const browserStackConfig = {
            'browserstackUser': BROWSERSTACK_USER,
            'browserstackKey': BROWSERSTACK_KEY,
            commonCapabilities: {  
                'browserstack.debug': true,
                'browserstack.local': true,
                'acceptSslCerts': 'true',
                'browserstack.ie.enablePopups': true,
                'browserstack.edge.enablePopups': true,
            },
           }

    user/key fall under the toplevel config and shouldn't be added to capabilities. It also seems like adding localIdentifier to capabilites breaks it as well. Also notice that the creds aren't dot separated like on their site. They are camelCase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions