Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
UpdateAttributeTab.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Client\Element\SimpleElement;
10 use Magento\Mtf\Client\Locator;
12 
16 class UpdateAttributeTab extends Tab
17 {
23  private $changeCheckbox = [
24  'selector' => './/./ancestor::div[contains(@class,"control")]'
25  . '//input[@data-role="toggle-editability-all" or contains(@id, "toggle_")]',
26  'strategy' => Locator::SELECTOR_XPATH,
27  'input' => 'checkbox',
28  'value' => 'Yes',
29  ];
30 
38  public function setFieldsData(array $fields, SimpleElement $contextElement = null)
39  {
40  $context = ($contextElement === null) ? $this->_rootElement : $contextElement;
41  $mapping = $this->dataMapping($fields);
42  foreach ($mapping as $field) {
43  $this->_fill([$this->changeCheckbox], $context->find($field['selector'], $field['strategy']));
44  $this->_fill([$field], $context);
45  }
46 
47  return $this;
48  }
49 }
$fields
Definition: details.phtml:14