Continuous Integration / Testing Javascript Code for Different Browsers

I am writing a feature set in Javascript intended to be executed inside a browser (without server-side Javascript).

How to run unit and performance tests again in them in different browsers and track the results for each assembly?

  • Tests should run in browser
  • Test results should be presented in separate text or html file.
  • Target browsers are Internet Explorer 7 and 8, latest Firefox, latest Chrome, latest Safari
  • I can set up a dedicated CI server and virtual machines for free
+8
performance javascript unit-testing continuous-integration
source share
4 answers

I use the Jasmine framework for testing and JSTestDriver. I also configured both Hudson and TeamCity for CI as part of the evaluation, although I ultimately decided to install TeamCity.

Jasmine is a very nice BDD framework that also provides mocking and gating functionality.

The JSTestDriver server allows any browser to connect to it, whether local or remote, as Vojta already pointed out. I managed to connect browsers from Windows and MAC computers, for example, as well as iPhone ... it is quite possible to connect other mobile browsers if mobile development tickles your imagination. JSTestDriver will create JUnit XML result files that either Hudson or TeamCity will be able to parse and report.

As Vojta noted, the Eclipse plugin is available for JSTestDriver. I recently switched to WebStorm 1.0, and now 2.0 (the IDE from JetBrains), and the plugin exists for this IDE, although it is somewhat erroneous. WebStorm is excellent, by the way, regarding the development of JavaScript.

We also write server-side JS code, and Jasmine also did a great job of this.

I installed and configured JsTestDriver / TeamCity in the Amazon cloud, and I can run Jasmine tests without problems.

In short, between the three solutions (Jasmine, JSTestDriver and TeamCity) there are many plugins / adapters / recipes that allow any number of settings or configurations. This does not mean that other combinations will not work ... just for me, these combinations have proven themselves so far.

+9
source share

Hi, you can take a look at JQunit, a jQuery-based javascript module testing platform. Available here http://code.google.com/p/jqunit/

+1
source share

Jasmine (http://pivotal.github.com/jasmine) is an independent BDD environment for testing JavaScript.

It would be very easy to use the Jasmine and Jasmine Ruby gem to set up the run matrix against different browsers (Selenium controls the gem browser) and report them through your CI, as you suggest. It should be simple.

+1
source share

I am using JsTestDriver to develop JS. This is a test runner (not a unit test framework), so you can use it with Jasmine or QUnit.

You just start the server and capture browsers (maybe a remote browser too!), And then run the tests in all of these browsers via the command line.

There is a good plugin for eclipse.

For more information on how to set up a continuous build environment, see http://code.google.com/p/js-test-driver/wiki/ContinuousBuild

+1
source share

Source: https://habr.com/ru/post/649844/


All Articles