Closed ianlin closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 63.4%. Comparing base (
cb7765e
) to head (ddc4c23
).
Not sure if related but I see this error when running E2E tests in GH https://github.com/woocommerce/google-listings-and-ads/actions/runs/9857791848/job/27217640650#step:10:219
In my local test when I didn't update WP and WC I got this fail:
1 failed [chromium] › product-editor/block-integration.test.js:30:6 › Product Block Editor integration › Prompt to Get Started when not yet finished onboarding
When I did the upgrade I got this one:
1 failed [chromium] › product-editor/block-integration.test.js:567:6 › Product Block Editor integration › Save all product attributes to simple product
Thanks for testing @puntope.
In my local test when I didn't update WP and WC I got this fail:
1 failed [chromium] › product-editor/block-integration.test.js:30:6 › Product Block Editor integration › Prompt to Get Started when not yet finished onboarding
I think this is expected, like I said in the description in WC 9.1.0 the tabs (<button>
elements) on the product edit block has been added role="tab"
attribute. So we should rewrite the Playwright query from getByRole( 'button' )
to getByRole( 'tab' )
.
In WC < 9.1 getByRole( 'tab' )
doesn't exist so the test will fail. This PR can be merged after WC 9.1.0 is released.
When I did the upgrade I got this one:
1 failed [chromium] › product-editor/block-integration.test.js:567:6 › Product Block Editor integration › Save all product attributes to simple product
Not sure if related but I see this error when running E2E tests in GH https://github.com/woocommerce/google-listings-and-ads/actions/runs/9857791848/job/27217640650#step:10:219
That's weird as I tried to run e2e again in my local and all the tests passed. I also ran the E2E workflow with this branch and updated WP/WC, all tests passed as well.
That's weird as I tried to run e2e again in my local and all the tests passed. I also ran the E2E workflow with this branch and updated WP/WC, all tests passed as well.
Seems to be a flaky test:
When I've run. npm run test:e2e product-editor/block-integration.test.js
few times like 6
4 were success and 2 not success
1) [chromium] › product-editor/block-integration.test.js:609:6 › Product Block Editor integration › Save all product attributes to variation product
Error: expect(received).toHaveLength(expected)
Expected length: 16
Received length: 15
await editorUtils.getAvailableProductAttributesWithTestValues();
616 |
> 617 | expect( pairs ).toHaveLength( 16 );
Maybe a race condition not sure. I will open a new issue
In WC < 9.1 getByRole( 'tab' ) doesn't exist so the test will fail. This PR can be merged after WC 9.1.0 is released.
Then I assume we should wait til WC/WP gets released to release this? Otherwise our E2E will fail
Thanks for testing again @puntope. WP 6.6 doesn't affect those E2E, so I will merge the PR after WC 9.1 is released.
WC 9.1 has been released so I'm merging this PR.
Changes proposed in this Pull Request:
Closes #2453.
This PR fixes three part of the E2E tests:
The first one is related to woocommerce/woocommerce#47860, where the tabs (
<button>
elements) on the product edit block has been addedrole="tab"
attribute. So we should rewrite the Playwright query fromgetByRole( 'button' )
togetByRole( 'tab' )
.The second one is related to woocommerce/woocommerce#48192, where the error messages of the failure notice on the product edit block has been modified from always showing
Failed to save product
to different messages based on the error type. E.g.Date error:
.
Multipack error:
.
Also, the behaviour of dismissing the error notice has been changed. Instead of clicking anywhere on the notice to dismiss it, now we need to click a specific
X
button.The third one is not related to the compatibility of WC 9.1. It's in the onboarding step 2 when we want to overwrite the default WC country by fulfilling the request
/wc-admin/options?options=woocommerce_default_country
. Now that there are more options being added into theoptions
query parameter, so we need to rewrite the URL matching pattern from/wc-admin\/options\?options=woocommerce_default_country\b/
to/wc-admin\/options\?options=.*woocommerce_default_country\b/
.Detailed test instructions:
npm run test:e2e
Additional details:
Changelog entry