Skip to content

Commit 4a70bc8

Browse files
committed
MAGETWO-51472: [FT] Form page action block is covering fields on product page
- Categories field is aligned to the center of the browser before it is filled;
1 parent 2b27f96 commit 4a70bc8

File tree

1 file changed

+49
-14
lines changed
  • dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/ProductDetails

1 file changed

+49
-14
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/ProductDetails/CategoryIds.php

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\ProductDetails;
88

99
use Magento\Mtf\Client\Element\MultisuggestElement;
10+
use Magento\Mtf\Client\BrowserInterface;
1011
use Magento\Mtf\Client\Locator;
12+
use Magento\Mtf\Client\DriverInterface;
13+
use Magento\Mtf\Client\ElementInterface;
14+
use Magento\Mtf\System\Event\EventManagerInterface;
1115

1216
/**
1317
* Typified element class for category element.
@@ -22,22 +26,53 @@ class CategoryIds extends MultisuggestElement
2226
protected $resultItem = './/label[contains(@class, "admin__action-multiselect-label")]/span[text() = "%s"]';
2327

2428
/**
25-
* Select searched item.
29+
* Browser instance.
2630
*
27-
* @param string $value
28-
* @return void
31+
* @var BrowserInterface
2932
*/
30-
protected function selectSearchedItem($value)
33+
protected $browser;
34+
35+
/**
36+
* Locator for page footer.
37+
*
38+
* @var string
39+
*/
40+
protected $pageFooter = '.page-footer';
41+
42+
/**
43+
* Locator for advanced inventory button.
44+
*
45+
* @var string
46+
*/
47+
protected $advancedInventoryButton = '[data-index="advanced_inventory_button"]';
48+
49+
/**
50+
* @param BrowserInterface $browser
51+
* @param DriverInterface $driver
52+
* @param EventManagerInterface $eventManager
53+
* @param Locator $locator
54+
* @param ElementInterface $context
55+
*/
56+
public function __construct(
57+
BrowserInterface $browser,
58+
DriverInterface $driver,
59+
EventManagerInterface $eventManager,
60+
Locator $locator,
61+
ElementInterface $context = null
62+
) {
63+
$this->browser = $browser;
64+
parent::__construct($driver, $eventManager, $locator, $context);
65+
}
66+
67+
/**
68+
* Set category value.
69+
*
70+
* @param array|string $value
71+
*/
72+
public function setValue($value)
3173
{
32-
$this->keys([$value]);
33-
$searchedItem = $this->find(sprintf($this->resultItem, $value), Locator::SELECTOR_XPATH);
34-
if ($searchedItem->isVisible()) {
35-
try {
36-
$searchedItem->click();
37-
} catch (\Exception $e) {
38-
// In parallel run on windows change the focus is lost on element
39-
// that causes disappearing of category suggest list.
40-
}
41-
}
74+
$this->browser->find($this->pageFooter)->hover();
75+
$this->browser->find($this->advancedInventoryButton)->hover();
76+
parent::setValue($value);
4277
}
4378
}

0 commit comments

Comments
 (0)