Testing with GUI in WebIDE

Posted on
  • I'm working on some new functions around testing plugin in WebIDE.
    To get some feedback, I created a small video
    on youtube.
    Main change is the option to use images as background for testing.
    Values from Espruino Board overlay this image, so you will see actual data.

  • @JumJum, great intro - raising some questions:
    a) Can I use this feature just for a graphical console (or monitor for Espruino)?
    b) Where can I place code for doing stuff in the IDE to not overload the Espruino?

  • Testing plugin is designed as a simple GUI to support testing and quick&dirty presentations.
    It supports a lot of functions, but it's not a full blown up GUI-Interface.
    WebIDE would not be the right place for a sophisticated GUI, this should be done in a seperate application.

    Testing supports 2 main functions.
    1. Display values from Espruino board
    WebIDE defines a function on Espruino, which creates and sends an JSON-Object and calls this function. Incoming data is interpreted and displayed as circle(alarm, warning,status), bar(0-100) or text(string or integer).
    2. Actions sent to Espruino board
    Clicking on the image sends data to Espruino. This can be assigning a value(number, boolean, string) or a command(e.g. calling a function). Commands are designed for short snippets right now, this could possibly be changed(from textbox to textarea).

    Definition of display and actions is stored locally, in a subfolder of local project folder (see link to tours in project part of options). Format is JSON see example:

    { "imageUrl":"Alarming.jpg",
      "testMode":"Image",
      "dataPoints":[
        {"label":"L07","expression":"a1","type":"number","points":[],"display":"A","x":"930","y":"300"},
        {"label":"P13","expression":"a2 * 0.7","type":"number","points":[],"display":"A","x":"670","y":"290"},
        {"label":"GeneralAlarm","expression":"as*2","type":"number","points":[],"display":"none","x":"0","y":"0"},
        {"label":"F03","expression":"w1*0.5","type":"number","points":[],"display":"W","x":"45","y":"455"},
        {"label":"T07","expression":"w2*0.3","type":"number","points":[],"display":"W","x":"170","y":"380"},
        {"label":"GeneralWarning","expression":"ws*1.5","type":"number","points":[],"display":"none","x":"0","y":"0"},
        {"label":"Motor","expression":"s1","type":"number","points":[],"display":"S","x":"170","y":"480"},
        {"label":"Log","expression":"asyncLog","type":"text","points":[],"display":"T","x":525,"y":75},
        {"label":"L09","expression":"process.memory().free / 30","type":"number","display":"B","x":"760","y":"790"}
      ],
      "actionPoints":[
        {"label":"Alarm","expression":"testAlarm()","type":"command","x":"66","y":"30"},
        {"label":"Warning","expression":"testWarning()","type":"command","x":"208","y":"30"},
        {"label":"Status","expression":"testStatus()","type":"command","x":"337","y":"30"},
        {"label":"Reset","expression":"resetAll();","type":"command","x":"0","y":"0"}
      ]
    }
    
  • You obviously can control what image is loaded... How about adding actionPoint of type image, which takes the expression result - literally or executed on Espruino - and loads the 'next' definition. Such an option of hard - or Espruino soft - controlled loading of definition enables flows through views (images)... More about along these lines in a later post.

    In what language is this testing plug-in written? (I'd like the answer: JS ;-) - of course).

  • Hmm, I could imagine a displayType like "switchTesting", giving name of a testingFile.
    This would stop actual polling, load and display new testingFile, create a new polling function on Espruino, and start polling again. I will check it.
    Language for plugins is Javascript
    BTW, would be nice to get some more information about your project. I was working in technical plants supporting DCS, where something similiar is often used.

  • No software without regression testing. I was thinking along these lines... If I can use a - or the - plugin to drive this with having the test driver and tests running within the IDE and not on the board, that helps. - Left you also a message.

  • Amazing!

    This will be very useful for certain kinds of projects, and it looks like it provides a path of least resistance to displaying information from the Espruino visually.

  • ...on an 'unlimited display' (not as the tiny 320x240 and even worse 128x64...

  • Even those are luxuriant compared to what many use - the 84x48 nokia displays >.<

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Testing with GUI in WebIDE

Posted by Avatar for JumJum @JumJum

Actions