Need help in Automated Test Framework for Multiple Approvals in RITM

Rahul Goyal
Tera Contributor

Hi Community,

I'm working on automating tests for a flow that includes both sequential and parallel approval steps. I want to validate that:

  • Approvers are triggered in the correct order for sequential approvals.
  • All parallel approvers receive tasks simultaneously.
  • The flow proceeds correctly based on approval/rejection outcomes.

Has anyone implemented ATF tests for such scenarios? Specifically:

  • How do you simulate multiple users approving in sequence or in parallel?
  • Are there best practices or limitations in ATF when dealing with complex approval logic?
  • Any examples or tips for structuring these tests effectively?
2 REPLIES 2

Valmik Patil1
Kilo Sage

Hello @Rahul Goyal ,
This can be possible using ATF run server side step.

You can use jasmine framework to validate the approvers

(function(outputs, steps, params, stepResult, assertEqual) {
   var approvals = [];
    var gr = new GlideRecord("sysapproval_approver");
    gr.addQuery("document_id", <records SysID>); // sysid of record for which approvals are triggered
    gr.orderBy("sys_created_on");
    gr.query();

    while (gr.next()) {
        approvals.push(gr.approver.name.toString() + ":" + gr.state.toString());
    }

    // After Approver1 approves, Approver2 should be 'requested'
    expect(approvals[0]).toContain("Approver1:approved");
    expect(approvals[1]).toContain("Approver2:requested"); // once user approved then this then below task should be requested
    expect(approvals[2]).toContain("Approver3:not_requested");

})(outputs, steps, params, stepResult, assertEqual);
// uncomment the next line to execute this script as a jasmine test
jasmine.getEnv().execute();

Above logic is just reference script you can modify it as per requirement.

Thanks,

Valmik Patil

Shaqeel
Mega Sage

Hi @Rahul Goyal 

 

Yes, I have implemented these scenarios.

You can create multiple tests according to requirement and add them to one suite.

First positive:

1. create Req/ritm.

2. Check the approval trigger using apply filter in list or record query.

3. Once you approve it validate the new approval using the same.

 

And for negative scenarios you can just reject the ritm at any level and check the status of ritm or req.

 

P.S: It could be a lengthy test according to scenarios.

 

Regards

Shaqeel


***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

***********************************************************************************************************************





Regards

Shaqeel