Using Setup Parameter Values in Test Steps
A !Setup parameter can be used in the
RUN_TEST_STEP
command in a script file to specify the set up
values to use when running the step. This allows a test step to behave in
various ways depending on the setup value specified. Use the
GetSetupState()
function in a test step to get the parameter
value.
The following example shows how the API can be used to choose what to do
within a test step:
TVerdict CSampleStep1::doTestStepL()
{
const TInt KTestStepActivityFlow1 = 1;
const TInt KTestStepActivityFlow2 = 2;
const TInt KTestStepActivityFlow3 = 3;
Tint setup = GetSetupState();
if (setup == KTestStepActivityFlow1)
{
TInt err = fnPerformActivity1();
if (err == KErrNone) { SetTestStepResult(EPass); }
else { SetTestStepResult(EFail); }
}
else if (setup == KTestStepActivityFlow2)
{ fnPerformActivity2(); ...}
else if (setup == KTestStepActivityFlow3)
{ fnPerformActivity3();...}
else { fnPerformDefaultActivity();...}
}