Main Page

From JavaScript JUnit Bridge (inactive) Wiki
Jump to: navigation, search

The JS-JUnit-Bridge enables execution of JavaScript tests inside the junit framework without the need to write test methods in junit.

In detail, it is a junit runner, that bridge the run and results of js-unit-test to junit. The runner can use different parser to support different JavaScript unit testing frameworks. Currently only qunit is supported but other could be added easily (add a feature-request).


The background for writing this bridge was the need to run complex javascript tests (with acceptable performance) inside the maven life-cycle, so the goal was js test automation for local development and also continues integration scenarios in standalone and/or java/groovy projects.

Getting Started

1. We need a valid Version of the JS-JUnit-Bridge. Let's use Maven for this ...

    <!-- js-junit-bridge maven repository -->
        <name>evolvis Maven2 Repository</name>
    <!-- js-junit-bridge dependancy -->

2. Create a 'index.html' with included JS-Unit-Tests under '/path/to/test/index.html'

3. Write a JUnit-Test and use the 'JsJUnitBridgeRunner', '@JsJUnitBridgeConfiguration' and JS-UnitParser for configuration

	uri = "file://path/to/test/index.html",
	resultParser = QUnitParser.class,
	localWebDriverConfigurations = {
			@WebDriverConfiguration(driver = FirefoxDriver.class)
public class LocalTest {}

4. Thats it.