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

Plugin Browse: Update e2e test to check URL with selected site #79803

Merged
merged 2 commits into from
Jul 27, 2023

Conversation

WBerredo
Copy link
Contributor

Fixes #66637
Related to #66636

Proposed Changes

Add URL check at the end of the Category selection e2e test.
This guarantees the site URL will always be present on this action.

Testing Instructions

Check if all checks are passing. Including e2e tests.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests 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)?

@WBerredo WBerredo self-assigned this Jul 24, 2023
@WBerredo WBerredo requested review from a team and worldomonation as code owners July 24, 2023 20:20
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jul 24, 2023
@github-actions
Copy link

github-actions bot commented Jul 24, 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.

Copy link
Contributor

@worldomonation worldomonation left a comment

Choose a reason for hiding this comment

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

Approved, but with a non-blocking nit/question.

@@ -103,6 +103,7 @@ describe( DataHelper.createSuiteTitle( 'Plugins: Browse' ), function () {
'Search Engine Optimization',
envVariables.VIEWPORT_NAME !== 'mobile' ? true : false
);
await page.waitForURL( new RegExp( `/plugins/browse/seo/${ siteUrl }$`, 'g' ) );
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:non-blocking - a small question, is the intention to make sure the site slug comes at the end?

In any case, the 'g' flag doesn't seem necessary from my experience. Have you run into faulty results without it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is the intention to make sure the site slug comes at the end?

The intention was to make a more specific regex as the bug it was trying to solve was that it being redirected to /plugins/browse/seo. So in the past, if we had used /plugins/browse/seo as regex the test would still be passing because we didn't specify the URL must end with it.

In this case, as we are specifying siteURL, we don't have any case currently where it might fail, so let me know if you prefer to remove it.

the 'g' flag doesn't seem necessary from my experience

That's right, I removed it 9266509

@WBerredo WBerredo merged commit 9ad3bc4 into trunk Jul 27, 2023
@WBerredo WBerredo deleted the update/e2e-category-selection branch July 27, 2023 12:26
@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 Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Marketplace: Add e2e or unit test plugin category > plugin page
3 participants