bigbite / wp-cypress

WordPress end to end testing with Cypress.io.
MIT License
86 stars 19 forks source link

Ability to define custom plugin/theme name #94

Closed noplanman closed 2 years ago

noplanman commented 2 years ago

Is your feature request related to a problem? Please describe. My plugin/theme folder has a different name than the plugin/theme itself.

Describe the solution you'd like Ability to define the name specifically, instead of using the folder name.

Describe alternatives you've considered Allow object for wp.plugins / wp.themes, where the key is the name and value the path:

{
    "wp": {
        "plugins": {
            "my-plugin": "./path/to/plugin"
        }
    }
}

or, to still allow whole folders more easily, a mix

{
    "wp": {
        "plugins": [
            { "my-plugin": "./path/to/plugin" },
            "./path/to/other/plugins"
        ]
    }
}

or, easiest to implement and ensure backwards compatibility, split string with delimiter

{
    "wp": {
        "plugins": [
            "./path/to/plugin|my-plugin",
            "./path/to/other/plugins"
        ]
    }
}

Additional context I have a repo with submodules that pull in different plugins and themes. The main plugin and theme have the same name, so the submodule folders are simply theme and plugin. As it is now, the basename is mapped directly, but that's not the actual name, so the activations fail.

PaulREnglish commented 2 years ago

I am finding that my plugin activation is still succeeding despite giving it a different UI name, basename and directory name. Is there anything else I need to do to reproduce the problem? https://d.pr/yh4nDw

Here's my cypress.json : http://bigbite.im/6oe301

noplanman commented 2 years ago

I've been trying to reproduce my problem but can't! :sweat_smile:

I can see that the test docker image maps the volume as plugin and theme respectively, which means that WP sees those folder names as their actual names.

So I'm a bit puzzled now, as to why my setup was breaking when I reported this issue but now seems to be working :thinking:

Anyway, if I do remember what I did and the issue pops up again, I'll re-open here.