diff --git a/app/code/Magento/Catalog/Pricing/Price/TierPrice.php b/app/code/Magento/Catalog/Pricing/Price/TierPrice.php index 6835453173dbd02b25e53a63b34bc4905a888d5c..6c4820d5184ac8f458b7065f80819e82fa12119c 100644 --- a/app/code/Magento/Catalog/Pricing/Price/TierPrice.php +++ b/app/code/Magento/Catalog/Pricing/Price/TierPrice.php @@ -208,7 +208,7 @@ class TierPrice extends AbstractPrice implements TierPriceInterface, BasePricePr */ public function getSavePercent(AmountInterface $amount) { - return ceil( + return round( 100 - ((100 / $this->priceInfo->getPrice(FinalPrice::PRICE_CODE)->getValue()) * $amount->getBaseAmount()) ); diff --git a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/TierPriceTest.php b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/TierPriceTest.php index fce88c3a3fea780d8ab05cc1fce24aba8383a1a7..ab7c62d9b5669cc33ac91f7ed20bd6b8566eafdc 100644 --- a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/TierPriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/TierPriceTest.php @@ -394,7 +394,8 @@ class TierPriceTest extends \PHPUnit_Framework_TestCase return [ ['basePrice' => '100', 'tierPrice' => '90', 'savedPercent' => '10'], ['basePrice' => '70', 'tierPrice' => '35', 'savedPercent' => '50'], - ['basePrice' => '50', 'tierPrice' => '35', 'savedPercent' => '30'] + ['basePrice' => '50', 'tierPrice' => '35', 'savedPercent' => '30'], + ['basePrice' => '20.80', 'tierPrice' => '18.72', 'savedPercent' => '10'] ]; } } diff --git a/app/code/Magento/SalesRule/Model/Rule/Condition/Address.php b/app/code/Magento/SalesRule/Model/Rule/Condition/Address.php index 62fcb8e4b3b6243d007e4d7c9dcbdb8b0985af63..3366ba4cd1f6e87903445e5f0c5e2a8954539a58 100644 --- a/app/code/Magento/SalesRule/Model/Rule/Condition/Address.php +++ b/app/code/Magento/SalesRule/Model/Rule/Condition/Address.php @@ -61,7 +61,6 @@ class Address extends \Magento\Rule\Model\Condition\AbstractCondition 'base_subtotal' => __('Subtotal'), 'total_qty' => __('Total Items Quantity'), 'weight' => __('Total Weight'), - 'payment_method' => __('Payment Method'), 'shipping_method' => __('Shipping Method'), 'postcode' => __('Shipping Postcode'), 'region' => __('Shipping Region'), diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/FormPageActions.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/FormPageActions.php old mode 100644 new mode 100755 index ecb59b6351a21eb68156216a9fecc0163e74c0e8..801000227c0d7fd7364be743ddad9ef36b240e49 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/FormPageActions.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/FormPageActions.php @@ -85,7 +85,7 @@ class FormPageActions extends PageActions */ public function reset() { - $this->waitBeforeClick(); + $this->waitForElementVisible($this->resetButton); $this->_rootElement->find($this->resetButton)->click(); } @@ -94,7 +94,7 @@ class FormPageActions extends PageActions */ public function saveAndContinue() { - $this->waitBeforeClick(); + $this->waitForElementVisible($this->saveAndContinueButton); $this->_rootElement->find($this->saveAndContinueButton)->click(); $this->waitForElementNotVisible('.popup popup-loading'); $this->waitForElementNotVisible('.loader'); @@ -105,7 +105,7 @@ class FormPageActions extends PageActions */ public function save() { - $this->waitBeforeClick(); + $this->waitForElementVisible($this->saveButton); $this->_rootElement->find($this->saveButton)->click(); $this->waitForElementNotVisible($this->spinner); $this->waitForElementNotVisible($this->loader, Locator::SELECTOR_XPATH); @@ -117,7 +117,10 @@ class FormPageActions extends PageActions */ public function delete() { - $this->waitBeforeClick(); + $this->waitForElementNotVisible($this->spinner); + $this->waitForElementNotVisible($this->loader, Locator::SELECTOR_XPATH); + $this->waitForElementNotVisible($this->loaderOld, Locator::SELECTOR_XPATH); + $this->waitForElementVisible($this->deleteButton); $this->_rootElement->find($this->deleteButton)->click(); } @@ -130,16 +133,4 @@ class FormPageActions extends PageActions { return $this->_rootElement->find($this->deleteButton)->isVisible(); } - - /** - * Wait for User before clicking any Button which calls JS validation on correspondent form. - * See details in MAGETWO-31121. - * - * @return void - */ - protected function waitBeforeClick() - { - time_nanosleep(0, 600000000); - usleep(1000000); - } } diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php old mode 100644 new mode 100755 index 3fbffbf0708c6968484b50f03dce05a81347a101..eff593ac8d0bf7a3761b2a74f7e8ab928d5ac713 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php @@ -467,6 +467,7 @@ abstract class Grid extends Block */ public function openFirstRow() { + $this->waitLoader(); $this->_rootElement->find($this->firstRowSelector, Locator::SELECTOR_XPATH)->click(); } diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CreateSalesRuleStep.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CreateSalesRuleStep.php index d919ecc88eae2d141912a72daa6544291c7d20f3..cdceb7404e20bd22b3093655e7a8acd452dc870c 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CreateSalesRuleStep.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CreateSalesRuleStep.php @@ -59,7 +59,6 @@ class CreateSalesRuleStep implements TestStepInterface { $result['salesRule'] = null; if ($this->salesRule !== null) { - $this->deleteAllSalesRule->run(); $salesRule = $this->fixtureFactory->createByCode( 'salesRule', ['dataset' => $this->salesRule] diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php old mode 100644 new mode 100755 index c85ef8ea9a07920572d574828eb40e34bb8382b7..4c6c01b28d9d4ff12fcd0e5f1b2c45d2b4136c49 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php @@ -93,7 +93,6 @@ abstract class AbstractAssertOrderTaxOnBackend extends AbstractConstraint $this->orderInvoiceNew = $orderInvoiceNew; $this->orderCreditMemoNew = $orderCreditMemoNew; $orderIndex->open(); - $this->waitBeforeClick(); $orderIndex->getSalesOrderGrid()->openFirstRow(); //Check prices on order page $actualPrices = []; @@ -223,15 +222,4 @@ abstract class AbstractAssertOrderTaxOnBackend extends AbstractConstraint { return 'Prices on backend after order creation is correct.'; } - - /** - * Wait for User before click - * - * @return void - */ - protected function waitBeforeClick() - { - time_nanosleep(0, 600000000); - usleep(1000000); - } } diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestStep/CreateTaxRuleStep.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestStep/CreateTaxRuleStep.php index 4ddae5cc0da6742fcd42e073809152c975d6793d..37113ef0cc225e0d5f3fb51e626c6bcd499bbfb2 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestStep/CreateTaxRuleStep.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestStep/CreateTaxRuleStep.php @@ -59,7 +59,6 @@ class CreateTaxRuleStep implements TestStepInterface { $result['taxRule'] = null; if ($this->taxRule !== null) { - $this->deleteAllTaxRule->run(); $taxRuleDataSets = explode(',', $this->taxRule); foreach ($taxRuleDataSets as $taxRuleDataSet) { $taxRule = $this->fixtureFactory->createByCode( diff --git a/lib/internal/Magento/Framework/HTTP/Client/Curl.php b/lib/internal/Magento/Framework/HTTP/Client/Curl.php index ee19ce7d961619348eff6e099f7e4f662ff004fb..67525f62f6336cf7de844e866a153be223dc0b5c 100644 --- a/lib/internal/Magento/Framework/HTTP/Client/Curl.php +++ b/lib/internal/Magento/Framework/HTTP/Client/Curl.php @@ -12,6 +12,12 @@ namespace Magento\Framework\HTTP\Client; */ class Curl implements \Magento\Framework\HTTP\ClientInterface { + /** + * Max supported protocol by curl CURL_SSLVERSION_TLSv1_2 + * @var int + */ + private static $sslVersion = 6; + /** * Hostname * @var string @@ -374,6 +380,7 @@ class Curl implements \Magento\Framework\HTTP\ClientInterface //$this->curlOption(CURLOPT_HEADER, 1); $this->curlOption(CURLOPT_RETURNTRANSFER, 1); $this->curlOption(CURLOPT_HEADERFUNCTION, [$this, 'parseHeaders']); + $this->curlOption(CURLOPT_SSLVERSION, self::$sslVersion); if (count($this->_curlUserOptions)) { foreach ($this->_curlUserOptions as $k => $v) {