Skip to content

Commit 3e55d71

Browse files
author
Dmytro Aponasenko
committed
MTA-2145: Sync qmt repository with mainline - Sprint 12
1 parent ca5088a commit 3e55d71

File tree

3 files changed

+31
-11
lines changed

3 files changed

+31
-11
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/DeleteAttributeStep.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ public function __construct(
6060
*/
6161
public function run()
6262
{
63-
$filter = ['attribute_code' => $this->attribute->getAttributeCode()];
64-
if ($this->catalogProductAttributeIndex->open()->getGrid()->isRowVisible($filter)) {
63+
$filter = $this->attribute->hasData('attribute_code')
64+
? ['attribute_code' => $this->attribute->getAttributeCode()]
65+
: ['frontend_label' => $this->attribute->getFrontendLabel()];
66+
$this->catalogProductAttributeIndex->open();
67+
if ($this->catalogProductAttributeIndex->getGrid()->isRowVisible($filter)) {
6568
$this->catalogProductAttributeIndex->getGrid()->searchAndOpen($filter);
6669
$this->catalogProductAttributeNew->getPageActions()->delete();
6770
}

dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/SaveAttributeStep.php

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

99
use Magento\Catalog\Test\Page\Adminhtml\CatalogProductAttributeNew;
10+
use Magento\Mtf\ObjectManager;
1011
use Magento\Mtf\TestStep\TestStepInterface;
12+
use Magento\Catalog\Test\Fixture\CatalogProductAttribute;
1113

1214
/**
1315
* Save attribute on attribute page.
@@ -22,21 +24,33 @@ class SaveAttributeStep implements TestStepInterface
2224
protected $attributeNew;
2325

2426
/**
25-
* Delete attribute step.
27+
* Product attribute fixture.
2628
*
27-
* @var DeleteAttributeStep
29+
* @var CatalogProductAttribute
2830
*/
29-
protected $deleteAttribute;
31+
protected $attribute;
32+
33+
/**
34+
* Object manager instance.
35+
*
36+
* @var ObjectManager
37+
*/
38+
protected $objectManager;
3039

3140
/**
3241
* @constructor
3342
* @param CatalogProductAttributeNew $attributeNew
34-
* @param DeleteAttributeStep $deleteAttribute
43+
* @param CatalogProductAttribute $attribute
44+
* @param ObjectManager $objectManager
3545
*/
36-
public function __construct(CatalogProductAttributeNew $attributeNew, DeleteAttributeStep $deleteAttribute)
37-
{
46+
public function __construct(
47+
CatalogProductAttributeNew $attributeNew,
48+
CatalogProductAttribute $attribute,
49+
ObjectManager $objectManager
50+
) {
3851
$this->attributeNew = $attributeNew;
39-
$this->deleteAttribute = $deleteAttribute;
52+
$this->attribute = $attribute;
53+
$this->objectManager = $objectManager;
4054
}
4155

4256
/**
@@ -56,6 +70,9 @@ public function run()
5670
*/
5771
public function cleanup()
5872
{
59-
$this->deleteAttribute->run();
73+
$this->objectManager->create(
74+
'Magento\Catalog\Test\TestStep\DeleteAttributeStep',
75+
['attribute' => $this->attribute]
76+
);
6077
}
6178
}

dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/WidgetGrid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class WidgetGrid extends AbstractGrid
2525
*
2626
* @var string
2727
*/
28-
protected $firstRowSelector = '//tr[./td[contains(@class, "col-title")]][1]/td';
28+
protected $firstRowSelector = '//tbody//tr[@data-role="row"]/td[contains(@class, "col-title")][1]';
2929

3030
/**
3131
* Filters array mapping.

0 commit comments

Comments
 (0)