Skip to content

Commit d758023

Browse files
Merge pull request #142 from magento-fearless-kiwis/develop-PR
[Fearless Kiwis] P1 and P2 bug fixes
2 parents 4c02b66 + 53584cf commit d758023

File tree

9 files changed

+18
-33
lines changed

9 files changed

+18
-33
lines changed

app/code/Magento/Catalog/Pricing/Price/TierPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ protected function getBasePrice()
208208
*/
209209
public function getSavePercent(AmountInterface $amount)
210210
{
211-
return ceil(
211+
return round(
212212
100 - ((100 / $this->priceInfo->getPrice(FinalPrice::PRICE_CODE)->getValue())
213213
* $amount->getBaseAmount())
214214
);

app/code/Magento/Catalog/Test/Unit/Pricing/Price/TierPriceTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ public function dataProviderGetSavePercent()
394394
return [
395395
['basePrice' => '100', 'tierPrice' => '90', 'savedPercent' => '10'],
396396
['basePrice' => '70', 'tierPrice' => '35', 'savedPercent' => '50'],
397-
['basePrice' => '50', 'tierPrice' => '35', 'savedPercent' => '30']
397+
['basePrice' => '50', 'tierPrice' => '35', 'savedPercent' => '30'],
398+
['basePrice' => '20.80', 'tierPrice' => '18.72', 'savedPercent' => '10']
398399
];
399400
}
400401
}

app/code/Magento/SalesRule/Model/Rule/Condition/Address.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public function loadAttributeOptions()
6161
'base_subtotal' => __('Subtotal'),
6262
'total_qty' => __('Total Items Quantity'),
6363
'weight' => __('Total Weight'),
64-
'payment_method' => __('Payment Method'),
6564
'shipping_method' => __('Shipping Method'),
6665
'postcode' => __('Shipping Postcode'),
6766
'region' => __('Shipping Region'),

dev/tests/functional/tests/app/Magento/Backend/Test/Block/FormPageActions.php

100644100755
Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function back()
8585
*/
8686
public function reset()
8787
{
88-
$this->waitBeforeClick();
88+
$this->waitForElementVisible($this->resetButton);
8989
$this->_rootElement->find($this->resetButton)->click();
9090
}
9191

@@ -94,7 +94,7 @@ public function reset()
9494
*/
9595
public function saveAndContinue()
9696
{
97-
$this->waitBeforeClick();
97+
$this->waitForElementVisible($this->saveAndContinueButton);
9898
$this->_rootElement->find($this->saveAndContinueButton)->click();
9999
$this->waitForElementNotVisible('.popup popup-loading');
100100
$this->waitForElementNotVisible('.loader');
@@ -105,7 +105,7 @@ public function saveAndContinue()
105105
*/
106106
public function save()
107107
{
108-
$this->waitBeforeClick();
108+
$this->waitForElementVisible($this->saveButton);
109109
$this->_rootElement->find($this->saveButton)->click();
110110
$this->waitForElementNotVisible($this->spinner);
111111
$this->waitForElementNotVisible($this->loader, Locator::SELECTOR_XPATH);
@@ -117,7 +117,10 @@ public function save()
117117
*/
118118
public function delete()
119119
{
120-
$this->waitBeforeClick();
120+
$this->waitForElementNotVisible($this->spinner);
121+
$this->waitForElementNotVisible($this->loader, Locator::SELECTOR_XPATH);
122+
$this->waitForElementNotVisible($this->loaderOld, Locator::SELECTOR_XPATH);
123+
$this->waitForElementVisible($this->deleteButton);
121124
$this->_rootElement->find($this->deleteButton)->click();
122125
}
123126

@@ -130,16 +133,4 @@ public function checkDeleteButton()
130133
{
131134
return $this->_rootElement->find($this->deleteButton)->isVisible();
132135
}
133-
134-
/**
135-
* Wait for User before clicking any Button which calls JS validation on correspondent form.
136-
* See details in MAGETWO-31121.
137-
*
138-
* @return void
139-
*/
140-
protected function waitBeforeClick()
141-
{
142-
time_nanosleep(0, 600000000);
143-
usleep(1000000);
144-
}
145136
}

dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ public function isFirstRowVisible()
467467
*/
468468
public function openFirstRow()
469469
{
470+
$this->waitLoader();
470471
$this->_rootElement->find($this->firstRowSelector, Locator::SELECTOR_XPATH)->click();
471472
}
472473

dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CreateSalesRuleStep.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public function run()
5959
{
6060
$result['salesRule'] = null;
6161
if ($this->salesRule !== null) {
62-
$this->deleteAllSalesRule->run();
6362
$salesRule = $this->fixtureFactory->createByCode(
6463
'salesRule',
6564
['dataset' => $this->salesRule]

dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php

100644100755
Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ public function processAssert(
9393
$this->orderInvoiceNew = $orderInvoiceNew;
9494
$this->orderCreditMemoNew = $orderCreditMemoNew;
9595
$orderIndex->open();
96-
$this->waitBeforeClick();
9796
$orderIndex->getSalesOrderGrid()->openFirstRow();
9897
//Check prices on order page
9998
$actualPrices = [];
@@ -223,15 +222,4 @@ public function toString()
223222
{
224223
return 'Prices on backend after order creation is correct.';
225224
}
226-
227-
/**
228-
* Wait for User before click
229-
*
230-
* @return void
231-
*/
232-
protected function waitBeforeClick()
233-
{
234-
time_nanosleep(0, 600000000);
235-
usleep(1000000);
236-
}
237225
}

dev/tests/functional/tests/app/Magento/Tax/Test/TestStep/CreateTaxRuleStep.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public function run()
5959
{
6060
$result['taxRule'] = null;
6161
if ($this->taxRule !== null) {
62-
$this->deleteAllTaxRule->run();
6362
$taxRuleDataSets = explode(',', $this->taxRule);
6463
foreach ($taxRuleDataSets as $taxRuleDataSet) {
6564
$taxRule = $this->fixtureFactory->createByCode(

lib/internal/Magento/Framework/HTTP/Client/Curl.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
*/
1313
class Curl implements \Magento\Framework\HTTP\ClientInterface
1414
{
15+
/**
16+
* Max supported protocol by curl CURL_SSLVERSION_TLSv1_2
17+
* @var int
18+
*/
19+
private static $sslVersion = 6;
20+
1521
/**
1622
* Hostname
1723
* @var string
@@ -374,6 +380,7 @@ protected function makeRequest($method, $uri, $params = [])
374380
//$this->curlOption(CURLOPT_HEADER, 1);
375381
$this->curlOption(CURLOPT_RETURNTRANSFER, 1);
376382
$this->curlOption(CURLOPT_HEADERFUNCTION, [$this, 'parseHeaders']);
383+
$this->curlOption(CURLOPT_SSLVERSION, self::$sslVersion);
377384

378385
if (count($this->_curlUserOptions)) {
379386
foreach ($this->_curlUserOptions as $k => $v) {

0 commit comments

Comments
 (0)