AppSuite:RunTests: Difference between revisions

From Open-Xchange
No edit summary
 
(23 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<!-- !!! -->
<!-- PLEASE APPLY CHANGES ONLY TO THE NEW TECHNICAL DOCUMENTATION: wd/frontend/web/documentation -->
<!-- !!! -->
{{Stability-experimental}}
{{Stability-experimental}}
<div class="title">Running the ui tests</div>
<div class="title">Running the ui tests</div>
Line 4: Line 8:
__TOC__
__TOC__


This article explains the test system of the frontend. It is aimed at developers that want to work with the frontend, be it creating new plugins or applications or modifying existing code using BDD. Bringing a BDD testing infrastructure to the frontend is still a work in progress and subject to (breaking) changes.
This article explains the test system of the frontend. It is aimed at developers that want to work with the frontend, be it creating new plugins or applications or modifying existing code using BDD. Bringing a BDD testing infrastructure to the frontend is still a work in progress and subject to (breaking) changes. Please contribute to the stability by reporting any issues or ideas to [[User:J.ohny.b|me]].


== Libraries ==
== Libraries ==


* [http://pivotal.github.io/jasmine/| Jasmine] - JS BDD framework
* [http://pivotal.github.io/jasmine/ Jasmine] - JS BDD framework
* [http://sinonjs.org/| Sinon.JS] - Standalone test spies, stubs and mocks for JavaScript.
* [http://sinonjs.org/ Sinon.JS] - Standalone test spies, stubs and mocks for JavaScript.
* [http://karma-runner.github.io/| Karma Runner] - test runner
* [http://karma-runner.github.io/ Karma Runner] - test runner
* [http://chaijs.com/ Chai.js] - Assertion framework


== Setting up your system ==
== Setting up your system ==


You need at least ''node'' version 0.8 to use the latest version of ''karma'', which we need. To install the (latest version of) karma runner, run
=== Before starting: Mac only ===
  brew install phantomjs
...or link it in path and set executable bit on phantomjs binary yourself. After this follow the rest of the guide.
 
=== All ===
You need at least ''node'' version 0.8 to use the latest version of ''karma'', which we need. Karma will be installed with all other development dependencies. So just make sure you ran
 
    npm install
 
within your ui directory in the appsuite repository.
 
== Running the tests ==
 
The recommended way to start testing is to run:


    npm install karma@carnary -g
  grunt dev


in a shell. You might need admin rights to do that, use ''sudo'' if needed.
This will start a connect server, the karma
test server and a watcher for changes. Optionally, it is possible to connect multiple browsers to the host running the karma server (port 9876). Tests will run in those browsers, too. You can trigger a test run manually by running:


== Running the test ==
  grunt testrun


Running the tests is pretty easy.
in another terminal. This will be done automatically by the grunt watch
task, after any source file of your project has been changed.


    git clone https://git.open-xchange.com/git/wd/frontend/web
    git checkout -b develop origin/develop
    cd web/ui
    karma start


After that, open up a browser and point it to http://localhost:9876/.


[[Category:AppSuite]]
[[Category:AppSuite]]
[[Category:UI]]
[[Category:UI]]
[[Category:Development process]]
[[Category:Development process]]
[[Category:Testing]]

Latest revision as of 08:39, 11 February 2016


API status: In Development

Running the ui tests

This article explains the test system of the frontend. It is aimed at developers that want to work with the frontend, be it creating new plugins or applications or modifying existing code using BDD. Bringing a BDD testing infrastructure to the frontend is still a work in progress and subject to (breaking) changes. Please contribute to the stability by reporting any issues or ideas to me.

Libraries

Setting up your system

Before starting: Mac only

  brew install phantomjs

...or link it in path and set executable bit on phantomjs binary yourself. After this follow the rest of the guide.

All

You need at least node version 0.8 to use the latest version of karma, which we need. Karma will be installed with all other development dependencies. So just make sure you ran

   npm install

within your ui directory in the appsuite repository.

Running the tests

The recommended way to start testing is to run:

 grunt dev

This will start a connect server, the karma test server and a watcher for changes. Optionally, it is possible to connect multiple browsers to the host running the karma server (port 9876). Tests will run in those browsers, too. You can trigger a test run manually by running:

 grunt testrun

in another terminal. This will be done automatically by the grunt watch task, after any source file of your project has been changed.