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


PHP FixtureInterface::getUrlKey方法代码示例

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


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

示例1: processAssert

 /**
  * Assert that products are displayed in up-sell section.
  *
  * @param Browser $browser
  * @param FixtureInterface $product
  * @param array $upSellProducts
  * @param CatalogProductView $catalogProductView
  * @return void
  */
 public function processAssert(Browser $browser, FixtureInterface $product, array $upSellProducts, CatalogProductView $catalogProductView)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     foreach ($upSellProducts as $upSellProduct) {
         \PHPUnit_Framework_Assert::assertTrue($catalogProductView->getUpsellBlock()->getItemBlock($upSellProduct)->isVisible(), "Product {$upSellProduct->getName()} is absent in up-sells products.");
     }
 }
开发者ID:MikeTayC,项目名称:magento.dev,代码行数:16,代码来源:AssertUpSellProductsSection.php

示例2: processAssert

 /**
  * Assert that product is displayed in up-sell section
  *
  * @param BrowserInterface $browser
  * @param FixtureInterface $product
  * @param InjectableFixture[] $relatedProducts,
  * @param CatalogProductView $catalogProductView
  * @return void
  */
 public function processAssert(BrowserInterface $browser, FixtureInterface $product, array $relatedProducts, CatalogProductView $catalogProductView)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     foreach ($relatedProducts as $relatedProduct) {
         \PHPUnit_Framework_Assert::assertTrue($catalogProductView->getUpsellBlock()->isUpsellProductVisible($relatedProduct->getName()), 'Product \'' . $relatedProduct->getName() . '\' is absent in up-sells products.');
     }
 }
开发者ID:,项目名称:,代码行数:16,代码来源:

示例3: processAssert

 /**
  * Assertion that tier prices are displayed correctly
  *
  * @param BrowserInterface $browser
  * @param CatalogProductView $catalogProductView
  * @param FixtureInterface $product
  * @return void
  */
 public function processAssert(BrowserInterface $browser, CatalogProductView $catalogProductView, FixtureInterface $product)
 {
     // TODO fix initialization url for frontend page
     //Open product view page
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     //Process assertions
     $this->assertPrice($product, $catalogProductView->getViewBlock());
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:AssertProductTierPriceOnProductPage.php

示例4: processAssert

 /**
  * Assert that displayed product data on product page(front-end) equals passed from fixture:
  * 1. Product Name
  * 2. Price
  * 3. Special price
  * 4. SKU
  * 5. Description
  * 6. Short Description
  *
  * @param BrowserInterface $browser
  * @param CatalogProductView $catalogProductView
  * @param FixtureInterface $product
  * @return void
  */
 public function processAssert(BrowserInterface $browser, CatalogProductView $catalogProductView, FixtureInterface $product)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $this->product = $product;
     $this->productView = $catalogProductView->getViewBlock();
     $errors = $this->verify();
     \PHPUnit_Framework_Assert::assertEmpty($errors, "\nFound the following errors:\n" . implode(" \n", $errors));
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:22,代码来源:AssertProductPage.php

示例5: processAssert

 /**
  * Assertion that tier prices are displayed correctly
  *
  * @param BrowserInterface $browser
  * @param CatalogProductView $catalogProductView
  * @param FixtureInterface $product
  * @return void
  */
 public function processAssert(BrowserInterface $browser, CatalogProductView $catalogProductView, FixtureInterface $product)
 {
     //Open product view page
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $viewBlock = $catalogProductView->getBundleViewBlock();
     $viewBlock->clickCustomize();
     //Process assertions
     $this->assertPrice($product, $viewBlock);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:17,代码来源:AssertTierPriceOnBundleProductPage.php

示例6: processAssert

 /**
  * Assertion that the product is correctly displayed in cart
  *
  * @param CatalogProductView $catalogProductView
  * @param FixtureInterface $product
  * @param BrowserInterface $browser
  * @param CheckoutCart $checkoutCart
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, FixtureInterface $product, BrowserInterface $browser, CheckoutCart $checkoutCart)
 {
     // Add product to cart
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $catalogProductView->getViewBlock()->fillOptions($product);
     $catalogProductView->getViewBlock()->clickAddToCart();
     $catalogProductView->getMessagesBlock()->waitSuccessMessage();
     // Check price
     $this->assertOnShoppingCart($product, $checkoutCart);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:19,代码来源:AssertProductInCart.php

示例7: processAssert

 /**
  * Assert that product review available on product page.
  *
  * @param CatalogProductView $catalogProductView
  * @param Review $review
  * @param FixtureInterface $product
  * @param BrowserInterface $browser
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, Review $review, FixtureInterface $product, BrowserInterface $browser)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $reviewBlock = $catalogProductView->getReviewsBlock();
     $catalogProductView->getViewBlock()->openCustomInformationTab('Reviews');
     $formReview = $reviewBlock->getItems()[0];
     $fixtureReview = $this->prepareReview($review);
     $errors = $this->verifyData($fixtureReview, $formReview);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:19,代码来源:AssertProductReviewOnProductPage.php

示例8: processAssert

 /**
  * Assertion that commodity options are displayed correctly
  *
  * @param CatalogProductView $catalogProductView
  * @param FixtureInterface $product
  * @param BrowserInterface $browser
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, FixtureInterface $product, BrowserInterface $browser)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $actualPrice = null;
     if ($this->isPrice) {
         $priceBlock = $catalogProductView->getViewBlock()->getPriceBlock();
         $specialPrice = $priceBlock->getSpecialPrice();
         $price = $priceBlock->getPrice();
         $actualPrice = $specialPrice ? $specialPrice : $price;
     }
     $fixtureCustomOptions = $this->prepareOptions($product, $actualPrice);
     $formCustomOptions = $catalogProductView->getViewBlock()->getOptions($product)['custom_options'];
     $error = $this->verifyData($fixtureCustomOptions, $formCustomOptions);
     \PHPUnit_Framework_Assert::assertEmpty($error, $error);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:23,代码来源:AssertProductCustomOptionsOnProductPage.php

示例9: processAssert

 /**
  * Assert that product review available on product page.
  *
  * @param CatalogProductView $catalogProductView
  * @param Review $review
  * @param FixtureInterface $product
  * @param BrowserInterface $browser
  * @param AdminCache $cachePage
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, Review $review, FixtureInterface $product, BrowserInterface $browser, AdminCache $cachePage)
 {
     $errors = [];
     $cachePage->open()->getActionsBlock()->flushMagentoCache();
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $reviewBlock = $catalogProductView->getCustomerReviewBlock();
     $catalogProductView->getViewBlock()->selectTab('Reviews');
     \PHPUnit_Framework_Assert::assertContains(sprintf("You're reviewing:\n%s", $product->getName()), $catalogProductView->getReviewFormBlock()->getLegend()->getText());
     foreach ($review->getData() as $name => $value) {
         $reviewValue = $reviewBlock->getFieldValue($name);
         if ($reviewValue !== null && 0 !== strcasecmp($value, trim($reviewValue))) {
             $errors[] = '- field "' . $name . '" is not equals submitted one, error value "' . $value . '"';
         }
     }
     \PHPUnit_Framework_Assert::assertEmpty($errors, 'The Review contains the following errors:' . PHP_EOL . implode(PHP_EOL, $errors));
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:26,代码来源:AssertProductReviewOnProductPage.php

示例10: run

 /**
  * Open product on frontend and click Checkout with PayPal button.
  *
  * @return void
  */
 public function run()
 {
     $this->browser->open($_ENV['app_frontend_url'] . $this->product->getUrlKey() . '.html');
     $this->catalogProductView->getViewBlock()->paypalCheckout();
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:10,代码来源:CheckoutWithPaypalFromProductPageStep.php

示例11: processAssert

 /**
  * Assert that In Stock status is displayed on product page
  *
  * @param CatalogProductView $catalogProductView
  * @param BrowserInterface $browser
  * @param FixtureInterface $product
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, BrowserInterface $browser, FixtureInterface $product)
 {
     // TODO fix initialization url for frontend page
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     \PHPUnit_Framework_Assert::assertEquals(self::STOCK_AVAILABILITY, $catalogProductView->getViewBlock()->stockAvailability(), 'Control "' . self::STOCK_AVAILABILITY . '" is not visible.');
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:14,代码来源:AssertProductInStock.php

示例12: isNotDisplayingOnFrontendAssert

 /**
  * Verify product displaying on frontend
  *
  * @param FixtureInterface $product
  * @return array
  */
 protected function isNotDisplayingOnFrontendAssert(FixtureInterface $product)
 {
     $errors = [];
     // Check the product page is not available
     // TODO fix initialization url for frontend page
     $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $titleBlock = $this->catalogProductView->getTitleBlock();
     if ($titleBlock->getTitle() !== self::NOT_FOUND_MESSAGE) {
         $errors[] = '- the headline on the page does not match, the text should be -> "' . self::NOT_FOUND_MESSAGE . '".';
     }
     $this->cmsIndex->open();
     $this->cmsIndex->getSearchBlock()->search($product->getSku());
     if ($this->catalogSearchResult->getListProductBlock()->isProductVisible($product->getName())) {
         $errors[] = '- successful product search.';
     }
     $categoryName = $product->hasData('category_ids') ? $product->getCategoryIds()[0] : $this->category->getName();
     $this->cmsIndex->open();
     $this->cmsIndex->getTopmenu()->selectCategoryByName($categoryName);
     $isProductVisible = $this->catalogCategoryView->getListProductBlock()->isProductVisible($product->getName());
     while (!$isProductVisible && $this->catalogCategoryView->getBottomToolbar()->nextPage()) {
         $isProductVisible = $this->catalogCategoryView->getListProductBlock()->isProductVisible($product->getName());
     }
     if ($isProductVisible) {
         $errors[] = "- product with name '{$product->getName()}' is found in this category.";
     }
     return $errors;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:33,代码来源:AssertProductIsNotDisplayingOnFrontend.php

示例13: processAssert

 /**
  * Assert that displayed special price on product page equals passed from fixture
  *
  * @param CatalogProductView $catalogProductView
  * @param BrowserInterface $browser
  * @param FixtureInterface $product
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, BrowserInterface $browser, FixtureInterface $product)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     //Process assertions
     $this->assertPrice($product, $catalogProductView->getViewBlock());
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:14,代码来源:AssertProductSpecialPriceOnProductPage.php


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