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


PHP Browser::selectWindow方法代码示例

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


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

示例1: processAssert

 /**
  * Assert that content of created cms page displayed in main content section and equals passed from fixture.
  *
  * @param CmsPage $cms
  * @param CmsPageIndex $cmsPageIndex
  * @param FrontendCmsPage $frontendCmsPage
  * @param CmsPageEdit $cmsPageEdit
  * @param Browser $browser
  * @return void
  */
 public function processAssert(CmsPage $cms, CmsPageIndex $cmsPageIndex, FrontendCmsPage $frontendCmsPage, CmsPageEdit $cmsPageEdit, Browser $browser)
 {
     $cmsPageIndex->open();
     $cmsPageIndex->getCmsPageGridBlock()->searchAndOpen(['title' => $cms->getTitle()]);
     $cmsPageEdit->getPageMainActions()->preview();
     $browser->selectWindow();
     $frontendCmsPage->getTemplateBlock()->waitLoader();
     $browser->switchToFrame(new Locator($this->iFrameSelector));
     $element = $browser->find('body');
     $fixtureContent = $cms->getContent();
     \PHPUnit_Framework_Assert::assertContains($fixtureContent['content'], $frontendCmsPage->getCmsPageContentBlock()->getPageContent($element), 'Wrong content is displayed.');
     if ($cms->getContentHeading()) {
         \PHPUnit_Framework_Assert::assertEquals(strtolower($cms->getContentHeading()), strtolower($frontendCmsPage->getCmsPageContentBlock()->getPageTitle($element)), 'Wrong title is displayed.');
     }
     if (isset($fixtureContent['widget'])) {
         foreach ($fixtureContent['widget']['preset'] as $widget) {
             \PHPUnit_Framework_Assert::assertTrue($frontendCmsPage->getCmsPageContentBlock()->isWidgetVisible($widget), "Widget '{$widget['widget_type']}' is not displayed.");
         }
     }
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:30,代码来源:AssertCmsPagePreview.php

示例2: processAssert

 /**
  * Assert that content of created cms page displayed in main content section and equals passed from fixture.
  *
  * @param CmsPage $cms
  * @param CmsPageIndex $cmsPageIndex
  * @param FrontendCmsPage $frontendCmsPage
  * @param Browser $browser
  * @param bool $isIFrame [optional]
  * @return void
  */
 public function processAssert(CmsPage $cms, CmsPageIndex $cmsPageIndex, FrontendCmsPage $frontendCmsPage, Browser $browser, $isIFrame = false)
 {
     $cmsPageIndex->open();
     $cmsPageIndex->getCmsPageGridBlock()->searchAndReview(['title' => $cms->getTitle()]);
     $browser->selectWindow();
     if ($isIFrame) {
         $this->switchToFrame($browser);
     }
     $element = $browser->find('body');
     $fixtureContent = $cms->getContent();
     \PHPUnit_Framework_Assert::assertContains($fixtureContent['content'], $frontendCmsPage->getCmsPageContentBlock()->getPageContent($element), 'Wrong content is displayed.');
     if ($cms->getContentHeading()) {
         \PHPUnit_Framework_Assert::assertEquals(strtolower($cms->getContentHeading()), strtolower($frontendCmsPage->getCmsPageContentBlock()->getPageTitle($element)), 'Wrong title is displayed.');
     }
     if (isset($fixtureContent['widget'])) {
         foreach ($fixtureContent['widget']['preset'] as $widget) {
             \PHPUnit_Framework_Assert::assertTrue($frontendCmsPage->getCmsPageContentBlock()->isWidgetVisible($widget), "Widget '{$widget['widget_type']}' is not displayed.");
         }
     }
     $browser->closeWindow();
     $browser->selectWindow();
     $browser->switchToFrame();
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:33,代码来源:AssertCmsPagePreview.php


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