Code Monkey home page Code Monkey logo

msl's People

Contributors

bryantrobbins avatar jacobsheppard avatar kood1 avatar na-na avatar peterdavehello avatar ransha avatar seoj avatar toberoo avatar warmachine64 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msl's Issues

Add extended HOW-TO for Browser client

Currently, only Java client has an extended HOW-TO documentation on the github io page. Extended documentation for Browser client should also be added.

Update tests to run from a Gradle script

Gradle is a build tool (like Ant, Maven) written in Groovy. It has a plugin for node (https://github.com/srs/gradle-node-plugin) and may be able to run Karma tests as well (http://stackoverflow.com/questions/22336537/how-to-run-js-karma-tests-from-gradle). Of course, it supports JUnit tests and the Maven project structure out of the box as well.

Since we have such a mix of languages, maybe we could look into a language-neutral build/test/deploy approach down the road.

Travis-CI build unstable after msl-server update

@ransha, @JacobSheppard - It appears that the Travis-CI builds got unstable after merging in the changes for the extensions. I am thinking it's to do with synchronization issue since it's throwing the following error:

JS 1.9.8 (Linux): Executed 3 of 8 SUCCESS (0 secs / 2.215 secs)
Intercept registered for: /services/getservice
Sent intercepted XHR for: /services/getservice
Unregisters path for:
PhantomJS 1.9.8 (Linux) ERROR
TypeError: 'undefined' is not an object (evaluating 'intrReq.xhr')
at /home/travis/build/FINRAOS/MSL/test/msl-client-browser/spec/MSLTestSpec.js:128
PhantomJS 1.9.8 (Linux): Executed 3 of 8 ERROR (0 secs / 2.215 secs)
JS 1.9.8 (Linux): Executed 3 of 8 ERROR (2.462 secs / 2.215 secs)

It's always happening on the 3rd test from the browser client test suite. Any ideas?

Create a new client in python (msl-client-python)

We need to create a client using python that can interact with msl-server. We need to create a library that supports calling of our 6 services. The package should be added to Python Package Index (PyPI).

ruby msl-client not changing anything.

I don't know if I'm using this correctly, but how am I supposed to run MSL on a port that's already used?

What I've been trying is:
Starting msl-server node_modules/msl-server/bin/msl --port=8001 --debug=true
Starting my app on 3082
Running a Test

RSpec.describe 'Tournament Settings Overview' do
  before :all do
    @browser = Watir::Browser.new(:firefox)
    @root = 'http://localhost:3082'
    @browser.goto @root

    @browser.text_field({id: 'user_login'}).set 'user'
    @browser.text_field({id: 'user_password'}).set 'password'
    @browser.button({name: 'commit'}).click
  end

  it 'is overridden by msl' do
    configurations = {}
    configurations['requestPath'] =  "#{@root}/api/tournaments/54e4c2bb29de79199e0074de" #<=Adding root is the only way I see to point it at the correct port, otherwise if I start msl-server up on this port, there's a conflict.
    configurations['responseText'] = '{"id":"54e4c2bb29de79199e0074de","name":"test 1234","short_name":"test asdf","abbrev":"TSTSDF","start_date":"2015-02-27","end_date":"2015-02-28","sport_id":26,"program_id":null,"program_name":null,"created_at":"2015-02-18T16:50:03Z","description":null,"org_id":7601,"primary_venue_id":null,"timezone":"America/Chicago","dst":null,"time_format":null,"current_season_id":"54e4c2bb29de79199e0074df","microsite_settings":{"standings":true,"schedule":true,"brackets":true,"seed_ranks":true,"auto_publish":true},"season_id":"54e4c2bb29de79199e0074df"}';
    configurations['contentType'] = 'application/json'
    configurations['eval'] = 'function (req,responseText) { return "[" + responseText + "]"; }'
    configurations['statusCode'] = '200'
    configurations['delayTime'] = '0'

    # Actually make the call  to register this information.
    setMockRespond('localhost', 8001, configurations.to_json)

    @browser.goto("#{@root}/tournaments/54e4c2bb29de79199e0074de/settings");

    expect(@browser.element({id: 'tournament-54e4c2bb29de79199e0074de-name'}).value).to eq "test 1234"
  end

  after :all do
    @browser.quit
  end
end

Improve client API to do proper waits

Instead of having users add arbitrary timeouts in their tests, we should add proper waits in our client API. For example, when we send setInterceptXHR(), we should wait until a response comes back from msl-server confirming the registration completed successfully.

Publish browser client JS to cndjs

We need to publish mockapi-browser.js to cdnjs so that users can include the browser client for their project.

TODO:

  • Create package json
  • Fork cndjs
  • Add library and files
  • Make pull request

Add extended HOW-TO for Node client

Currently, only Java client has an extended HOW-TO documentation on the github io page. Extended documentation for Node client should also be added.

Enhance integration/unit tests for msl-server

We currently have 5 tests testing 5 of our 6 services. We should a test to test the remaining service and add other variations for the existing services. We need to also add JS code coverage reporting.

Update test folder structure for standalone JasmineRunner test to work as well as e2e script

The e2e-script works with the current test folder structure, with browserResponse.txt file being inside of msl-client-browser folder. However, if someone follows the getting started doc and opens JasmineSpecRunner.html, the last test fails because of invalid file path to browserResponse.txt. We should create a new folder within "test" and make standalone Jasmine runner and e2e work accordingly.

Suggested path: test/responseFiles/browserResponse.txt

Enable browser and node client tests to run via CI on Travis

We currently run Java client tests only. We should enable browser and node client tests to run as well on Travis-CI.

For the browser client, we need to have a runner to execute the Jasmine tests on PhantomJS.

For the node client, we need to run the tests on SauceLabs.

Change Element.size() to Element.length() in appcontainer-driver.js

jQuery has deprecated size() and encourages length attribute to be used instead. We should change our size() method to length() and use .length in the eval call.

We need to make the change in following files:

  • msl-client-browser/appcontainer-driver.js
  • test/msl-clien-browser/spec/MSLTestSpec.js

Create config file for MSL server

We will create a config file so that user can put all the setting such as port, basedir, debug mode into to the file for the server to pick up, instead of typing in the command line.

Enhance mock response to handle request with parameters inside request body

Currently our mock response is registered and returned by using the request Url + Params as unique key. However, there can be situations that a server handles requests through the same URI and interact with the parameter inside request body.

We will enhance our MSL server to be able to parse the request body and form a unique key so that it can handle more complex mock responses.

Enhance appcontainer-driver.js with getElement methods

Instead of providing API to trigger jQuery methods, we should add an element class with the necessary interactive methods already provided, which wraps the jQuery methods. For instance, the user should be able to do:

  • getElement(locator).click();
  • getElement(locator).val();
  • getElement(locator).text();

The idea is to use eval on a frame instead of jQuery contents() so that all the events will get triggered inside the iframe.

Create karma-msl plugin

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

Handling multi layer iframes in appcontainer-driver.js

When we have sub-level iframes, appcontainer-driver.js won't work beyond first level. We should provide an API to allow users to select different levels of iframe inside our container iframe (at minimum the 2nd level).

Avaliable for MSL server to inject custom functions for parsing URL to read static file.

User will be able to inject custom made functions to parse URLs to retrieve static files.
For example, If some of the app code or css file is been redirect to other folder like this
http://localhost:8000/basefolder/redirect/:new:folder:is:here:appCode.js
The default express.js will not be able to reach file appCode.js because it's trying to find ":new:folder:is:here:appCode.js" in the "/basefolder/redirect" folder.

We allow the user to inject their own function that can parse the URL in a custom way so it can look up file appCode.js in /new/folder/is/here folder.

The function will be in a designated js file and will return the parsed file path so MSL server can look up the file.

Browser client tests unstable on Travis-ci

The browser client tests sometimes fail on Travis-ci. This is likely due to timing issues on the Jasmine tests running on different VM every time. We should add proper synchronization to the tests.

Related to #44

Consistent function parameter names across clients

Node/Browser client's setMockRespond() uses "body" whereas Java client uses "configurations". We should stay consistent and make everything "configurations". The API doc on homepage is set to "configurations".

Auto-deploy to Sonatype for Java client for snapshot builds

The Travis-CI build currently runs the E2E script which builds and installs NPM package, runs msl-server, and executes the unit tests. The snapshot build for the Java client should be automatically published to Sonatype repo upon successful run.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.