-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add/upload themes e2e tests #1813
base: master
Are you sure you want to change the base?
Add/upload themes e2e tests #1813
Conversation
@kevin940726 @tellthemachines @hellofromtonya this PR is ready for reviews. |
installTheme, | ||
deleteTheme, | ||
isThemeInstalled, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a reminder that we should probably test these individually here in core instead, and rewrite the utils using rest API or other alternatives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean we should rewrite these utilities in Core @kevin940726?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean we should test these utilities in core, so that we don't have to do them manually in e2e-test-utils
. Currently, these utils are implemented in a slow way of manually navigating to the themes page and interact with the buttons. We should be able to rewrite them using programmatic methods like REST API so that they can be faster. We still have to write e2e tests for installing and deleting themes though and they should be in core rather than in gutenberg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense.
The isThemeInstalled
utility would benefit to be rewritten using the REST API.
Not sure if we can delete and install themes using the API though 🤔.
I will go ahead and create a new PR with a utility folder and functions.
|
||
await page.click('.update-from-upload-actions a:not(.update-from-upload-overwrite)'); | ||
|
||
expect(await checkThemeVersion(themeName)).not.toBe(themeVersion); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the expected theme version then? Maybe I'm missing something, why is the old version and the updated version both 2.0.0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the old version and the updated version both 2.0.0?
This is actually the opposite: not.toBe
. Since the update has been canceled, we make sure that the current version is different from the old that was being uploaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the old version? Isn't themeVersion
equals to 2.0.0
which is used in oldThemePath
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old version is themeVersion
yes.
The current version is 2.4.1 which is the latest version of Hello Elementor.
Hi @kevin940726 👋🏻 |
Hi @JustinyAhin! Sorry, been busy with 5.9 and other things. I'll try to find some time to review this 🙇♂️ ! |
Thank you, Kevin :) |
__experimentalRest as rest, | ||
} from "@wordpress/e2e-test-utils"; | ||
|
||
const themeSlug = "hello-elementor"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we replace this with a skeleton theme that has only the files required for a theme to be considered valid?
Related Trac Ticket: https://core.trac.wordpress.org/ticket/54334
Test Scenario