Skip to content

Commit

Permalink
Merge pull request #279 from test-fullautomation/namsonx/task/stabi_b…
Browse files Browse the repository at this point in the history
…ranch

Namsonx/task/stabi branch
  • Loading branch information
test-fullautomation authored May 14, 2024
2 parents e6de769 + 5119168 commit 164b1d5
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 9 deletions.
Binary file not shown.
4 changes: 2 additions & 2 deletions RobotFramework_TestsuitesManagement/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"
]
}
Expand Down
2 changes: 1 addition & 1 deletion packagedoc/additional_docs/History.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
78 changes: 73 additions & 5 deletions packagedoc/additional_docs/The JSONP format.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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}
<TODO: error message>
\end{pythonlog}
% --------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 164b1d5

Please sign in to comment.