Introducing a new language pattern - iks-gmbh-tools/SysNat GitHub Wiki

Back


How to introduce a new language pattern?

  1. Add a single new line into an existing executable example file (e.g. FirstTest.nlxx).

  2. Restart the test execution.

  3. The execution fails and an error message suggests to add a new method to a language template container (i.e. LanguageTemplatesBasics_MyTestApp.java).

  4. Copy the lines of code from the error message's suggestion into the language container.

  5. Rename the method so that the new name explains what is going to be executed when called.

  6. 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."); 
     }
    
  7. 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.


Back