Commit Graph

308 Commits

Author SHA1 Message Date
Tung Du 862477f9aa Remove compatibility notice from Mini Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/6803) 2022-08-01 18:01:57 +02:00
Luigi Teschio 1761da37cd fix E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/6639) 2022-07-18 11:38:49 +02:00
Paulo Arromba 678fa6bff0 Add: Cross-sells for the Store API Cart response. (https://github.com/woocommerce/woocommerce-blocks/pull/6635)
* Added Cross-sells object and schema for the API Cart response.

* Cross-sells are now WC_Product objects that pass through the visibility filter.

* Removed redundant check.

* Updated function doc comment.

* Cleaned up imports.

* Cross-sells item schema (extension of ProductSchema) was removed, and replaced by ProductSchema itself. Cross-sells are direct product representation, and extending this goes out of scope for the task at hand.

* Unit testing for cart response containing cross-sell products.
2022-07-13 15:02:49 +01:00
Luigi Teschio 4aaaebe0c0 Disable render blockified Product Grid Block (https://github.com/woocommerce/woocommerce-blocks/pull/6660)
* Disable render blockified Product Grid Block

* try now
2022-07-06 14:16:32 +02:00
Alba Rincón 75184ae22d Add migration strategy and load blockified templates (https://github.com/woocommerce/woocommerce-blocks/pull/6538)
* Increase `schema_version` to add the new `wc_blocks_use_blockified_templates` flag

If the schema version stored on the db is <= 260 means the plugin is being updated
to the new version and we should keep using the old templates, not the blockified ones.

* After the theme is switched we check if we need to update the flag to
start loading the blockified templates or not.

* Get the templates from the blockified folder if the flag is set to true on the db

* Add temporary blockified template for testing purposes

* Inline variable

* Improve comment

* Use blockified templates on new installs with block themes only

* Don't use blockified templates when switching to a non FSE theme

* Fix condition

* Add tests for the option value

* Move the check to use blockified templates

* WIP

* WIP

* Add migration strategy

* Move the blockified templates to the templates folder and filter them depending on the option

* Fix tests and start using the Options constants

* Fix migration, the `should_use_blockified_product_grid_templates` and tests

* Rename tests and move to Utils folder

* add Migration class test

* try

* remove PHP

* add composer

* Replace the blockified templates with a temporary version

* Fix tests

* add comment

* Add feature gating for experimental builds

* Inject the package to the controller

* test

* Change blocks.ini

* debug

* Remove debug info

* fix test

* fix tests

* try now

* using composer cache

* install deps

* test

* Remove unnecessary extra key

* Add cache actions

* Undo tests change

* Fix readme format

Co-authored-by: Luigi <gigitux@gmail.com>
2022-07-06 09:51:39 +02:00
Brian 2328ca3f4f Add Footer Template Part (https://github.com/woocommerce/woocommerce-blocks/pull/6596)
* Adjust template with tagname footer

* Adjust template with tagname footer

* Adjust template with tagname footer

* Adjust template with tagname footer

* Adjust template with tagname footer

* Update e2e tests snapshots

Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-06-22 16:31:20 +02:00
Michael P. Pfeiffer 521f93619b Upgrade wp-prettier to 2.6.2 and reformat the codebase (https://github.com/woocommerce/woocommerce-blocks/pull/6566)
* Remove mixed tabs and spaces in tsconfig.json

* Update formatting in json files

* Upgrade wp-prettier to 2.6.2
2022-06-15 11:56:52 +02:00
Luigi Teschio 04ebfd2264 Fix E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/6415)
* Fix E2E tests woocommerce/woocommerce-blocks#6415

Fix E2E tests

* Add full state in customer data and exclude it from details check

* update webpack configuration

* Revert change to combobox index

* don't splitChunk frontend scripts

* simplfy output folders

* reduce minimum chunk size to 10kb

* add all inner blocks for loading

* better splitChunks

* update translation code

* wait for scripts

* try sleeping

* fix loading translation

* fix tests for mini cart

* simplfy po logic

* automate loading chunks

* rename webpack group file

* rename block.json path

* remove test

* revert changes to webpack file

* fix loading of chunks

* revert changes to assets api as well

* restore wp-env json configuration

* restore .wp-env.json

* address feedback

* add comment

* address comments

* improve utils function

* install puppeteer

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2022-06-13 11:15:29 +02:00
Luigi Teschio abd5c6afd1 Fix ESLint: use window.localstorage instead localstorage woocommerce/woocommerce-blocks#6442 (https://github.com/woocommerce/woocommerce-blocks/pull/6540)
Fix ESLint: use window.localstorage instead localstorage
2022-06-09 14:47:17 +02:00
Seghir Nadir 238ab01ab2 Refactor webpack splitting to fix missing translation (https://github.com/woocommerce/woocommerce-blocks/pull/6420)
* don't splitChunk frontend scripts

* simplfy output folders

* reduce minimum chunk size to 10kb

* add all inner blocks for loading

* better splitChunks

* update translation code

* wait for scripts

* try sleeping

* fix loading translation

* fix tests for mini cart

* simplfy po logic

* automate loading chunks

* rename webpack group file

* rename block.json path
2022-05-23 15:58:13 +01:00
Luigi Teschio 33a9e654ca Enable ESLint for E2E folder woocommerce/woocommerce-blocks#6410 (https://github.com/woocommerce/woocommerce-blocks/pull/6413)
Enable ESLint for E2E folder; fix ESLint errors
2022-05-23 14:05:30 +02:00
Luigi Teschio 38c8a2ae32 Add E2E tests for the Active Filters Block (https://github.com/woocommerce/woocommerce-blocks/pull/6393)
* 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>
2022-05-13 15:18:51 +02:00
Luigi Teschio 07e6878700 Add E2E tests for the Filter Products By Price Block (https://github.com/woocommerce/woocommerce-blocks/pull/6373)
* 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
2022-05-13 14:15:33 +02:00
Luigi Teschio ac609f05dc Add E2E tests for the Filter Products By Stock Block (https://github.com/woocommerce/woocommerce-blocks/pull/6357)
* 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
2022-05-13 11:11:02 +02:00
Luigi Teschio ded12079cf Add E2E tests for the Filter Products By Attribute Block (https://github.com/woocommerce/woocommerce-blocks/pull/6355)
* 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
2022-05-12 17:15:53 +02:00
Artur Piszek 62024321b9 Fix relative include paths (https://github.com/woocommerce/woocommerce-blocks/pull/6365) 2022-05-06 09:46:54 +02:00
Tarun Vijwani 51495ff32c Meaningful comment for skipping the e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/6353)
* Added meaningful comment for skipping the tests if it's a WooCommerce Core process environment.

* Fixed the flag number for MiniCart
2022-05-05 12:19:38 +04:00
Tung Du 5930ee6a94 Remove custom ensureSidebarOpened() (https://github.com/woocommerce/woocommerce-blocks/pull/6359) 2022-05-05 07:14:07 +07:00
Tarun Vijwani 02a1b9f78d Remove redundant front-end Checkout block test case (https://github.com/woocommerce/woocommerce-blocks/pull/6352)
* Removed redundant front-end test case
2022-05-04 09:58:12 +04:00
Alex Florisca 2f9b54ae03 Try to fix E2E tests once and for all (https://github.com/woocommerce/woocommerce-blocks/pull/6337)
* 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()
2022-05-01 12:33:58 +01:00
Tom Cafferkey 6fb43ed8cb Deprecate legacy filter widgets with block alternatives (https://github.com/woocommerce/woocommerce-blocks/pull/6299)
* 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>
2022-04-27 08:36:00 +01:00
Niels Lange f10bb2da82 Critical flows: Merchant → Checkout → Can adjust T&S and Privacy Policy options (https://github.com/woocommerce/woocommerce-blocks/pull/6211)
* 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>
2022-04-25 10:48:54 +02:00
Luigi Teschio 881c202717 Make Filter Products by Stock block compatible with PHP rendered Classic Template block (https://github.com/woocommerce/woocommerce-blocks/pull/6261)
* Enable Attribute Filter block to work with the PHP rendered Classic Template block

* Check for presence of option before rendering it

* improve filter product by attribute

* fix pagination problem

* fix check when two filter block with same attribute are used

* fix filter by stock for PHP templates

* fix naming and comment

* Update filter key in ClassicTemplate

* Update stock filter block for PHP templates when the filter button is enabled

* Remove unused useEffect and fix ESLint error

* Set active stock filter and track using local state

* ESLint fix

* Remove unncessary dependencies from useEffect

Co-authored-by: tjcafferkey <tjcafferkey@gmail.com>
2022-04-21 08:28:41 +01:00
Tarun Vijwani 3e36dd40dc Critical flows: Shopper → Checkout → Can login to existing account and can create an account (https://github.com/woocommerce/woocommerce-blocks/pull/6147)
* Added test cases for user can login and create an account from Checkout block page
2022-04-21 10:47:22 +04:00
Alex Florisca 59b4da800b Cart & Checkout translations test use nl_NL (https://github.com/woocommerce/woocommerce-blocks/pull/6267)
* 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
2022-04-19 08:56:52 +01:00
Niels Lange 75f8de911a Allow running e2e test individually (https://github.com/woocommerce/woocommerce-blocks/pull/6230)
* Allow running e2e test individually

* Adjust ignore and root paths

* Simplify jest.performance.config.js

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
2022-04-15 09:34:18 +01:00
Luigi Teschio bac2c59daa Add Product Search Results Template (https://github.com/woocommerce/woocommerce-blocks/pull/6219)
* Add Search Result Product Template woocommerce/woocommerce-blocks#6218

Add Search Result Product Template

* update title

* add E2E test for Product Search Results template

* renaming class

* update E2E tests
2022-04-14 11:45:00 +02:00
Tung Du ad85348151 Shopper → Mini Cart → Can view translated mini cart contents block (https://github.com/woocommerce/woocommerce-blocks/pull/6214) 2022-04-13 18:51:13 +07:00
Raluca Stan 0b18ff59bd Register missing C&C inner blocks and update fallback template for older C& C versions (https://github.com/woocommerce/woocommerce-blocks/pull/6195)
* 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.
2022-04-12 12:20:22 +01:00
Jamel Noel Reid 64fcdda420 Add Product endpoint to ExtendSchema (https://github.com/woocommerce/woocommerce-blocks/pull/6122)
* Added ProductSchema Identifier

* Updated get_extended_schema & get_item_response

* Test for extensions field on products

* Updated endpoint extend Readme
2022-04-11 17:40:26 +01:00
Alex Florisca 5c396c4e26 Tidy up and organise e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/6206)
* 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
2022-04-11 11:52:33 +01:00
Alex Florisca 6c2d24e3e5 Fix/e2e tests timeout issue (https://github.com/woocommerce/woocommerce-blocks/pull/6165)
* 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>
2022-04-08 14:47:49 +01:00
Alex Florisca 0c7c2db6c0 Update @woocmmerce/eslint-plugin to 2.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6203)
* Update @woocmmerce/eslint-plugin to 2.0.0

* Fixed some eslint errors

* Fix syntax errors

* Fix most linting errors

* Feedback changes

* Fix one more eslint issue
2022-04-08 14:47:19 +01:00
Thomas Roberts d7a52b6f67 Check for performance file existence before running reporter (https://github.com/woocommerce/woocommerce-blocks/pull/6189)
* 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>
2022-04-06 12:22:51 +01:00
Thomas Roberts 10793e8e18 Try adding performance tests (https://github.com/woocommerce/woocommerce-blocks/pull/6119)
* 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>
2022-04-04 13:30:07 +01:00
Saad Tarhi c636cb1bbe Shopper → Checkout → Can apply single-use coupon once (https://github.com/woocommerce/woocommerce-blocks/pull/6174)
* 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>
2022-04-01 23:09:54 +00:00
Mike Jolley eb196226d8 WIP: Add Inner blocks to order summary (https://github.com/woocommerce/woocommerce-blocks/pull/6065)
* 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>
2022-04-01 15:45:18 +02:00
Luigi Teschio 4f2f267cf8 Add tests for the Mini Cart Block when it is added on the FSE editor. (https://github.com/woocommerce/woocommerce-blocks/pull/6000)
* 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
2022-04-01 11:23:48 +02:00
Tomasz Tunik d62a126476 Ensure e2e tests work with TS (https://github.com/woocommerce/woocommerce-blocks/pull/6173)
* 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
2022-04-01 10:22:54 +02:00
Niels Lange 8943629a86 Shopper → Checkout → Can have different shipping and billing addresses (https://github.com/woocommerce/woocommerce-blocks/pull/5860)
* 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>
2022-03-31 13:10:50 +02:00
Alex Florisca 1108c9994b Fix E2E Tests on trunk (https://github.com/woocommerce/woocommerce-blocks/pull/6154)
* Fire up CI

* Increase timeout after selector
2022-03-29 16:05:11 +01:00
Alex Florisca f344d192d9 E2E tests for translated Cart & Checkout blocks (https://github.com/woocommerce/woocommerce-blocks/pull/6101)
* Translation tests for Cart & Checkout

* Remove comments
2022-03-28 16:20:59 +01:00
Alex Florisca 2459c05d42 Critical flows: Shopper → Cart/Checkout → Can use express checkout (https://github.com/woocommerce/woocommerce-blocks/pull/6075)
* Test if express payment button is available on cart & checkout

* Remove unused uiUnblocked
2022-03-28 14:48:21 +01:00
Tomasz Tunik f7f1b89dc5 Upgrade @wordpress/scripts and /env packages (https://github.com/woocommerce/woocommerce-blocks/pull/6114)
* 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
2022-03-28 15:00:20 +02:00
Tomasz Tunik e821983447 Improve goToSiteEditor E2E utils (https://github.com/woocommerce/woocommerce-blocks/pull/6109)
* 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 
2022-03-28 14:32:15 +02:00
Tung Du 7d60c8fc66 Fix: Mini Cart: Ability to choose the drawer behavior when user add products to cart (https://github.com/woocommerce/woocommerce-blocks/pull/6052) 2022-03-26 07:32:23 +07:00
Saad Tarhi ba2308f729 Shopper → Checkout → Can see warnings when form is incomplete (https://github.com/woocommerce/woocommerce-blocks/pull/6116)
* 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>
2022-03-25 18:34:17 +01:00
Tung Du ed83dfbafa Shopper → Mini Cart → Can remove product (https://github.com/woocommerce/woocommerce-blocks/pull/5937) 2022-03-24 22:37:17 +07:00
Tomasz Tunik fdb8dde033 Fix site editor E2E tests for Gutenberg latest (https://github.com/woocommerce/woocommerce-blocks/pull/6080)
* Add handling of editor context via GUTENBERG_EDITOR_CONTEXT env var
* Fix flaky tests around editing templates
* Wait for save template response to complete
2022-03-23 14:18:00 +01:00
Saad Tarhi f8c5e910d2 Shopper → Cart → Can update product quantity (https://github.com/woocommerce/woocommerce-blocks/pull/6025)
* 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>
2022-03-23 13:51:56 +01:00