Skip to content
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

Merged
merged 3 commits into from
Aug 31, 2023

Conversation

worldomonation
Copy link
Contributor

@worldomonation worldomonation commented Aug 30, 2023

Related to #80730.

Proposed Changes

This PR expands the existing SEO spec to something more substantial.

Key flows:

  • change one of the page structure.
  • check how the SEO external preview looks like for Facebook.

Testing Instructions

Ensure the following build configurations are passing:

  • Calypso E2E (desktop)
  • Jetpack E2E Simple (mobile)
  • Jetpack E2E Simple (desktop)
  • Jetpack E2E AT (desktop)

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • https://wpcalypso.wordpress.com/devdocs/docs/testing/index.md for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-ajp-p2)?

- expand the spec

packages/calypso-e2e/src/lib/pages/marketing-page.ts
- implement new methods to support expanded testing.
- add compat with eCommerce plans
@worldomonation worldomonation self-assigned this Aug 30, 2023
@github-actions
Copy link

github-actions bot commented Aug 30, 2023

@matticbot
Copy link
Contributor

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.

@worldomonation worldomonation marked this pull request as ready for review August 30, 2023 07:29
@worldomonation worldomonation requested a review from a team as a code owner August 30, 2023 07:29
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 30, 2023
Copy link
Contributor

@dpasque dpasque left a 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(
Copy link
Contributor

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! 😄

Copy link
Contributor Author

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.

Comment on lines -15 to -18
websiteMetaTextArea: '#advanced_seo_front_page_description',
seoPreviewButton: '.seo-settings__preview-button',
seoPreviewPane: '.web-preview.is-seo',
seoPreviewPaneCloseButton: '.web-preview__close',
Copy link
Contributor

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! 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

} );

it( 'Verify preview for Facebook', async function () {
await marketingPage.validateExternalPreview( 'Facebook', externalPreviewText );
} );

Copy link
Contributor

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. 😄

Copy link
Contributor Author

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!

@worldomonation worldomonation merged commit ae2fbbb into trunk Aug 31, 2023
3 checks passed
@worldomonation worldomonation deleted the update/jetpack-marketing-seo branch August 31, 2023 08:50
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants