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

Add additional information to report #179

Closed
martingrossmann opened this issue Nov 29, 2021 · 4 comments · Fixed by #197
Closed

Add additional information to report #179

martingrossmann opened this issue Nov 29, 2021 · 4 comments · Fixed by #197
Labels
enhancement New feature or request

Comments

@martingrossmann
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The Testerra legacy report provided the ReportInfo class to add some information to the dashboard or to method details page.
ReportNG does not have such a feature to personalize the report.

Describe the solution you'd like
The ExecutionContext could hold some meta data as a map. The content of this map can be placed on the dashboard in an extra box.

@mreiche
Copy link
Collaborator

mreiche commented Jan 12, 2022

We need to introduce a new Info model. My proposal would be to have the following information.

  • Info Key (like xray.sync.status)
  • Message
  • LogLevel (like WARN, INFO, ERROR)

This Info model could be added to the MethodContext or ExecutionContext like:

Info info = new Info("Synchronisation successful", LogLevel.INFO);
context.setInfo("xray.sync.status", info);

@martingrossmann
Copy link
Contributor Author

If we add the Info object to MethodContext and to ExecutionContext we will have the possibility to add information to the whole test run and to single methods.

@mreiche
Copy link
Collaborator

mreiche commented Jan 19, 2022

Proposal 2: Add a prompt property to LogMessage class

A message with prompt=true is not a regular message based on a Log4J LogEvent, but it's user generated.

Advantages:

  • We can reuse the LogMessage model
  • LogMessages are context sensitive and can be placed in MethodContext or ExecutionContext
  • They are visible in the reports log view
  • They can be shown within the Reports' method details view by filtering:
    const promptMessage = methodContext.logMessages.filter(value => value.prompt);

To create such a message programatically, do:

LogMessage logMessage = new LogMessage("Synchronisation successful", Level.INFO);
methodContext.addLogMessage(logMessage);

Assert.assertTrue(logMessage.isPrompt());

User-friendly usage via. Loggable interface:

// Regular context sensitive log message
log().info("My log message");

// Prompt context sensitive log message
prompt().warn("XRay synchronisation failed");

@mreiche
Copy link
Collaborator

mreiche commented Jan 20, 2022

Final proposal (works best with current implementation).

log().info("Prompts a message", Loggable.prompt);
log().info("Sends a message to another MethodContext", MethodContext methodContext);
log().info("Prompt me to method context", Loggable.prompt, MethodContext methodContext);

@mreiche mreiche mentioned this issue Jan 21, 2022
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants