本文整理汇总了PHP中Magento\Mtf\Fixture\InjectableFixture::getUrlKey方法的典型用法代码示例。如果您正苦于以下问题:PHP InjectableFixture::getUrlKey方法的具体用法?PHP InjectableFixture::getUrlKey怎么用?PHP InjectableFixture::getUrlKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Mtf\Fixture\InjectableFixture
的用法示例。
在下文中一共展示了InjectableFixture::getUrlKey方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processAssert
/**
* Assert that redirect from newCategory/oldProduct is correct to new product.
*
* @param InjectableFixture $product
* @param InjectableFixture $initialProduct
* @param Browser $browser
* @param CatalogProductView $catalogProductView
* @return void
*/
public function processAssert(InjectableFixture $product, InjectableFixture $initialProduct, Browser $browser, CatalogProductView $catalogProductView)
{
$category = $product->getDataFieldConfig('category_ids')['source']->getProductCategory();
$productUrl = $_ENV['app_frontend_url'] . $category->getUrlKey() . '/' . $initialProduct->getUrlKey() . '.html';
$browser->open($productUrl);
\PHPUnit_Framework_Assert::assertEquals($catalogProductView->getViewBlock()->getProductName(), strtoupper($product->getName()));
}
示例2: processAssert
/**
* Assertion that tier prices are displayed correctly.
*
* @param Browser $browser
* @param CatalogProductView $catalogProductView
* @param InjectableFixture $product
* @return void
*/
public function processAssert(Browser $browser, CatalogProductView $catalogProductView, InjectableFixture $product)
{
//Open product view page
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
//Process assertions
$this->assertPrice($product, $catalogProductView->getViewBlock());
}
示例3: processAssert
/**
* Assertion that the product is correctly displayed in cart.
*
* @param CatalogProductView $catalogProductView
* @param InjectableFixture $product
* @param Browser $browser
* @param CheckoutCart $checkoutCart
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, InjectableFixture $product, Browser $browser, CheckoutCart $checkoutCart)
{
// Add product to cart
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$catalogProductView->getViewBlock()->addToCart($product);
// Check price
$this->assertOnShoppingCart($product, $checkoutCart);
}
示例4: processAssert
/**
* Assertion that commodity options are displayed correctly.
*
* @param CatalogProductView $catalogProductView
* @param InjectableFixture $product
* @param Browser $browser
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, InjectableFixture $product, Browser $browser)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$fixtureCustomOptions = $this->prepareOptions($product);
$formCustomOptions = $catalogProductView->getViewBlock()->getOptions($product)['custom_options'];
$error = $this->verifyData($fixtureCustomOptions, $formCustomOptions);
\PHPUnit_Framework_Assert::assertEmpty($error, $error);
}
示例5: processAssert
/**
* Check whether there is an opportunity to compare products using given attribute.
*
* @param InjectableFixture $product
* @param CatalogProductAttribute $attribute
* @param BrowserInterface $browser
* @param CatalogProductView $catalogProductView
* @param CatalogProductCompare $catalogProductCompare
* @return void
*/
public function processAssert(InjectableFixture $product, CatalogProductAttribute $attribute, BrowserInterface $browser, CatalogProductView $catalogProductView, CatalogProductCompare $catalogProductCompare)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$catalogProductView->getViewBlock()->clickAddToCompare();
$catalogProductCompare->open();
$label = $attribute->hasData('manage_frontend_label') ? $attribute->getManageFrontendLabel() : $attribute->getFrontendLabel();
\PHPUnit_Framework_Assert::assertTrue($catalogProductCompare->getCompareProductsBlock()->isAttributeVisible($label), 'Attribute is absent on product compare page.');
}
示例6: processAssert
/**
* Assertion that the product is correctly displayed in cart.
*
* @param CatalogProductView $catalogProductView
* @param InjectableFixture $product
* @param Browser $browser
* @param CheckoutCart $checkoutCart
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, InjectableFixture $product, Browser $browser, CheckoutCart $checkoutCart)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$catalogProductView->getViewBlock()->addToCart($product);
$checkoutData = $product->getCheckoutData();
$price = $checkoutCart->getCartBlock()->getCartItem($product)->getCartItemTypePrice('price');
\PHPUnit_Framework_Assert::assertEquals($checkoutData['cartItem']['price'], $price, 'Product price in shopping cart is not correct.');
}
示例7: 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 InjectableFixture $product
* @return void
*/
public function processAssert(Browser $browser, CatalogProductView $catalogProductView, InjectableFixture $product)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$this->product = $product;
$this->productView = $catalogProductView->getViewBlock();
$this->catalogProductView = $catalogProductView;
$errors = $this->verify();
\PHPUnit_Framework_Assert::assertEmpty($errors, "\nFound the following errors:\n" . implode(" \n", $errors));
}
示例8: processAssert
/**
* Assert that product can be added to active gift registry from shopping cart.
*
* @param CatalogProductView $catalogProductView
* @param CheckoutCart $checkoutCart
* @param InjectableFixture $product
* @param GiftRegistry $giftRegistry
* @param GiftRegistryItems $giftRegistryItems
* @param BrowserInterface $browser
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, CheckoutCart $checkoutCart, InjectableFixture $product, GiftRegistry $giftRegistry, GiftRegistryItems $giftRegistryItems, BrowserInterface $browser)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$catalogProductView->getViewBlock()->addToCart($product);
$catalogProductView->getMessagesBlock()->waitSuccessMessage();
$checkoutCart->open();
$checkoutCart->getGiftRegistryBlock()->addToGiftRegistry($giftRegistry);
\PHPUnit_Framework_Assert::assertTrue($giftRegistryItems->getGiftRegistryItemsBlock()->isProductInGrid($product), "Product can not be added to active gift registry '{$giftRegistry->getTitle()}' from shopping cart.");
}
示例9: processAssert
/**
* Assert that add view review links are present on product page.
*
* @param Browser $browser
* @param CatalogProductView $catalogProductView
* @param InjectableFixture $product
* @param Review $review
* @return void
*/
public function processAssert(Browser $browser, CatalogProductView $catalogProductView, InjectableFixture $product, Review $review)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
// Verify add review link
\PHPUnit_Framework_Assert::assertTrue($catalogProductView->getReviewViewBlock()->getAddReviewLink()->isVisible(), 'Add review link is not visible on product page.');
// Verify view review link
$viewReviewLink = $catalogProductView->getReviewViewBlock()->getViewReviewLink($review);
\PHPUnit_Framework_Assert::assertTrue($viewReviewLink->isVisible(), 'View review link is not visible on product page.');
\PHPUnit_Framework_Assert::assertContains('1', $viewReviewLink->getText(), 'There is more than 1 approved review.');
}
示例10: processAssert
/**
* Assert that product duplicate is not displayed on front-end.
*
* @param InjectableFixture $product
* @param Browser $browser
* @param CatalogProductView $catalogProductView
* @return void
*/
public function processAssert(InjectableFixture $product, Browser $browser, CatalogProductView $catalogProductView)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '-1' . '.html');
\PHPUnit_Framework_Assert::assertFalse($catalogProductView->getViewBlock()->isVisible(), 'Duplicate Product is displayed on frontend.');
}
示例11: processAssert
/**
* Assert that In Stock status is displayed on product page.
*
* @param CatalogProductView $catalogProductView
* @param Browser $browser
* @param InjectableFixture $product
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, Browser $browser, InjectableFixture $product)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
\PHPUnit_Framework_Assert::assertEquals(self::STOCK_AVAILABILITY, $catalogProductView->getViewBlock()->getStockAvailability($product), 'Control "' . self::STOCK_AVAILABILITY . '" is not visible.');
}
示例12: processAssert
/**
* Assert that 'Add to Cart' button is absent on product page.
*
* @param CatalogProductView $catalogProductView
* @param InjectableFixture $product
* @param Browser $browser
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, InjectableFixture $product, Browser $browser)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
\PHPUnit_Framework_Assert::assertFalse($catalogProductView->getViewBlock()->checkAddToCartButton(), 'Add to Cart button is present on product page');
}
示例13: processAssert
/**
* Check whether html tags are using in attribute value.
* Checked tag structure <b><i>atttribute_default_value</p></i></b>
*
* @param InjectableFixture $product
* @param CatalogProductAttribute $attribute
* @param CatalogProductView $catalogProductView
* @param BrowserInterface $browser
* @throws \Exception
* @return void
*/
public function processAssert(InjectableFixture $product, CatalogProductAttribute $attribute, CatalogProductView $catalogProductView, BrowserInterface $browser)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
\PHPUnit_Framework_Assert::assertTrue($catalogProductView->getAdditionalInformationBlock()->hasHtmlTagInAttributeValue($attribute), 'Attribute is not visible with HTML tags on frontend.');
}
示例14: processAssert
/**
* Assert that video is absent on product page on Store front.
*
* @param BrowserInterface $browser
* @param CatalogProductView $catalogProductView
* @param InjectableFixture $initialProduct
*/
public function processAssert(BrowserInterface $browser, CatalogProductView $catalogProductView, InjectableFixture $initialProduct)
{
$browser->open($_ENV['app_frontend_url'] . $initialProduct->getUrlKey() . '.html');
$catalogProductView->getViewBlock()->isGalleryVisible();
\PHPUnit_Framework_Assert::assertFalse($catalogProductView->getViewBlock()->isGalleryVisible(), 'Product video is displayed on product view when it should not.');
}
示例15: addProduct
/**
* Add product to compare list.
*
* @param InjectableFixture $product
* @return void
*/
protected function addProduct(InjectableFixture $product)
{
$this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$this->catalogProductView->getViewBlock()->clickAddToCompare();
}