From 22594bd6cf742210b2d3b8483702510b25d7fa14 Mon Sep 17 00:00:00 2001 From: Max Lesechko Date: Mon, 29 Oct 2018 11:47:50 -0500 Subject: [PATCH 1/8] MAGETWO-95883: [FT] [Klarna] Failed functional tests --- .../Bundle/Test/Block/Adminhtml/Product/Composite/Configure.xml | 1 - .../Test/Block/Adminhtml/Product/Composite/Configure.xml | 1 - .../Test/Block/Adminhtml/Product/Composite/Configure.xml | 1 - 3 files changed, 3 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Product/Composite/Configure.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Product/Composite/Configure.xml index e4c0dce0c5b10..18aedfa97f9eb 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Product/Composite/Configure.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Product/Composite/Configure.xml @@ -7,7 +7,6 @@ --> - div[contains(@class,"field choice") and label[contains(.,"%product_name%")]]//input xpath diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Composite/Configure.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Composite/Configure.xml index a66753c2adf23..f7bd155fd2d51 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Composite/Configure.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Composite/Configure.xml @@ -7,7 +7,6 @@ --> - //div[@class="product-options"]//label[.="%s"]//following-sibling::*//select xpath diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/Composite/Configure.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/Composite/Configure.xml index 7a7a6d2124cb7..2f721f05f5ee8 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/Composite/Configure.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/Composite/Configure.xml @@ -7,7 +7,6 @@ --> - //*[@id="downloadable-links-list"]/*[contains(.,"%link_name%")]//input xpath From 95c3579b9e2b2e6c732d676155953aff3de05702 Mon Sep 17 00:00:00 2001 From: Iryna Lagno Date: Mon, 29 Oct 2018 13:54:28 -0500 Subject: [PATCH 2/8] MAGETWO-95977: Magento 2.3.0-beta18: ReflectionException on Backend -> Stores -> Configuration -> Services -> OAuth page --- .../Integration/etc/adminhtml/system.xml | 2 +- .../System/Config/OauthSectionTest.php | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 dev/tests/integration/testsuite/Magento/Integration/Block/Adminhtml/System/Config/OauthSectionTest.php diff --git a/app/code/Magento/Integration/etc/adminhtml/system.xml b/app/code/Magento/Integration/etc/adminhtml/system.xml index 5abec8efbfdd6..fe80fe105493a 100644 --- a/app/code/Magento/Integration/etc/adminhtml/system.xml +++ b/app/code/Magento/Integration/etc/adminhtml/system.xml @@ -54,7 +54,7 @@ Maximum Number of authentication failures to lock out account. - + Period of time in seconds after which account will be unlocked. diff --git a/dev/tests/integration/testsuite/Magento/Integration/Block/Adminhtml/System/Config/OauthSectionTest.php b/dev/tests/integration/testsuite/Magento/Integration/Block/Adminhtml/System/Config/OauthSectionTest.php new file mode 100644 index 0000000000000..ac5d8005180b4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Integration/Block/Adminhtml/System/Config/OauthSectionTest.php @@ -0,0 +1,25 @@ +dispatch('backend/admin/system_config/edit/section/oauth/'); + $body = $this->getResponse()->getBody(); + $this->assertContains('id="oauth_access_token_lifetime-head"', $body); + $this->assertContains('id="oauth_cleanup-head"', $body); + $this->assertContains('id="oauth_consumer-head"', $body); + $this->assertContains('id="oauth_authentication_lock-head"', $body); + } +} From 7daec41bcf5451b2ca7cb11b3e4784a9049f090c Mon Sep 17 00:00:00 2001 From: Joan He Date: Wed, 31 Oct 2018 09:39:34 -0500 Subject: [PATCH 3/8] MAGETWO-94313: Random test failures on jenkins - unskip Magento\Reports\Test\TestCase\ProductsInCartReportEntityTest --- .../Reports/Test/TestCase/ProductsInCartReportEntityTest.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.xml index fd0d169967161..e13d31342dba1 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.xml @@ -8,14 +8,12 @@ - MQE-1160 default 1 0 - MQE-1160 default 2 1 From 5d84640f097dd94a361a6b0b1085e13da472a360 Mon Sep 17 00:00:00 2001 From: Joan He Date: Wed, 31 Oct 2018 20:17:21 -0500 Subject: [PATCH 4/8] MAGETWO-95659: Fix and Unskip MTF OnePageCheckoutOfflinePaymentMethodsTest --- .../OnePageCheckoutOfflinePaymentMethodsTest.xml | 11 ++++------- .../Test/TestStep/SelectCheckoutMethodStep.php | 11 +++++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutOfflinePaymentMethodsTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutOfflinePaymentMethodsTest.xml index 7c12b546d1359..361c5031f3317 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutOfflinePaymentMethodsTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutOfflinePaymentMethodsTest.xml @@ -22,7 +22,6 @@ - MAGETWO-59816: Redirect works improperly in a browser incognito mode severity:S1 catalogProductSimple::default register_customer @@ -57,7 +56,7 @@ - stable:no, severity:S0 + severity:S0 catalogProductSimple::default active_sales_rule_for_all_groups default @@ -79,7 +78,7 @@ - severity:S1, stable:no + severity:S1 catalogProductSimple::product_with_qty_25 0 out of stock @@ -92,7 +91,7 @@ 375.00 banktransfer - Precessing + Processing Back, Send Email, Cancel, Hold, Invoice, Edit banktransfer_specificcountry_gb, can_subtract_and_can_back_in_stock @@ -102,10 +101,8 @@ - MAGETWO-66737: Magento\Checkout\Test\TestCase\OnePageCheckoutTest with OnePageCheckoutTestVariation3 and 4 is not stable - MAGETWO-95659: Fix and Unskip MTF OnePageCheckoutOfflinePaymentMethodsTest test_type:acceptance_test, test_type:extended_acceptance_test, severity:S0 catalogProductSimple::product_with_special_price configurableProduct::product_with_special_price @@ -211,7 +208,7 @@ - stable:no, severity:S1 + severity:S1 catalogProductSimple::simple_with_tier_price_and_order_qty_3 default login diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php index d951d84bab78d..f79cf8d7eb7fa 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php @@ -59,6 +59,13 @@ class SelectCheckoutMethodStep implements TestStepInterface */ private $customerAccountCreatePage; + /** + * Proceed to checkout from minicart step + * + * @var proceedToCheckoutFromMiniShoppingCartStep + */ + private $proceedToCheckoutFromMiniShoppingCartStep; + /** * @constructor * @param CheckoutOnepage $checkoutOnepage @@ -66,6 +73,7 @@ class SelectCheckoutMethodStep implements TestStepInterface * @param Customer $customer * @param LogoutCustomerOnFrontendStep $logoutCustomerOnFrontend * @param ClickProceedToCheckoutStep $clickProceedToCheckoutStep + * @param ProceedToCheckoutFromMiniShoppingCartStep $proceedToCheckoutFromMiniShoppingCartStep * @param string $checkoutMethod */ public function __construct( @@ -74,6 +82,7 @@ public function __construct( Customer $customer, LogoutCustomerOnFrontendStep $logoutCustomerOnFrontend, ClickProceedToCheckoutStep $clickProceedToCheckoutStep, + ProceedToCheckoutFromMiniShoppingCartStep $proceedToCheckoutFromMiniShoppingCartStep, $checkoutMethod ) { $this->checkoutOnepage = $checkoutOnepage; @@ -82,6 +91,7 @@ public function __construct( $this->logoutCustomerOnFrontend = $logoutCustomerOnFrontend; $this->clickProceedToCheckoutStep = $clickProceedToCheckoutStep; $this->checkoutMethod = $checkoutMethod; + $this->proceedToCheckoutFromMiniShoppingCartStep = $proceedToCheckoutFromMiniShoppingCartStep; } /** @@ -129,6 +139,7 @@ private function processRegister() if ($this->checkoutMethod === 'register_before_checkout') { $this->checkoutOnepage->getAuthenticationPopupBlock()->createAccount(); $this->customerAccountCreatePage->getRegisterForm()->registerCustomer($this->customer); + $this->proceedToCheckoutFromMiniShoppingCartStep->run(); } } From 52381c16a8af9255dc032f13aa80d0dce8d8cd53 Mon Sep 17 00:00:00 2001 From: Iryna Lagno Date: Thu, 1 Nov 2018 11:21:58 -0500 Subject: [PATCH 5/8] MAGETWO-96034: DB compare of upgrade vs fresh install has some inconsistent table schemas --- app/code/Magento/Customer/etc/db_schema.xml | 2 +- app/code/Magento/Integration/etc/db_schema.xml | 2 +- app/code/Magento/Sales/etc/db_schema.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Customer/etc/db_schema.xml b/app/code/Magento/Customer/etc/db_schema.xml index b3c15799011a2..8178baef71abb 100644 --- a/app/code/Magento/Customer/etc/db_schema.xml +++ b/app/code/Magento/Customer/etc/db_schema.xml @@ -506,7 +506,7 @@ - diff --git a/app/code/Magento/Integration/etc/db_schema.xml b/app/code/Magento/Integration/etc/db_schema.xml index c2c2cedc665fb..1f702bfe4bc7a 100644 --- a/app/code/Magento/Integration/etc/db_schema.xml +++ b/app/code/Magento/Integration/etc/db_schema.xml @@ -136,7 +136,7 @@ comment="User type (admin or customer)"/> - diff --git a/app/code/Magento/Sales/etc/db_schema.xml b/app/code/Magento/Sales/etc/db_schema.xml index 6847b4681de52..ced999bb86019 100644 --- a/app/code/Magento/Sales/etc/db_schema.xml +++ b/app/code/Magento/Sales/etc/db_schema.xml @@ -769,7 +769,7 @@ - Date: Fri, 2 Nov 2018 09:44:30 -0500 Subject: [PATCH 6/8] MAGETWO-95659: Fix and Unskip MTF OnePageCheckoutOfflinePaymentMethodsTest --- .../Test/Constraint/AssertCartIsEmpty.php | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartIsEmpty.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartIsEmpty.php index c2839651b582f..22a6136737089 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartIsEmpty.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartIsEmpty.php @@ -6,7 +6,6 @@ namespace Magento\Checkout\Test\Constraint; -use Magento\Checkout\Test\Fixture\Cart; use Magento\Checkout\Test\Page\CheckoutCart; use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\Constraint\AbstractConstraint; @@ -42,10 +41,12 @@ public function processAssert(CheckoutCart $checkoutCart, BrowserInterface $brow ); $cartEmptyBlock->clickLinkToMainPage(); - \PHPUnit\Framework\Assert::assertEquals( + $this->assertUrlEqual( $_ENV['app_frontend_url'], $browser->getUrl(), - 'Wrong link to main page on empty cart page.' + true, + 'Wrong link to main page on empty cart page: expected - ' . $_ENV['app_frontend_url'] + . ', actural - ' . $browser->getUrl() ); } @@ -58,4 +59,27 @@ public function toString() { return 'Shopping Cart is empty.'; } + + /** + * Asserts that two urls are equal + * + * @param string $url1 + * @param string $url2 + * @param bool $ignoreScheme + * @param string $message + * @return void + */ + private function assertUrlEqual($expectedUrl, $actualUrl, $ignoreScheme = false, $message = '') + { + $urlArray1 = parse_url($expectedUrl); + $urlArray2 = parse_url($actualUrl); + if ($ignoreScheme) { + unset($urlArray1['scheme']); + unset($urlArray2['scheme']); + } + \PHPUnit\Framework\Assert::assertTrue( + $urlArray1 === $urlArray2, + $message + ); + } } From 4ec4c0e1f390c987b6db7efd799cb0da74df1770 Mon Sep 17 00:00:00 2001 From: Joan He Date: Fri, 2 Nov 2018 11:54:18 -0500 Subject: [PATCH 7/8] MAGETWO-95660: Fix and Unskip MTF OnePageCheckoutTest --- .../Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml index 5c05d4a840009..0edd8f4183f30 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml @@ -7,7 +7,7 @@ --> - + severity:S1 catalogProductSimple::default customer_UK_US_addresses @@ -49,10 +49,6 @@ - - stable:no - MAGETWO-94169: [MTF] - OnePageCheckoutUsingNonDefaultAddress_0 fails on 2.3-develop - severity:S1 From dda4f8af9ba60997cb7b78fcd7afe61f988b444b Mon Sep 17 00:00:00 2001 From: Joan He Date: Tue, 6 Nov 2018 15:56:34 -0600 Subject: [PATCH 8/8] MAGETWO-95659: Fix and Unskip MTF OnePageCheckoutOfflinePaymentMethodsTest - address code review comments --- .../Test/Constraint/AssertCartIsEmpty.php | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartIsEmpty.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartIsEmpty.php index 22a6136737089..cf05079b0a079 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartIsEmpty.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartIsEmpty.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Checkout\Test\Constraint; @@ -29,8 +30,10 @@ class AssertCartIsEmpty extends AbstractConstraint * @param BrowserInterface $browser * @return void */ - public function processAssert(CheckoutCart $checkoutCart, BrowserInterface $browser) - { + public function processAssert( + CheckoutCart $checkoutCart, + BrowserInterface $browser + ): void { $checkoutCart->open(); $cartEmptyBlock = $checkoutCart->getCartEmptyBlock(); @@ -46,7 +49,7 @@ public function processAssert(CheckoutCart $checkoutCart, BrowserInterface $brow $browser->getUrl(), true, 'Wrong link to main page on empty cart page: expected - ' . $_ENV['app_frontend_url'] - . ', actural - ' . $browser->getUrl() + . ', actual - ' . $browser->getUrl() ); } @@ -63,14 +66,18 @@ public function toString() /** * Asserts that two urls are equal * - * @param string $url1 - * @param string $url2 + * @param string $expectedUrl + * @param string $actualUrl * @param bool $ignoreScheme * @param string $message * @return void */ - private function assertUrlEqual($expectedUrl, $actualUrl, $ignoreScheme = false, $message = '') - { + private function assertUrlEqual( + string $expectedUrl, + string $actualUrl, + bool $ignoreScheme = false, + string $message = '' + ): void { $urlArray1 = parse_url($expectedUrl); $urlArray2 = parse_url($actualUrl); if ($ignoreScheme) {