-
Notifications
You must be signed in to change notification settings - Fork 68
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
E2E Playwright Migration: convert merchant-subscriptions-renew-action-scheduler spec #10143
E2E Playwright Migration: convert merchant-subscriptions-renew-action-scheduler spec #10143
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.36 MB ℹ️ View Unchanged
|
…ons-renew-action-scheduler-spec
…ons-renew-action-scheduler-spec
Update WIP spec
…ons-renew-action-scheduler-spec
Add changelog
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.
Thanks for working on this! I found one issue that needs to be fixed, after it is done I'll proceed with the local testing. The tests are passing, but it's a structural change that will add clarity to the code.
const { merchantPage } = await getMerchant( browser ); | ||
page = merchantPage; |
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.
Since you already added useMerchant
just after the describe, the page
is already merchantPage
. I suggest using getMerchant
only if you also need to use getShopper
in the code, for the context not to mix, and prevent unintended use of page
.
Suggestion: Instead of useMerchant
you can write let shopperPage, merchantPage: Page;
, assign them in the beforeAll
callback, and then use them in any test you want.
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.
Since you already added useMerchant just after the describe, the page is already merchantPage. I suggest using getMerchant only if you also need to use getShopper in the code, for the context not to mix, and prevent unintended use of page.
TIL that beforeAll
doesn't assign the page yet with useMerchant
, because it only assigns pages per test basis. But you can still remove useMerchant
and use the specific pages from getShopper
and getMerchant
assigned to shopperPage and merchantPage respectively on the global scope.
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.
Thanks for the review! I was running into some issues with that very thing with beforeAll
and got it working in a sub-optimal way as you pointed out with useMerchant
and the redundant page assignments. I have cleaned this up in 30107c1.
const { shopperPage } = await getAnonymousShopper( browser ); | ||
page = shopperPage; |
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.
You don't need to assign shopperPage
to page
, to be clear in the code, it'll be probably best to use shopperPage
instead of page
. See my other comment about useMerchant
.
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've fixed this up in 30107c1.
…ons-renew-action-scheduler-spec
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.
Thanks for working on this, Code is good, readable, understandable, tests well on both GH checks, and locally, we can 🚢 it.
…ons-renew-action-scheduler-spec
Fixes #10081
Changes proposed in this Pull Request
merchant-subscriptions-renew-action-scheduler
spec to Playwright E2E tests.merchant-subscriptions-renew-action-scheduler
spec from Puppeteer E2E tests.shouldRunActionSchedulerTests
.Testing instructions
npm run build:client
npm run test:e2e-pw merchant-subscriptions-renew-action-scheduler
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge