From 7a0b00ec0c8fbafd9dffcdca86bf8d602d91c0be Mon Sep 17 00:00:00 2001 From: Bec Scott Date: Fri, 30 Apr 2021 11:38:26 +1000 Subject: [PATCH] Un-skip product import test, delete all products in the setup (https://github.com/woocommerce/woocommerce-admin/pull/6905) * un-skip test, delete all products in the setup * add to readme * change fix to dev --- plugins/woocommerce-admin/readme.txt | 1 + plugins/woocommerce-admin/tests/api/onboarding-tasks.php | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/woocommerce-admin/readme.txt b/plugins/woocommerce-admin/readme.txt index a2c4c6f7a6a..4b0077ef58d 100644 --- a/plugins/woocommerce-admin/readme.txt +++ b/plugins/woocommerce-admin/readme.txt @@ -88,6 +88,7 @@ Release and roadmap notes are available on the [WooCommerce Developers Blog](htt - Dev: Update E2E jest config, so it correctly creates screenshots on failure. #6858 - Dev: Fixed storybook build script #6875 - Dev: Removed allowed keys list for adding woocommerce_meta data. #6889 🎉 @xristos3490 +- Dev: Delete all products when running product import tests, unskip previously skipped test. #6905 - Feature: Add recommended payment methods in payment settings. #6760 - Fix: Disable the continue btn on OBW when requested are being made #6838 - Fix: Event tracking for merchant email notes #6616 diff --git a/plugins/woocommerce-admin/tests/api/onboarding-tasks.php b/plugins/woocommerce-admin/tests/api/onboarding-tasks.php index 4b12639c0ab..79f2e83a7e2 100644 --- a/plugins/woocommerce-admin/tests/api/onboarding-tasks.php +++ b/plugins/woocommerce-admin/tests/api/onboarding-tasks.php @@ -30,6 +30,13 @@ class WC_Tests_API_Onboarding_Tasks extends WC_REST_Unit_Test_Case { 'role' => 'administrator', ) ); + + // Empty the db of any products. + $query = new \WC_Product_Query(); + $products = $query->get_products(); + foreach ( $products as $product ) { + $product->delete( true ); + } } /** @@ -57,7 +64,6 @@ class WC_Tests_API_Onboarding_Tasks extends WC_REST_Unit_Test_Case { * Test that sample product data is imported. */ public function test_import_sample_products() { - $this->markTestSkipped( 'Skipped as test randomly fails on line 77.' ); wp_set_current_user( $this->user ); $this->remove_color_or_logo_attribute_taxonomy();