Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
UpdateSearchTermEntityTest.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\CatalogSearch\Test\Page\Adminhtml\CatalogSearchEdit;
11 use Magento\CatalogSearch\Test\Page\Adminhtml\CatalogSearchIndex;
12 use Magento\Cms\Test\Page\CmsIndex;
13 use Magento\Mtf\TestCase\Injectable;
14 
32 class UpdateSearchTermEntityTest extends Injectable
33 {
34  /* tags */
35  const MVP = 'yes';
36  /* end tags */
37 
43  protected $cmsIndex;
44 
50  protected $indexPage;
51 
57  protected $editPage;
58 
67  public function __inject(
68  CmsIndex $cmsIndex,
69  CatalogSearchIndex $indexPage,
70  CatalogSearchEdit $editPage
71  ) {
72  $this->cmsIndex = $cmsIndex;
73  $this->indexPage = $indexPage;
74  $this->editPage = $editPage;
75  }
76 
83  public function test(CatalogSearchQuery $searchTerm)
84  {
85  // Preconditions
86  $searchText = $searchTerm->getQueryText();
87  // Steps
88  $this->cmsIndex->open()->getSearchBlock()->search($searchText);
89  $this->indexPage->open()->getGrid()->searchAndOpen(['search_query' => $searchText]);
90  $this->editPage->getForm()->fill($searchTerm);
91  $this->editPage->getFormPageActions()->save();
92  }
93 }
__inject(CmsIndex $cmsIndex, CatalogSearchIndex $indexPage, CatalogSearchEdit $editPage)