fix: stitch all frames into one snapshot (#49)
This commit is contained in:
parent
fb24561c67
commit
723a5420e6
3 changed files with 54 additions and 3 deletions
|
|
@ -155,5 +155,13 @@ export const screenshot: Tool = {
|
|||
};
|
||||
|
||||
function refLocator(page: playwright.Page, ref: string): playwright.Locator {
|
||||
return page.locator(`aria-ref=${ref}`);
|
||||
let frame = page.frames()[0];
|
||||
const match = ref.match(/^f(\d+)(.*)/);
|
||||
if (match) {
|
||||
const frameIndex = parseInt(match[1], 10);
|
||||
frame = page.frames()[frameIndex];
|
||||
ref = match[2];
|
||||
}
|
||||
|
||||
return frame.locator(`aria-ref=${ref}`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue