admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Quintiq file version 2.0
#parent: #root
Method PTF_DuplicateTestScenario (
  internal[GUIComponent] parent,
  LibPTF_TestScenario selection
) as LibPTF_TestScenario id:Method_LibPTF_dlgCreateEditTestScenario_PTF_DuplicateTestScenario
{
  #keys: '[103546.0.62981758]'
  Body:
  [*
    // Duplicate test scenario
    this.Title( "Duplicate test scenario" );
    
    // Make sure reconcatenate all the script parts to have full complete action script for test script commit later
    traverse( selection, LibPTF_TestScript, testScript )
    {
      testScript.ActionScriptForUIDisplay( testScript.GetActionScript() );
    }
    
    data := shadow( selection );
    
    Dialog.Data( data );
    
    data.ExpandRecursive();
    data.ResetWrapped();
    
    if( Dialog.DoModal( parent ) > 0 )
    {
      // Manually remove the test script results associated with the test scripts under the selected scenario.
      traverse( data, LibPTF_TestScript, testscript )
      {
        testscript.LibPTF_ExecResult( relflush );
      }
      
      data.Commit();
    }
    
    return data.WrappedInstance();
  *]
}