Use Theme Unit Test Data as a starter content
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.
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”.
Related: https://meta.trac.wordpress.org/ticket/7309
This is more of a documentation / UX thing on how to get that content into Playground (as it's already supported).
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?
If someone wants to look at how to fix the CORS situation, here's a great troubleshooting option for contributor day
- 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
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.
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
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