PhantomJS teamcity configuration

In the teamcity configuration, I have a build step that runs PhantomJS tests. This is the "Command Line" step with a custom script. The script looks like this:

% PhantomJS% CreateEntityPopupTest \ unit.htm
% PhantomJS% ExcelImportPopupTest \ unit.htm
... and etc.

Thus, it runs every qunit test package listed on the htm page. But I could not find a way to point PhantomJS (phantomjs-1.9.0-windows) to a folder, and not to a single file. Therefore, there is no need to change the configuration every time we add new files with tests.

+5
source share
1 answer

I used Chutzpah to wrap this behavior for use in TeamCity. Chutzpah can run tests written in QUnit, Jasmine, or Mocha, and uses PhantomJS as a headless test leader.

https://github.com/mmanela/chutzpah

I installed it on the assembly agents and added it to the path on the machine.

Now I just add a command line command-line step called "Run JS Test" in my build template. The command line is simple:

chutzpah.console.exe %jsTestFolder% 

Then I just define a parameter for each project pointing to a folder ... chutzpah does the rest.

0
source

All Articles