-
Notifications
You must be signed in to change notification settings - Fork 2
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
transformDOM not working #5
Comments
Hi @ErikCupal! Thanks for the report and the good investigation. I'm looking into this issue now and I want to make sure that I'm completely understanding the issue and how to best solve it for you. Can you please give me a little more information about exactly how you are using the |
Thanks for quick reply @lencioni. Here is an example of how we are using const page = await context.newPage()
// test code
// ...
await happoPlaywright.screenshot(page, page.locator("body"), {
component: "Members page",
variant: "default",
transformDOM: {
selector: "[data-test=members-company-member-email]",
transform: (_, doc) => {
const div = doc.createElement("div")
div.innerHTML = "HAPPO_PLACEHOLDER"
return div
},
}
}) As I mentioned earlier, this used to work perfectly with |
Hi @ErikCupal! We looked into this yesterday and it turns out supporting this option for Playwright is a little bit tricky. We found a way but it included using It looks like you're using |
Thanks for the suggestion @trotzig yes, Maybe it would be good to mention it in the docs that |
This question came up recently and it seems like we should document it to help point people in the right direction. More info: happo/happo-playwright#5
Hello @trotzig! We have been using Happo with Cypress almost for two years without issues. Recently we migrated from Cypress to Playwright. All went well except of Happo DOM transformations, which stopped working.
First I thought the problem is on our side, but now I have the suspision that it's a problem in
happo-playwright
. Specifically, it looks that thetransformDOM
property is not even passed to thehappoTakeDOMSnapshot
function:I compared it with
happo-cypress
, there the transformDOM is passed:The text was updated successfully, but these errors were encountered: