Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ResourcesPopup.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Block\Form;
10 use Magento\Mtf\Client\Locator;
11 
15 class ResourcesPopup extends Form
16 {
22  protected $allowButtonSelector = '[data-row-dialog="tokens"][type="button"]';
23 
29  protected $reauthorizeButtonSelector = '[data-row-dialog="tokens"][data-row-is-reauthorize="1"]';
30 
36  protected $content = '#integrations-activate-permissions-content';
37 
43  protected $tree = '[data-role="tree-resources-container"]';
44 
50  protected function init()
51  {
52  parent::init();
53  $this->waitPopupToLoad();
54  }
55 
61  protected function waitPopupToLoad()
62  {
63  $context = $this->_rootElement;
64  $selector = $this->content;
65  $context->waitUntil(
66  function () use ($context, $selector) {
67  return $context->find($selector)->isVisible() ? true : null;
68  }
69  );
70  }
71 
77  public function clickAllowButton()
78  {
79  $this->_rootElement->find($this->allowButtonSelector)->click();
80  }
81 
87  public function clickReauthorizeButton()
88  {
89  $this->_rootElement->find($this->reauthorizeButtonSelector)->click();
90  }
91 
98  public function getStructure($level = null)
99  {
100  return $this->_rootElement->find($this->tree, Locator::SELECTOR_CSS, 'jquerytree')->getStructure($level);
101  }
102 }
if($block->getRoot())< div class="message message-notice">< div ><?=__( 'This operation can take a long time') ?></div ></div ></div >< script > var tree
Definition: tree.phtml:27