Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CategoryForm.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Mtf\Client\Element\SimpleElement;
11 use Magento\Mtf\Client\Locator;
12 use Magento\Mtf\Fixture\FixtureInterface;
13 
18 {
24  protected $storeSwitcherBlock = '.store-switcher';
25 
31  protected $dropdownBlock = '.dropdown';
32 
38  protected $confirmModal = '.confirm._show[data-role=modal]';
39 
47  public function fill(FixtureInterface $fixture, SimpleElement $element = null)
48  {
49  if ($fixture->hasData('store_id')) {
50  $store = $fixture->getStoreId();
51  $this->browser->find($this->header)->hover();
52  $storeSwitcherBlock = $this->browser->find($this->storeSwitcherBlock);
53  $storeSwitcherBlock->find($this->dropdownBlock, Locator::SELECTOR_CSS, 'liselectstore')->setValue($store);
54  $modalElement = $this->browser->find($this->confirmModal);
56  $modal = $this->blockFactory->create(
57  \Magento\Ui\Test\Block\Adminhtml\Modal::class,
58  ['element' => $modalElement]
59  );
60  $modal->acceptAlert();
61  $modal->waitModalWindowToDisappear();
62  }
63  return parent::fill($fixture, $element);
64  }
65 }
fill(FixtureInterface $fixture, SimpleElement $element=null)
$element
Definition: element.phtml:12