Skip to content

Commit 299c359

Browse files
committed
MAGETWO-95963: [TSG] Pull Request 53 stabilization
1 parent 991d785 commit 299c359

17 files changed

+147
-1
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120

121121
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/>
122122
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/>
123+
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/>
123124
<fillField selector="{{OrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="fillOrderNum"/>
124125
<click selector="{{OrdersGridSection.submitSearch}}" stepKey="submitSearch"/>
125126
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask4"/>
@@ -176,4 +177,4 @@
176177
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
177178
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
178179
</test>
179-
</tests>
180+
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitle.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
6666
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/>
6767
<waitForPageLoad stepKey="waitForPageLoad1"/>
68+
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/>
6869
<fillField selector="{{AdminOrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="fillOrderNum"/>
6970
<click selector="{{AdminOrdersGridSection.submitSearch}}" stepKey="submitSearchOrderNum"/>
7071
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnSearch"/>

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363

6464
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/>
6565
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnOrdersPage"/>
66+
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/>
6667
<fillField selector="{{OrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="fillOrderNum"/>
6768
<click selector="{{OrdersGridSection.submitSearch}}" stepKey="submitSearchOrderNum"/>
6869
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnSearch"/>

app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161

6262
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onAdminOrdersPage"/>
6363
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/>
64+
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/>
6465
<fillField selector="{{OrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="searchOrderNum"/>
6566
<click selector="{{OrdersGridSection.submitSearch}}" stepKey="submitSearch"/>
6667
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask4"/>

dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductOnConfigureCartPage.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
use Magento\Bundle\Test\Fixture\BundleProduct;
1010
use Magento\Catalog\Test\Page\Product\CatalogProductView;
11+
use Magento\Checkout\Test\Constraint\Utils\CartPageLoadTrait;
1112
use Magento\Checkout\Test\Fixture\Cart;
1213
use Magento\Checkout\Test\Page\CheckoutCart;
1314
use Magento\Mtf\Constraint\AbstractAssertForm;
@@ -17,6 +18,8 @@
1718
*/
1819
class AssertBundleProductOnConfigureCartPage extends AbstractAssertForm
1920
{
21+
use CartPageLoadTrait;
22+
2023
/**
2124
* Check bundle product options correctly displayed on cart configuration page.
2225
*
@@ -28,6 +31,8 @@ class AssertBundleProductOnConfigureCartPage extends AbstractAssertForm
2831
public function processAssert(CheckoutCart $checkoutCart, Cart $cart, CatalogProductView $catalogProductView)
2932
{
3033
$checkoutCart->open();
34+
$this->waitForCartPageLoaded($checkoutCart);
35+
3136
$sourceProducts = $cart->getDataFieldConfig('items')['source'];
3237
$products = $sourceProducts->getProducts();
3338
foreach ($cart->getItems() as $key => $item) {

dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ class Cart extends Block
113113
*/
114114
private $popupWindowContent = '#main';
115115

116+
/**
117+
* Locator for page with ajax loading state.
118+
*
119+
* @var string
120+
*/
121+
private $ajaxLoading = 'body.ajax-loading';
122+
116123
/**
117124
* Wait for PayPal page is loaded.
118125
*
@@ -295,4 +302,14 @@ public function waitForCheckoutButton()
295302
{
296303
$this->waitForElementVisible($this->inContextPaypalCheckoutButton);
297304
}
305+
306+
/**
307+
* Wait loading.
308+
*
309+
* @return void
310+
*/
311+
public function waitForLoader()
312+
{
313+
$this->waitForElementNotVisible($this->ajaxLoading);
314+
}
298315
}

dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.php

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ class Shipping extends Form
7272
*/
7373
protected $commonShippingPriceSelector = '.totals.shipping .price';
7474

75+
/**
76+
* Estimate shipping and tax form locator.
77+
*
78+
* @var string
79+
*/
80+
private $estimateShippingForm = '#shipping-zip-form';
81+
7582
/**
7683
* Open estimate shipping and tax form.
7784
*
@@ -250,4 +257,51 @@ public function waitForCommonShippingPriceBlock()
250257
{
251258
$this->waitForElementVisible($this->commonShippingPriceSelector, Locator::SELECTOR_CSS);
252259
}
260+
261+
/**
262+
* Wait until estimation form to appear.
263+
*
264+
* @return void
265+
*/
266+
public function waitForEstimateShippingAndTaxForm()
267+
{
268+
$browser = $this->browser;
269+
$selector = $this->estimateShippingForm;
270+
271+
$browser->waitUntil(
272+
function () use ($browser, $selector) {
273+
$element = $browser->find($selector);
274+
return $element->isPresent() ? true : null;
275+
}
276+
);
277+
}
278+
279+
/**
280+
* Wait for shipping method form.
281+
*
282+
* @return void
283+
*/
284+
public function waitForShippingMethodForm()
285+
{
286+
$browser = $this->browser;
287+
$selector = $this->shippingMethodForm;
288+
289+
$browser->waitUntil(
290+
function () use ($browser, $selector) {
291+
$element = $browser->find($selector);
292+
return $element->isPresent() ? true : null;
293+
}
294+
);
295+
}
296+
297+
/**
298+
* Wait for summary block to be loaded.
299+
*
300+
* @return void
301+
*/
302+
public function waitForSummaryBlock()
303+
{
304+
$this->waitForEstimateShippingAndTaxForm();
305+
$this->waitForShippingMethodForm();
306+
}
253307
}

dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,4 +264,15 @@ public function waitForShippingPriceBlock()
264264
{
265265
$this->waitForElementVisible($this->shippingPriceBlockSelector, Locator::SELECTOR_CSS);
266266
}
267+
268+
/**
269+
* Wait for "Grand Total" row to appear.
270+
*
271+
* @return void
272+
*/
273+
public function waitForGrandTotal()
274+
{
275+
$this->waitForUpdatedTotals();
276+
$this->waitForElementVisible($this->grandTotal);
277+
}
267278
}

dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartItemsOptions.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\Checkout\Test\Constraint;
88

99
use Magento\Catalog\Test\Fixture\CatalogProductSimple;
10+
use Magento\Checkout\Test\Constraint\Utils\CartPageLoadTrait;
1011
use Magento\Checkout\Test\Fixture\Cart;
1112
use Magento\Checkout\Test\Fixture\Cart\Items;
1213
use Magento\Checkout\Test\Page\CheckoutCart;
@@ -21,6 +22,8 @@
2122
*/
2223
class AssertCartItemsOptions extends AbstractAssertForm
2324
{
25+
use CartPageLoadTrait;
26+
2427
/**
2528
* Error message for verify options
2629
*
@@ -44,6 +47,8 @@ class AssertCartItemsOptions extends AbstractAssertForm
4447
public function processAssert(CheckoutCart $checkoutCart, Cart $cart)
4548
{
4649
$checkoutCart->open();
50+
$this->waitForCartPageLoaded($checkoutCart);
51+
4752
/** @var Items $sourceProducts */
4853
$sourceProducts = $cart->getDataFieldConfig('items')['source'];
4954
$products = $sourceProducts->getProducts();

dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php

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

77
namespace Magento\Checkout\Test\Constraint;
88

9+
use Magento\Checkout\Test\Constraint\Utils\CartPageLoadTrait;
910
use Magento\Checkout\Test\Fixture\Cart;
1011
use Magento\Checkout\Test\Page\CheckoutCart;
1112
use Magento\Mtf\Constraint\AbstractConstraint;
@@ -16,6 +17,8 @@
1617
*/
1718
class AssertGrandTotalInShoppingCart extends AbstractConstraint
1819
{
20+
use CartPageLoadTrait;
21+
1922
/**
2023
* Assert that grand total is equal to expected
2124
*
@@ -28,6 +31,7 @@ public function processAssert(CheckoutCart $checkoutCart, Cart $cart, $requireRe
2831
{
2932
if ($requireReload) {
3033
$checkoutCart->open();
34+
$this->waitForCartPageLoaded($checkoutCart);
3135
$checkoutCart->getTotalsBlock()->waitForUpdatedTotals();
3236
}
3337

0 commit comments

Comments
 (0)