当前位置: 首页>>代码示例>>PHP>>正文


PHP CmsIndex::getWidgetView方法代码示例

本文整理汇总了PHP中Magento\Cms\Test\Page\CmsIndex::getWidgetView方法的典型用法代码示例。如果您正苦于以下问题:PHP CmsIndex::getWidgetView方法的具体用法?PHP CmsIndex::getWidgetView怎么用?PHP CmsIndex::getWidgetView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Cms\Test\Page\CmsIndex的用法示例。


在下文中一共展示了CmsIndex::getWidgetView方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processAssert

 /**
  * Assert that created widget displayed on frontend on Home page and on Advanced Search and
  * after click on widget link on frontend system redirects you to catalog page.
  *
  * @param CmsIndex $cmsIndex
  * @param CatalogCategoryView $categoryView
  * @param Widget $widget
  * @param AdminCache $adminCache
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CatalogCategoryView $categoryView, Widget $widget, AdminCache $adminCache)
 {
     // Flush cache
     $adminCache->open();
     $adminCache->getActionsBlock()->flushMagentoCache();
     $adminCache->getMessagesBlock()->waitSuccessMessage();
     $cmsIndex->open();
     $widgetText = $widget->getParameters()['anchor_text'];
     \PHPUnit_Framework_Assert::assertTrue($cmsIndex->getWidgetView()->isWidgetVisible($widget, $widgetText), 'Widget with type catalog category link is absent on Home page.');
     $cmsIndex->getWidgetView()->clickToWidget($widget, $widgetText);
     $title = $categoryView->getTitleBlock()->getTitle();
     \PHPUnit_Framework_Assert::assertEquals($widget->getParameters()['entities'][0]->getName(), $title, 'Wrong category title.');
     $cmsIndex->getFooterBlock()->openAdvancedSearch();
     \PHPUnit_Framework_Assert::assertTrue($cmsIndex->getWidgetView()->isWidgetVisible($widget, $widgetText), 'Widget with type catalog category link is absent on Advanced Search page.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:25,代码来源:AssertWidgetCatalogCategoryLink.php

示例2: processAssert

 /**
  * Assert that created widget displayed on frontent on Home page and on Advanced Search and
  * after click on widget link on frontend system redirects you to cms page.
  *
  * @param CmsIndex $cmsIndex
  * @param Widget $widget
  * @param AdminCache $adminCache
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, Widget $widget, AdminCache $adminCache)
 {
     // Flush cache
     $adminCache->open();
     $adminCache->getActionsBlock()->flushMagentoCache();
     $adminCache->getMessagesBlock()->waitSuccessMessage();
     $cmsIndex->open();
     $widgetText = $widget->getParameters()['anchor_text'];
     \PHPUnit_Framework_Assert::assertTrue($cmsIndex->getWidgetView()->isWidgetVisible($widget, $widgetText), 'Widget with type CmsPageLink is absent on Home page.');
     $title = isset($widget->getParameters()['node']) ? $widget->getParameters()['entities'][0]->getLabel() : $widget->getParameters()['entities'][0]->getContentHeading();
     $cmsIndex->getWidgetView()->clickToWidget($widget, $widgetText);
     $pageTitle = $cmsIndex->getCmsPageBlock()->getPageTitle();
     \PHPUnit_Framework_Assert::assertEquals($title, $pageTitle, 'Wrong page title on Cms page.');
     $cmsIndex->getFooterBlock()->openAdvancedSearch();
     \PHPUnit_Framework_Assert::assertTrue($cmsIndex->getWidgetView()->isWidgetVisible($widget, $widgetText), 'Widget with type CmsPageLink is absent on Advanced Search page.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:25,代码来源:AssertWidgetCmsPageLink.php

示例3: processAssert

 /**
  * Assert that created widget is absent on frontend on Home page
  *
  * @param CmsIndex $cmsIndex
  * @param Widget $widget
  * @param AdminCache $adminCache
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, Widget $widget, AdminCache $adminCache)
 {
     // Flush cache
     $adminCache->open();
     $adminCache->getActionsBlock()->flushMagentoCache();
     $adminCache->getMessagesBlock()->waitSuccessMessage();
     $cmsIndex->open();
     $widgetText = $widget->getParameters()['anchor_text'];
     \PHPUnit_Framework_Assert::assertFalse($cmsIndex->getWidgetView()->isWidgetVisible($widget, $widgetText), 'Widget is present on Home page.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:18,代码来源:AssertWidgetAbsentOnFrontendHome.php

示例4: processAssert

 /**
  * Assert that after click on widget link on frontend system redirects you to Product page defined in widget.
  *
  * @param CmsIndex $cmsIndex
  * @param CatalogProductView $productView
  * @param Widget $widget
  * @param AdminCache $adminCache
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CatalogProductView $productView, Widget $widget, AdminCache $adminCache)
 {
     // Flush cache
     $adminCache->open();
     $adminCache->getActionsBlock()->flushMagentoCache();
     $adminCache->getMessagesBlock()->waitSuccessMessage();
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategoryByName($widget->getWidgetInstance()[0]['entities']->getName());
     $cmsIndex->getWidgetView()->clickToWidget($widget, $widget->getParameters()['anchor_text']);
     $title = $productView->getTitleBlock()->getTitle();
     \PHPUnit_Framework_Assert::assertEquals($widget->getParameters()['entities'][0]->getName(), $title, 'Wrong product title.');
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:21,代码来源:AssertWidgetProductLink.php


注:本文中的Magento\Cms\Test\Page\CmsIndex::getWidgetView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。