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]: export globals/currentTestInfo() for custom matchers #7558

Closed
florianbepunkt opened this issue Jul 12, 2021 · 2 comments
Closed
Labels
feature-test-runner Playwright test specific issues P3-collecting-feedback

Comments

@florianbepunkt
Copy link

florianbepunkt commented Jul 12, 2021

Feature request

I'm writing a custom matcher that ports additional image comparison algorithms in order to solve my issue in #7548

Could you please export currentTestInfo() from https://github.com/microsoft/playwright/blob/master/src/test/globals.ts so wen can import it in our custom matchers like import { currentTestInfo } from "@playwright/test"

As far as I know this is the only method to receive snapshots paths and some more test info inside a custom matcher. I can require this file, but this means loosing TS support in IDE.

I think other people writing their own matchers would benefit from this as well.

@mxschmitt mxschmitt added P3-collecting-feedback feature-test-runner Playwright test specific issues labels Jul 13, 2021
@pavelfeldman
Copy link
Member

test.info() will be there as of v1.18.

@nicojs
Copy link
Contributor

nicojs commented Jan 4, 2022

And how will we get a reference to the test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-test-runner Playwright test specific issues P3-collecting-feedback
Projects
None yet
Development

No branches or pull requests

4 participants