playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Feature]: Show URL's within annotations as hyperlink

Open dirtydiesel46 opened this issue 11 months ago • 2 comments

🚀 Feature Request

Add functionality to display URL within annotations as hyperlink instead of just as a string

Example

test.describe(
  "Test URL string hyperlink",
  {
    annotation: [
      {
        type: "issue",
        description:
          "https://github.com/microsoft/playwright/issues/new?assignees=&labels=&projects=&template=feature.yml&title=%5BFeature%5D:+",
      },
      {
        type: "Project",
        description: "Part of this project - https://github.com/microsoft/playwright/issues/new?assignees=&labels=&projects=&template=feature.yml&title=%5BFeature%5D:+",
      },
    ],
  },

As can be seen in a report for running the above example test, the "issue" description will be fine - and show as a hyperlink - because it's the only part of the string present

However, the Project description won't show as an hyperlink - just as a normal string

Suggest adding functionality to do the below

test.describe(
  "Test URL string hyperlink",
  {
    annotation: [
      {
        type: "issue",
        description:
          "https://github.com/microsoft/playwright/issues/new?assignees=&labels=&projects=&template=feature.yml&title=%5BFeature%5D:+",
      },
      {
        type: "Project",
        url: "https://github.com/microsoft/playwright/issues/new?assignees=&labels=&projects=&template=feature.yml&title=%5BFeature%5D:+"
        description: "Part of this project",
      },
    ],
  },

Motivation

Easier to click on the hyperlink and open up the URL, similar to how Playwright currently caters for only a URL in a string to be hyperlinked, adding support for this would make it even better..

dirtydiesel46 avatar Mar 25 '24 14:03 dirtydiesel46

Would be greetly appreciated, it would for example be used to add a link to the corresponding issue/task directly in the report

Az8th avatar Mar 26 '24 14:03 Az8th

Hello! :) @dirtydiesel46 I made #30665 PR 🙆🏻‍♀️ PTAL when you have time 🙇🏻‍♂️

osohyun0224 avatar May 05 '24 13:05 osohyun0224

This first change looks good! Could you follow up with:

  • rendering it in the HTML report and other reports
  • rendering it in the Trace
  • supporting it in the TeleReceiver/Emitter for shard merger?

pavelfeldman avatar May 21 '24 19:05 pavelfeldman

This seems to be addressed by https://github.com/microsoft/playwright/pull/31521.

mxschmitt avatar Jul 08 '24 18:07 mxschmitt