-
Notifications
You must be signed in to change notification settings - Fork 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
Jetpack E2E: expand the Marketing: SEO spec. #81199
Conversation
- expand the spec packages/calypso-e2e/src/lib/pages/marketing-page.ts - implement new methods to support expanded testing.
- add compat with eCommerce plans
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
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.
This is awesome! 😄 Two small optional suggestions, otherwise LGTM! 🚀
async closeSEOPreview(): Promise< void > { | ||
await this.page.click( selectors.seoPreviewPaneCloseButton ); | ||
await this.page.waitForSelector( selectors.seoPreviewButton ); | ||
async getPreviewTextForPageStructureCategory( |
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.
Suggestion (non-blocking): Definitely not required, but what do you think of designing this function as a validate
function?
I was thinking more of the case where you already have a title, but then you change it. The element will already exist in the DOM, and at that point it's effectively a race against the React re-render. 😆 I think in the vast majority of cases (and we don't even test this case right now), the re-render will be fast enough, but using waitFor
for a specific piece of text might be even more stable for future extensions. Up to you though! 😄
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.
Done, changed to a validate function instead.
websiteMetaTextArea: '#advanced_seo_front_page_description', | ||
seoPreviewButton: '.seo-settings__preview-button', | ||
seoPreviewPane: '.web-preview.is-seo', | ||
seoPreviewPaneCloseButton: '.web-preview__close', |
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.
Praise: You've done such a nice job in these PRs updating the locator syntax as you go! I really appreciate that! 😄
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.
} ); | ||
|
||
it( 'Verify preview for Facebook', async function () { | ||
await marketingPage.validateExternalPreview( 'Facebook', externalPreviewText ); | ||
} ); | ||
|
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.
Suggestion (non-blocking): How do you feel about adding saving the settings into this test spec? I think it should be easily designable to handle concurrencies, because i think the previews seem to be based on local unsaved state. I figured validating that the save web request goes through okay might be nice addition! But totally not required. 😄
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.
Your hunch is correct, and I was able to work saving the changes into the flow. Nice suggestion!
Related to #80730.
Proposed Changes
This PR expands the existing SEO spec to something more substantial.
Key flows:
Testing Instructions
Ensure the following build configurations are passing:
Pre-merge Checklist