GithubHelp home page GithubHelp logo

karma-webdriver-launcher's Introduction

karma-webdriver-launcher

A plugin for Karma to launch Remote WebDriver instances.

Usage

$ npm install karma-webdriver-launcher

In your karma.conf.js file (e.g. using SauceLabs Connect - you need to have a scout tunnel open for this to work!):

module.exports = function(karma) {

  var webdriverConfig = {
    hostname: 'ondemand.saucelabs.com',
    port: 80,
    user: 'USERNAME',
    pwd: 'APIKEY'
  }


  ...

    config.set({

      ...

      customLaunchers: {
        'IE7': {
          base: 'WebDriver',
          config: webdriverConfig,
          browserName: 'internet explorer',
          platform: 'XP',
          version: '10',
          'x-ua-compatible': 'IE=EmulateIE7',
          name: 'Karma',
          pseudoActivityInterval: 30000
        }
      },

      browsers: ['IE7'],

      ...

    });

pseudoActivityInterval

Interval in ms to do some activity to avoid killing session by timeout.

If not set or set to 0 - no activity will be performed.

karma-webdriver-launcher's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

karma-webdriver-launcher's Issues

"wd" module dependency should be updated to fix Firefox and IE issues

Both geckodriver and IEDriverServer have been upgraded to use the new W3C protocol. The "wd" module, which "karma-webdriver-launcher" depends on, has just been updated for compatibility with the new protocol.

karma-webdriver-launcher should depend on wd v1.8.0. If you are using the launcher in the mean time, you can work around this by also depending on wd v1.8.0 directly in your own project.

XP configuration

Docs are not OK (at least for me):

customLaunchers: {
'IE7': {
base: 'WebDriver',
config: webdriverConfig,
browserName: 'internet explorer',
platform: 'Windows XP',
version: '10',
'x-ua-compatible': 'IE=EmulateIE7',
name: 'Karma'
}
},

Platform should be XP, and not 'Windows XP'.

Example tests?

Sorry to sound like such a n00b but how does one access the browser object to actually handle the webdriver? It would be great to have an example of how to write a simple test with this!

Thanks

Make sure it works with v0.10 and push to NPM

Hey, currently this plugin won't install with Karma 0.10, so I changed the peerDependency in package.json to make that work.

Can you please make sure the plugin works with v0.10 and push it to NPM ?

Stop Karma from Appium after executing the tests.

Hello All,

I am on the verge of automating Jasmine tests via karma runner within a Webview. Launched the iOS device with Hybrid App from Appium Webdriver using karma-webdriver-launcher plugin, the webpage in the hybrid app is hard-coded with Karma server's URL. Karma is able to run the test and aggregate the results, however, Karma is not stopped after all the tests, instead tries and gives up after 3 tries. SingleRun is set to true. I am testing WebRTC capabilities on iOS, I cannot test the same on Safari or any other browsers but for hybrid app.
One of the documents for Appium configuration points to https://github.com/appium/sample-code/tree/master/sample-code/examples/node
But, My concern is only API testing and little to do with UIAutomation. Do I need to run the mocha test script and start the appium, If so how do I do that and let Karma know when the tests are complete - perhaps send a driver.quit() from the any of the tests.

Any suggestions? I am not sure if this has anything to do with Karma.

Thanks,
Nuthan.

Can no longer specify custom capabilities

There was a change to the way spec is handled. The old code just used the spec object as specified, allowing driver-specific custom properties. Unfortunately, a change was made that now copies specific properties from "args", ignoring custom capabilities. This makes it impossible to run a custom version of firefox using the "firefox_binary" capability.

iOS launching Safari to 127.0.0.1:4723/Welcome

I'm trying to implement this in my Karma flow for a webapp using appium.

When I run karma, the iOS simulator launches and opens safari to 127.0.0.1:4723/Welcome

Karma is able to open every other browser (chrome, firefox, phantom, safari (all on mac)) to the service it creates (localhost:9876). Is this something that needs to be set in the config or am I going about something fundamentally wrong?

My setup is as follows:

var webdriverConfig = {
    hostname: '192.168.10.126',
    port: 4723
}

and

customLaunchers: {
        'iOS-Safari' : {
            base: 'WebDriver',
            platformName: "iOS",
            deviceName: 'iPhone 6 Plus',
            config: webdriverConfig,
            browserName: 'Safari',
            platform: 'iPhone 6 Plus',
            version: '8.4'
        }
    },

Appium config is as such:
screen shot 2015-08-19 at 16 14 58

Thank you

Not working with the docker image selenium/standalone-chrome:3.9 or newer

When using this driver to connect to selenium/standalone-chrome:3.9 or newer, one gets a confusing error message:

09 09 2020 13:25:20.208:DEBUG [WebDriver]: WebDriver config: {"remoteHost":true,"hostname":"localhost","port":4444}
09 09 2020 13:25:20.209:DEBUG [WebDriver]: Browser capabilities: {"platform":"ANY","testName":"Karma test","tags":[],"version":"","base":"WebDriver","browserName":"chrome"}
09 09 2020 13:25:21.558:DEBUG [WebDriver]: Session ID: undefined
09 09 2020 13:25:21.588:ERROR [WebDriver]: WebDriver command failed { spec:
   { platform: 'ANY',
     testName: 'Karma test',
     tags: [],
     version: '',
     base: 'WebDriver',
     browserName: 'chrome' },
  error:
   {"message":"[get(\"http://ip-of-host-running-karma-tests:9876/?id=99564073\")] Error response status: 6 Selenium error: No active session with ID url","status":6,"cause":{"sessionId":"url","value":{"error":"invalid session id","message":"No active session with ID url","stacktrace":""},"status":6}} }

Tried to use several configs, the session id is always undefined. Might be a bug somewhere in the wd dependency.

Workaround: Use the selenium/standalone-chrome:3.8 docker image.

Specifying Karma server URL for Android Simulator

I'm using Appium with Karma via the karma-webdriver-launcher to run my Jasmine tests on iOS and Android via their respective simulators (mac).

I've been able to configure it correctly to work with iOS but have hit a stumbling block with the android simulator. The Android simulator is launched correctly and it fires up the browser but it tries to hit the Karma server at localhost:9876 where the Karma server is located at 192.168.10.126:9876.

How can I specify the URL to pass to the simulator to open in the browser for testing (in the iOS implementation, there is a safariInitialUrl parameter but there doesn't appear to be an equivalent for Android)

Both the Karma server and Appium server are running on my local machine currently but when this gets deployed, the appium server will be running on a different machine to the Karma server so to be able to specify a URL is important

Here is my config:

var webdriverConfig = {
hostname: '192.168.10.126',
port: 4723
}
.

.....
'Browser-Android' : {
base: 'WebDriver',
platformName: "Android",
deviceName: 'Android',
config: webdriverConfig,
browserName: 'Browser',
platform: 'Android',
version: '8.4'
}
........

Not enough context in errors when WebDriver fails

We had an issue where one of the drivers in our Selenium grid was out of date and causing failures. The "get" command would return a 404.

But to find out what was causing it, we had to do a lot of digging and hacking around in the "wd" module to find out which of a dozen Selenium nodes was to blame. The error logging from Karma in this situation had no context whatsoever to help you identify which node was returning a bad response.

In the current versions of this launcher (master and 1.0.5), WebDriver failures show up through Karma's unhandled rejection callback. There's no error handling in the launcher itself.

I'll have a PR up soon to address this.

Default conf doesn't work with Karma version: 0.10.2

As title. The only way this would run on my setup was to change line 31 in index,js as follows;

self.browser = wd.remote(config.hostname, config.port);

As per the wd docs, using either a url string or named params failed to initialize the webdriver, but using index params just worked.

Newer version of wd needed for Firefox 23/24

The karma-webdriver-launcher currently has wd (webdriver) version "0.0.32" defined in the package.json. With Firefox 23 and 24 the browser will launch but never navigates to the url.

I tried karma-webdriver-launcher locally with wd version "0.1.5" and both Firefox 23 and 24 worked correctly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.