No description, website, or topics provided.
Java JavaScript Shell
Failed to load latest commit information.

#JUnit-Karma test suite runner# This library allows you to run a karma test suite with a java JUnit test runner.

A full running demo for using the runner can be found at


* important: reinstall node modul karma-remote-reporter to v0.2.x
* receiving test results via raw tcp socket communication instead of websockets
* removed java 1.7 specific stuff to be compatible with java 1.6
* added maven-shade-plugin to the package phase to build an uber-jar which includes all required dependencies
* important: reinstall karma-remote-reporter to get the latest version, which is now compatible to karma 0.12.x
* important: reinstall karma-remote-reporter to get the latest version, which fixes a bug when running multiple junit-karma-testrunner simultaneously without getting a "port already in use"-exception
* IMPORTANT: reinstall karma-remote-reporter to get the latest version, which fixes critical reporting errors
* the JUnit testrunner will fail, when karma reports syntax errors

###Prerequisites### To combine the javascript karma test runner with a java JUnit runner you need this library and our karma-remote-reporter. The karma-remote-reporter is a karma plugin which you can add easily in your "karma.conf":

module.exports = function (config) {
      basePath: '../.',
        files: [

        browsers: ['PhantomJS'],
        reporters: ['junit','remote'],
        frameworks: ["jasmine"],
        autoWatch: false,
        singleRun: true,
        junitReporter: {
            outputFile: 'target/test_out/unit.xml',
            suite: 'unit'
        remoteReporter: {
            host: 'localhost',
            port: '9889'
        plugins: [

To add the remote reporter plugin add 'karma-remote-reporter' to the plugin section and add 'remote' to the reporters section. To configure the host and port where the karma remote reporter should send the test results use the remoteReporter section.

The test results will send by the remote reporter to a server which is in the java world e.g. this JUnit-karma-testrunner. All you need is a normal java test class:

@KarmaTestSuiteRunner.KarmaConfigPath("") // use several test classes with different karma configurations for e.g. running unit or e2e tests
public class KarmaTestSuiteRunnerBasicTestFixture {

    public static void setupTestSzenario(){
    public static void cleanupTestSzenario(){

With the KarmaTestSuiteRunner annotations you can configure your the server where the test results will be reported and the karma config. With @BeforeClass and @AfterClass you can setup and cleanup your test scenario when running e2e tests.

There're several more configuration points using the annotations in KarmaTestSuiteRunner: de.is24.util.karmatestrunner.junit.KarmaTestSuiteRunner.KarmaProcessName -> defaults to "karma" for linux and mac os, "karma.cmd" for windows os

de.is24.util.karmatestrunner.junit.KarmaTestSuiteRunner.KarmaProcessArgs -> defaults to "start"

de.is24.util.karmatestrunner.junit.KarmaTestSuiteRunner.KarmaStartupScripts -> you can setup the karma environment e.g. path setup or browser bin location variables by yourself via a shell or batch script

de.is24.util.karmatestrunner.junit.KarmaTestSuiteRunner.KarmaRemoteServerPort -> defaults to 9889

You can overwrite all annotations by using the following system properties:




With the system properties you can overwrite the environment specifics to run the tests on a dev machine and a ci server without code changes...