-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Testing: Add e2e test for PluginPostStatusInfo #7284
Conversation
df4b062
to
62a3123
Compare
62a3123
to
d6b7f0c
Compare
test/e2e/support/utils.js
Outdated
/** | ||
* Clicks on the button in the header which opens Document Settings sidebar when it is closed. | ||
*/ | ||
export async function ensureDocumentSettingsSidebarIsOpened() { |
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.
Not certain if this is the best name for the function, because if Publish panel is open, the button is not rendered and the function will not be able to ensure "document settings sidebar is opened".
An option is call the function click toggle sidebar or something similar but off course that name will bot transmit the main objective of clicking in the sidebar.
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.
Would openDocumentSettingsSidebar
work for you?
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.
Yes openDocumentSettingsSidebar looks good, as it is not strong as "ensure".
test/e2e/specs/plugins-api.test.js
Outdated
|
||
const pluginSidebarContent = await page.$eval( '.edit-post-sidebar', ( el ) => el.innerHTML ); | ||
expect( pluginSidebarContent ).toMatchSnapshot(); | ||
const pluginPostStatusInfoText = await page.$eval( '.my-post-status-info-plugin', ( el ) => el.innerText ); |
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 think we should improve the selector to `.edit-post-post-status .my-post-status-info-plugin' to test that it was rendered "inside" right now if we render outside of Document Setting sidebar the test will pass.
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.
Good catch
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 left some comments, but generally, this changes look good to me 👍 Thank you for adding this additional test cases!
d6b7f0c
to
55fd7d0
Compare
55fd7d0
to
238c1c7
Compare
* 'master' of https://github.com/WordPress/gutenberg: (69 commits) fix: Show permalink editor in editor (WordPress#7494) Fix text wrapping in Firefox. (WordPress#7472) Try another approach to fixing the sibling inserter in Firefox (WordPress#7530) fix: Improve "add block" text in NUX onboarding (WordPress#7511) Implement core style of including revisions data on Post response (WordPress#7495) Testing: Add e2e test for PluginPostStatusInfo (WordPress#7284) Add end 2 end test for sidebar behaviours on mobile and desktop. (WordPress#6877) Only save metaboxes when it's not an autosave (WordPress#7502) Fix broken links in documentation (WordPress#7532) Remove post type 'viewable' compatibility shim (WordPress#7496) Fix typo. (WordPress#7528) Blocks: Remove wrapping div from paragraph block (WordPress#7477) fix: change import for InnerBlocks (WordPress#7484) Polish library just a teeeeensy bit (WordPress#7522) feat: Add snapshot update script (WordPress#7514) Display server error message when one exists (WordPress#7434) Fix issues with gallery in IE11. (WordPress#7465) Polish region focus style (WordPress#7459) Fix IE11 formatting toolbar visibility (WordPress#7413) Update plugin version to 3.1. (WordPress#7402) ...
Description
Builds upon #7269.
This PR improves basic end-to-end tests for the
PluginSidebar
andPluginSidebarMoreMenuItem
registration. In addition, it adds another test forPluginPostStatusInfo
.It would be great to replace this snapshot for
PluginSidebar
with something which tests also data sync between the page title and its copy in the sidebar, but I keep it for later to make sure we have also the publish flow covered.Update: I also included the script with code that registers publish panels:
PluginPrePublishPanel
andPluginPostPublishPanel
. We still need to add some basics tests to make sure it works as expected. I can be in another PR.How has this been tested?
npm run test-e2e
and Travis verification should be green.Checklist: