diff --git a/plugins/woocommerce-blocks/tests/e2e/bin/scripts/parallel/products.sh b/plugins/woocommerce-blocks/tests/e2e/bin/scripts/parallel/products.sh index 8526207e164..dd804a6d174 100644 --- a/plugins/woocommerce-blocks/tests/e2e/bin/scripts/parallel/products.sh +++ b/plugins/woocommerce-blocks/tests/e2e/bin/scripts/parallel/products.sh @@ -5,3 +5,11 @@ ################################################################################################### wp import wp-content/plugins/woocommerce/sample-data/sample_products.xml --authors=skip wp wc tool run regenerate_product_lookup_tables --user=1 + +# This is a hacky work around to fix product gallery images not being imported +# This sets up the product Hoodie to have product gallery images for e2e testing +post_id=$(wp post list --post_type=product --field=ID --name="Hoodie" --format=ids) +image1=$(wp post list --post_type=attachment --field=ID --name="hoodie-with-logo-2.jpg" --format=ids) +image2=$(wp post list --post_type=attachment --field=ID --name="hoodie-green-1.jpg" --format=ids) +image3=$(wp post list --post_type=attachment --field=ID --name="hoodie-2.jpg" --format=ids) +wp post meta update $post_id _product_image_gallery "$image1,$image2,$image3"