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


PHP Factory::getClientBrowser方法代码示例

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


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

示例1: testAddReviewByGuest

 /**
  * Adding product review from not logged customer prospective
  *
  * @ZephyrId MAGETWO-12403
  */
 public function testAddReviewByGuest()
 {
     //Preconditions
     $productFixture = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct();
     $productFixture->switchData('simple_required');
     $productFixture->persist();
     $reviewFixture = Factory::getFixtureFactory()->getMagentoReviewReview();
     //Pages & Blocks
     $homePage = Factory::getPageFactory()->getCmsIndexIndex();
     $productPage = Factory::getPageFactory()->getCatalogProductView();
     $backendReviewIndex = Factory::getPageFactory()->getReviewProductIndex();
     $backendReviewEdit = Factory::getPageFactory()->getReviewProductEdit();
     $reviewsSummaryBlock = $productPage->getReviewSummary();
     $reviewsBlock = $productPage->getCustomerReviewBlock();
     $reviewForm = $productPage->getReviewFormBlock();
     $reviewGrid = $backendReviewIndex->getReviewGrid();
     $reviewBackendForm = $backendReviewEdit->getReviewForm();
     //Steps & verifying
     $homePage->open();
     Factory::getClientBrowser()->open($_ENV['app_frontend_url'] . $productFixture->getUrlKey() . '.html');
     $this->verifyNoReviewOnPage($reviewsSummaryBlock);
     $reviewsSummaryBlock->getAddReviewLink()->click();
     $this->assertFalse($reviewsBlock->isVisibleReviewItem(), 'No reviews below the form required');
     $reviewForm->fill($reviewFixture);
     $reviewForm->submit();
     $submitReviewMessage = 'Your review has been accepted for moderation.';
     $this->assertContains($submitReviewMessage, $productPage->getMessagesBlock()->getSuccessMessages(), sprintf('Message "%s" is not appear', $submitReviewMessage));
     $this->verifyNoReviewOnPage($productPage->getReviewSummary());
     Factory::getApp()->magentoBackendLoginUser();
     $backendReviewIndex->open();
     $reviewGrid->searchAndOpen(['title' => $reviewFixture->getTitle()]);
     $this->assertEquals('Guest', $reviewBackendForm->getPostedBy(), 'Review is not posted by Guest');
     $this->assertEquals('Pending', $reviewBackendForm->getStatus(), 'Review is not in Pending status');
     $this->assertTrue($this->verifyReviewBackendForm($reviewFixture, $reviewBackendForm), 'Review data is not corresponds to submitted one');
     $reviewBackendForm->setApproveReview();
     $backendReviewEdit->getPageActions()->save();
     $this->assertContains('You saved the review.', $backendReviewIndex->getMessagesBlock()->getSuccessMessages(), 'Review is not saved');
     $this->flushCacheStorageWithAssert();
     Factory::getClientBrowser()->open($_ENV['app_frontend_url'] . $productFixture->getUrlKey() . '.html');
     $reviewsSummaryBlock = $productPage->getReviewSummary();
     $this->assertTrue($reviewsSummaryBlock->getAddReviewLink()->isVisible(), 'Add review link is not visible');
     $this->assertTrue($reviewsSummaryBlock->getViewReviewLink()->isVisible(), 'View review link is not visible');
     $this->assertContains('1', $reviewsSummaryBlock->getViewReviewLink()->getText(), 'There is more than 1 approved review');
     $reviewForm = $productPage->getReviewFormBlock();
     $reviewsBlock = $productPage->getCustomerReviewBlock();
     $reviewsSummaryBlock->getViewReviewLink()->click();
     $this->assertContains(sprintf("You're reviewing:\n%s", $productFixture->getName()), $reviewForm->getLegend()->getText());
     $this->verifyReview($reviewsBlock, $reviewFixture);
 }
开发者ID:aiesh,项目名称:magento2,代码行数:54,代码来源:ReviewTest.php

示例2: assertOnProductPage

 /**
  * Assert product data on product page
  *
  * @param SimpleProduct $productOld
  * @param SimpleProduct $productEdited
  * @return void
  */
 protected function assertOnProductPage(SimpleProduct $productOld, SimpleProduct $productEdited)
 {
     Factory::getClientBrowser()->open($_ENV['app_frontend_url'] . $productOld->getUrlKey() . '.html');
     $productPage = Factory::getPageFactory()->getCatalogProductView();
     $productViewBlock = $productPage->getViewBlock();
     $this->assertEquals($productEdited->getName(), $productViewBlock->getProductName());
     $price = $productViewBlock->getProductPrice();
     $this->assertEquals(number_format($productEdited->getProductPrice(), 2), $price['price_regular_price']);
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:16,代码来源:EditSimpleProductTest.php

示例3: _reopenBrowser

 /**
  * Force reopen browser
  * @return void
  */
 protected function _reopenBrowser()
 {
     Factory::getClientBrowser()->reopen();
 }
开发者ID:Mohitsahu123,项目名称:mtf,代码行数:8,代码来源:Listener.php

示例4: assertUrlRedirect

 /**
  * Assert that request URL redirects to target URL
  *
  * @param string $requestUrl
  * @param string $targetUrl
  * @param string $message
  * @return void
  */
 protected function assertUrlRedirect($requestUrl, $targetUrl, $message = '')
 {
     $browser = Factory::getClientBrowser();
     $browser->open($requestUrl);
     $this->assertStringStartsWith($targetUrl, $browser->getUrl(), $message);
 }
开发者ID:aiesh,项目名称:magento2,代码行数:14,代码来源:CategoryTest.php

示例5: addNewAttribute

 /**
  * Add new attribute to product
  *
  * @param ProductAttribute $attribute
  * @return void
  */
 protected function addNewAttribute(ProductAttribute $attribute)
 {
     $createProductPage = Factory::getPageFactory()->getCatalogProductNew();
     $productForm = $createProductPage->getConfigurableProductForm();
     $productForm->openVariationsTab();
     $productForm->clickCreateNewVariationSet();
     $newAttributeForm = $productForm->getConfigurableAttributeEditBlock();
     $this->assertTrue($newAttributeForm->isVisible(), '"New attribute" window is not opened');
     $newAttributeForm->openFrontendProperties();
     $newAttributeForm->fill($attribute);
     $newAttributeForm->saveAttribute();
     Factory::getClientBrowser()->switchToFrame();
 }
开发者ID:aiesh,项目名称:magento2,代码行数:19,代码来源:CreateWithAttributeTest.php


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