Skip to content

Login with a different user doesn't seem to work #2872

@yookoala

Description

@yookoala

I've created a blueprint.json that would:

  1. Create a regular user ("user") with wp-cli; and then
  2. 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:

Image

I've then go on to logout and then login to the "user" account. And the username and password works, too:

Image

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:

Image

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.

Metadata

Metadata

Assignees

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