Commit Graph

2 Commits

Author SHA1 Message Date
Tomasz Tunik f15d628610 Fix 404 and 500 errors in E2E test logs, editor and front-end. (https://github.com/woocommerce/woocommerce-blocks/pull/5989)
* 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>
2022-03-10 11:00:23 +01:00
Lucio Giannotta 08a99165ca Add mock theme with Woo Templates for E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/5920)
This PR adds a block-enabled theme with templates for WooCommerce
which is intended to be used when testing the more complex scenarios
such as template fallbacks.

Additionally, since theme-dependent logic seems to be becoming more
and more useful (see woocommerce/woocommerce-blocks#5913), this PR also adds a utility function used to
explicitly declare theme dependencies of a test (`useTheme`).

Said function will activate the theme before running a given suite and then
reactivate the previous theme, as to make sure to not have any side-effects
(such as the ones described in woocommerce/woocommerce-blocks#5913 above).

Closes woocommerce/woocommerce-blocks#5660
2022-03-02 15:49:00 +01:00