percy / percy-playwright

Playwright client library for visual testing with Percy
MIT License
17 stars 6 forks source link

Unable to take screenshot for single element #115

Closed luckhiem closed 2 years ago

luckhiem commented 2 years ago

The problem

using scope to take screenshots in a single element but the error Object literal may only specify known properties, and 'scope' does not exist in type 'SnapshotOptions' in the return

Environment

Details

https://docs.percy.io/docs/screenshot-a-single-element

Debug logs

Argument of type '{ scope: string; }' is not assignable to parameter of type 'SnapshotOptions'.
Object literal may only specify known properties, and 'scope' does not exist in type 'SnapshotOptions'

Code to reproduce the issue

import percySnapshot from "@percy/playwright";
....
await percySnapshot(page, "name", { scope: '.cookie-banner' })
Robdel12 commented 2 years ago

Hey @luckhiem! Are you using TypeScript? This seems like it's a type error (just want to be 100% sure)