I've created a blueprint.json that would:
- Create a regular user ("user") with
wp-cli; and then
- Login with the user.
The login step seem to suggest I can do this:
{
"step": "login",
"username": "user",
"password": "password"
},
The entire blueprint.json content (same as this file):
{
"landingPage": "/wp-admin/profile.php",
"preferredVersions": {
"php": "7.4",
"wp": "6.8"
},
"extraLibraries": [
"wp-cli"
],
"phpExtensionBundles": [
"kitchen-sink"
],
"steps": [
{
"step": "wp-cli",
"command": "wp user create user user@example.com --user_pass='password' --display_name='Demo User' --user_nicename='Demo User' --description='This is a demo user.'"
},
{
"step": "login",
"username": "user",
"password": "password"
},
{
"step": "installPlugin",
"pluginZipFile": {
"resource": "wordpress.org\/plugins",
"slug": "user-profile-tabs"
},
"options": {
"activate": true
}
}
]
}
However, if you test this against WordPress playground, the resulting page would still be as user login as "admin" instead:
I've tried to then check the user list, and the wp-cli user creation step is definitely working:
I've then go on to logout and then login to the "user" account. And the username and password works, too:
I've also checked the documentation. My settings with the "login" has no field name typo. And, although not explicitly suggested, the JSON object clearly suggest I may change to login with different username:
It seems that the "login" is not functioning as it seems. It do not support login with username different than "admin". This can be a regression caused by some changes before. Or this can be a documentation error. Either way, things need to be changed.
I've created a blueprint.json that would:
wp-cli; and thenThe login step seem to suggest I can do this:
{ "step": "login", "username": "user", "password": "password" },The entire
blueprint.jsoncontent (same as this file):{ "landingPage": "/wp-admin/profile.php", "preferredVersions": { "php": "7.4", "wp": "6.8" }, "extraLibraries": [ "wp-cli" ], "phpExtensionBundles": [ "kitchen-sink" ], "steps": [ { "step": "wp-cli", "command": "wp user create user user@example.com --user_pass='password' --display_name='Demo User' --user_nicename='Demo User' --description='This is a demo user.'" }, { "step": "login", "username": "user", "password": "password" }, { "step": "installPlugin", "pluginZipFile": { "resource": "wordpress.org\/plugins", "slug": "user-profile-tabs" }, "options": { "activate": true } } ] }However, if you test this against WordPress playground, the resulting page would still be as user login as "admin" instead:
I've tried to then check the user list, and the wp-cli user creation step is definitely working:
I've then go on to logout and then login to the "user" account. And the username and password works, too:
I've also checked the documentation. My settings with the "login" has no field name typo. And, although not explicitly suggested, the JSON object clearly suggest I may change to login with different username:
It seems that the "login" is not functioning as it seems. It do not support login with username different than "admin". This can be a regression caused by some changes before. Or this can be a documentation error. Either way, things need to be changed.