Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How to add a new node to XML test response? #1397

Open
pavelkostyurin opened this issue Nov 15, 2022 · 3 comments
Open

[Question] How to add a new node to XML test response? #1397

pavelkostyurin opened this issue Nov 15, 2022 · 3 comments

Comments

@pavelkostyurin
Copy link

** General Description **
I'd like to add new node to test XML response, because it would be beneficial to our needs. However, I failed to find a corresponding place in code. Could you please, navigate me, how could I implement this? Thanks in advance!

** What have you tried? **
I tried to inspect the FitNesse code in order to figure out solution on my own

@fhoeben
Copy link
Collaborator

fhoeben commented Dec 19, 2022

Sorry, it's not clear to me what you mean by

I'd like to add new node to test XML response

Do you mean 'code to test XML response'?

FitNesse is a testing framework, to perform actual tests you need to write 'fixture code'. This is not a change in the FitNesse project codebase, but additional code loaded when starting a test from the wiki.

So adding some code to check a piece of XML requires a fixture to retrieve/load the XML and then perform the check. You can create one your own fixture or maybe you can use one of the existing fixture 'plugins'. (I would recommend you use 'Slim' to connect you code to the wiki, instead of 'fit' which is used in the initial fixture code examples.)

I know my own fixture project includes some features to test XML. Especially for XML retrieved via HTTP calls.

@pavelkostyurin
Copy link
Author

@fhoeben Thanks for your answer. FitNesse XML response consists of many XML nodes, like test results, right, wrong, etc. I'd like to add new XML node to it, test's help text to be precise. Do you have any hints how to do that?

@fhoeben
Copy link
Collaborator

fhoeben commented May 7, 2023

@pavelkostyurin I have to admit I never worked with the XML response of FitNesse, so I cannot really help you I'm afraid.

Looking at the code I come across SuiteXmlReformatter which uses fitnesse/resources/templates/suiteXML.vm to generate an XML response using Velocity. Are you looking to extend/change that?

I also see suiteHistoryXML.vm and testHistoryXML.vm which I assume generate the XML in different contexts. So you may want to add nodes there.

Hopefully these minimal pointers give you a place to start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants