bigbite / wp-cypress

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

Load theme before plugins #95

Closed noplanman closed 1 year ago

noplanman commented 2 years ago

Describe the bug In my scenario, certain essential plugins extend the functionality of the theme and require it to be installed and active. As it is now, the plugins load first, making certain initialisations fail because the theme isn't there yet.

Expected behaviour Theme should be installed first, to ensure it is available for any plugins that require on it.

How to fix Not sure if just swapping around the activation order is appropriate and backwards compatible, but maybe a way to choose the order?

Desktop (please complete the following information):

PaulREnglish commented 2 years ago

Here is one idea I had. We could create a new property in cypress.json called plugins-loaded-after-theme, plugins-depend-on-theme or theme-dependent-plugins which will store all the plugins that need to be specifically loaded after the theme. This would also solve the situation where we would have plugin A depending on the theme which in turn depends on plugin B.

graph LR;
    A-->|Depends on| theme;
    theme--> |Depends on| B;
PaulREnglish commented 1 year ago

Created PR https://github.com/bigbite/wp-cypress/pull/106

noplanman commented 1 year ago

Thanks @PaulREnglish, I'll close off here.

PaulREnglish commented 1 year ago

Pleasure! :D