FINRAOS / MSL

MSL (pronounced 'Missile') stands for Mock Service Layer. Our tools enable quick local deployment of your UI code on Node and mocking of your service layer for fast, targeted testing.
http://finraos.github.io/MSL/
Apache License 2.0
32 stars 24 forks source link

Create karma-msl plugin #29

Closed kood1 closed 10 years ago

kood1 commented 10 years ago

Create a plugin for karma to run as a framework. With the plugin added to the karma config, msl-server should start automatically before executing the tests (jasmine, mocha, etc). In addition, the HTML fixture containing an iframe (to load the app running on the msl-server) should be added automatically to the runner HTML page before executing the tests.

Karma - https://github.com/karma-runner/karma

kood1 commented 10 years ago

I figured out how to run the tests in Karma using Jasmine! At high-level:

You need to have msl-server running before running karma tests. You also need to use the port number specified in your karma config as your port number when calling msl-client APIs.

Similar approach can be followed for Mocha tests as well.

I will write a wiki page or create documentation on github io page soon.

kood1 commented 10 years ago

The plugin should essentially need to do the following:

kood1 commented 10 years ago

We should also create a light library which drives iframe through jQuery:

ransha commented 10 years ago

Finished the basic POC for karma plugin, it contains the following feature:

kood1 commented 10 years ago

Thanks @ransha. Let's plan to push out alpha version of karma-msl plugin to npm next week.

kood1 commented 10 years ago

The light library driving iframe should be part of msl-client-browser library

kood1 commented 10 years ago

@ransha, @bryantrobbins, @JacobSheppard - just to be clear, we did decide that we will create a separate msl-runner library instead of adding to msl-client-browser for the basic functions like openApp(), triggerEvent() and get iframe, right?

kood1 commented 10 years ago

@ransha, @bryantrobbins, @JacobSheppard - browser-helper.js? iframe-helper.js? iframe-driver.js?

kood1 commented 10 years ago

Reference #35 for the app container driver library

kood1 commented 10 years ago

Made a PR to cdnjs - https://github.com/cdnjs/cdnjs/pull/3912

kood1 commented 10 years ago

Updated msl-client-browser example on getting started doc with version 1.0.2. This is using the appcontainer-driver.js.

kood1 commented 10 years ago

BTW, we need to use karma-jasmine 2.0

kood1 commented 10 years ago

Updated msl-client-browser to 1.0.3 to include https://github.com/FINRAOS/MSL/issues/37

kood1 commented 10 years ago

@ransha, we should include both https://github.com/FINRAOS/MSL/blob/master/msl-client-browser/mockapi-browser.min.js and https://github.com/FINRAOS/MSL/blob/master/msl-client-browser/appcontainer-driver.min.js as part of the plugin.

kood1 commented 10 years ago

Package published on npm - https://www.npmjs.org/package/karma-msl

Code published here - https://github.com/FINRAOS/karma-msl