Skip to content

Commit

Permalink
fix: use compare json-json instead of json with tmp_file
Browse files Browse the repository at this point in the history
  • Loading branch information
vladislavploaia committed Nov 15, 2024
1 parent cf36c23 commit 628f2a6
Show file tree
Hide file tree
Showing 39 changed files with 329 additions and 445 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,16 @@ Execute Query
${query} Set Variable ${query_dict["tmp_query"]}
Log ${query}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Log Expected data: ${data_replaced_vars}
Create File ${EXPECTED_JSON_DATA_SETS}/order_by/multiple_order_by_on_extracted_columns_iv_tmp.json
... ${data_replaced_vars}
${expected_result_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta']
${diff} compare json-string with json-file
... ${resp_body_actual} ${EXPECTED_JSON_DATA_SETS}/order_by/multiple_order_by_on_extracted_columns_iv_tmp.json
Set Test Variable ${order1} ${order1}
Set Test Variable ${order2} ${order2}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
#Log Expected data: ${expected_json}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${FALSE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${EXPECTED_JSON_DATA_SETS}/order_by/multiple_order_by_on_extracted_columns_iv_tmp.json
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,14 @@ Execute Query
${query} Set Variable ${query_dict["tmp_query"]}
Log ${query}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Log Expected data: ${data_replaced_vars}
Create File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_dv_date_tmp.json
... ${data_replaced_vars}
${expected_result_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta']
${diff} compare json-string with json-file
... ${resp_body_actual} ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_dv_date_tmp.json
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
#Log Expected data: ${expected_json}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${FALSE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_dv_date_tmp.json
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,14 @@ Execute Query
${query} Replace Variables ${temp_query}
Log ${query}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Log Expected data: ${data_replaced_vars}
Create File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_extracted_columns_i_tmp.json
... ${data_replaced_vars}
${expected_result_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta']
${diff} compare json-string with json-file
... ${resp_body_actual} ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_extracted_columns_i_tmp.json
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
#Log Expected data: ${expected_json}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${FALSE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_extracted_columns_i_tmp.json
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,14 @@ Execute Query
${query} Replace Variables ${temp_query}
Log ${query}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Log Expected data: ${data_replaced_vars}
Create File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_extracted_columns_ii_tmp.json
... ${data_replaced_vars}
${expected_result_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta']
${diff} compare json-string with json-file
... ${resp_body_actual} ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_extracted_columns_ii_tmp.json
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
#Log Expected data: ${expected_json}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${FALSE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_extracted_columns_ii_tmp.json
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,16 @@ Execute Query
${query} Replace Variables ${temp_query}
Log ${query}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Log Expected data: ${data_replaced_vars}
Create File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_with_extracted_column_iii_tmp.json
... ${data_replaced_vars}
${expected_result_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta']
${diff} compare json-string with json-file
... ${resp_body_actual} ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_with_extracted_column_iii_tmp.json
Set Test Variable ${path} ${path}
Set Test Variable ${order} ${order}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
#Log Expected data: ${expected_json}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${FALSE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_with_extracted_column_iii_tmp.json
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,16 @@ Execute Query
${query} Replace Variables ${temp_query}
Log ${query}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Log Expected data: ${data_replaced_vars}
Create File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_with_extracted_column_iv_tmp.json
... ${data_replaced_vars}
${expected_result_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta']
${diff} compare json-string with json-file
... ${resp_body_actual} ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_with_extracted_column_iv_tmp.json
Set Test Variable ${path} ${path}
Set Test Variable ${order} ${order}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
#Log Expected data: ${expected_json}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${FALSE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_with_extracted_column_iv_tmp.json
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ Execute Query
${query} Set Variable ${query_dict["tmp_query"]}
Log ${query}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Log Expected data: ${data_replaced_vars}
Create File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_path_from_entry_to_dv_ordered_tmp.json
... ${data_replaced_vars}
${expected_result_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta']
${diff} compare json-string with json-file
... ${resp_body_actual} ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_path_from_entry_to_dv_ordered_tmp.json
Set Test Variable ${path} ${path}
Set Test Variable ${spath} ${spath}
Set Test Variable ${order} ${order}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
#Log Expected data: ${data_replaced_vars}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${FALSE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_path_from_entry_to_dv_ordered_tmp.json
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,16 @@ Execute Query
${query} Replace Variables ${temp_query}
Log ${query}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Log Expected data: ${data_replaced_vars}
Create File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_paths_same_hierarchy_lvl_i_tmp.json
... ${data_replaced_vars}
${expected_result_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta']
${diff} compare json-string with json-file
... ${resp_body_actual} ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_paths_same_hierarchy_lvl_i_tmp.json
Set Test Variable ${path} ${path}
Set Test Variable ${order} ${order}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
#Log Expected data: ${expected_json}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${FALSE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_paths_same_hierarchy_lvl_i_tmp.json
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,16 @@ Execute Query
${query} Set Variable ${query_dict["tmp_query"]}
Log ${query}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Log Expected data: ${data_replaced_vars}
Create File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_paths_same_hierarchy_lvl_ii_tmp.json
... ${data_replaced_vars}
${expected_result_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta']
${diff} compare json-string with json-file
... ${resp_body_actual} ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_paths_same_hierarchy_lvl_ii_tmp.json
Set Test Variable ${path} ${path}
Set Test Variable ${order} ${order}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
#Log Expected data: ${expected_json}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${FALSE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_paths_same_hierarchy_lvl_ii_tmp.json
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ Execute Query
${query} Set Variable ${query_dict["tmp_query"]}
Log ${query}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Log Expected data: ${data_replaced_vars}
Create File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_paths_same_hierarchy_lvl_iii_tmp.json
... ${data_replaced_vars}
${expected_result_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/order_by/${expected_file}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta']
${diff} compare json-string with json-file
... ${resp_body_actual} ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_paths_same_hierarchy_lvl_iii_tmp.json
Set Test Variable ${path} ${path}
Set Test Variable ${order} ${order}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
#Log Expected data: ${expected_json}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${FALSE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${EXPECTED_JSON_DATA_SETS}/order_by/order_by_paths_same_hierarchy_lvl_iii_tmp.json
Should Be Empty ${diff} msg=DIFF DETECTED!
19 changes: 9 additions & 10 deletions tests/robot/AQL_TESTS/PARAMETER/parameter_in_where.robot
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,16 @@ Execute Query
Log ${query}
${parameter_obj} Set Variable {"param":${value}}
Set AQL And Execute Ad Hoc Query ${query} parameter=${parameter_obj}
${expected_res_tmp} Set Variable ${EXPECTED_JSON_DATA_SETS}/parameter/${expected_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Log Expected data: ${data_replaced_vars}
Create File ${EXPECTED_JSON_DATA_SETS}/parameter/parameter_in_where_tmp.json
... ${data_replaced_vars}
${expected_result_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/parameter/${expected_file}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta']
${diff} compare json-string with json-file
... ${resp_body_actual} ${EXPECTED_JSON_DATA_SETS}/parameter/parameter_in_where_tmp.json
Set Test Variable ${path} ${path}
Set Test Variable ${value} ${value}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
#Log Expected data: ${expected_json}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${TRUE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${EXPECTED_JSON_DATA_SETS}/parameter/parameter_in_where_tmp.json
Should Be Empty ${diff} msg=DIFF DETECTED!
Loading

0 comments on commit 628f2a6

Please sign in to comment.