* wip
* set editor using env var instead
* fix attribute missing issue when watching the test
* wip php templates test
* Add E2E tests for the Filter Products By Price Block woocommerce/woocommerce-blocks#6363
add E2E tests for the Filter Products By Price Block
* Add E2E tests for the Filter Products By Price Block woocommerce/woocommerce-blocks#6363
add E2E tests for the Filter Products By Price Block
* create clickLink util
* Add E2E tests for the Active Filters Block woocommerce/woocommerce-blocks#6377
add E2E tests for the Active Filters Block
* Add E2E tests for the Filter Products By Attribute Block woocommerce/woocommerce-blocks#6322
add E2E tests for the Filter Products By Attribute Block
* Add E2E tests for the Filter Products By Stock Block woocommerce/woocommerce-blocks#6323
add E2E tests for the Filter Products By Stock Block
* improve checks
* improve checks
* improve checks
* remove globals.d.ts file
* replace waitForTimeout
* create clickLint utils
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Add E2E tests for the Filter Products By Price Block woocommerce/woocommerce-blocks#6363
add E2E tests for the Filter Products By Price Block
* Add E2E tests for the Filter Products By Attribute Block woocommerce/woocommerce-blocks#6322
add E2E tests for the Filter Products By Attribute Block
* Add E2E tests for the Filter Products By Stock Block woocommerce/woocommerce-blocks#6323
add E2E tests for the Filter Products By Stock Block
* improve checks
* improve checks
* remove globals.d.ts file
* replace waitForTimeout
* Add E2E tests for the Filter Products By Attribute Block woocommerce/woocommerce-blocks#6322
add E2E tests for the Filter Products By Attribute Block
* Add E2E tests for the Filter Products By Stock Block woocommerce/woocommerce-blocks#6323
add E2E tests for the Filter Products By Stock Block
* improve checks
* improve checks
* remove globals.d.ts file
* Add E2E tests for the Filter Products By Attribute Block woocommerce/woocommerce-blocks#6322
add E2E tests for the Filter Products By Attribute Block
* improve checks
* Try to fix account.test.js
* Remove language installations for woo core and wp core and take screenshots
* Upload screenshots to artifacts
* npm install instead of npm ci
* Upload artifacts not matter what
* fsdf
* fsdfsf
* remove screenshoting from account.test.js and only run checkout-terms.test.js
* Print NODE_ENV
* Better handling of overriding wp-env.json
* Run all tests
* Re-enable translations for WP and Woo
* Wait for Cart & Checkout blocks to load before moving on
* Uncomment github actions
* Try to fix shipping test
* fill checkout before placing order, duuuh
* Wait until networkidel0 instead of domcontentloaded for page navigations
* Fix account.test.js
* change visitBlockPage() to use Promise.all()
* Remove screenshot taking
* I think Promise.all() is being funny and not throwing properly, testing
* wait for checkbox to be visible before clicking
* Remove try catch around Promise.all()
* Fix linting issues
* Remove screenshot dir
* Raluca feedback:
* Timeout back to 30000
* Login to merhcant before changing settings
* merchant.logout()
* Transform object for woocommerce_price_filter legacy widget to be replaced with block alternative
* Filter products by price transform
* Price Filter formatting
* Set set_filterable_product_data data on the widgets screen
* Prevent rendering the Price Filter block if there are no products to filter
* Prevent Classic Price Filter Widget from being available as a widget
* Transform layered nav classic widget to attribute filter block
* Allow Filter Products by Stock block to be added as a widget
* Allow Active Filters widget to be transformed to Active Filters block
* Set showFilterButton to true and showInputFields to false in the transform of Price Filter to minic widgets more
* Change displayStyle property to be display_type instead of incorrectly using title
* mock @woocommerce/settings for has_filterable_products setting
* try: add All Products block to render that filter on the front end
* Revert "try: add All Products block to render that filter on the front end"
This reverts commit 5ad09e964b77e5c6499b4134cf58d7a6c226424d.
* try: add all product block to bypass has_filterable_products check
* fix: backend e2e test for attribute filter
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Add test to check if T&C and Privacy links are visible
* Fix filling wrong type of form error
With a virtual product we shouldn't need to fill the shipping details
We need to fill the billing instead
* Fix undefined 'termsCheckbox' bug
* Fix terms checkbox name
* Activate test case
* Replace static URL with dynamic one
* Convert external plugin into mock
* Fix JS linting issue
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
* Cart & Checkout translations test use the already installed language nl_NL
* Extra timeout when checking for shipping and billing addresses
* wait for selector instead of increase timeout
* Change waitForSelector selector:
* Clean up
* Increase idleTime for waitForNetworkRequest
* Fix random timeouts and increase timeout of verifying shipping option
* feedack
* Register missing C & C inner blocks and update fallback template for older C & C versions
This will fix the issues with missing order summary inner blocks: Coupons (both in C & C blocks) and the Cart header. The issue was happening because, for example, for Cart the coupons were registred on the on frontend, but it just wasn't forced in the attributes. Because it also wasn't added to the PHP fallback layout, the render function didn't include it. For the Checkout block the coupons inner block wasn't registered at all.
* Revert changes to Checkout.php, we don't need to test for inner blocks
* Revert "Revert changes to Checkout.php, we don't need to test for inner blocks"
This reverts commit fc39535f8476d02e35353374d9434a8723458cfa.
* Fix the returned template for older Checkout block iterations
* Fix Cart and Checkout templates to accommodate the Summary order inner blocks
* Hide coupon form div from inner blocks if coubons are not enabled
* Fix checkout coupon tests in checkout
They have been written for logged in user
* Fix Order Summary Heading inner block's default text
* Update comments with better wording
* Revert "Hide coupon form div from inner blocks if coubons are not enabled"
This reverts commit ab09021b923fad4218b3016e47760ad07f6bc960.
* rename some things
* Refactor e2e tests
* remove only from checkout test
* Typo in test
* Add --testPathIgnorePatterns performance back into package.json
* Niels feedback and fix a test
* Update import from utils
* Increase timeout of translations test to 30000
* Wait for network idle in goToCart and goToCheckout
* Increase timeout to 30000
* fix E2E tests
* try fix
* test
* test
* test
* another test
* fix test
* 60s timeout
* test
* Update product constants
* Simplify orderSummary check
* Go back to page.$
Co-authored-by: Luigi <gigitux@gmail.com>
* Check for performance file existence before running
* check reports/performance-report.json file exists on setup
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
* Add performance script to measure load times of cart and checkout blocks
* Temp commit
* Temp commit
* Temp commit
* Remove specific test from performance e2e command
* Add performance reporter
* Add step to clean performance file before running tests
* Add test report constant & average and logPerformanceResult test utils
* Update uses of product name constant
* Add cart coupon performance test
* Check if report file is empty before parsing
* Limit performance tests to only ones in performance directory
* Round the averages and add a linebreak after each entry in the log
* Fix formatting of report and only output after all tests
* Log each loading metric as an individual data point
* Improve formatting
* Get load times in ms from profiler
* Revert changes to fixtures
* Remove trace.json from git
* Remove checkout test file (tests not implemented)
* Check performance log file exists before truncating it
* Fix checkout coupon test
* Remove console logs
* Revert to use virtual products after rename of constant
* Ignore performance tests when running regular e2e tests
* Feedback changes
* Tidy up
* Fix packag-log.json:
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
* Add "single-use" coupon to the fixture data
* Create a first draft of the coupon e2e test
* Create single use coupon code constant
* Create "applyCouponFromCheckout" function
* Remove the "single-use" coupon from the fixture data
* Setup coupon creation using Woo's Rest API
* Add single-use coupon E2E test
* Move discount XPath definition to the expressions file
* Clean comments
* Remove unnecessary delay function
* Refactor to a more human friendly check
* Clear the setup in the afterAll branch (delete coupon)
Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
* Sub/Total/Fee inner blocks
* Row blocks within the inner block
* Update icons
* Resolve stying issues
* Remove old block
* Pin totals row
* Locking logic update
* Heading inner block
* Refactor where inner blocks are defined
* Add todos
* Todo for Consider deprecating OrderMetaSlotFill and DiscountSlotFill in favour of inner block areas.
* Improve frontend registration of components using new entrypoint
* Experiment- external block context
* Revert "Experiment- external block context"
This reverts commit 4b75668ec7eb62f065c6a488cd942a666e26204f.
* Duplicate inner blocks to avoid conflicts with context
* Remove todo
* Rename block dir
* Some test fixes
* Fix import
* fix import
* linting
* Remove unused attributes
* Optional classname
* fix coupons import
* fix shipping mocks
* Styling
* Fix selectors in e2e tests
* Add back the wc-block-components-totals-wrapper class that was used for each segment in the totals Order summary
Because, removing them was:
- a breaking change for the old structure
- was making it harder to target the inner blocks. Before the class was used to target each segment
- it was making the wc-block-components-totals-item behave as a child or parent depending on the inner block, inconsitency
* Reuse the TotalsWrapper component for C& C blocks inner blocks
This component was removed in this PR, but we wrap components in the Cart and Checkout sidebar in a TotalsWrapper. This will ensure consistent spacing and borders are applied to items in the sidebar.
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Raluca Stan <ralucastn@gmail.com>
* Add tests for the Mini Cart Block when it is added on the FSE editor woocommerce/woocommerce-blocks#5727
Add tests for the Mini Cart Block when it is added on the FSE editor
* not hardcoding selectors
* fix typo
* restore old searchForBlock function
* add export
* Revert "restore old searchForBlock function"
This reverts commit 7049ad85bc2752ad33933eec00da9682943ec35a.
* use searchForBlock from package only for FSE pages
* add fix for GB
* Cleanup e2e jest config from moduleFileExtensions
moduleFileExtensions by default support js, ts, tsx etc.
* convert legacy-template-blocks e2e test to TS
* clean up jest.config.json moduleFileExtensions
unnecessary defaults override
* Shopper can have different shipping and billing addresses
* Shopper can have different shipping and billing addresses
* Shopper can have different shipping and billing addresses
* Correct billing field IDs
* Remove unused variable
* Remove unused timeout
* Remove unused commands
* Activate company field using setCheckbox
* Deactivate company field using unsetCheckbox
* Remove obsolete command
* Empty cart before and after each test
* Remove obsolete import
* Check billing and shipping company
* Remove manual code with unsetCheckbox
* Fill company if field exist
* Get checkbox ID from label
* Remove duplicate company field toFill method
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
* upgrade wordpress/scripts to 22.3
* update jest config/setup
* add explicit-exports-references plugin
to handle payment-method-config.tsx spying on external methods
the way code is output now changed and tests like this would not
work anymore as transpilet files were no longer using exports but
local references to methods.
* missing snapshot
* make cart-products E2E test more stable
* surppress eslint error in test file
* fix css stylelint issues
* update eslint-plugin-woocommerce eslint package
* remove temp test:e2e:start script
* re-run
* add stylelint as recommended extension
* remove redundant types (provided by packages now)
* patch update @testing-library/jest-dom
* dry getAllTemplates util
* Improve goToSiteEditor e2e util
It will now properly wait for page to load
and critical parts to be available before
handing control over to the next steps
* adapt site editing tests to new goToSiteEditor API
* try to stabilize the saveTemplate
to early navigation was causing the dreaded
"Expected an Error, but "" was thrown"
* try stabilizing saveTemplate
* contextually group/sort params
* improve clarity of the goToSiteEditor E2E util
- adds goToSiteEditor private helper that hides the temporary need
for handling theme.php and site-editor.php paths
- adds two exported utils goToTemplatesList and goToTemplateEdit
that hide UX details of waiting ofr page to be ready on load including special
case for waitingFor templates list actions to be loaded
* put back page where it belongs ⚡️
* Create "isLoggedIn" shopper function
This function checks if a shopper is logged in
* Add "Can see warnings when form is incomplete" test
* Optimize login check and logout process for the test
Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
* Add handling of editor context via GUTENBERG_EDITOR_CONTEXT env var
* Fix flaky tests around editing templates
* Wait for save template response to complete
* Add XPath expressions
* Add "setCartQuantity" utility function
* Add "productIsInCart" utility function
* Add "update product qty" e2e test
* Clean up test file
* Fix test on headless mode
* Add Increase/Decrease qty test cases
* Decrease the query chain for better maintainability
* Rename expression functions/file for more clarity
* Resolve conflict with trunk
Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
The internal ID has been kept after a comment by @tjcafferkey. This causes a
bit of inconsistency in the internal code, but it was deemed that it would have
been better as users who have customized templates using this
blocks ID will have saved this in their database, and it would result
in a corrupt block when loaded, and we didn't want to support both IDs at the
moment.
Otherwise, most other references to the legacy template, are now using the word
“classic”.
Co-authored-by: Alba Rincón <alba@albasauatticmbp.home>
* Change atomic blocks to not use custom webpack build paths
we want to always load lazy loaded components from their default paths
to avoid having to handle importing components in different ways for
regular and atomic component packages
* Add footer parts to test themes
The Site Editor is expecting the footer parts to be there or it will try to
load them anyways and throw a 404. It's not breaking, but it's polluting
the console.
* Use REST API to tear down the templates
Previously, we used a util called `trashAllPosts` which navigated to the post UI
and deleted all the posts to tear down any side-effects of template editing tests.
However, with a [recent change](14e20f72b5),
WP Core removed the UI for those and that made our tests meet a 500 error.
Using the REST API should also make everything faster.
* Remove deprecated pupeteer waitFor usage
was still present in attribute-filter.test.js
* Update package-lock.json
* pin package versions
* Unify all atomic blocks to register on php side
* Remove Atomic Blcoks chunk_translation handling from AllBlocks
Before it was responsible for enabling translations for all the atomic blocks
* Add per atomic block chunk_translation registration
* update @wordpress/e2e-test-utils to 6.0.2
* add optional puppeteer
* pin workflows node version to 16.13.2
* upgrade package-lock
* upgrade package-lock
* set react and react-dom as peerDeps
* remove atomic block registration
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
Co-authored-by: Luigi <gigitux@gmail.com>