Highlighted
New Member.
364 views

HPSM - Automated Unit Testing?

Is there a way to write unit tests in HPSM very much like Java developers write using Junit, or Javscript developers write using Mocha?

I am trying to help a HPSM developer write automated tests.

0 Likes
1 Reply
Highlighted
Knowledge Partner
Knowledge Partner

Re: HPSM - Automated Unit Testing?

Vivganes, this topic is very interesting

Some time ago I was working with a JS responsible to define the approval sequence.. it was a bit complicate because it used several variables to set the correct approval flow.. after the tests started and the bugs appeared I started to noticed that I was fixing one place and destroying another... (you are probably thinking.. I've been there..)
So I wrote test cases that were basically doing what you are looking for.. I created a matrix with each line have the parameters combinations and approvers expected at each level .. called the function passing the parameters and compared the return with expected values.. so at the end my script output was:

test case XX successful,

test case XY failed, params {} expected results {} returned {}..

For some specific custom functions I think it's worth use some strategy like this... but I don't think it makes much sense to extend it to much and do something like test cases to priority change, reassignment and so on because usually the test cases are very simple and it's very dificult to mess up with this when developing.. maybe if you are in a very critical, distributed, with a lot of developer working in paralel and in a very custom environment it would make sense... so far I never did something like it...

Anyway, I think the easiest and best way to accomplish it is through Web Services... you can even use Junit or Mocha to do this 🙂

 

Regards,
Breno Abreu

If you feel this was helpful please click the KUDOS! thumb below!
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.