-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fix E2E gtag events for a blockified confirmation page. #2161
Fix E2E gtag events for a blockified confirmation page. #2161
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## release/2.5.12 #2161 +/- ##
==================================================
- Coverage 58.3% 58.3% -0.0%
- Complexity 4119 4120 +1
==================================================
Files 452 452
Lines 17679 17681 +2
==================================================
Hits 10305 10305
- Misses 7374 7376 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This reverts commit c3d6f68.
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 fixing the E2E tests. LGTM.
Left an alternative method to avoid clicking the button too quickly and it's not a blocker for this PR.
//TODO: See if there's an alternative method to click the button without relying on waitForTimeout. | ||
await page.waitForTimeout( 3000 ); |
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 commented out this line and ran the related tests several times, and all attempts can pass.
- I added
await page.waitForTimeout( 3000 );
because it was clicking the button too quickly making the tests fail.
Maybe an alternative method is to wait for the button to be enabled:
//TODO: See if there's an alternative method to click the button without relying on waitForTimeout. | |
await page.waitForTimeout( 3000 ); | |
await expect( page.locator( 'text=Place order' ) ).toBeEnabled(); |
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 suggestion! Locally the E2E tests failed for me, even with the suggestion that you mentioned. For now, I will keep it as it is. If I find the root cause I will change it.
Changes proposed in this Pull Request:
Currently, there's a fatal error due to this issue: woocommerce/woocommerce-blocks#11851 and a "blockified" confirmation page. This problem is caused because the hookwoocommerce_before_thankyou
is being called with incorrect parameters.Additionally, our E2E tests are failing. Check here: https://github.com/woocommerce/google-listings-and-ads/actions/runs/6942346039/job/18885109983?pr=2160. The blockified confirmation page uses a different class for the order status.
This PR
introduces a temporary solution for the mentioned issueand resolves the E2E test problem.Screenshots:
Detailed test instructions:
Fatal Error in the confirmation page.This has been fixed in WC 8.3.1 p1700588910958219-slack-C01DT6U03HC1. Use WC 8.32. Use a theme that supports blocks, for example twenty twenty-two.3. Blockify your confirmation page. See instructions here: https://woo.com/document/cart-checkout-blocks-status/ (Search for "Replacing the order confirmation page" )4. Buy a product and complete the order, you shouldn't get any fatal error.5. Checkout develop and repeat the steps and you will get a fatal error.E2E Tests
Additional details:
await page.waitForTimeout( 3000 );
because it was clicking the button too quickly making the tests fail.Changelog entry