Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AffectedAttributeSet.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Mtf\Client\Locator;
11 use Magento\Mtf\Fixture\FixtureInterface;
12 use Magento\Mtf\Client\Element\SimpleElement;
13 use Magento\Mtf\Block\Form as ParentForm;
14 
18 class AffectedAttributeSet extends ParentForm
19 {
25  protected $confirmButton = '[data-index="confirm_button"]';
26 
32  protected $affectedAttributeSetNew = 'input[data-index="affectedAttributeSetNew"]';
33 
41  public function fill(FixtureInterface $product, SimpleElement $element = null)
42  {
43  $affectedAttributeSet = $product->getData('affected_attribute_set');
44 
45  if ($affectedAttributeSet) {
46  $fields = ['new_attribute_set_name' => $affectedAttributeSet];
47  $mapping = $this->dataMapping($fields);
48 
49  $this->_rootElement->find($this->affectedAttributeSetNew)->click();
50  $this->_fill($mapping, $element);
51  }
52 
53  return $this;
54  }
55 
61  public function confirm()
62  {
63  $this->_rootElement->find($this->confirmButton, Locator::SELECTOR_CSS)->click();
64  }
65 }
$fields
Definition: details.phtml:14
$element
Definition: element.phtml:12