Packages testing

Testing is an essential part of development process. You should ensure that your product works properly at each stage of it’s lifecycle. For instance, when developing a new version of a package you should perform regression testing and confirm that new changes haven’t affected previous functionality.
Each package should include a bunch of unit tests responsible for either UI or logic underneath. And Datagrok provides various capabilities and tools to conveniently run those tests any time during development.

Test manager

Test manager is a tool within the Datagrok platform that provides a convenient interface to select and run package unit tests with further results exploration. Test manager itself is a part of the DevTools package.

To start Test manager go to top menu Tools -> Dev -> Test manager

test-mngr-start

After starting the tool you will see a list of all packages containing unit tests. Inside each package, tests
are divided by category. Categories support multiple nesting (subcategories should be divided by : ).
To select a test or a category, click on it, or use keyboard.

test-mngr-tests-list

Running tests

There are multiple ways you can run tests:

  • by right clicking on package, category, or test and selecting Run from context menu
  • by selecting package, category, or test and pushing Enter
  • by selecting package, category, or test and pushing Run on a ribbon panel
  • by selecting package, category, or test and pushing Run on a property panel
  • individual tests can be run by double click
  • you can run all tests at once using Run all button on the ribbon
  • package, category, or test can be run by putting the corresponding url into address bar of the browser. The format is the following your_server_name/apps/DevTools/TestManager/package_name/category_name/test_name

Progress icon is shown opposite to active test/category/package, it will end up in result icon after completion. In case at least one test fails within category or package the fail icon will be shown.

Progress bar on the bottom of the page shows the percentage of completed tests.

Reviewing results

Information about test results is available via tooltip or in the property panel. Selected test, category, or package to explore results.

In case category/package contain multiple tests results are shown as a grid which can be added to workspace for further exploration.

2 Likes