Rayrun
← Back to Discord Forum

Report Portal detailed reports

Hey everyone, not sure if this is really the correct place, as it's tied to a third party reporting integration. We are looking for the best way to achieve good reporting on each action in Report Portal. We are using the official RP agent - https://github.com/reportportal/agent-js-playwright

What's the best way to log as much info as possible with it? So far the only way we've achieved it is by wrapping the relevant (for us) Playwright API actions (click, fill, waitFor, etc) in a custom class and putting the relevant logs there. The downside is that we can't use the Playwright API directly as we lose the logging capability. Is there a better way to achieve the same behaviour directly with the Playwright API and a custom reporter or anything else?

Example of what we want to get into RP: Entering automation in the #username Clicking on text='Login'

This thread is trying to answer question "What's the best way to log as much info as possible with the official RP agent without losing the logging capability when using the Playwright API directly?"

3 replies

@jaratlanta I don't think that this would work for Report Portal

@gh0s72087: Hi @gh0s72087 . Were you able to get the solution?

Hi @gh0s72087 . Were you able to get the solution?

Answer

Maximize Logging with RP Agent and Playwright API

To get the most out of your logging with the RP agent and Playwright API, you'll want to use Playwright's trace viewer. This tool gives you a detailed view of your tests, including actions, timing, parameters, return values, and logs.

Local Testing

When running tests locally, start recording a trace by setting the --trace flag to "on". Use the command npx playwright test --trace on.

npx playwright test --trace on

This records traces for each test and generates an HTML report.

Continuous Integration Testing

For tests on continuous integration (CI), configure traces to run on the first retry of a failed test. Set the trace: 'on-first-retry' option in your test configuration file (playwright.config.ts).

module.exports = {
  use: {
    trace: 'on-first-retry',
  },
};

This produces a trace.zip file for each retried test.

Using the Trace Viewer

The trace viewer lets you inspect your tests in detail. You can see actions, their time and duration, console output, network requests, and source code.

By integrating the Playwright trace viewer with RP Agent logging, you get detailed logging while still benefiting from Playwright API's other features.

Remember, this advice is based on the information provided. If you have specific requirements or constraints not covered here, please provide more context.

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.