當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FixtureInterface::getUrlKey方法代碼示例

本文整理匯總了PHP中Mtf\Fixture\FixtureInterface::getUrlKey方法的典型用法代碼示例。如果您正苦於以下問題:PHP FixtureInterface::getUrlKey方法的具體用法?PHP FixtureInterface::getUrlKey怎麽用?PHP FixtureInterface::getUrlKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Mtf\Fixture\FixtureInterface的用法示例。


在下文中一共展示了FixtureInterface::getUrlKey方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: processAssert

 /**
  * Assertion that tier prices are displayed correctly
  *
  * @param CatalogProductView $catalogProductView
  * @param Browser $browser
  * @param FixtureInterface $product
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, Browser $browser, 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);
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:16,代碼來源:AssertProductTierPriceOnProductPage.php

示例2: 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 Browser $browser
  * @param CatalogProductView $catalogProductView
  * @param FixtureInterface $product
  * @return void
  */
 public function processAssert(Browser $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:buskamuza,項目名稱:magento2-skeleton,代碼行數:22,代碼來源:AssertProductPage.php

示例3: processAssert

 /**
  * Assertion that the product is correctly displayed in cart
  *
  * @param CatalogProductView $catalogProductView
  * @param FixtureInterface $product
  * @param Browser $browser
  * @param CheckoutCart $checkoutCart
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, FixtureInterface $product, Browser $browser, CheckoutCart $checkoutCart)
 {
     // Add product to cart
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $catalogProductView->getViewBlock()->fillOptions($product);
     $catalogProductView->getViewBlock()->clickAddToCart();
     // Check price
     $this->assertOnShoppingCart($product, $checkoutCart);
 }
開發者ID:buskamuza,項目名稱:magento2-skeleton,代碼行數:18,代碼來源:AssertProductInCart.php

示例4: processAssert

 /**
  * Assertion that tier prices are displayed correctly
  *
  * @param CatalogProductView $catalogProductView
  * @param FixtureInterface $product
  * @param Browser $browser
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, FixtureInterface $product, Browser $browser)
 {
     //Open product view page
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $viewBlock = $catalogProductView->getViewBlock();
     $viewBlock->clickCustomize();
     //Process assertions
     $this->assertPrice($product, $catalogProductView);
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:17,代碼來源:AssertTierPriceOnBundleProductPage.php

示例5: processAssert

 /**
  * Assertion that the product page is displayed correctly
  *
  * @param CatalogProductView $catalogProductView
  * @param Browser $browser
  * @param FixtureInterface $product
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, Browser $browser, FixtureInterface $product)
 {
     $this->product = $product;
     // TODO fix initialization url for frontend page
     //Open product view page
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $data = $this->prepareData($catalogProductView);
     $badValues = array_diff($data['onPage'], $data['fixture']);
     $errors = array_intersect_key($this->errorsMessages, array_keys($badValues));
     $errors += $this->verifySpecialPrice($catalogProductView);
     \PHPUnit_Framework_Assert::assertEmpty($errors, PHP_EOL . 'Found the following errors:' . PHP_EOL . implode(' ' . PHP_EOL, $this->errorsMessages));
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:20,代碼來源:AssertProductPage.php

示例6: processAssert

 /**
  * Assertion that commodity options are displayed correctly
  *
  * @param CatalogProductView $catalogProductView
  * @param FixtureInterface $product
  * @param Browser $browser
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, FixtureInterface $product, Browser $browser)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $actualPrice = null;
     if ($this->isPrice) {
         $prices = $catalogProductView->getViewBlock()->getPriceBlock()->getPrice();
         $actualPrice = isset($prices['price_special_price']) ? $prices['price_special_price'] : $prices['price_regular_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:buskamuza,項目名稱:magento2-skeleton,代碼行數:21,代碼來源:AssertProductCustomOptionsOnProductPage.php

示例7: processAssert

 /**
  * Assert that product review available on product page
  *
  * @param CatalogProductView $catalogProductView
  * @param ReviewInjectable $review
  * @param FixtureInterface $product
  * @param Browser $browser
  * @param AdminCache $cachePage
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, ReviewInjectable $review, FixtureInterface $product, Browser $browser, AdminCache $cachePage)
 {
     $errors = [];
     $cachePage->open()->getActionsBlock()->flushMagentoCache();
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $reviewBlock = $catalogProductView->getCustomerReviewBlock();
     $catalogProductView->getViewBlock()->selectTab('Reviews');
     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:buskamuza,項目名稱:magento2-skeleton,代碼行數:25,代碼來源:AssertProductReviewOnProductPage.php

示例8: processAssert

 /**
  * Assertion that the product is correctly displayed in cart
  *
  * @param CatalogProductView $catalogProductView
  * @param FixtureInterface $product
  * @param Browser $browser
  * @param CheckoutCart $checkoutCart
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, FixtureInterface $product, Browser $browser, CheckoutCart $checkoutCart)
 {
     // Add product to cart
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $productOptions = $product->getCustomOptions();
     if ($productOptions) {
         $customOption = $catalogProductView->getCustomOptionsBlock();
         $options = $customOption->getOptions();
         $key = $productOptions[0]['title'];
         $customOption->selectProductCustomOption($options[$key]['title']);
     }
     $catalogProductView->getViewBlock()->clickAddToCart();
     // Check price
     $this->assertOnShoppingCart($product, $checkoutCart);
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:24,代碼來源:AssertProductInCart.php

示例9: processAssert

 /**
  * Assert that In Stock status is displayed on product page
  *
  * @param CatalogProductView $catalogProductView
  * @param Browser $browser
  * @param FixtureInterface $product
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, Browser $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:aiesh,項目名稱:magento2,代碼行數:14,代碼來源:AssertProductInStock.php

示例10: openProductPage

 /**
  * Open product view page
  *
  * @param CatalogProductView $catalogProductView
  * @param FixtureInterface $product
  * @param Browser $browser
  * @return void
  */
 protected function openProductPage(CatalogProductView $catalogProductView, FixtureInterface $product, Browser $browser)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $catalogProductView->getViewBlock()->clickCustomize();
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:13,代碼來源:AssertProductCustomOptionsOnBundleProductPage.php

示例11: processAssert

 /**
  * Assert that displayed special price on product page equals passed from fixture
  *
  * @param CatalogProductView $catalogProductView
  * @param Browser $browser
  * @param FixtureInterface $product
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, Browser $browser, FixtureInterface $product)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     //Process assertions
     $this->assertPrice($product, $catalogProductView);
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:14,代碼來源:AssertProductSpecialPriceOnProductPage.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:buskamuza,項目名稱:magento2-skeleton,代碼行數:33,代碼來源:AssertProductIsNotDisplayingOnFrontend.php

示例13: init

 /**
  * Page initialization
  *
  * @param FixtureInterface $fixture
  * @return void
  */
 public function init(FixtureInterface $fixture)
 {
     $this->_url = $_ENV['app_frontend_url'] . $fixture->getUrlKey() . '.html';
 }
開發者ID:Atlis,項目名稱:docker-magento2,代碼行數:10,代碼來源:CatalogProductView.php

示例14: openProductPage

 /**
  * Open product view page
  *
  * @param FixtureInterface $product
  * @param Browser $browser
  * @return void
  */
 protected function openProductPage(FixtureInterface $product, Browser $browser)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:11,代碼來源:AssertProductCustomOptionsOnProductPage.php


注:本文中的Mtf\Fixture\FixtureInterface::getUrlKey方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。