Introducing a new language pattern - iks-gmbh-tools/SysNat GitHub Wiki
How to introduce a new language pattern?
-
Add a single new line into an existing executable example file (e.g. FirstTest.nlxx).
-
Restart the test execution.
-
The execution fails and an error message suggests to add a new method to a language template container (i.e. LanguageTemplatesBasics_MyTestApp.java).
-
Copy the lines of code from the error message's suggestion into the language container.
-
Rename the method so that the new name explains what is going to be executed when called.
-
Implement the body of the new java method (Use the guicontroller functions to manipulate the GUI and do not forget to create a report message for each GUI action!). For instance:
@LanguageTemplate("Click main item ^^."); public void clickMainMenuItem(String item); { executableExample.clickMainMenuItem(item); executableExample.addReportMessage( "Main menu item <b>" + item + "</b> was clicked."); }
-
Restart the test execution. If the natural language instruction from the nlxx-file and the new java method match, then the test execution will be successful and the test result will contain one more line of details.