xray-code-snippets icon indicating copy to clipboard operation
xray-code-snippets copied to clipboard

Reformat TestRail sample XML using xmllint

Open vnaipaul opened this issue 1 year ago • 0 comments
trafficstars

Just reformatting for easier browsing, with no changes in behaviour expected.

I've presumed 2-space indentation--please let me know if a 4-space indent is preferred, and I'll adjust.

I've verified by comparing the output of testrail2Xray.py -i comic_estore.xml before and after, for cloud and server versions:

Before

  • Note that an additional record is being output for server/comic_estore.xml, compared to the existing server/comicEstore.csv.
bash-3.2$ python3 cloud/testrail2Xray.py -i cloud/comic_estore.xml -o cloud/comicEStore.csv
bash-3.2$ echo $?
0
bash-3.2$ python3 server/testrail2Xray.py -i server/comic_estore.xml -o server/comicEstore.csv -e https://testrail101.testrail.io/
bash-3.2$ echo $?
0
bash-3.2$ git diff  
diff --git a/use_cases/import_from_testrail/server/comicEstore.csv b/use_cases/import_from_testrail/server/comicEstore.csv
index 4cf3757..d84a680 100644
--- a/use_cases/import_from_testrail/server/comicEstore.csv
+++ b/use_cases/import_from_testrail/server/comicEstore.csv
@@ -19,3 +19,4 @@ Application redirects you to the main page in a logged in state",,,Test Cases/Re
 || Ford .. | Mustang |444444444  |  Address4
 ",Additional step 2 description (Var1: %Var1% and Var2: %Var2%),Expected result for the third step,,
 2,,Manual,,3, [Link|https://testrail101.testrail.io/index.php?/attachments/get/3b93e38b-5609-49c6-a987-8f2f6968121e] , [Link|https://testrail101.testrail.io/index.php?/attachments/get/5edccf31-330d-4e62-9e8a-324f771d96c8] , [Link|https://testrail101.testrail.io/index.php?/attachments/get/6c9ccdd6-446f-4b23-9244-3a16b997a0e6] ,,
+3,,Manual,Exploratory Session Test,3,,,,Exploratory Tests,Regression

After

  • No change in output for the cloud or server versions, with their respective comic_estore.xml reformatted.
  • The additional record is output for the server version, compared to the current server/comicEstore.csv, just as in the Before case.
bash-3.2$ git log --name-status main..@       
commit 9029d23a30efa9cc892e04e0795dc0115eb18eca (HEAD -> reformat_testrail_sample_xml, origin/reformat_testrail_sample_xml)
Author: Val Naipaul <[email protected]>
Date:   Mon Nov 11 17:52:10 2024 -0500

    Reformat TestRail sample XML using xmllint

M       use_cases/import_from_testrail/cloud/comic_estore.xml
M       use_cases/import_from_testrail/server/comic_estore.xml

bash-3.2$ python3 cloud/testrail2Xray.py -i cloud/comic_estore.xml -o cloud/comicEStore.csv
bash-3.2$ echo $?
0
bash-3.2$ python3 server/testrail2Xray.py -i server/comic_estore.xml -o server/comicEstore.csv -e https://testrail101.testrail.io/
bash-3.2$ echo $?
0
bash-3.2$ git diff
diff --git a/use_cases/import_from_testrail/server/comicEstore.csv b/use_cases/import_from_testrail/server/comicEstore.csv
index 4cf3757..d84a680 100644
--- a/use_cases/import_from_testrail/server/comicEstore.csv
+++ b/use_cases/import_from_testrail/server/comicEstore.csv
@@ -19,3 +19,4 @@ Application redirects you to the main page in a logged in state",,,Test Cases/Re
 || Ford .. | Mustang |444444444  |  Address4
 ",Additional step 2 description (Var1: %Var1% and Var2: %Var2%),Expected result for the third step,,
 2,,Manual,,3, [Link|https://testrail101.testrail.io/index.php?/attachments/get/3b93e38b-5609-49c6-a987-8f2f6968121e] , [Link|https://testrail101.testrail.io/index.php?/attachments/get/5edccf31-330d-4e62-9e8a-324f771d96c8] , [Link|https://testrail101.testrail.io/index.php?/attachments/get/6c9ccdd6-446f-4b23-9244-3a16b997a0e6] ,,
+3,,Manual,Exploratory Session Test,3,,,,Exploratory Tests,Regression

vnaipaul avatar Nov 12 '24 01:11 vnaipaul