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

[Feature] Expand testCaseIDMatcher to work with annotations #78

Closed
Az8th opened this issue Sep 20, 2024 · 5 comments · Fixed by #80
Closed

[Feature] Expand testCaseIDMatcher to work with annotations #78

Az8th opened this issue Sep 20, 2024 · 5 comments · Fixed by #80
Assignees
Labels

Comments

@Az8th
Copy link

Az8th commented Sep 20, 2024

Hello,

I just seen that #76 was resolved, thanks for the improvement !
As I realised that it was very close to the initial purpose of #55, except it would focus on annotations rather than tags, would it be possible to add the support for it please ?

It would be much less visible on the main page of the test report, but would still be visible when reviewing a specific test, with the possibility to directly add a clickable link to the test plan.

Example:

Using the new matcher

testCaseIdMatcher: azureTestID,

If needed, a parameter to specify where to search ID between tag, titles or annotations could be added

testCaseIdZone: ['title', 'annotation'],

Specifying test ID using annotation

test("Title", {
  tag: ['@tag1', '@tag2'],
  annotation: [{ type: 'azureTestID', description: '42' }]
  }, async ({ page }) => {
  //perform actions
});
@alexneo2003 alexneo2003 self-assigned this Sep 22, 2024
@alexneo2003
Copy link
Owner

@Az8th
I have published beta version, can you check it?

also you can read README about version

@Az8th
Copy link
Author

Az8th commented Sep 24, 2024

Waow ! Nice work, will test it today ;)

@Az8th
Copy link
Author

Az8th commented Sep 24, 2024

@alexneo2003 Works like a charm, thanks for your work !

Just wondering if testCaseIdZone should have separate title and tags values.
I initially thought that due to the old way of declaring them (in the title with an @), they were not separated, but it seems that the API now include a separate testInfo.tags property !

There is only one thing that I can't recover from my prior setup though, in order to have the Tests tab in the pipeline run, I use the following task in my pipeline file:

 - task: PublishTestResults@2
    displayName: "Tests reports publication on Azure"
    condition: eq(variables['initDone'], 'true')
    inputs:
      searchFolder: "Reports"
      testResultsFiles: "e2e-junit-results.xml"
      testResultsFormat: "JUnit"
      mergeTestResults: true
      failTaskOnFailedTests: false
      testRunTitle: "${{parameters.project}} Playwright tests"

And use this reporter in the Playwright config file : ['junit', { outputFile: 'Reports/e2e-junit-results.xml' }]

Nevetheless, as this task also creates a test run, I removed it to avoid duplicates, but the tab is no longer visible on my pipeline run. What is strange is that both Test results tab acts the same when comparing Test run reports. Am I missing something to make this appear, or is it not supported yet, and shall open a dedicated issue ?

@alexneo2003
Copy link
Owner

@Az8th

  1. testCaseIdZone by default has title config which look at title and tags section together to save backward compatibility.
    after last release was made, when you use test title to define you testCaseIds you can define testcaseid in you own format (without @ symbol inside title). but when you use tags section you still need to define testCaseId in format which included @ symbol - it's Playwright requirement
    just look at some examples
Monosnap example spec ts — pw-example 2024-09-26 10-12-19 Monosnap Playwright Test Report 2024-09-26 10-13-41 Monosnap example spec ts — pw-example 2024-09-26 10-15-20 Monosnap Playwright Test Report 2024-09-26 10-15-54
  1. about test tab inside release. currently we have the same flow as you - playwright-azure-reporter + junit report for tests tab. and yes - you still have both inside Test Runs.

If you have some question I'll try to answer for it, if I am aware of it. If not - lets deploy current feature

@Az8th
Copy link
Author

Az8th commented Sep 26, 2024

Thanks for your answers, I understand the backward compatibility importance, feel free to close the issue when it is officialy released ;)
About the test run duplicate, I have an idea on how we could be able to fix this, I will open a separate issue to avoid polluting this one

@alexneo2003 alexneo2003 linked a pull request Sep 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants