webgme / webgme-engine

WebGME server and Client API without a GUI
MIT License
11 stars 7 forks source link

Browser Testing for WebGME apps #276

Open umesh-timalsina opened 2 years ago

umesh-timalsina commented 2 years ago

webgme-cli uses plugins in the webgme-engine to generate files for plugins, visualizers etc... and the test suites use the _globals api provided by webgme to provide a range of well defined and customizable test suites. While, this works great for testing in a node environment, what is the recommended way to define an end-to-end browser testing regime for a webgme app?

Some Observations

Levaraging karma, there are certain inbrowser tests (esp. for the client api) that are used to test webgme-engine. Based on brief walkthrough of the code-base one can note that, for an end-to-end browser testing regime (For the UI or Plugins) that leverage the same techniques used in webgme-engine, one must:

  1. Configure karma to support requirejs and configure some requirejs paths that are used by webgme as well as the webgme app you are developing.
  2. Define your mocha tests that you want to execute using karma
  3. Import the projects that you want to run the tests on before starting a standalone server and run your tests after that

Can this be extended in such a way that the browser-testing support from webgme-engine provides a base configuration and server starting capabilities such that we can leverage that users (developers) can define their browser-tests?

brollb commented 2 years ago

@kecso - Are you interested in something like this (ie, open to PRs implementing it)? The main idea is basically updating the generated plugin tests so they include automated tests for running the plugin in the browser, too.

kecso commented 2 years ago

I am not, but it would be useful nonetheless :).