%% Create a New Test Step
% This example creates a test step, |step1|, in a Test Sequence block after
% the step |SetLowPhi|, which is in the second level of hierarchy under the 
% top-level step |APEngagement_AttitudeLevels|.

% Copyright 2020 The MathWorks, Inc.

%% Open the Model and the Test Harness
rollModel = 'RollAutopilotMdlRef';
testHarness = 'RollReference_Requirement1_3';

open_system(rollModel);
sltest.harness.open([rollModel '/Roll Reference'],testHarness)

%% Create a New Local Variable Named |h|
sltest.testsequence.addSymbol...
   ('RollReference_Requirement1_3/Test Sequence',...
   'h','Data','Local');

%% Add a Step Named |step2| and Set the Value of |h| to 5
sltest.testsequence.addStepAfter...
   ('RollReference_Requirement1_3/Test Sequence',...
   'AttitudeLevels.APEngage_LowRoll.step2',...
   'AttitudeLevels.APEngage_LowRoll.SetLowPhi',...
   'Action','h = 5;')