Skip to content

Commit 533e208

Browse files
committed
MTA-4096: Ignore functional test failures caused by Magento issues
- fixed iframe block - fixed update qty flow
1 parent 4305361 commit 533e208

File tree

5 files changed

+39
-14
lines changed

5 files changed

+39
-14
lines changed

dev/tests/functional/tests/app/Magento/Paypal/Test/Block/Onepage/Payment/HostedPro.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
namespace Magento\Paypal\Test\Block\Onepage\Payment;
88

9+
use Magento\Mtf\Client\ElementInterface;
10+
911
/**
1012
* Hosted Pro credit card block.
1113
*/
@@ -17,4 +19,12 @@ class HostedPro extends PaypalIframe
1719
* @var string
1820
*/
1921
protected $formBlockCc = \Magento\Paypal\Test\Block\Form\HostedPro\Cc::class;
22+
23+
/**
24+
* {@inheritdoc}
25+
*/
26+
protected function waitSubmitForm(ElementInterface $iframeRootElement)
27+
{
28+
// This method is empty because Selenium is blocking current click operation.
29+
}
2030
}

dev/tests/functional/tests/app/Magento/Paypal/Test/Block/Onepage/Payment/PaypalIframe.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class PaypalIframe extends Method
5454
*
5555
* @var string
5656
*/
57-
private $loader = '#lightBoxDiv';
57+
protected $loader = '#lightBoxDiv';
5858

5959
/**
6060
* Fill credit card data in PayPal iframe form.
@@ -72,6 +72,19 @@ public function fillPaymentData(FixtureInterface $creditCard)
7272
$formBlock->fill($creditCard, $iframeRootElement);
7373
$iframeRootElement->find($this->payNowButton)->click();
7474

75+
$this->waitSubmitForm($iframeRootElement);
76+
77+
$this->browser->switchToFrame();
78+
}
79+
80+
/**
81+
* Wait form submit for that payment.
82+
*
83+
* @param ElementInterface $iframeRootElement
84+
* @return void
85+
*/
86+
protected function waitSubmitForm(ElementInterface $iframeRootElement)
87+
{
7588
$loaderElement = $iframeRootElement->find($this->loader);
7689

7790
$loaderElement->waitUntil(function () use ($loaderElement) {
@@ -81,8 +94,6 @@ public function fillPaymentData(FixtureInterface $creditCard)
8194
$loaderElement->waitUntil(function () use ($loaderElement) {
8295
return !$loaderElement->isVisible() ? true : null;
8396
});
84-
85-
$this->browser->switchToFrame();
8697
}
8798

8899
/**

dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateCreditMemoStep.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,13 @@ public function run()
8686
$refundsData = $this->order->getRefund() !== null ? $this->order->getRefund() : ['refundData' => []];
8787
foreach ($refundsData as $refundData) {
8888
$this->salesOrderView->getPageActions()->orderCreditMemo();
89-
$this->orderCreditMemoNew->getFormBlock()->fillProductData(
90-
$refundData,
91-
$this->cart->getItems()
92-
);
93-
$this->orderCreditMemoNew->getFormBlock()->updateQty();
89+
90+
$items = $this->cart->getItems();
91+
$this->orderCreditMemoNew->getFormBlock()->fillProductData($refundData, $items);
92+
if (!empty($refundData) && count($refundData) !== count($items)) {
93+
$this->orderCreditMemoNew->getFormBlock()->updateQty();
94+
}
95+
9496
$this->orderCreditMemoNew->getFormBlock()->fillFormData($refundData);
9597
$this->orderCreditMemoNew->getFormBlock()->submit();
9698
}

dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateInvoiceStep.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,13 @@ public function run()
121121
$invoicesData = $this->order->getInvoice() !== null ? $this->order->getInvoice() : ['invoiceData' => []];
122122
foreach ($invoicesData as $invoiceData) {
123123
$this->salesOrderView->getPageActions()->invoice();
124-
$this->orderInvoiceNew->getFormBlock()->fillProductData(
125-
$invoiceData,
126-
$this->cart->getItems()
127-
);
128-
$this->orderInvoiceNew->getFormBlock()->updateQty();
124+
125+
$items = $this->cart->getItems();
126+
$this->orderInvoiceNew->getFormBlock()->fillProductData($invoiceData, $items);
127+
if (!empty($invoiceData) && count($invoiceData) !== count($items)) {
128+
$this->orderInvoiceNew->getFormBlock()->updateQty();
129+
}
130+
129131
$this->orderInvoiceNew->getFormBlock()->fillFormData($invoiceData);
130132
$this->orderInvoiceNew->getFormBlock()->submit();
131133
$shipmentIds = $this->getShipmentIds();

dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateOnlineCreditMemoStep.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function run()
104104

105105
$items = $this->cart->getItems();
106106
$this->orderCreditMemoNew->getFormBlock()->fillProductData($refundData, $items);
107-
if (count($refundData) !== count($items)) {
107+
if (!empty($refundData) && count($refundData) !== count($items)) {
108108
$this->orderCreditMemoNew->getFormBlock()->updateQty();
109109
}
110110

0 commit comments

Comments
 (0)