From 2b1a932b8e79abb45e9c060cae3aa9188ee7ae36 Mon Sep 17 00:00:00 2001 From: Smrtnyk Date: Wed, 15 Oct 2025 19:06:15 +0200 Subject: [PATCH 1/2] chore(): update playwright --- e2e/utils/CanvasUtil.ts | 32 ++++++++++++++++++++------------ e2e/utils/ObjectUtil.ts | 25 +++++++++++++++---------- package-lock.json | 24 ++++++++++++------------ package.json | 2 +- 4 files changed, 48 insertions(+), 35 deletions(-) diff --git a/e2e/utils/CanvasUtil.ts b/e2e/utils/CanvasUtil.ts index 1b420245af1..7c67a7ede3a 100644 --- a/e2e/utils/CanvasUtil.ts +++ b/e2e/utils/CanvasUtil.ts @@ -1,16 +1,24 @@ -import type { JSHandle } from '@playwright/test'; -import type { PageFunctionOn } from 'playwright-core/types/structs'; -import type { LocatorScreenshotOptions, Page } from '@playwright/test'; +import type { + JSHandle, + LocatorScreenshotOptions, + Page, +} from '@playwright/test'; import type { Canvas, XY } from 'fabric'; import os from 'node:os'; import type { ObjectUtil } from './ObjectUtil'; import * as fabric from 'fabric'; export class CanvasUtil { + executeInBrowser: JSHandle['evaluate']; + evaluateHandle: JSHandle['evaluateHandle']; + constructor( readonly page: Page, readonly selector = '#canvas', - ) {} + ) { + this.executeInBrowser = this._executeInBrowserImpl.bind(this); + this.evaluateHandle = this._evaluateHandleImpl.bind(this); + } click(clickProperties: Parameters[1]) { return this.page.click(`canvas_top=${this.selector}`, clickProperties); @@ -84,17 +92,17 @@ export class CanvasUtil { ); } - async executeInBrowser( - runInBrowser: PageFunctionOn, - context: C, - ): Promise { + private async _executeInBrowserImpl( + runInBrowser: any, + context?: any, + ): Promise { return (await this.evaluateSelf()).evaluate(runInBrowser, context); } - async evaluateHandle( - runInBrowser: PageFunctionOn, - context: C, - ): Promise> { + private async _evaluateHandleImpl( + runInBrowser: any, + context?: any, + ): Promise { return (await this.evaluateSelf()).evaluateHandle(runInBrowser, context); } } diff --git a/e2e/utils/ObjectUtil.ts b/e2e/utils/ObjectUtil.ts index 9d213b4bf5d..09cab622118 100644 --- a/e2e/utils/ObjectUtil.ts +++ b/e2e/utils/ObjectUtil.ts @@ -1,16 +1,21 @@ import type { JSHandle, Page } from '@playwright/test'; import { expect } from '@playwright/test'; import type { FabricObject } from 'fabric'; -import type { PageFunctionOn } from 'playwright-core/types/structs'; export class ObjectUtil { + executeInBrowser: JSHandle['evaluate']; + evaluateHandle: JSHandle['evaluateHandle']; + constructor( readonly page: Page, /** * the key matching the a key returned from the {@link beforeAll} or {@link before} callback */ readonly objectId: string, - ) {} + ) { + this.executeInBrowser = this._executeInBrowserImpl.bind(this); + this.evaluateHandle = this._evaluateHandleImpl.bind(this); + } evaluateSelf() { return this.page.evaluateHandle( @@ -19,17 +24,17 @@ export class ObjectUtil { ); } - async executeInBrowser( - runInBrowser: PageFunctionOn, - context: C, - ): Promise { + private async _executeInBrowserImpl( + runInBrowser: any, + context?: any, + ): Promise { return (await this.evaluateSelf()).evaluate(runInBrowser, context); } - async evaluateHandle( - runInBrowser: PageFunctionOn, - context?: C, - ): Promise> { + private async _evaluateHandleImpl( + runInBrowser: any, + context?: any, + ): Promise { return (await this.evaluateSelf()).evaluateHandle(runInBrowser, context); } diff --git a/package-lock.json b/package-lock.json index 163c93a10ca..29d47faac94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@babel/preset-env": "^7.28.3", "@babel/preset-typescript": "^7.27.1", "@eslint/js": "^9.37.0", - "@playwright/test": "^1.55.0", + "@playwright/test": "^1.56.0", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-terser": "^0.4.4", @@ -3209,13 +3209,13 @@ } }, "node_modules/@playwright/test": { - "version": "1.55.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.55.1.tgz", - "integrity": "sha512-IVAh/nOJaw6W9g+RJVlIQJ6gSiER+ae6mKQ5CX1bERzQgbC1VSeBlwdvczT7pxb0GWiyrxH4TGKbMfDb4Sq/ig==", + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.56.0.tgz", + "integrity": "sha512-Tzh95Twig7hUwwNe381/K3PggZBZblKUe2wv25oIpzWLr6Z0m4KgV1ZVIjnR6GM9ANEqjZD7XsZEa6JL/7YEgg==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.55.1" + "playwright": "1.56.0" }, "bin": { "playwright": "cli.js" @@ -8001,13 +8001,13 @@ } }, "node_modules/playwright": { - "version": "1.55.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.55.1.tgz", - "integrity": "sha512-cJW4Xd/G3v5ovXtJJ52MAOclqeac9S/aGGgRzLabuF8TnIb6xHvMzKIa6JmrRzUkeXJgfL1MhukP0NK6l39h3A==", + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.0.tgz", + "integrity": "sha512-X5Q1b8lOdWIE4KAoHpW3SE8HvUB+ZZsUoN64ZhjnN8dOb1UpujxBtENGiZFE+9F/yhzJwYa+ca3u43FeLbboHA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.55.1" + "playwright-core": "1.56.0" }, "bin": { "playwright": "cli.js" @@ -8020,9 +8020,9 @@ } }, "node_modules/playwright-core": { - "version": "1.55.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.55.1.tgz", - "integrity": "sha512-Z6Mh9mkwX+zxSlHqdr5AOcJnfp+xUWLCt9uKV18fhzA8eyxUd8NUWzAjxUh55RZKSYwDGX0cfaySdhZJGMoJ+w==", + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.0.tgz", + "integrity": "sha512-1SXl7pMfemAMSDn5rkPeZljxOCYAmQnYLBTExuh6E8USHXGSX3dx6lYZN/xPpTz1vimXmPA9CDnILvmJaB8aSQ==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index 75da1c9a078..5f6d577ec82 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "@babel/preset-env": "^7.28.3", "@babel/preset-typescript": "^7.27.1", "@eslint/js": "^9.37.0", - "@playwright/test": "^1.55.0", + "@playwright/test": "^1.56.0", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-terser": "^0.4.4", From 1b14253899f426e8c76a0e5875cc74a47397b08a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 15 Oct 2025 17:09:28 +0000 Subject: [PATCH 2/2] update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06a510e67aa..26b56b64f50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [next] +- chore(): update playwright [#10780](https://github.com/fabricjs/fabric.js/pull/10780) - chore(): up dev deps [#10773](https://github.com/fabricjs/fabric.js/pull/10773) - chore(): up deps [#10771](https://github.com/fabricjs/fabric.js/pull/10771) - chore(): remove moment dev dependency [#10770](https://github.com/fabricjs/fabric.js/pull/10770)