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

Product Collection: add E2E tests to Editor filters - by tag and by stock status #43548

Conversation

kmanijak
Copy link
Contributor

@kmanijak kmanijak commented Jan 12, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

  • Add missing test for Product Collection Editor filter: filtering by tags
  • Set single product out of stock and unskip the test for Product Collection Editor filter: filtering by stock status

Closes #42284

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

Note: no need to test when testing the release.

  1. All the tests should pass.

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Comment

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Jan 12, 2024
@kmanijak kmanijak changed the title 42284 product collection add e2e tests which require fixture data Product Collection: add E2E tests to Editor filters - by tag and by stock status Jan 12, 2024
@kmanijak kmanijak added focus: e2e tests Issues related to e2e tests team: Kirigami & Origami WC Store Editing (FSE) block: product collection Issues related to the Product Collection block labels Jan 12, 2024
Copy link
Contributor

github-actions bot commented Jan 12, 2024

Test Results Summary

Commit SHA: e332281

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 38s
E2E Tests230004902792m 56s

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.

@github-actions github-actions bot removed the focus: e2e tests Issues related to e2e tests label Jan 12, 2024
@kmanijak kmanijak marked this pull request as ready for review January 12, 2024 10:28
@woocommercebot woocommercebot requested review from a team and Aljullu and removed request for a team January 12, 2024 10:29
Copy link
Contributor

Hi @Aljullu,

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:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

Copy link
Contributor

@Aljullu Aljullu left a comment

Choose a reason for hiding this comment

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

LGTM, nice to see so much test coverage for the Product Collection block. I left one comment about the simple_product_id variable name, I might be overthinking it, so feel free to ignore if you don't agree.

@@ -30,6 +30,10 @@ product_id=$(wp post list --post_type=product --field=ID --name="Cap" --format=i
crossell_id=$(wp post list --post_type=product --field=ID --name="Beanie" --format=ids)
wp post meta update $crossell_id _crosssell_ids "$product_id"

# Set a product out of stock
simple_product_id=$(wp post list --post_type=product --field=ID --name="T-Shirt with Logo" --format=ids)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: not a big deal, but what do you think about either naming this variable based on what we are testing (out_of_stock_product) or its real name (tshirt_with_logo_product)? I worry that we currently have post_id, product_id and now simple_product_id in the same file and they don't seem very descriptive names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call. I decided to rename ALL of the product variables to follow the same convention, basically PRODUCT_NAME_product_id in the same way as categories are names at the top of a file.

I decided NOT to use "functional" names (e.g. out_of_stock_product) because some of the products are used in multiple places and also the comments are well describing the purpose.

Changes in: e332281

@kmanijak kmanijak merged commit 2c628a2 into trunk Jan 15, 2024
50 checks passed
@kmanijak kmanijak deleted the 42284-product-collection-add-e2e-tests-which-require-fixture-data branch January 15, 2024 10:25
@github-actions github-actions bot added this to the 8.6.0 milestone Jan 15, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Jan 15, 2024
@nigeljamesstevenson nigeljamesstevenson added status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Jan 15, 2024
samueljseay pushed a commit that referenced this pull request Jan 16, 2024
…tock status (#43548)

* Add test to check Product Collection filtering by tags

* Set single product out of stock and unskip the test for stock status

* Add changelog

* Use more specific selector

* Update variables holding products in products.sh to keep the same convention
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
block: product collection Issues related to the Product Collection block plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris team: Kirigami & Origami WC Store Editing (FSE)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Product Collection - Add E2E tests which require fixture data
3 participants