From bdca603479bb48c12db687ed5dced145b7ac7070 Mon Sep 17 00:00:00 2001 From: eduard13 Date: Mon, 4 Jan 2021 16:31:29 +0200 Subject: [PATCH 1/2] Fixing the flaky test that fails because of the wrong formatted date value --- .../CreateProductAttributeEntityDateTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDateTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDateTest.xml index d1f7adb8a902c..7d8d71f23535a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDateTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDateTest.xml @@ -34,7 +34,7 @@ - + From a9bee0fb53536052f2ce307bb0260de6a1fed51d Mon Sep 17 00:00:00 2001 From: eduard13 Date: Mon, 4 Jan 2021 21:19:03 +0200 Subject: [PATCH 2/2] Fixing the flaky test that fails because of the wrong formatted date value --- .../Block/Product/View/Options/Type/DateTest.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Options/Type/DateTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Options/Type/DateTest.php index 91a54d8fc13fa..2cdc1e974a1b2 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Options/Type/DateTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/Options/Type/DateTest.php @@ -207,19 +207,21 @@ private function getHtmlDocument(string $source): \DOMDocument */ public function toHtmlWithDropDownDataProvider(): array { + $currentYear = date('Y'); + return [ [ [ 'month' => '3', 'day' => '5', - 'year' => '2020', + 'year' => $currentYear, 'hour' => '2', 'minute' => '15', 'day_part' => 'am', - 'date_internal' => '2020-09-30 02:15:00' + 'date_internal' => sprintf('%s-09-30 02:15:00', $currentYear) ], [ - '//select[@id="options_{id}_year"]/option[@selected]' => '2020', + '//select[@id="options_{id}_year"]/option[@selected]' => $currentYear, '//select[@id="options_{id}_month"]/option[@selected]' => '3', '//select[@id="options_{id}_day"]/option[@selected]' => '5', '//select[@id="options_{id}_hour"]/option[@selected]' => '2', @@ -233,10 +235,10 @@ public function toHtmlWithDropDownDataProvider(): array 'hour' => '2', 'minute' => '15', 'day_part' => 'am', - 'date_internal' => '2020-09-30 02:15:00' + 'date_internal' => sprintf('%s-09-30 02:15:00', $currentYear) ], [ - '//select[@id="options_{id}_year"]/option[@selected]' => '2020', + '//select[@id="options_{id}_year"]/option[@selected]' => $currentYear, '//select[@id="options_{id}_month"]/option[@selected]' => '9', '//select[@id="options_{id}_day"]/option[@selected]' => '30', '//select[@id="options_{id}_hour"]/option[@selected]' => '2',