Skip to content

Commit

Permalink
Merge pull request #369 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 Nov 15, 2024
2 parents 33fc21b + cfc62de commit 86dd7af
Show file tree
Hide file tree
Showing 138 changed files with 5,730 additions and 678 deletions.
278 changes: 194 additions & 84 deletions JsonPreprocessor/CJsonPreprocessor.py

Large diffs are not rendered by default.

Binary file modified JsonPreprocessor/JsonPreprocessor.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions JsonPreprocessor/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
#
# Version and date of JsonPreprocessor
#
VERSION = "0.8.1"
VERSION_DATE = "28.10.2024"
VERSION = "0.8.2"
VERSION_DATE = "30.10.2024"

36 changes: 25 additions & 11 deletions config/robotframework_aio/release_items_JsonPreprocessor.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,28 +138,42 @@

* Added a naming convention check for key names within JSONP content processed by the **JsonPreprocessor**

Key names have to start with a character, digit, or underscore and must not contain these special characters ``!#$%^&()=[]{}|;',?`~``
Naming convention:

* Key names can only consist of letters, digits and the following special characters: ``_ + - * / \\`` (backslashes are allowed but must be masked).
* Key names must start with a letter, a digit or an underscore.
* Key names must not be empty strings. But leading and trailing blanks will be removed (and therefore do not cause errors).

**Example:**

Valid key names are: ``\"abcParam\"``, ``\"01_Param\"``, ``\"__param+1\"``, ``\"param-1\"``, ``\"[email protected]\"``, ...

Invalid key names are: ``\"+param01\"``, ``\"param$01\"``, ``\"abc#Param\"``, ...

* Checked absolute path when overwriting parameter
* Reworked handling of parameter scope

When overwriting a parameter, the absolute path of the parameter must be provided
To change the value of an existing parameter, an absolute path must be used always.

**Example:**

|``\u007b``
| ``\"params\" : \u007b\"001\" : \u007b\"002\" : \u007b``
| ``\"param\" : 1,``
| ``$\u007bparams.001.002.param\u007d : 2``
| ``\u007d``
| ``\u007d``
| ``\u007d``
|``\u007d``
| ``{``
| ``\u00a0\u00a0\u00a0\"params\"\u00a0:\u00a0{\"001\"\u00a0:\u00a0{\"002\"\u00a0:\u00a0{``
| ``\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"param\"\u00a0:\u00a01,``
| ``\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0${params.001.002.param}\u00a0:\u00a02``
| ``\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}``
| ``\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}``
| ``\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}``
| ``}``

* Enabled dynamic paths for imported JSON files (based on dollar operator expressions)

**Example:**

| ``{``
| ``\u00a0\u00a0\u00a0\"root_folder\" : \"imports\",``
| ``\u00a0\u00a0\u00a0\"json_file\"\u00a0\u00a0\u00a0: \"configuration.jsonp\",``
| ``\u00a0\u00a0\u00a0\"[import]\"\u00a0\u00a0\u00a0\u00a0: \"./${root_folder}/${json_file}\" ``
| ``}``
"
]
}
Expand Down
3 changes: 3 additions & 0 deletions packagedoc/additional_docs/History.tex
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,7 @@
- Prevented side effects of token string in error messages log\newline
- Checked absolute path when overwriting parameter}

\historyversiondate{0.8.2}{10/2024}
\historychange{- Enhanced import JSON file feature which allows dynamic path of imported file}

\end{packagehistory}
43 changes: 33 additions & 10 deletions test/JPP_TestUsecases.csv
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ JPP_0369|VALUE_DETECTION|BADCASE|JSON file with expression starting with '${' an
JPP_0370|VALUE_DETECTION|BADCASE|JSON file with expression starting with '${' and ending with '}', further matching '${' and '}' in between (not all nested) (invalid syntax 4)
JPP_0371|VALUE_DETECTION|BADCASE|JSON file with expression starting with '${' and ending with '}', further matching '${' and '}' in between (not all nested) (invalid syntax 5)
JPP_0400|NAMING_CONVENTION|GOODCASE|JSON file with several parameter names w.r.t. the naming convention
JPP_0450|NAMING_CONVENTION|BADCASE|JSON file with several invalid parameter names (1)
JPP_0451|NAMING_CONVENTION|BADCASE|JSON file with several invalid parameter names (2)
JPP_0452|NAMING_CONVENTION|BADCASE|JSON file with several invalid parameter names (3)
JPP_0453|NAMING_CONVENTION|BADCASE|JSON file with several invalid parameter names (4)
JPP_0454|NAMING_CONVENTION|BADCASE|JSON file with several invalid parameter names (5)
JPP_0455|NAMING_CONVENTION|BADCASE|JSON file with several invalid parameter names (6)
JPP_0500|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file with composite data structure (nested lists and dictionaries 1)
JPP_0501|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file with composite data structure (nested lists and dictionaries 2)
JPP_0502|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file with composite data structure (nested lists and dictionaries 3 / some key names with dots inside)
Expand Down Expand Up @@ -110,8 +116,25 @@ JPP_1055|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data stru
JPP_1056|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (6)
JPP_1057|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (7)
JPP_1058|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (8)
JPP_1150|CYCLIC_IMPORTS|BADCASE|JSON file with cyclic imports (JSON file imports itself)
JPP_1151|CYCLIC_IMPORTS|BADCASE|JSON file with cyclic imports (JSON file imports another file, that is already imported)
JPP_1100|FILE_IMPORTS|GOODCASE|JSON file import based on parameters (dynamic import (1))
JPP_1101|FILE_IMPORTS|GOODCASE|JSON file import based on parameters (dynamic import (2))
JPP_1102|FILE_IMPORTS|GOODCASE|JSON file import based on parameters (dynamic import (3))
JPP_1103|FILE_IMPORTS|GOODCASE|JSON file import based on parameters (dynamic import (4))
JPP_1104|FILE_IMPORTS|GOODCASE|JSON file import based on parameters (dynamic import (5))
JPP_1105|FILE_IMPORTS|GOODCASE|JSON file import based on parameters (dynamic import (6))
JPP_1106|FILE_IMPORTS|GOODCASE|JSON file import based on parameters (dynamic import, recursive (7))
JPP_1107|FILE_IMPORTS|GOODCASE|JSON file import based on parameters (dynamic import, alternate (8))
JPP_1108|FILE_IMPORTS|GOODCASE|JSON file import based on parameters (dynamic import, parallel (9))
JPP_1109|FILE_IMPORTS|GOODCASE|JSON file import based on dictionary key values
JPP_1110|FILE_IMPORTS|GOODCASE|JSON file import based on list elemens
JPP_1111|FILE_IMPORTS|GOODCASE|JSON file import based on parameters (dynamic import (7))
JPP_1150|FILE_IMPORTS|BADCASE|JSON file with cyclic imports (JSON file imports itself, fix path)
JPP_1151|FILE_IMPORTS|BADCASE|JSON file with cyclic imports (JSON file imports another file, that is already imported, fix path)
JPP_1154|FILE_IMPORTS|BADCASE|JSON file with not existing parameter within dynamic import path
JPP_1155|FILE_IMPORTS|BADCASE|JSON file with not existing import file
JPP_1158|FILE_IMPORTS|BADCASE|JSON file with error in [import] key (1)
JPP_1159|FILE_IMPORTS|BADCASE|JSON file with error in [import] key (2)
JPP_1160|FILE_IMPORTS|BADCASE|JSON file with error in imported file
JPP_1200|PATH_FORMATS|GOODCASE|Relative path to JSON file
JPP_1350|BLOCKED_SLICING|BADCASE|JSON file with blocked slicing notation (-1)
JPP_1351|BLOCKED_SLICING|BADCASE|JSON file with blocked slicing notation (-1)
Expand Down Expand Up @@ -156,11 +179,11 @@ JPP_2001|PARAMETER_SCOPE|GOODCASE|JSON file with nested dictionary, in which a p
JPP_2002|PARAMETER_SCOPE|GOODCASE|JSON file with nested dictionary, in which a parameter is overwritten (3)
JPP_2003|PARAMETER_SCOPE|GOODCASE|JSON file with nested dictionary, in which a parameter is overwritten (4)
JPP_2007|PARAMETER_SCOPE|GOODCASE|JSON file with nested dictionary, in which a parameter is overwritten (8)
JPP_2500|PARAMETER_SCOPE|BADCASE|JSON file containing a parameter with missing scope (1)
JPP_2501|PARAMETER_SCOPE|BADCASE|JSON file containing a parameter with missing scope (2)
JPP_2502|PARAMETER_SCOPE|BADCASE|JSON file containing a parameter with missing scope (3)
JPP_2503|PARAMETER_SCOPE|BADCASE|JSON file containing a parameter with missing scope (4)
JPP_2504|PARAMETER_SCOPE|BADCASE|JSON file containing a parameter with missing scope (5)
JPP_2506|PARAMETER_SCOPE|BADCASE|JSON file containing a parameter with missing scope (7)
JPP_2507|PARAMETER_SCOPE|BADCASE|JSON file containing a parameter with missing scope (8)
JPP_2508|PARAMETER_SCOPE|BADCASE|JSON file containing a parameter with missing scope (9)
JPP_2050|PARAMETER_SCOPE|BADCASE|JSON file containing a parameter with missing scope (1)
JPP_2051|PARAMETER_SCOPE|BADCASE|JSON file containing a parameter with missing scope (2)
JPP_2052|PARAMETER_SCOPE|BADCASE|JSON file containing a parameter with missing scope (3)
JPP_2053|PARAMETER_SCOPE|BADCASE|JSON file containing a parameter with missing scope (4)
JPP_2054|PARAMETER_SCOPE|BADCASE|JSON file containing a parameter with missing scope (5)
JPP_2056|PARAMETER_SCOPE|BADCASE|JSON file containing a parameter with missing scope (7)
JPP_2057|PARAMETER_SCOPE|BADCASE|JSON file containing a parameter with missing scope (8)
JPP_2058|PARAMETER_SCOPE|BADCASE|JSON file containing a parameter with missing scope (9)
Loading

0 comments on commit 86dd7af

Please sign in to comment.