Skip to content

Commit c820d46

Browse files
author
Dmytro Aponasenko
committed
MTA-1994: Analyse functional test failures - Sprint 10
1 parent 71fd413 commit c820d46

File tree

22 files changed

+243
-162
lines changed

22 files changed

+243
-162
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Product/CatalogProductView.xml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,16 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd">
9-
<page name="CatalogProductView" area="Product" mca="catalog/product/view" module="Magento_Catalog">
10-
<block name="viewBlock" class="Magento\Catalog\Test\Block\Product\View" locator="#maincontent" strategy="css selector"/>
11-
<block name="additionalInformationBlock" class="Magento\Catalog\Test\Block\Product\Additional" locator="#additional" strategy="css selector"/>
12-
<block name="customOptionsBlock" class="Magento\Catalog\Test\Block\Product\View\CustomOptions" locator="#product-options-wrapper" strategy="css selector"/>
13-
<block name="relatedProductBlock" class="Magento\Catalog\Test\Block\Product\ProductList\Related" locator=".block.related" strategy="css selector"/>
14-
<block name="upsellBlock" class="Magento\Catalog\Test\Block\Product\ProductList\Upsell" locator=".block.upsell" strategy="css selector"/>
15-
<block name="crosssellBlock" class="Magento\Catalog\Test\Block\Product\ProductList\Crosssell" locator=".block.crosssell" strategy="css selector"/>
16-
<block name="downloadableLinksBlock" class="Magento\Downloadable\Test\Block\Catalog\Product\View\Links" locator="[data-container-for=downloadable-links]" strategy="css selector"/>
17-
<block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator=".page.messages .messages" strategy="css selector"/>
18-
<block name="reviewSummary" class="Magento\Review\Test\Block\Product\View\Summary" locator=".product-reviews-summary" strategy="css selector"/>
19-
<block name="customerReviewBlock" class="Magento\Review\Test\Block\Product\View" locator="#customer-reviews" strategy="css selector"/>
20-
<block name="reviewFormBlock" class="Magento\Review\Test\Block\Form" locator="#review-form" strategy="css selector"/>
21-
<block name="titleBlock" class="Magento\Theme\Test\Block\Html\Title" locator=".page-title-wrapper h1.page-title .base" strategy="css selector"/>
22-
<block name="widgetView" class="Magento\Widget\Test\Block\WidgetView" locator=".column.main .widget" strategy="css selector"/>
23-
</page>
9+
<page name="CatalogProductView" area="Product" mca="catalog/product/view" module="Magento_Catalog">
10+
<block name="viewBlock" class="Magento\Catalog\Test\Block\Product\View" locator="#maincontent" strategy="css selector" />
11+
<block name="additionalInformationBlock" class="Magento\Catalog\Test\Block\Product\Additional" locator="#additional" strategy="css selector" />
12+
<block name="customOptionsBlock" class="Magento\Catalog\Test\Block\Product\View\CustomOptions" locator="#product-options-wrapper" strategy="css selector" />
13+
<block name="relatedProductBlock" class="Magento\Catalog\Test\Block\Product\ProductList\Related" locator=".block.related" strategy="css selector" />
14+
<block name="upsellBlock" class="Magento\Catalog\Test\Block\Product\ProductList\Upsell" locator=".block.upsell" strategy="css selector" />
15+
<block name="crosssellBlock" class="Magento\Catalog\Test\Block\Product\ProductList\Crosssell" locator=".block.crosssell" strategy="css selector" />
16+
<block name="downloadableLinksBlock" class="Magento\Downloadable\Test\Block\Catalog\Product\View\Links" locator="[data-container-for=downloadable-links]" strategy="css selector" />
17+
<block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator=".page.messages .messages" strategy="css selector" />
18+
<block name="titleBlock" class="Magento\Theme\Test\Block\Html\Title" locator=".page-title-wrapper h1.page-title .base" strategy="css selector" />
19+
<block name="widgetView" class="Magento\Widget\Test\Block\WidgetView" locator=".column.main .widget" strategy="css selector" />
20+
</page>
2421
</config>

dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CreateCatalogRuleTest extends AbstractCatalogRuleEntityTest
3333
const TEST_TYPE = 'acceptance_test';
3434
const MVP = 'yes';
3535
const DOMAIN = 'MX';
36-
const TO_MAINTAIN = 'yes';
36+
const TO_MAINTAIN = 'yes'; // Selecting conditions in parallel mode
3737
/* end tags */
3838

3939
/**

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,25 @@
1010
use Magento\Mtf\Constraint\AbstractConstraint;
1111

1212
/**
13-
* Class AssertOrderTotalOnReviewPage
14-
* Assert that Order Grand Total is correct on checkoutOnePage
13+
* Assert that Order Grand Total is correct on checkoutOnePage.
1514
*/
1615
class AssertOrderTotalOnReviewPage extends AbstractConstraint
1716
{
1817
/**
1918
* Assert that Order Grand Total is correct on checkoutOnePage
2019
*
2120
* @param CheckoutOnepage $checkoutOnepage
22-
* @param string $grandTotal
21+
* @param array $prices
2322
* @return void
2423
*/
25-
public function processAssert(CheckoutOnepage $checkoutOnepage, $grandTotal)
24+
public function processAssert(CheckoutOnepage $checkoutOnepage, array $prices)
2625
{
2726
$checkoutReviewGrandTotal = $checkoutOnepage->getReviewBlock()->getGrandTotal();
2827

2928
\PHPUnit_Framework_Assert::assertEquals(
3029
$checkoutReviewGrandTotal,
31-
number_format($grandTotal, 2),
32-
'Grand Total price: \'' . $checkoutReviewGrandTotal
33-
. '\' not equals with price from data set: \'' . $grandTotal . '\''
30+
number_format($prices['grandTotal'], 2),
31+
"Grand Total price: $checkoutReviewGrandTotal not equals with price from data set: " . $prices['grandTotal']
3432
);
3533
}
3634

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

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,40 @@
1212
use Magento\Mtf\TestStep\TestStepInterface;
1313

1414
/**
15-
* Class PlaceOrderStep
16-
* Place order in one page checkout
15+
* Place order in one page checkout.
1716
*/
1817
class PlaceOrderStep implements TestStepInterface
1918
{
2019
/**
21-
* Onepage checkout page
20+
* Onepage checkout page.
2221
*
2322
* @var CheckoutOnepage
2423
*/
2524
protected $checkoutOnepage;
2625

2726
/**
28-
* Assert that Order Grand Total is correct on checkout page review block
27+
* Assert that Order Grand Total is correct on checkout page review block.
2928
*
3029
* @var AssertOrderTotalOnReviewPage
3130
*/
3231
protected $assertOrderTotalOnReviewPage;
3332

3433
/**
35-
* One page checkout success page
34+
* One page checkout success page.
3635
*
3736
* @var CheckoutOnepageSuccess
3837
*/
3938
protected $checkoutOnepageSuccess;
4039

4140
/**
42-
* Grand total price
41+
* Price array.
4342
*
4443
* @var string
4544
*/
46-
protected $grandTotal;
45+
protected $prices;
4746

4847
/**
49-
* Checkout method
48+
* Checkout method.
5049
*
5150
* @var string
5251
*/
@@ -58,31 +57,31 @@ class PlaceOrderStep implements TestStepInterface
5857
* @param AssertOrderTotalOnReviewPage $assertOrderTotalOnReviewPage
5958
* @param CheckoutOnepageSuccess $checkoutOnepageSuccess
6059
* @param string $checkoutMethod
61-
* @param string|null $grandTotal
60+
* @param array $prices
6261
*/
6362
public function __construct(
6463
CheckoutOnepage $checkoutOnepage,
6564
AssertOrderTotalOnReviewPage $assertOrderTotalOnReviewPage,
6665
CheckoutOnepageSuccess $checkoutOnepageSuccess,
6766
$checkoutMethod,
68-
$grandTotal = null
67+
array $prices = []
6968
) {
7069
$this->checkoutOnepage = $checkoutOnepage;
7170
$this->assertOrderTotalOnReviewPage = $assertOrderTotalOnReviewPage;
72-
$this->grandTotal = $grandTotal;
71+
$this->prices = $prices;
7372
$this->checkoutOnepageSuccess = $checkoutOnepageSuccess;
7473
$this->checkoutMethod = $checkoutMethod;
7574
}
7675

7776
/**
78-
* Place order after checking order totals on review step
77+
* Place order after checking order totals on review step.
7978
*
8079
* @return array
8180
*/
8281
public function run()
8382
{
84-
if ($this->grandTotal !== null) {
85-
$this->assertOrderTotalOnReviewPage->processAssert($this->checkoutOnepage, $this->grandTotal);
83+
if (!empty($this->prices)) {
84+
$this->assertOrderTotalOnReviewPage->processAssert($this->checkoutOnepage, $this->prices);
8685
}
8786
$this->checkoutOnepage->getReviewBlock()->placeOrder();
8887

dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/CheckoutData.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,39 @@ protected function getPreset($name)
5757
],
5858
],
5959
],
60+
'three_simple_products_default_qty' => [
61+
'options' => [
62+
[
63+
'name' => 'product_key_0',
64+
'qty' => 17,
65+
],
66+
[
67+
'name' => 'product_key_1',
68+
'qty' => 36
69+
],
70+
[
71+
'name' => 'product_key_2',
72+
'qty' => 20
73+
],
74+
],
75+
'cartItem' => [
76+
'price' => [
77+
'product_key_0' => 560,
78+
'product_key_1' => 40,
79+
'product_key_2' => 100,
80+
],
81+
'qty' => [
82+
'product_key_0' => 17,
83+
'product_key_1' => 36,
84+
'product_key_2' => 20,
85+
],
86+
'subtotal' => [
87+
'product_key_0' => 9520.00,
88+
'product_key_1' => 1440.00,
89+
'product_key_2' => 2000.00,
90+
],
91+
],
92+
],
6093
];
6194
return isset($presets[$name]) ? $presets[$name] : null;
6295
}

dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,34 @@
117117
<item name="preset" xsi:type="string">three_simple_products</item>
118118
</field>
119119
</dataset>
120+
121+
<dataset name="three_simple_products_default_qty">
122+
<field name="name" xsi:type="string">Grouped product %isolation%</field>
123+
<field name="sku" xsi:type="string">grouped_product_%isolation%</field>
124+
<field name="category_ids" xsi:type="array">
125+
<item name="presets" xsi:type="string">default</item>
126+
</field>
127+
<field name="associated" xsi:type="array">
128+
<item name="preset" xsi:type="string">three_simple_products</item>
129+
</field>
130+
<field name="status" xsi:type="string">Product online</field>
131+
<field name="visibility" xsi:type="string">Catalog, Search</field>
132+
<field name="tax_class_id" xsi:type="array">
133+
<item name="dataSet" xsi:type="string">taxable_goods</item>
134+
</field>
135+
<field name="url_key" xsi:type="string">test-grouped-product-%isolation%</field>
136+
<field name="quantity_and_stock_status" xsi:type="array">
137+
<item name="is_in_stock" xsi:type="string">In Stock</item>
138+
</field>
139+
<field name="website_ids" xsi:type="array">
140+
<item name="0" xsi:type="string">Main Website</item>
141+
</field>
142+
<field name="attribute_set_id" xsi:type="array">
143+
<item name="dataSet" xsi:type="string">default</item>
144+
</field>
145+
<field name="checkout_data" xsi:type="array">
146+
<item name="preset" xsi:type="string">three_simple_products_default_qty</item>
147+
</field>
148+
</dataset>
120149
</repository>
121150
</config>

dev/tests/functional/tests/app/Magento/Review/Test/Block/Form.php renamed to dev/tests/functional/tests/app/Magento/Review/Test/Block/ReviewForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* Review form on frontend.
1818
*/
19-
class Form extends AbstractForm
19+
class ReviewForm extends AbstractForm
2020
{
2121
/**
2222
* Legend selector.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/**
4+
* Copyright © 2015 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd">
9+
<page name="CatalogProductView" area="Product" mca="catalog/product/view" module="Magento_Catalog">
10+
<block name="reviewSummary" class="Magento\Review\Test\Block\Product\View\Summary" locator=".product-reviews-summary" strategy="css selector" />
11+
<block name="customerReviewBlock" class="Magento\Review\Test\Block\Product\View" locator="#customer-reviews" strategy="css selector" />
12+
<block name="reviewFormBlock" class="Magento\Review\Test\Block\ReviewForm" locator="#review-form" strategy="css selector" />
13+
</page>
14+
</config>

dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCommentsHistory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@ class AssertOrderCommentsHistory extends AbstractConstraint
2626
* @param SalesOrderView $salesOrderView
2727
* @param OrderIndex $salesOrder
2828
* @param string $orderId
29-
* @param string $grandTotal
29+
* @param array $prices
3030
* @return void
3131
*/
3232
public function processAssert(
3333
SalesOrderView $salesOrderView,
3434
OrderIndex $salesOrder,
3535
$orderId,
36-
$grandTotal
36+
array $prices
3737
) {
3838
$salesOrder->open();
3939
$salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]);
4040

4141
$actualAuthorizedAmount = $salesOrderView->getOrderHistoryBlock()->getCommentsHistory();
4242

4343
\PHPUnit_Framework_Assert::assertContains(
44-
self::AUTHORIZED_AMOUNT . $grandTotal,
44+
self::AUTHORIZED_AMOUNT . $prices['grandTotal'],
4545
$actualAuthorizedAmount,
4646
'Incorrect authorized amount value for the order #' . $orderId
4747
);

0 commit comments

Comments
 (0)