Skip to content

Commit 3fcb108

Browse files
author
Dmytro Aponasenko
committed
MTA-1602: Sync qmt repository with mainline - Sprint 6
1 parent 144f00c commit 3fcb108

File tree

15 files changed

+29
-23
lines changed

15 files changed

+29
-23
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ protected function assertPrice(
7979
? $originalProduct->getPriceType()
8080
: $product->getPriceType();
8181
$catalogProductView->getViewBlock()->addToCart($product);
82+
$catalogProductView->getMessagesBlock()->waitSuccessMessage();
83+
$checkoutCartView->open();
8284
$cartItem = $checkoutCartView->getCartBlock()->getCartItem($product);
8385
$specialPrice = 0;
8486
if (isset($bundleData['group_price'])) {

dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSells.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public function processAssert(
5050

5151
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
5252
$catalogProductView->getViewBlock()->addToCart($product);
53+
$catalogProductView->getMessagesBlock()->waitSuccessMessage();
54+
$checkoutCart->open();
5355
foreach ($promotedProducts as $promotedProduct) {
5456
\PHPUnit_Framework_Assert::assertFalse(
5557
$checkoutCart->getCrosssellBlock()->getProductItem($promotedProduct)->isVisible(),

dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCrossSells.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public function processAssert(
5151

5252
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
5353
$catalogProductView->getViewBlock()->addToCart($product);
54+
$catalogProductView->getMessagesBlock()->waitSuccessMessage();
55+
$checkoutCart->open();
5456
foreach ($promotedProducts as $promotedProduct) {
5557
if (!$checkoutCart->getCrosssellBlock()->getProductItem($promotedProduct)->isVisible()) {
5658
$errors[] = 'Product \'' . $promotedProduct->getName() . '\' is absent in cross-sell section.';

dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public function processAssert(
4242
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
4343
$catalogProductView->getViewBlock()->fillOptions($product);
4444
$catalogProductView->getViewBlock()->clickAddToCart();
45+
$catalogProductView->getMessagesBlock()->waitSuccessMessage();
4546

4647
// Check price
4748
$this->assertOnShoppingCart($product, $checkoutCart);
@@ -56,6 +57,7 @@ public function processAssert(
5657
*/
5758
protected function assertOnShoppingCart(FixtureInterface $product, CheckoutCart $checkoutCart)
5859
{
60+
$checkoutCart->open();
5961
/** @var CatalogProductSimple $product */
6062
$customOptions = $product->getCustomOptions();
6163
$checkoutData = $product->getCheckoutData();

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
use Magento\Mtf\Fixture\InjectableFixture;
1212

1313
/**
14-
* Test Flow:
15-
*
1614
* Preconditions:
1715
* 1. Create products.
1816
* 2. Assign promoted products.
@@ -84,6 +82,7 @@ public function test(
8482

8583
$this->browser->open($_ENV['app_frontend_url'] . $initialProduct->getUrlKey() . '.html');
8684
$this->catalogProductView->getViewBlock()->addToCart($initialProduct);
85+
$this->catalogProductView->getMessagesBlock()->waitSuccessMessage();
8786
$this->assertCrossSellSection($initialProductToVerify);
8887
foreach ($navigateProductsOrder as $productName) {
8988
$this->addToCart($this->products[$productName]);
@@ -109,7 +108,7 @@ protected function addToCart(InjectableFixture $product)
109108
$this->catalogProductView->getViewBlock()->addToCart($product);
110109
}
111110

112-
$this->checkoutCart->getMessagesBlock()->waitSuccessMessage();
111+
$this->catalogProductView->getMessagesBlock()->waitSuccessMessage();
113112
}
114113

115114
/**
@@ -119,6 +118,7 @@ protected function addToCart(InjectableFixture $product)
119118
*/
120119
protected function assertAbsentCrossSellSection()
121120
{
121+
$this->checkoutCart->open();
122122
\PHPUnit_Framework_Assert::assertFalse(
123123
$this->checkoutCart->getCrosssellBlock()->isVisible(),
124124
"Cross-sell block is present."
@@ -139,6 +139,7 @@ protected function assertCrossSellSection(array $promotedProductNames)
139139
foreach ($promotedProductNames as $promotedProductName) {
140140
$productNames[] = $this->products[$promotedProductName]->getName();
141141
}
142+
$this->checkoutCart->open();
142143
foreach ($this->checkoutCart->getCrosssellBlock()->getProducts() as $productItem) {
143144
$pageProductNames[] = $productItem->getProductName();
144145
}

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
use Magento\Mtf\Fixture\InjectableFixture;
1111

1212
/**
13-
* Test Flow:
14-
*
1513
* Preconditions:
1614
* 1. Create products.
1715
* 2. Assign promoted products.
@@ -102,6 +100,7 @@ public function test(
102100
$checkoutProducts = $this->selectRelatedProducts($lastProductName);
103101
$checkoutProducts[] = $lastProduct;
104102
$this->catalogProductView->getViewBlock()->addToCart($lastProduct);
103+
$this->catalogProductView->getMessagesBlock()->waitSuccessMessage();
105104
$this->assertCheckoutCart($checkoutProducts);
106105
}
107106

dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
use Magento\Mtf\TestCase\Injectable;
1616

1717
/**
18-
* Class DeleteProductsFromShoppingCartTest
19-
* Test delete products from shopping cart
20-
*
2118
* Preconditions
2219
* 1. Test products are created
2320
*
@@ -141,6 +138,7 @@ protected function addToCart(array $products)
141138
*/
142139
protected function removeProducts(array $products)
143140
{
141+
$this->cartPage->open();
144142
foreach ($products as $product) {
145143
$this->cartPage->getCartBlock()->getCartItem($product)->removeItem();
146144
}

dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/AddProductsToTheCartStep.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Magento\Mtf\TestStep\TestStepInterface;
1414

1515
/**
16-
* Class AddProductsToTheCartStep
1716
* Adding created products to the cart
1817
*/
1918
class AddProductsToTheCartStep implements TestStepInterface
@@ -88,6 +87,7 @@ public function run()
8887
foreach ($this->products as $product) {
8988
$this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
9089
$this->catalogProductView->getViewBlock()->addToCart($product);
90+
$this->catalogProductView->getMessagesBlock()->waitSuccessMessage();
9191
}
9292
}
9393
}

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInCart.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public function processAssert(
3636
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
3737

3838
$catalogProductView->getViewBlock()->addToCart($product);
39+
$catalogProductView->getMessagesBlock()->waitSuccessMessage();
40+
$checkoutCart->open();
3941

4042
$checkoutData = $product->getCheckoutData();
4143
$price = $checkoutCart->getCartBlock()->getCartItem($product)->getPrice();

dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
use Magento\Mtf\TestCase\Injectable;
1414

1515
/**
16-
* Test Creation for Create DownloadableProductEntity
17-
*
18-
* Test Flow:
16+
* Steps:
1917
* 1. Log in to Backend.
2018
* 2. Navigate to Products > Catalog.
2119
* 3. Start to create new Downloadable product.

0 commit comments

Comments
 (0)