- For a command taking no parameters:
Then do safs command <command>
Example:
Then do safs command ClearAppMapCache
- For a command taking one or more parameters use a standard syntax that Cucumber will parse into a List of values passed to running step definition. Generally, that means one or more values separated by commas with the entire set of values enclosed in double-quotes:
Then do safs command <command> using "param 1, param 2, param 3"
Examples:
Then do safs command SetApplicationMap using "MyAppMap.map"
Then do safs command GetAppMapValue using " , , theItem, theVar"
(Note how a command's unused optional params must still be provided as empty values.)
- For an action on a component taking no parameters:
Then do safs action <action> on <windowname>
Or
Then do safs action <action> on <childname> in <windowname>Examples:
Then do safs action Click on LoginWindow
Or
Then do safs action Click on Submit in LoginWindow - For an action on a component taking one or more parameters use a standard syntax that Cucumber will parse into a List of values passed to running step definition. Generally, that means one or more values separated by commas with the entire set of values enclosed in double-quotes:
Then do safs <action> on <windowname> using "param 1, param 2, param 3"
Or
Then do safs <action> on <childname> in <windowname> using "param 1, param 2, param 3"Examples:
Then do safs action Click on LoginWindow using "TopLeft"
Or
Then do safs action VerifyProperty on Submit in LoginWindow using "Enabled, True, CaseInsensitive"
""The variable value is: "& ^varValue"
Example:
Then do safs command LogMessage using ""The stored property value is: "& ^varValue"
- SAFS Cukes StepDriver class -- provides access to the SAFS Framework.
- SAFS Cukes SAFSSteps class -- step definitions superclass to extend.
- SAFS Cukes StepDefinitions class -- runtime access to SAFS Commands and Actions.
Primarily, any and all Cucumber-JVM step definition class files that intend to use SAFS *MUST* insure SAFS is running and initialized by implementing an @Before Cucumber hook, like below:
@Before(order=10)
public void beforeAll(){
safsstep.beforeAll();
}
The easiest way to do this is to have affected step definition classes extend the SAFSSteps class. Though, this is not required.
The SAFSSteps class provides all subclasses with ready access to the initialized SAFS JSAFSDriver and SAFS StepDefinition methods for running SAFS DriverCommands and ComponentFunctions.
You can invoke a SAFS DriverCommand or ComponentFunction from within your own step definition implementations like below:
public void yourImplementedMethod(){
helper = safsstep.runDriverCommand("SetApplicationMap", Arrays.asList("MyAppMap.map"));
helper = safsstep.runComponentFunction("Click", "Submit", "LoginWindow", Arrays.asList("TopLeft"));
}
Of course, you would want to use static String constants or other lookups rather than hardcoded literal Strings wherever possible.