wp-browser icon indicating copy to clipboard operation
wp-browser copied to clipboard

activateTheme() method for WPBrowser module

Open alexkuc opened this issue 4 years ago • 3 comments

How come WPBrowser module does not have a method activateTheme() but has activatePlugin()?

As a workaround, what is the recommended way to activate theme? I know WPDb has useTheme() but it does not fire any hooks or filters so it is not really appropriate. Maybe wp-cli?

alexkuc avatar Feb 07 '21 01:02 alexkuc

Looking at activatePlugin (and related methods), this looks like a fairly straight forward way to implement it. If @lucatume don't object, I can give it a shot at creating a PR for this

alexkuc avatar Feb 07 '21 19:02 alexkuc

@alexkuc,

thanks for opening an issue to report this.

You are correct: the WPDb module does have a useTheme method, but that method will not apply the full, user-like, flow.

A activateTheme (or should it be switchTheme?) method should have an implementation available both in the WPBrowser module and in the WPWebDriver one.

I have to work on the code for #484, I might, as well, get to this.

As per objections to a PR: none whatsoever. I'd like any change to have full test coverage, if you could add those too, it would be great, else I will add those in a wrapping PR.

I will drop a note here to let you know when I start working on this to avoid duplicate work.

Thanks!

lucatume avatar Feb 08 '21 08:02 lucatume

@lucatume

Hopefully this week I will have the time to look into this 👨‍💻

Edit: typo

alexkuc avatar Feb 08 '21 15:02 alexkuc

Added in version 3.2.0 and 4.0.1.

lucatume avatar Sep 15 '23 10:09 lucatume