Skip to content

Template Activation: update needed for @wordpress/e2e-test-utils-playwright #71815

@kmanijak

Description

@kmanijak

Description

EDIT: Update description

With Template Activation some @wordpress/e2e-test-utils-playwright stopped working as they used to, mainly saveSiteEditorEntities in packages/e2e-test-utils-playwright/src/editor/site-editor.ts. Save flow has changed and will be updated so final changes should include whatever #71811 ends up with


This is old description but visitSiteEditor can be easily addressed by either providing wp_id returned for custom created template or replacing wp_template with wp_registered_template.

With Template Activation some @wordpress/e2e-test-utils-playwright stopped working as they used to, mainly visitSiteEditor in packages/e2e-test-utils-playwright/src/admin/visit-site-editor.ts no longer works when passing postType: wp_template, postId: <<template_slug>> resulting in /wp-admin/site-editor.php?postId=twentytwentyfour%2F%2Fsingle-product&postType=wp_template&canvas=edit and no content:

Image

Step-by-step reproduction instructions

In your Playwright test use visitSiteEditor util to visit template in editor:

Used to be:

await visitSiteEditor( {
	postId: <<TEMPLATE_SLUG>>,
	postType: 'wp_template',
	canvas: 'edit',
} );

now with template slug being represented by postId it cannot be always known upfront.

Screenshots, screen recording, code snippet

No response

Environment info

  • GB 21.7RC

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions