-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tool or commands to seed data for testing. #13
Comments
Some research:
|
After checking about login automation, I just need to comment on this:
With Cypress in cli mode, the |
@jeffpaul suggested investigating the |
A concept of the solution A bash script which is called once (manually or via GitHub Actions), which do couple things:
Now inside Cypress we get access to posts by IDs. If the script is called twice for some reason, it will just duplicate testing data (which is not a problem) and will update fixtures file.
|
Here's a sample of how we could seed with the WP-CLI "wp post generate" command:
|
@jeffpaul while testing plugins, each plugin requires its own "state" of data, especially its own admin settings. While working with RSA, I tested both WP-CLI and REST API and found the latter one to be a lot faster. wp-env provides a way to load plugins, which I have used in RSA just to register REST endpoints which are called by Cypress to seed data as required. Adding to that, seeding options with complex nested data is a real pain when using WP-CLI. |
@Sidsector9 that seems reasonable, perhaps referencing an example or two might be sufficient here |
Is your enhancement related to a problem? Please describe.
It's very nice to have a way to repopulate data like posts/pages/options before testing.
Designs
I'm thinking about using REST API to populate data in the setup phase. Each plugin will have its own set of fixture data. What I'm targeting for this library is creating tools to make the process easier.
Describe alternatives you've considered
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: