-
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 plugin e2e tests #1931
base: trunk
Are you sure you want to change the base?
Add/upload plugin e2e tests #1931
Conversation
Cc @kevin940726, when you have some time, this PR might need some review. |
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.
Sorry for that late review. Good job on creating this! I have some concerns of using "Classic Editor" directly in tests, but it's a good start!
if (pluginStatus === 'active') { | ||
await deactivatePlugin(pluginSlug); | ||
await uninstallPlugin(pluginSlug); | ||
await installPlugin(pluginSlug, pluginName); | ||
} else if (pluginStatus === 'inactive') { | ||
await uninstallPlugin(pluginSlug); | ||
await installPlugin(pluginSlug, pluginName); | ||
} else { | ||
await installPlugin(pluginSlug, pluginName); | ||
} |
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.
We could just do this, might be simpler:
if (pluginStatus === 'active') { | |
await deactivatePlugin(pluginSlug); | |
await uninstallPlugin(pluginSlug); | |
await installPlugin(pluginSlug, pluginName); | |
} else if (pluginStatus === 'inactive') { | |
await uninstallPlugin(pluginSlug); | |
await installPlugin(pluginSlug, pluginName); | |
} else { | |
await installPlugin(pluginSlug, pluginName); | |
} | |
if (pluginStatus === 'active') { | |
await deactivatePlugin(pluginSlug); | |
} | |
if (pluginStatus === 'inactive') { | |
await uninstallPlugin(pluginSlug); | |
} | |
await installPlugin(pluginSlug, pluginName); |
|
||
describe('Manage uploading new plugin/theme version', () => { | ||
const pluginSlug = 'classic-editor'; | ||
const pluginName = 'Classic Editor'; |
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.
Could we use a smaller and test-purposed plugin instead? It will have some benefits:
- We'll be able to manage the zip source and check it into the source control as well.
- The plugin name can be explicitly named for testing purposes.
- We won't mess with the download count in wp.org.
- It will be clear in the test whether the installation is an upgrade or a downgrade.
Related Trac Ticket: https://core.trac.wordpress.org/ticket/54334
Test Scenario