TDD_cycle

KARMA configuration (Testacular)

What is KARMA

Karma is a Test Driver. We still needs Jasmine and also node.js, gut and Xcode if we have an Apple product

karmaconnected

Test the installation

  • node -v
  • git –version

Download node.js src code

  • Install node.js
  • Install Xcode
  • Install git

Download Node.js or Installing Node.js via package manager

node.js

install karma (npm = mode project management):

install safari pluggin

iOS pluggin

mobile-tall-128x128

Install/download Jasmine.js

Jasmine

Associating KARMA and Jasmine (karma.conf.js)

Install rpm karma-jasmine

Selecting predefined browsers

karma init

result:
Config file:
generated at: “/Users/llanese/Sites/wi.mobile/wi.mobile/Source/WI.Web/tests/karma.conf.js”.
The files array is where we tell karma whats files we are going to load.

Add iOS to the browsers key in your Karma configuration:

RUN KARMA

cd path_to_your_app_directory

RUNNIG our THE REAL TEST:

KARMA configuration example: karma.conf.js

Configuration karma.conf.js PhantomJS

Just uncomment: browsers: [‘PhantomJS’]

KARMA AND JASMINE (package.json)

Conection to your MAC


KARMA and WebStorm/IntelliJ integration:

we don’t need to go and run the automatic-test. Test is integrated on out IDE:

karmaserver

  • Click on drop down and Edit Configuration.
    Working Directory:/Users/llanese/Sites/wi.mobile/wi.mobile/Source/WI.Web/tests
    Path to Node.js: /Users/llanese/Sites/node_modules/karma/bin/karma
    Application Parameters: start
    SAVE.
  • RUN THE SERVER.
    karma start karma.conf.js –browsers Chrome –auto-watch &
  • KILL PROCESSES:
    ps aux | grep karma
    kill N-Process
  • WebStorm Server Log

    serverlog


    Setting up EXTERNAL DEVICES:

    • MASTER AND SLAVE needs to be on the same wife net
    • Check if you can see master

    karma-phantomjs-launcher

    This plugin ships with Karma by default, so you don’t need to install it, it should just work 😉

    If you don’t have it: install the karma-phantomjs-launcher

    Normal error on installation:

    Workaround: install manually the version that works:

    and run it within the: karma-phantomjs-launcher folder (karma start)

    Final result


    Documentation

    If you want to connect to dome other device, as always check your IP: do ifconfig

    Karma

Leave a Reply

Your email address will not be published. Required fields are marked *

* Copy This Password *

* Type Or Paste Password Here *