wordpress-playground icon indicating copy to clipboard operation
wordpress-playground copied to clipboard

Use Theme Unit Test Data as a starter content

Open courtneyr-dev opened this issue 2 years ago • 7 comments

Import https://github.com/WordPress/theme-test-data into Beta/RC versions so that testing areas, such a query block, list of posts, navigation menus, and more have content created to ease testing setup time.

courtneyr-dev avatar Oct 19 '23 16:10 courtneyr-dev

Oh yes, that would be absolutely fantastic! And, since importing content is already supported, this could be just about making that data easy to „turn on”.

adamziel avatar Oct 20 '23 09:10 adamziel

Related: https://meta.trac.wordpress.org/ticket/7309

adamziel avatar Nov 06 '23 18:11 adamziel

This is more of a documentation / UX thing on how to get that content into Playground (as it's already supported).

adamziel avatar Nov 21 '23 14:11 adamziel

Theme unit test data may now be imported using this works thanks to @eliot-akira and #610!

https://playground.wordpress.net/?php=8.0&wp=6.4&storage=none&networking=yes&import-content=https://raw.githubusercontent.com/WordPress/theme-test-data/master/themeunittestdata.wordpress.xml

As a side note, unfortunately some CORS issues visible in devtools are preventing the importer from downloading the images from this particular XML export. Perhaps the image URLs in the export file could be updated to reference the raw.githubusercontent.com domain?

adamziel avatar Dec 11 '23 19:12 adamziel

If someone wants to look at how to fix the CORS situation, here's a great troubleshooting option for contributor day image

  • https://github.com/WordPress/wordpress-playground/issues/1185

Otherwise it's a great Blueprint for the Community

Blueprint for Theme Unit Testing with Playground

  • https://github.com/adamziel/blueprints/issues/1

flexseth avatar Apr 12 '24 00:04 flexseth

The CORS issue cannot be fixed, as it's just the security mechanism implemented by web browsers. We can, however, provide a developer friendly error message in the console, see #1205.

adamziel avatar Apr 12 '24 11:04 adamziel

The CORS issue cannot be fixed, as it's just the security mechanism implemented by web browsers.

Asked to see if the proper headers could be sent from the unit testing subdomain on the server, to address the issue. Posted in #meta and #themereview

Related to

  • https://github.com/WordPress/wordpress-playground/issues/759

flexseth avatar Apr 12 '24 17:04 flexseth

Looks like there's a PR in the works to address accessing and re-directing the affected imports (leaving here as a trackback)

  • https://github.com/WordPress/wordpress-playground/pull/1250

flexseth avatar Apr 16 '24 18:04 flexseth