Skip to content

Commit 139e383

Browse files
author
Dmytro Aponasenko
committed
MTA-2145: Sync qmt repository with mainline - Sprint 12
1 parent 736c368 commit 139e383

File tree

5 files changed

+29
-26
lines changed

5 files changed

+29
-26
lines changed

dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,14 @@ abstract class Grid extends Block
172172
*
173173
* @var string
174174
*/
175-
protected $actionNextPage = '.pager .action-next';
175+
protected $actionNextPage = '[class*=data-grid-pager] .action-next';
176176

177177
/**
178178
* Locator for disabled next page action
179179
*
180180
* @var string
181181
*/
182-
protected $actionNextPageDisabled = '.pager .action-next.disabled';
182+
protected $actionNextPageDisabled = '[class*=data-grid-pager] .action-next.disabled';
183183

184184
/**
185185
* First row selector
@@ -188,6 +188,13 @@ abstract class Grid extends Block
188188
*/
189189
protected $firstRowSelector = '';
190190

191+
/**
192+
* Selector for no records row.
193+
*
194+
* @var string
195+
*/
196+
protected $noRecords = '[data-role="row"] .empty-text';
197+
191198
/**
192199
* Get backend abstract block
193200
*
@@ -328,6 +335,9 @@ public function resetFilter()
328335
*/
329336
public function massaction(array $items, $action, $acceptAlert = false, $massActionSelection = '')
330337
{
338+
if ($this->_rootElement->find($this->noRecords)->isVisible()) {
339+
return;
340+
}
331341
if (!is_array($action)) {
332342
$action = [$action => '-'];
333343
}

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.php

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,16 @@
1212
use Magento\Mtf\TestCase\Injectable;
1313

1414
/**
15-
* Test Creation for Delete Attribute Set (Product Template)
16-
*
1715
* Preconditions:
18-
* 1. Create Product template, based on Default
19-
* 2. Create product attribute and add to created template
16+
* 1. Create Product template, based on Default.
17+
* 2. Create product attribute and add to created template.
2018
*
2119
* Test Flow:
2220
* 1. Log in to Backend.
23-
* 2. Go to Stores > Attributes > Product
24-
* 3. Search product attribute in grid by given data
25-
* 4. Open this attribute by clicking
26-
* 5. Click on the "Delete Attribute" button
21+
* 2. Go to Stores > Attributes > Product.
22+
* 3. Search product attribute in grid by given data.
23+
* 4. Open this attribute by clicking.
24+
* 5. Click on the "Delete Attribute" button.
2725
* 6. Perform all assertions.
2826
*
2927
* @group Product_Attributes_(MX)
@@ -37,21 +35,21 @@ class DeleteAssignedToTemplateProductAttributeTest extends Injectable
3735
/* end tags */
3836

3937
/**
40-
* Catalog Product Attribute index page
38+
* Catalog Product Attribute index page.
4139
*
4240
* @var CatalogProductAttributeIndex
4341
*/
4442
protected $attributeIndex;
4543

4644
/**
47-
* Catalog Product Attribute new page
45+
* Catalog Product Attribute new page.
4846
*
4947
* @var CatalogProductAttributeNew
5048
*/
5149
protected $attributeNew;
5250

5351
/**
54-
* Inject pages
52+
* Inject pages.
5553
*
5654
* @param CatalogProductAttributeIndex $attributeIndex
5755
* @param CatalogProductAttributeNew $attributeNew
@@ -64,7 +62,7 @@ public function __inject(CatalogProductAttributeIndex $attributeIndex, CatalogPr
6462
}
6563

6664
/**
67-
* Run DeleteAssignedToTemplateProductAttribute test
65+
* Run test.
6866
*
6967
* @param CatalogAttributeSet $productTemplate
7068
* @return array
@@ -73,19 +71,14 @@ public function test(CatalogAttributeSet $productTemplate)
7371
{
7472
// Precondition
7573
$productTemplate->persist();
74+
$attribute = $productTemplate->getDataFieldConfig('assigned_attributes')['source']->getAttributes()[0];
7675

7776
// Steps
78-
$filter = [
79-
'attribute_code' => $productTemplate
80-
->getDataFieldConfig('assigned_attributes')['source']
81-
->getAttributes()[0]
82-
->getAttributeCode(),
83-
];
84-
77+
$filter = ['attribute_code' => $attribute->getAttributeCode()];
8578
$this->attributeIndex->open();
8679
$this->attributeIndex->getGrid()->searchAndOpen($filter);
8780
$this->attributeNew->getPageActions()->delete();
8881

89-
return ['productTemplate' => $productTemplate];
82+
return ['productTemplate' => $productTemplate, 'attribute' => $attribute];
9083
}
9184
}

dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class AssociatedProducts extends Tab
4343
*
4444
* @var string
4545
*/
46-
protected $deleteButton = '.delete';
46+
protected $deleteButton = '[data-role="delete"]';
4747

4848
/**
4949
* Get search grid

dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Template/Grid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Grid extends \Magento\Backend\Test\Block\Widget\Grid
3737
*
3838
* @var string
3939
*/
40-
protected $action = '.action-select';
40+
protected $action = '.col-actions [class*="control-select"]';
4141

4242
/**
4343
* Action for newsletter template

dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Rating/Grid.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ class Grid extends AbstractGrid
2828
*/
2929
protected $filters = [
3030
'rating_code' => [
31-
'selector' => '.filter [name="rating_code"]',
31+
'selector' => '[name="rating_code"]',
3232
],
3333
'is_active' => [
34-
'selector' => '.filter [name="is_active"]',
34+
'selector' => '[name="is_active"]',
3535
'input' => 'select',
3636
],
3737
];

0 commit comments

Comments
 (0)