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] Can test timestamp be retrieved from Restful test method? #1396

Open
roboaks opened this issue Nov 8, 2022 · 3 comments
Open

Comments

@roboaks
Copy link

roboaks commented Nov 8, 2022

General Description
My overall goal is to be able to execute individual tests via the Restful API and then process the response as follows:

  1. Extract summary results (right/wrong/ignored/exceptions)
  2. Create a link to the full HTML test results (e.g. http://host.com:8000/ClientSuites.ClaimsMigrationSuites.LossNoticeMigrator?pageHistory&resultDate=20221108155215)

This processed response is then stored in a DB. 1 is easily accomplished with a regex. 2 is more difficult as explained next.

The test results HTML has this timestamp info:
image

If the API response had this timestamp as well, I could easily construct the link to the full HTML results. Alas, the API response does not include this timestamp.

What have you tried?

I tried generating a timestamp in my code (Java) just before the call to the FitNesse API but, alas, the code generated timestamp does not reliably correspond to the test timestamp (it seems to differ by 1 second and I'm not confident that's reliable).

Can someone provide a way to solve this problem?

@fhoeben
Copy link
Collaborator

fhoeben commented Nov 9, 2022

Can you be explicit about the exact request you send to have the test executed, so we are more clear what response should contain the timestamp/result?

Can you elaborate on how the call and database storage are used in your test setup? It's just for my curiosity, I haven't heard of this kind of setup before.
If you keep a database of test results I would imagine you would want the actual HTML result also to be in the database. I normally would not 'trust' the FitNesse server to keep the history but have that stored along with the summary so they are consistent and there is a single source of truth regarding test execution.

@roboaks
Copy link
Author

roboaks commented Nov 9, 2022

Here is a sample URL (I have omitted additional name/value pairs at the end):

http://localhost:8000/ClientSuites.ClaimsMigrationSuites.LossNoticeMigrator?responder=test&format=xml&SutLoginProfile=uat.adminaft.1&NAME_GIVEN_NAME=%24%7BSKIP%7D&SUB_LOSS_CAUSE_CD=Fire-All+Other&...

And whether we use format=xml or format=html doesn't seem to matter: the timestamp doesn't appear in the response.

Our ITAP (ITS Test Automation Platform) platform is built on top of FitNesse and a fixture that wraps Selenium (and provides a lot of advanced functionality). We use ITAP for some unorthodox purposes including, in this case, using it in conjunction with our data migration platform (the IDMP) to migrate insurance claims to a system that does not have an API for that purpose. The IDMP maintains the migration lifecycle status in a DB. I would strongly prefer not to store the entire FitNesse response in the DB but, rather, just the summary results and a link to the full HTML results in FitNesse. Apart from the sheer volume of data that would entail, neither the HTML nor XML response from FitNesse seems very human readable (the HTML response certainly doesn't display the way it does in FitNesse itself--perhaps because of missing style sheets?). Even if the test history is not 100% reliable, it's still better than just storing the response.

I just need a way to generate the test history URL from the test response and that seems to require the timestamp that appears at the top of the FitNesse results.

@roboaks
Copy link
Author

roboaks commented Nov 15, 2022

Any ideas?

fhoeben added a commit to fhoeben/fitnesse that referenced this issue Dec 23, 2022
fhoeben added a commit that referenced this issue Dec 23, 2022
* Add date and page history link to XML responses, #1396
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