-
Notifications
You must be signed in to change notification settings - Fork 17
[TE-3912] Add support for tagging executions in playwright #112
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
Conversation
playwright/reporter.js
Outdated
const fileName = this._paths.prefixTestPath(test.location.file); | ||
const location = [fileName, test.location.line, test.location.column].join(':'); | ||
|
||
const tags = (test.tags || []).reduce((acc, test) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you looked into Test Annotation? It supports key/value-like structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered that yep, but felt it was more likely that they were already using the annotations for other stuff than using tags in a particular format. I'd then need to allow for an annotation sentinel that I could use to detect annotations that were meant to be passed through to bk, to avoid ones that weren't being passed through.
9283f11
to
8e2d05a
Compare
8e2d05a
to
a6f8066
Compare
const { test, expect } = require('@playwright/test'); | ||
|
||
test('has title', async ({ page }) => { | ||
test('has title', { tag: ['@foo:bar'] }, async ({ page }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make sure it works with multiple tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me 👍 Can we also update the readme?
94a1da1
to
7768087
Compare
@nprizal @KatieWright26 I've updated the tests and added a small section to the README.md. Could I please have a re-review? TIA! |
Description
Playwright has the ability to tag tests.
We want to enable execution-level tagging for playwright so that individual executions can be tagged in TE.
This PR adds the ability to specify tags in the form of
@key:value
and have these parsed by TE askey: value
pairs.