Skip to content

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Aug 9, 2025

  • Move codegen to isomorphic, generate code on the client side for the recorder api.
  • Move deviceDescriptors to isomorphic, as these are used by codegen.
  • Remove ProgrammaticRecorderApp as it does not do anything anymore.
  • Move actionUpdated logic to the recorder core.

Copy link
Contributor

github-actions bot commented Aug 9, 2025

Test results for "tests 1"

6 failed
❌ [chromium-library] › library/multiclient.spec.ts:350:1 › should avoid side effects upon disconnect @ubuntu-22.04-chromium-tip-of-tree
❌ [webkit-library] › library/browsercontext-viewport-mobile.spec.ts:157:5 › mobile viewport › mouse should work with mobile viewports and cross process navigations @webkit-ubuntu-22.04-node18
❌ [webkit-library] › library/screenshot.spec.ts:95:14 › page screenshot › should work with device scale factor and scale:css @webkit-ubuntu-22.04-node18
❌ [webkit-library] › library/screenshot.spec.ts:205:14 › element screenshot › element screenshot should work with a mobile viewport @webkit-ubuntu-22.04-node18
❌ [webkit-library] › library/screenshot.spec.ts:218:14 › element screenshot › element screenshot should work with device scale factor @webkit-ubuntu-22.04-node18
❌ [webkit-library] › library/video.spec.ts:441:5 › screencast › should work for popups @webkit-ubuntu-22.04-node18

43 flaky ⚠️ [chromium-library] › library/trace-viewer.spec.ts:1358:1 › should highlight locator in iframe while typing @chromium-ubuntu-22.04-node22
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1079:7 › cli codegen › should not throw csp directive violation errors @firefox-ubuntu-22.04-node18
⚠️ [firefox-page] › page/page-add-script-tag.spec.ts:93:3 › should throw when added with content to the CSP page @firefox-ubuntu-22.04-node18
⚠️ [webkit-library] › library/browsercontext-device.spec.ts:45:5 › device › should scroll to click @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › library/browsercontext-pages.spec.ts:82:3 › should click the button with offset with page scale @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › library/browsercontext-pages.spec.ts:105:3 › should return bounding box with page scale @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › library/browsercontext-viewport-mobile.spec.ts:87:5 › mobile viewport › should support window.orientation emulation @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › library/browsercontext-viewport-mobile.spec.ts:97:5 › mobile viewport › should fire orientationchange event @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › library/browsercontext-viewport-mobile.spec.ts:116:5 › mobile viewport › default mobile viewports to 980 width @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › library/browsercontext-viewport-mobile.spec.ts:175:5 › mobile viewport › should scroll when emulating a mobile viewport @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › library/defaultbrowsercontext-2.spec.ts:28:3 › should work in persistent context @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › library/emulation-focus.spec.ts:104:3 › should not affect screenshots @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › library/screenshot.spec.ts:44:14 › page screenshot › should work with a mobile viewport @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › library/screenshot.spec.ts:55:14 › page screenshot › should work with a mobile viewport and clip @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › library/screenshot.spec.ts:66:14 › page screenshot › should work with a mobile viewport and fullPage @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › library/trace-viewer.spec.ts:827:1 › should preserve currentSrc @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › library/video.spec.ts:411:5 › screencast › should capture css transformation @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/elementhandle-bounding-box.spec.ts:30:3 › should handle nested frames @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/elementhandle-screenshot.spec.ts:36:5 › element screenshot › should work when main world busts JSON.stringify @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/elementhandle-screenshot.spec.ts:199:5 › element screenshot › should wait for visible @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/elementhandle-screenshot.spec.ts:259:5 › element screenshot › should prefer type over extension @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/locator-misc-2.spec.ts:96:3 › should take screenshot @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-add-locator-handler.spec.ts:184:5 › should work with toHaveScreenshot @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-click.spec.ts:1053:3 › should click a button that is overlaid by a permission popup @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:139:5 › page screenshot › should clip rect @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:153:5 › page screenshot › should clip rect with fullPage @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:183:5 › page screenshot › should throw on clip outside the viewport @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:215:5 › page screenshot › should take fullPage screenshots @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:224:5 › page screenshot › should take fullPage screenshots and mask elements outside of it @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:260:5 › page screenshot › should render white background on jpeg file @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:283:5 › page screenshot › should work for canvas @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:327:5 › page screenshot › should work for webgl @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:358:5 › page screenshot › should work with iframe in shadow @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:425:5 › page screenshot › should work with Array deleted @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:433:5 › page screenshot › should take fullPage screenshots during navigation @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:451:7 › page screenshot › mask option › should work @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:459:7 › page screenshot › mask option › should work with locator @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:468:7 › page screenshot › mask option › should work with elementhandle @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:556:7 › page screenshot › mask option › should work when mask color is not pink #F0F @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:565:7 › page screenshot › mask option › should hide elements based on attr @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:580:7 › page screenshot › mask option › should remove elements based on attr @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:868:5 › page screenshot animations › should wait for fonts to load @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-set-input-files.spec.ts:38:5 › should upload a folder @webkit-ubuntu-22.04-node18

46600 passed, 805 skipped
✔️✔️✔️

Merge workflow run.

@dgozman dgozman requested a review from pavelfeldman August 9, 2025 17:07
};
const languageGenerator = languages.find(l => l.id === params.language) ?? languages.find(l => l.id === 'playwright-test')!;

this._channel.on('recorderEvent', ({ event, data, page }) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is enable/disable/enable scenario supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, updated.


static async show(context: BrowserContext, params: channels.BrowserContextEnableRecorderParams) {
if (process.env.PW_CODEGEN_NO_INSPECTOR)
if (process.env.PW_CODEGEN_NO_INSPECTOR || params.recorderMode === 'api')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recorderMode === 'api' should not get here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not. I guess I can replace the check with the comment, that would be better.

if (debugMode() === 'inspector')
await RecorderApp.show(this, { pauseOnNextStatement: true });

// When paused, show inspector.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did this go?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was dead code. We are initializing the browser context, cannot be already paused here.

* limitations under the License.
*/

import { CSharpLanguageGenerator } from './csharp';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason move is not detected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess adding types to this small file pushed it over the "changed" threshold.

@dgozman dgozman force-pushed the chore-recorder-partially-to-client branch from 12df65c to f8ce4b0 Compare August 11, 2025 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants