npm install
npm start&
./run_server.sh
All the magic should start in a index.js:
import {elementPresent, elementNotPresent, value, trigger, setValue, waitForElementPresent} from '../common/api';
// Do the magic here! :D
var e = jQuery.Event("keydown");
e.which = 50; // # Some key code value
jsEsgrima("t1", trigger, {id:'#search', event: e, group:"search", function (){}},
'search');
jsEsgrima("t2", trigger, {id:'#search', event: e, group:"search", function (){}},
'search');
jsEsgrima("a1", waitForElementPresent, {id:"#searchBtnRes", timeout: 4000, group: "search",
callBackResult: function (){}},
'search');
jsEsgrima("t3", trigger, {id:'#search', event: e, group:"search", function (){}},
'search');
jsEsgrima("t5", function(args){
$("#search").html("Just a change in HTML");
console.log(window);
args.callBackResult();
}, {id:'#search', callBackResult: function (){console.log("!t5")}, group:"search", function (){}},
'search');
jsEsgrima("Look for the result", function() {
it("contains spec with an expectation", function() {
console.log("lol");
expect(true).toBe(true);
});
}, 'results');
Add a config.js with the following content:
import {EsgrimaInstance} from '../client/esgrima';
var jsEsgrimaGroups = {
'search': function () {
var search = document.getElementById("search");
return search!==undefined;
},
'results' : function () {
var results = document.getElementById("results");
return results!==undefined;
}
}
EsgrimaInstance.registerGroups(jsEsgrimaGroups);
export {jsEsgrimaGroups}
./node_modules/babel/bin/babel-node server/lib/webserver.js
TODO: fix it ! We still need to build the scripts. Moreover, in windows, the npm start still do not work!
$ ./jsEsgrima build
$ ./jsEsgrima serve
If you want to test, add it now.
<script src="http://localhost:9001/EsgrimaTestSet.js"/>
<script src="http://localhost:9001/EsgrimaClient.js"/>