Implement Playwright utility functions/improvements

Created on 11 August 2025, about 1 month ago

Overview

After πŸ“Œ Port component-operations.cy.js tests to Playwright Active lands there is some QoL changes to be done for our Playwright tests ahead of porting more Cypress tests over.

Proposed resolution

  1. Ascertain if the Webkit workarounds for clicking/hovering are necessary and/or if they can be only used conditionally or something to try and tidy clickPreviewComponent and hoverPreviewComponent
  2. Regardless of the outcome of the above I think both the functions mentioned above should be improved by a) taking a component name, not an id (e.g. 'Hero' instead of 'sdc.xb_test_sdc.my-hero') and b) taking an optional index parameter to allow for example clicking the 2nd Hero on a page.
  3. editComponentProp is set up to automatically blur the field after entering a value but I think this should be a manual step as it might be desirable to test instances where a user does not blur a field (e.g. seeing real-time updates to the preview).
  4. The methods in XBEditor.ts could all do with a nice set of comments explaining how and when they should be used for future test writers.
  5. It might be worth considering moving some commands in XBEditor.ts to a new file because some commands are aimed at the Code Component editor rather than the main XB editor. This should set us up nicely for when need to start adding PW tests for other parts of XB (like segments/audiences etc)

User interface changes

πŸ“Œ Task
Status

Active

Version

1.0

Component

… to be triaged

Created by

πŸ‡¬πŸ‡§United Kingdom jessebaker

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024