diff --git a/RobotFramework_TestsuitesManagement/RobotFramework_TestsuitesManagement.pdf b/RobotFramework_TestsuitesManagement/RobotFramework_TestsuitesManagement.pdf index 88acd4bf..e0e4e703 100644 Binary files a/RobotFramework_TestsuitesManagement/RobotFramework_TestsuitesManagement.pdf and b/RobotFramework_TestsuitesManagement/RobotFramework_TestsuitesManagement.pdf differ diff --git a/RobotFramework_TestsuitesManagement/version.py b/RobotFramework_TestsuitesManagement/version.py index 562eada5..a0c92863 100644 --- a/RobotFramework_TestsuitesManagement/version.py +++ b/RobotFramework_TestsuitesManagement/version.py @@ -18,5 +18,5 @@ # # Version and date of package RobotFramework_TestsuitesManagement # -VERSION = "0.7.7" -VERSION_DATE = "10.04.2024" +VERSION = "0.7.8" +VERSION_DATE = "14.05.2024" diff --git a/config/robotframework_aio/release_items_RobotFramework_TestsuitesManagement.json b/config/robotframework_aio/release_items_RobotFramework_TestsuitesManagement.json index 74df60d6..8fa4fdde 100644 --- a/config/robotframework_aio/release_items_RobotFramework_TestsuitesManagement.json +++ b/config/robotframework_aio/release_items_RobotFramework_TestsuitesManagement.json @@ -96,7 +96,7 @@ , "0.12." : [ " -* Improved the error logging method when loading configuration fails. +* Improved error messages in case of issues while loading the test configuration. " ] } diff --git a/packagedoc/additional_docs/History.tex b/packagedoc/additional_docs/History.tex index d1fef164..3d62ae73 100644 --- a/packagedoc/additional_docs/History.tex +++ b/packagedoc/additional_docs/History.tex @@ -54,6 +54,6 @@ \historychange{Extended debugging support. In case of JSON syntax errors in configuration files, the Robot Framework log files contain an extract of the JSON content nearby the position, where the error occurred.} \historyversiondate{0.7.8}{05/2024} -\historychange{Improved the error logging method when loading configuration fails.} +\historychange{Improved error messages in case of issues while loading the test configuration.} \end{packagehistory} diff --git a/packagedoc/additional_docs/The JSONP format.tex b/packagedoc/additional_docs/The JSONP format.tex index a1e4ef4e..c33f334b 100644 --- a/packagedoc/additional_docs/The JSONP format.tex +++ b/packagedoc/additional_docs/The JSONP format.tex @@ -263,7 +263,7 @@ \section{Import of JSON files} % -------------------------------------------------------------------------------------------------------------- -\section{Overwrite parameters} +\section{Overwrite parameters}\label{overwrite-parameters} We take over the scenario from the previous section: We still have a JSON file \plog{componentA.jsonp} containig the parameters for component \textit{A}, a JSON file \plog{componentB.jsonp} for component \textit{B} and a JSON file \plog{common.jsonp} for both components. @@ -986,10 +986,78 @@ \section{\texttt{dotdict} notation}\label{dotdict-notation} % -------------------------------------------------------------------------------------------------------------- -% \newpage -% \section{Substitution of dollar operator expressions} -% TODO: Currently nothing imortant to be explained here any more because of features of the JsonPreprocessor have been reduced. -% "Dynamic key names" still under discussion: https://github.com/test-fullautomation/python-jsonpreprocessor/issues/270 +\newpage + +\section{Dynamic key names} + +In section \hyperref[overwrite-parameters]{Overwrite parameters} we mentioned the possibility to define the value of string parameters dynamically, e.g. in this way: + +\begin{pythoncode} +"str_val" : "ABC", +"newparam1" : "prefix_${str_val}_suffix", +\end{pythoncode} + +The value of \pcode{newparam1} is defined by an expression that is encapsulated in quotes and contains - beneath hard coded parts - a dollar operator expression +that is the dynamic part. + +The same is also possible on the left hand side of the colon. In this case the name of a parameter is created dynamically. + +\vspace{2ex} + +\textbf{Example:} + +\begin{pythoncode} +"strval" : "A", +"dictval" : {"A_2" : 1}, +${dictval}['${strval}_2'] : 2 +\end{pythoncode} + +In second line a new dictionary with key \pcode{A_2} is defined. In third line we overwrite the initial value of this key with another value. +The name of this key is defined with the help of parameter \pcode{strval}. + +\vspace{2ex} + +\textbf{Outcome:} + +\begin{pythonlog} +{'dictval': {'A_2': 2}, 'strval': 'A'} +\end{pythonlog} + +\vspace{2ex} + +The same in dotdict notation: + +\vspace{2ex} + +\begin{pythoncode} +"strval" : "A", +"dictval" : {"A_2" : 1}, +${dictval.${strval}_2} : 3 +\end{pythoncode} + +\textbf{The precondition for using dynamic key names is that a key with the resulting name (here \pcode{A_2}) does exist already. +Therefore this mechanism can be used to overwrite the value of existing keys, but cannot be used to create new keys!} + +\vspace{2ex} + +This will not work: + +\vspace{2ex} + +\begin{pythoncode} +"strval" : "A", +"dictval" : {"${strval}_2" : 1} +\end{pythoncode} + +\vspace{2ex} + +\textbf{Outcome:} + +\begin{pythonlog} + +\end{pythonlog} + + % --------------------------------------------------------------------------------------------------------------