Skip to content

Commit c745625

Browse files
committed
MAGETWO-35175: Impossible to create Configurable product
- adopt functional test, kindly provided by Dmytro Aponasenko <daponasenko@ebay.com>
1 parent 62fc1fe commit c745625

File tree

5 files changed

+17
-19
lines changed

5 files changed

+17
-19
lines changed

dev/tests/functional/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"magento/mtf": "1.0.0-rc19",
3+
"magento/mtf": "1.0.0-rc20",
44
"php": "~5.5.0|~5.6.0",
55
"phpunit/phpunit": "4.1.0",
66
"phpunit/phpunit-selenium": ">=1.2",

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php

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

77
namespace Magento\Catalog\Test\Block\Adminhtml\Product\Attribute;
88

9-
use Magento\Backend\Test\Block\Widget\Tab;
109
use Magento\Backend\Test\Block\Widget\FormTabs;
10+
use Magento\Backend\Test\Block\Widget\Tab;
11+
use Magento\Mtf\Block\BlockFactory;
12+
use Magento\Mtf\Block\Mapper;
1113
use Magento\Mtf\Client\BrowserInterface;
12-
use Magento\Mtf\Client\Element\SimpleElement;
1314
use Magento\Mtf\Client\Element;
15+
use Magento\Mtf\Client\Element\SimpleElement;
1416
use Magento\Mtf\Client\Locator;
1517
use Magento\Mtf\Fixture\FixtureInterface;
16-
use Magento\Mtf\Block\BlockFactory;
17-
use Magento\Mtf\Block\Mapper;
1818
use Magento\Mtf\Util\XmlConverter;
1919

2020
/**
@@ -64,14 +64,6 @@ public function __construct(
6464
$this->browser->switchToFrame(new Locator($this->iFrame));
6565
}
6666

67-
/**
68-
* @destructor
69-
*/
70-
public function __destruct()
71-
{
72-
$this->browser->switchToFrame();
73-
}
74-
7567
/**
7668
* Fill the attribute form.
7769
*

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ protected function verifySku()
150150
$fixtureProductSku = $this->product->getSku();
151151
$formProductSku = $this->productView->getProductSku();
152152

153-
if ($fixtureProductSku == $formProductSku) {
153+
if ($fixtureProductSku === null || $fixtureProductSku == $formProductSku) {
154154
return null;
155155
}
156156
return "Displayed product sku on product page(front-end) not equals passed from fixture. "

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php

100755100644
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66

77
namespace Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Super\Config;
88

9-
use Magento\Mtf\Client\Locator;
109
use Magento\Backend\Test\Block\Widget\Form;
11-
use Magento\Mtf\Client\Element\SimpleElement;
1210
use Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Super\Config\Attribute\AttributeSelector;
11+
use Magento\Mtf\Client\Element\SimpleElement;
12+
use Magento\Mtf\Client\Locator;
13+
use Magento\Mtf\ObjectManager;
1314

1415
/**
1516
* Attribute block in Variation section.
@@ -158,13 +159,17 @@ public function fillAttributes(array $attributes)
158159
*/
159160
protected function createNewVariationSet(array $attribute)
160161
{
161-
$this->_rootElement->find($this->createNewVariationSet)->click();
162+
$attributeFixture = ObjectManager::getInstance()->create(
163+
'Magento\Catalog\Test\Fixture\CatalogProductAttribute',
164+
['data' => $attribute]
165+
);
162166

167+
$this->_rootElement->find($this->createNewVariationSet)->click();
163168
$newAttribute = $this->getEditAttributeForm();
164-
$newAttribute->getTabElement('properties')->fillFormTab($attribute);
169+
$newAttribute->fill($attributeFixture);
165170
$newAttribute->_rootElement->find($this->saveAttribute)->click();
166171

167-
$this->browser->selectWindow();
172+
$this->browser->switchToFrame();
168173
}
169174

170175
/**

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
<data name="product/data/price/value" xsi:type="string">100</data>
121121
<data name="product/data/category_ids/new_category" xsi:type="string">no</data>
122122
<data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data>
123+
<data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data>
123124
<data name="product/data/affected_attribute_set" xsi:type="string">custom_attribute_set_%isolation%</data>
124125
<data name="tag" xsi:type="string">test_type:acceptance_test</data>
125126
<constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" />

0 commit comments

Comments
 (0)