Skip to content

Commit fe0e0e6

Browse files
author
Oleksandr Manchenko
committed
MTA-548: Re-factor Tests for Create Products
- Fixed logical and code style errors
1 parent 9131023 commit fe0e0e6

File tree

61 files changed

+155
-326
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+155
-326
lines changed

dev/tests/functional/.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
**/var
12
/composer.lock
2-
/vendor
3-
/generated
4-
/var
53
/config/*
4+
/generated
5+
/lib/Magento/Mtf/Util/Generate/testcase.xml
6+
/vendor
67
!/config/application.yml.dist
78
!/config/handler.yml.dist
89
!/config/isolation.yml.dist
910
!/config/server.yml.dist
1011
phpunit.xml
1112
credentials.xml
12-
/lib/Magento/Mtf/Util/Generate/testcase.xml

dev/tests/functional/client_error.log

Lines changed: 0 additions & 61 deletions
This file was deleted.

dev/tests/functional/lib/Magento/Mtf/Client/Element/SuggestElement.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public function setValue($value)
5858
$this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]);
5959

6060
$this->clear();
61+
62+
if ($value == ''){
63+
return;
64+
}
6165
foreach (str_split($value) as $symbol) {
6266
$input = $this->find($this->suggest);
6367
$input->click();

dev/tests/functional/logger.log

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
2015-02-06 14:27:38+00:00 5a8199584ce11f8690dd54de28280ebf7c2036c8 Magento\Catalog\Test\TestCase\Product\AddToCartCrossSellTest test with data set #1 Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable Wrong products are displayed in cross-sell section.
2-
Failed asserting that two arrays are equal.
3-
2015-02-06 14:37:27+00:00 c67be221e7e04f061c1f6530c083a31adf73b13f Magento\Catalog\Test\TestCase\Product\NavigateRelatedProductsTest test with data set #1 Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable Error occurred on attempt to get element. Message: "Timed out after 90 seconds". Locator: "css selector(#maincontent) -> css selector(#qty)" . Wait: "1"
4-
2015-02-06 15:36:41+00:00 0224e53ffc5b7752b664ed28fb4d528bf8a81c20 Magento\Checkout\Test\TestCase\Guest\CheckMoneyOrderTest testOnepageCheckout Magento\Bundle\Test\Fixture\BundleProduct Argument 2 passed to Magento\Checkout\Test\TestCase\Guest\CheckMoneyOrderTest::checkProductPrice() must be an instance of Magento\Catalog\Test\Fixture\Product, instance of Magento\Catalog\Test\Fixture\CatalogProductSimple given, called in C:\magento\m2dev2\magento2ee\dev\tests\functional\tests\app\Magento\Checkout\Test\TestCase\Guest\CheckMoneyOrderTest.php on line 66 and defined
5-
2015-02-06 15:41:00+00:00 6e899646febacc64057f1b1067927992c2d78e0e Magento\Checkout\Test\TestCase\Guest\CheckMoneyOrderTest testOnepageCheckout Magento\Bundle\Test\Fixture\BundleProduct Failed asserting that '10.00' matches expected null.
6-
2015-02-06 16:28:08+00:00 2fbdd569fec39c684105c195c1a83c7f60cb9438 Magento\Checkout\Test\TestCase\Guest\CheckMoneyOrderTest testOnepageCheckout Magento\Bundle\Test\Fixture\BundleProduct Error occurred on attempt to get element. Message: "Timed out after 90 seconds". Locator: "css selector(#checkout-step-review) -> css selector(.totals-tax span)" . Wait: "1"
1+
2015-02-09 09:15:34+00:00 abf3e3e3650feeb10be9a15e297541ba33dcf681 Magento\Catalog\Test\TestCase\Product\NavigateUpSellProductsTest test with data set #1 Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct include(C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor/sebastian/recursion-context/src/Context.php): failed to open stream: No such file or directory

dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ protected function getPreset($name)
639639
],
640640
],
641641

642-
'bundle_required' => [
642+
'required_two_fixed_options' => [
643643
'bundle_options' => [
644644
[
645645
'title' => 'Drop-down Option',
@@ -672,7 +672,7 @@ protected function getPreset($name)
672672
'products' => [
673673
[
674674
'catalogProductSimple::simple',
675-
'catalogProductVirtual::for_bundle_required',
675+
'catalogProductVirtual::for_bundle_fixed',
676676
],
677677
],
678678
],

dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ protected function getPreset($name)
304304
],
305305
],
306306
],
307-
'bundle_required' => [
307+
'required_two_fixed_options' => [
308308
'options' => [
309309
'bundle_options' => [
310310
[

dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
</field>
179179
</dataset>
180180

181-
<dataset name="bundle_required">
181+
<dataset name="fixed_100_dollar_with_required_options">
182182
<field name="name" xsi:type="string">Bundle fixed product %isolation%</field>
183183
<field name="url_key" xsi:type="string">bundle-fixed-product-%isolation%</field>
184184
<field name="sku" xsi:type="string">sku_bundle_fixed_product_%isolation%</field>
@@ -197,10 +197,10 @@
197197
</field>
198198
<field name="shipment_type" xsi:type="string">Separately</field>
199199
<field name="bundle_selections" xsi:type="array">
200-
<item name="preset" xsi:type="string">bundle_required</item>
200+
<item name="preset" xsi:type="string">required_two_fixed_options</item>
201201
</field>
202202
<field name="checkout_data" xsi:type="array">
203-
<item name="preset" xsi:type="string">bundle_required</item>
203+
<item name="preset" xsi:type="string">required_two_fixed_options</item>
204204
</field>
205205
</dataset>
206206
</storage>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Magento\Catalog\Test\Fixture\Category;
1010
use Magento\Catalog\Test\Fixture\Category\LandingPage;
1111
use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
12-
use Magento\Mtf\Client\Browser;
1312
use Magento\Mtf\Client\BrowserInterface;
1413
use Magento\Mtf\Constraint\AbstractConstraint;
1514
use Magento\Mtf\Fixture\FixtureFactory;
@@ -43,7 +42,7 @@ class AssertCategoryPage extends AbstractConstraint
4342
/**
4443
* Browser instance
4544
*
46-
* @var Browser
45+
* @var BrowserInterface
4746
*/
4847
protected $browser;
4948

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

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

99
use Magento\Catalog\Test\Page\Product\CatalogProductView;
10-
use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable;
10+
use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct;
1111
use Magento\Mtf\Client\BrowserInterface;
1212
use Magento\Mtf\Constraint\AbstractAssertForm;
1313
use Magento\Mtf\Fixture\FixtureInterface;
@@ -32,7 +32,7 @@ class AssertProductPage extends AbstractAssertForm
3232
/**
3333
* Product fixture
3434
*
35-
* @var ConfigurableProductInjectable
35+
* @var ConfigurableProduct
3636
*/
3737
protected $product;
3838

dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@
965965
</field>
966966
</dataset>
967967

968-
<dataset name="simple">
968+
<dataset name="simple_10_dollar">
969969
<field name="attribute_set_id" xsi:type="array">
970970
<item name="dataSet" xsi:type="string">default</item>
971971
</field>
@@ -998,76 +998,5 @@
998998
<item name="presets" xsi:type="string">default_subcategory</item>
999999
</field>
10001000
</dataset>
1001-
1002-
<dataset name="simple_required">
1003-
<field name="attribute_set_id" xsi:type="array">
1004-
<item name="dataSet" xsi:type="string">default</item>
1005-
</field>
1006-
<field name="name" xsi:type="string">Simple Product %isolation%</field>
1007-
<field name="sku" xsi:type="string">sku_simple_product_%isolation%</field>
1008-
<field name="url_key" xsi:type="string">simple-product-%isolation%</field>
1009-
<field name="weight" xsi:type="string">1</field>
1010-
<field name="quantity_and_stock_status" xsi:type="array">
1011-
<item name="qty" xsi:type="string">1000</item>
1012-
<item name="is_in_stock" xsi:type="string">In Stock</item>
1013-
</field>
1014-
<field name="price" xsi:type="array">
1015-
<item name="value" xsi:type="string">10</item>
1016-
<item name="preset" xsi:type="string">-</item>
1017-
</field>
1018-
<field name="tax_class_id" xsi:type="array">
1019-
<item name="dataSet" xsi:type="string">taxable_goods</item>
1020-
</field>
1021-
<field name="website_ids" xsi:type="array">
1022-
<item name="0" xsi:type="string">Main Website</item>
1023-
</field>
1024-
<field name="visibility" xsi:type="string">Catalog, Search</field>
1025-
<field name="checkout_data" xsi:type="array">
1026-
<item name="preset" xsi:type="string">order_default</item>
1027-
</field>
1028-
<field name="stock_data" xsi:type="array">
1029-
<item name="manage_stock" xsi:type="string">No</item>
1030-
</field>
1031-
</dataset>
1032-
1033-
<dataset name="simple_edit_required_fields">
1034-
<field name="attribute_set_id" xsi:type="array">
1035-
<item name="dataSet" xsi:type="string">default</item>
1036-
</field>
1037-
<field name="name" xsi:type="string">Simple Product %isolation%</field>
1038-
<field name="sku" xsi:type="string">sku_simple_product_%isolation%</field>
1039-
<field name="price" xsi:type="array">
1040-
<item name="value" xsi:type="string">1.99</item>
1041-
<item name="preset" xsi:type="string">-</item>
1042-
</field>
1043-
</dataset>
1044-
1045-
<dataset name="simple_with_map">
1046-
<field name="name" xsi:type="string">Simple Product with msrp %isolation%</field>
1047-
<field name="sku" xsi:type="string">sku_simple_product_with_msrp_%isolation%</field>
1048-
<field name="weight" xsi:type="string">1</field>
1049-
<field name="quantity_and_stock_status" xsi:type="array">
1050-
<item name="qty" xsi:type="string">1000</item>
1051-
<item name="is_in_stock" xsi:type="string">In Stock</item>
1052-
</field>
1053-
<field name="price" xsi:type="array">
1054-
<item name="value" xsi:type="string">10</item>
1055-
<item name="preset" xsi:type="string">-</item>
1056-
</field>
1057-
<field name="category_ids" xsi:type="array">
1058-
<item name="presets" xsi:type="string">default_subcategory</item>
1059-
</field>
1060-
<field name="tax_class_id" xsi:type="array">
1061-
<item name="dataSet" xsi:type="string">taxable_goods</item>
1062-
</field>
1063-
<field name="website_ids" xsi:type="array">
1064-
<item name="0" xsi:type="string">Main Website</item>
1065-
</field>
1066-
<field name="stock_data" xsi:type="array">
1067-
<item name="manage_stock" xsi:type="string">No</item>
1068-
</field>
1069-
<field name="msrp" xsi:type="string">15</field>
1070-
<field name="msrp_display_actual_price_type" xsi:type="string">On Gesture</field>
1071-
</dataset>
10721001
</storage>
10731002
</repository>

0 commit comments

Comments
 (0)