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 tests] Add new tests for up-sells and cross-sells #44154
Conversation
…dd/related-products
Test Results SummaryCommit SHA: fa6c18d
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
…dd/related-products
…dd/related-products
…dd/related-products
…dd/related-products
* Add a check for up-sells before removing them to prevent a false negative result
Hi @lanej0, @woocommerce/solaris Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
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.
The viewport isn't an issue, more of a question. I'm curious about creating a function to replace page.goto
though -- we're definitely trying to stay away from replacing built-in Playwright functions with custom ones.
stateDir: 'tests/e2e-pw/test-results/storage/', | ||
trace: 'retain-on-failure', | ||
video: 'on-first-retry', | ||
viewport: { width: 1280, height: 720 }, | ||
viewport: { width: 1280, height: 1600 }, |
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.
While I don't think there's an issue with this, what was the driver for increasing the viewport size so much? Seems like an unlikely resolution that a user might use, which could lead to some false-negative test results... but maybe I'm overthinking it.
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 reverted the height in fa6c18d.
It helped me when I ran tests locally to view all elements at once without needing to scroll. I should have reverted it before.
I'm curious though to know your thoughts on the possible false-negative that could result from that.
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 don't really think it's an issue, but e2e tests are meant to mimic real-world testing. Most people probably aren't browsing a site using a browser that's 1600 pixels tall. In an extreme edge case, if there was some CSS limiting scrolling/the content shown, and the button you're supposed to click is cropped off screen... there could be an issue. Not likely, scenario for sure.
await page.goto( | ||
`wp-admin/post.php?post=${ productId }&action=edit` | ||
); | ||
} ); |
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.
Why did you choose to abstract this into a separate function instead of just inlining page.goto
in the test?
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.
There are two steps in that function, the goto
and the click on the Linked Products
, which are repeated in each test, so I extracted them into a function, the same way that I extracted the update product logic into updateProduct
function.
Thanks @lanej0 for reviewing.
I think you misinterpreted this one. I did not replace Playwright's |
Submission Review Guidelines:
Changes proposed in this Pull Request:
Closes https://github.com/woocommerce/woocommerce-quality/issues/604.
Closes https://github.com/woocommerce/woocommerce-quality/issues/605.
Added a new spec file with tests for linked products. It covers adding and removing up-sells and adding and removing cross-sells.
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Run the new spec file locally:
pnpm env:restart && pnpm test:e2e-pw ./tests/e2e-pw/tests/merchant/product-linked-producs.spec.js
Changelog entry
Significance
Type
Message
Comment