Package de.gematik.test.tiger.glue
Class TigerGlue
java.lang.Object
de.gematik.test.tiger.glue.TigerGlue
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionTigerGlue(TigerGlobalConfigurationController tigerGlobalConfigurationController) -
Method Summary
Modifier and TypeMethodDescriptionvoidctxtAssertVariableMatches(String key, String regex) asserts that value with given key either equals or matches (regex) the given regex string.voidasserts that value of context entry with given key either equals or matches (regex) the given regex string.voidctxtISetGlobalVariableTo(String key, String value) Sets the given key to the given value in the global configuration store.voidctxtISetLocalVariableTo(String key, String value) Sets the given key to the given value in the global configuration store.voidprintVariable(String key) Prints the value of the given variable to the System-outvoidsetFeatureVariable(String key, String value) voidtestsuiteAndVersion(String testsuite, String version) NoOp step to allow marking test suites as being from a specific version, this step is shown in the workflow ui, the serenity report and can be validated by the Titus validator.voidtgrAssertMatches(String value1, String value2) voidtgrIWantToShowBanner(String text) voidLoads the Tiger Global Configuration from the given file.voidPauses the validation test suite.voidtgrPauseExecutionWithMessage(String message) Pauses the validation test suite with a message.voidtgrPauseExecutionWithMessageAndErrorMessage(String message, String errorMessage) Pauses the validation test suite with a message shown and the option to either continue or fail with the given error message.voidtgrSaveTigerGlobalConfigurationToFile(String filename) Saves all the values of the Tiger Global Configuration in the given file formatted as yaml.voidtgrShowColoredBanner(String color, String text) voidtgrShowColoredText(String color, String text) voidtgrShowHtmlNotification(String message) voidtgrStartServer(String servername) Starts the given server.voidtgrStopServer(String servername) Stops the given server.voidThis step aborts the test after user acknowledgement.
-
Constructor Details
-
TigerGlue
public TigerGlue() -
TigerGlue
-
-
Method Details
-
testsuiteAndVersion
@Given("TGR testsuite {string} version {string}") @Gegebensei("TGR Testsuite {string} Version {string}") public void testsuiteAndVersion(String testsuite, String version) NoOp step to allow marking test suites as being from a specific version, this step is shown in the workflow ui, the serenity report and can be validated by the Titus validator. Tiger does not resolve the test suite name and version string!- Parameters:
testsuite- name of the test suiteversion- version of the test suite
-
ctxtISetGlobalVariableTo
@Wenn("TGR setze globale Variable {tigerResolvedString} auf {tigerResolvedString}") @When("TGR set global variable {tigerResolvedString} to {tigerResolvedString}") public void ctxtISetGlobalVariableTo(String key, String value) Sets the given key to the given value in the global configuration store. Variable substitution is performed.- Parameters:
key- key of the contextvalue- value for the context entry with given key
-
ctxtISetLocalVariableTo
@Wenn("TGR setze lokale Variable {tigerResolvedString} auf {tigerResolvedString}") @When("TGR set local variable {tigerResolvedString} to {tigerResolvedString}") public void ctxtISetLocalVariableTo(String key, String value) Sets the given key to the given value in the global configuration store. Variable substitution is performed. This value will only be available in the given scenario being clear up after the scenario run is finished.- Parameters:
key- key of the contextvalue- value for the context entry with given key
-
setFeatureVariable
-
ctxtAssertVariableMatches
@Dann("TGR pr\u00fcfe Variable {tigerResolvedString} stimmt \u00fcberein mit {tigerResolvedString}") @Then("TGR assert variable {tigerResolvedString} matches {tigerResolvedString}") public void ctxtAssertVariableMatches(String key, String regex) asserts that value with given key either equals or matches (regex) the given regex string. Variable substitution is performed. This checks both global and local variables!- Parameters:
key- key of entry to checkregex- regular expression (or equals string) to compare the value of the entry to
-
ctxtAssertVariableUnknown
@Dann("TGR pr\u00fcfe Variable {tigerResolvedString} ist unbekannt") @Then("TGR assert variable {tigerResolvedString} is unknown") public void ctxtAssertVariableUnknown(String key) asserts that value of context entry with given key either equals or matches (regex) the given regex string. Variable substitution is performed.Special values can be used:
- Parameters:
key- key of entry to check
-
tgrShowColoredBanner
-
tgrShowColoredText
-
tgrIWantToShowBanner
@Gegebensei("TGR zeige Banner {tigerResolvedString}") @Given("TGR show banner {tigerResolvedString}") public void tgrIWantToShowBanner(String text) -
tgrWaitForUserAbort
@When("TGR wait for user abort") @Wenn("TGR warte auf Abbruch") public void tgrWaitForUserAbort()This step aborts the test after user acknowledgement. -
tgrPauseExecution
@When("TGR pause test run execution") @Wenn("TGR pausiere Testausf\u00fchrung") public void tgrPauseExecution()Pauses the validation test suite. Please note, these steps are only modified for the Workflow UI and don't work on a regular console (no failure, there is just no pause). -
tgrPauseExecutionWithMessage
@When("TGR pause test run execution with message {tigerResolvedString}") @Wenn("TGR pausiere Testausf\u00fchrung mit Nachricht {tigerResolvedString}") public void tgrPauseExecutionWithMessage(String message) Pauses the validation test suite with a message. Please note, these steps are only modified for the Workflow UI and don't work on a regular console (no failure, there is just no popup / pause).- Parameters:
message- message to be displayed in the Workflow UI.
-
tgrPauseExecutionWithMessageAndErrorMessage
@When("TGR pause test run execution with message {tigerResolvedString} and message in case of error {tigerResolvedString}") @Wenn("TGR pausiere Testausf\u00fchrung mit Nachricht {tigerResolvedString} und Meldung im Fehlerfall {tigerResolvedString}") public void tgrPauseExecutionWithMessageAndErrorMessage(String message, String errorMessage) Pauses the validation test suite with a message shown and the option to either continue or fail with the given error message. Please note, these steps are only modified for the Workflow UI and don't work on a regular console (no failure, there is just no popup / pause).- Parameters:
message- message to be displayed in the Workflow UI.
-
tgrShowHtmlNotification
@When("TGR show HTML Notification:") @Wenn("TGR zeige HTML Notification:") public void tgrShowHtmlNotification(String message) -
tgrAssertMatches
-
printVariable
@Dann("TGR gebe variable {tigerResolvedString} aus") @Then("TGR print variable {tigerResolvedString}") public void printVariable(String key) Prints the value of the given variable to the System-out -
tgrStopServer
@Given("TGR stop server {tigerResolvedString}") @Gegebensei("TGR stoppe Server {tigerResolvedString}") public void tgrStopServer(String servername) Stops the given server. If the server is not running or the server is not found, an exception is thrown.- Parameters:
servername- The server to be stopped.
-
tgrStartServer
@Given("TGR start server {tigerResolvedString}") @Gegebensei("TGR starte Server {tigerResolvedString}") public void tgrStartServer(String servername) Starts the given server. If the server is already running or the server is not found, an exception is thrown.- Parameters:
servername- The server to be started.
-
tgrSaveTigerGlobalConfigurationToFile
@Given("TGR save TigerGlobalConfiguration to file {tigerResolvedString}") @Gegebensei("TGR speichere TigerGlobalConfiguration in Datei {tigerResolvedString}") public void tgrSaveTigerGlobalConfigurationToFile(String filename) throws IOException Saves all the values of the Tiger Global Configuration in the given file formatted as yaml.ATTENTION: If the file already exists it will be overwritten!
- Parameters:
filename- the file to save the configuration to- Throws:
IOException- if an I/ O error occurs writing to or creating the file
-
tgrLoadTigerGlobalConfigurationFromFile
@Given("TGR load TigerGlobalConfiguration from file {tigerResolvedString}") @Gegebensei("TGR lade TigerGlobalConfiguration aus Datei {tigerResolvedString}") public void tgrLoadTigerGlobalConfigurationFromFile(String filename) throws IOException Loads the Tiger Global Configuration from the given file. The file must be formatted as yaml. All previous values in the configuration will be cleared and only the values from the file will end up in the configuration.- Parameters:
filename- the file to load the configuration from- Throws:
IOException- if an I/O error occurs reading the file
-