本文整理汇总了PHP中Magento\Mtf\Client\Browser类的典型用法代码示例。如果您正苦于以下问题:PHP Browser类的具体用法?PHP Browser怎么用?PHP Browser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Browser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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());
}
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:15,代码来源:AssertProductTierPriceOnProductPage.php
示例2: processAssert
/**
* Assert that product is displayed in related products section.
*
* @param Browser $browser
* @param CatalogProductSimple $product
* @param InjectableFixture[] $relatedProducts
* @param CatalogProductView $catalogProductView
* @return void
*/
public function processAssert(Browser $browser, CatalogProductSimple $product, array $relatedProducts, CatalogProductView $catalogProductView)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
foreach ($relatedProducts as $relatedProduct) {
\PHPUnit_Framework_Assert::assertTrue($catalogProductView->getRelatedProductBlock()->getItemBlock($relatedProduct)->isVisible(), "Product {$relatedProduct->getName()} is absent in related products.");
}
}
开发者ID:QiuLihua83,项目名称:magento-ee,代码行数:16,代码来源:AssertRelatedProductsSection.php
示例3: 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()));
}
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:16,代码来源:AssertUrlRewriteUpdatedProductOnFrontend.php
示例4: processAssert
/**
* Assert that displayed price view for bundle product on product page equals passed from fixture.
*
* @param CatalogProductView $catalogProductView
* @param Browser $browser
* @param BundleProduct $product
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, Browser $browser, BundleProduct $product)
{
//Open product view page
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
//Process assertions
$this->assertPrice($product, $catalogProductView);
}
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:15,代码来源:AssertBundlePriceView.php
示例5: processAssert
/**
* Assert that created CMS page displays with error message on unassigned store views on frontend.
*
* @param CmsPage $cms
* @param FrontendCmsPage $frontendCmsPage
* @param Browser $browser
* @param CmsIndex $cmsIndex
* @param string|null $notFoundMessage
* @return void
*/
public function processAssert(CmsPage $cms, FrontendCmsPage $frontendCmsPage, Browser $browser, CmsIndex $cmsIndex, $notFoundMessage = null)
{
$browser->open($_ENV['app_frontend_url'] . $cms->getIdentifier());
$notFoundMessage = $notFoundMessage !== null ? $notFoundMessage : self::ERROR_MESSAGE;
$cmsIndex->getHeaderBlock()->selectStore('Default Store View');
\PHPUnit_Framework_Assert::assertContains($notFoundMessage, $frontendCmsPage->getCmsPageContentBlock()->getPageContent(), 'Wrong page content is displayed.');
}
开发者ID:cewolf2002,项目名称:magento,代码行数:17,代码来源:AssertCmsPageDisabledOnUnassignedStoreView.php
示例6: 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
示例7: processAssert
/**
* Assert that price stored in fixture equals to product price on product page.
*
* @param CatalogProductSimple $productSimple
* @param Browser $browser
* @param CatalogProductView $catalogProductView
* @return void
*/
public function processAssert(CatalogProductSimple $productSimple, Browser $browser, CatalogProductView $catalogProductView)
{
$productSimple->persist();
$browser->open($_ENV['app_frontend_url'] . $productSimple->getUrlKey() . '.html');
$productPriceFromFixture = $productSimple->getPrice();
$productPrice = number_format($catalogProductView->getViewBlock()->getPriceBlock()->getPrice(), 2);
\PHPUnit_Framework_Assert::assertEquals($productPrice, $productPriceFromFixture);
}
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:16,代码来源:AssertCatalogPriceRuleNotInProductPage.php
示例8: processAssert
/**
* Assert that gift card usable in frontend.
*
* @param CatalogProductView $catalogProductView
* @param CheckoutCart $checkoutCart
* @param CatalogProductSimple $product
* @param Browser $browser
* @param string $code
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, CheckoutCart $checkoutCart, CatalogProductSimple $product, Browser $browser, $code)
{
$this->checkoutCart = $checkoutCart;
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$catalogProductView->getViewBlock()->clickAddToCart();
$checkoutCart->getGiftCardAccountBlock()->addGiftCard($code);
$this->assert();
}
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:18,代码来源:AbstractAssertGiftCardAccountUsableInCartOnFrontend.php
示例9: 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.');
}
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:17,代码来源:AssertConfigurableProductInCart.php
示例10: 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);
}
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:16,代码来源:AssertProductCustomOptionsOnProductPage.php
示例11: processAssert
/**
* Assert that displayed assigned products on category page equals passed from fixture.
*
* @param CatalogCategory $category
* @param CatalogCategoryView $categoryView
* @param Browser $browser
* @return void
*/
public function processAssert(CatalogCategory $category, CatalogCategoryView $categoryView, Browser $browser)
{
$browser->open($_ENV['app_frontend_url'] . strtolower($category->getUrlKey()) . '.html');
$products = $category->getDataFieldConfig('category_products')['source']->getProducts();
foreach ($products as $productFixture) {
\PHPUnit_Framework_Assert::assertTrue($categoryView->getListProductBlock()->isProductVisible($productFixture), "Products '{$productFixture->getName()}' is not find.");
}
}
开发者ID:cewolf2002,项目名称:magento,代码行数:16,代码来源:AssertCategoryForAssignedProducts.php
示例12: processAssert
/**
* Assert that filtered product is present on category page by attribute and another products are absent.
*
* @param CatalogCategoryView $catalogCategoryView
* @param ProcessList $processList
* @param Browser $browser
* @param CatalogCategory $category
* @param InjectableFixture[] $products
* @param string $searchProductsIndexes
* @param string $filterLink
* @return void
*/
public function processAssert(CatalogCategoryView $catalogCategoryView, ProcessList $processList, Browser $browser, CatalogCategory $category, array $products, $searchProductsIndexes, $filterLink)
{
$processList->open()->getIndexManagementGrid()->massactionForAll('Reindex Data');
$browser->open($_ENV['app_frontend_url'] . strtolower($category->getUrlKey()) . '.html');
$filter = $this->prepareFilter($products[$searchProductsIndexes], $filterLink);
$catalogCategoryView->getLayeredNavigationBlock()->selectAttribute($filter);
$this->verify($catalogCategoryView, $products, $searchProductsIndexes);
}
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:20,代码来源:AssertProductsVisibleOnCategoryPageShopByAttribute.php
示例13: 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);
}
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:17,代码来源:AssertProductInCart.php
示例14: processAssert
/**
* Assert that default qty for sub products in grouped product displays according to dataset on product page.
*
* @param CatalogProductView $groupedProductView
* @param GroupedProduct $product
* @param Browser $browser
* @return void
*/
public function processAssert(CatalogProductView $groupedProductView, GroupedProduct $product, Browser $browser)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$pageOptions = $groupedProductView->getViewBlock()->getOptions($product);
$fixtureQtyData = $this->prepareFixtureQtyData($product);
$pageQtyData = $this->prepareFormQtyData($pageOptions);
$error = $this->verifyData($fixtureQtyData, $pageQtyData);
\PHPUnit_Framework_Assert::assertEmpty($error, $error);
}
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:17,代码来源:AssertGroupedProductsDefaultQty.php
示例15: processAssert
/**
* Assert that displayed price for bundle items on shopping cart page equals to passed from fixture.
* Price for bundle items has two options:
* 1. Fixed (price of bundle product)
* 2. Dynamic (price of bundle item)
*
* @param CatalogProductView $catalogProductView
* @param BundleProduct $product
* @param CheckoutCart $checkoutCartView
* @param Browser $browser
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, BundleProduct $product, CheckoutCart $checkoutCartView, Browser $browser)
{
$this->product = $product;
$checkoutCartView->open()->getCartBlock()->clearShoppingCart();
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$catalogProductView->getViewBlock()->addToCart($product);
//Process assertions
$this->assertPrice($checkoutCartView);
}
开发者ID:QiuLihua83,项目名称:magento-ee,代码行数:21,代码来源:AssertBundlePriceType.php
示例16: 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));
}
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:23,代码来源:AssertProductPage.php
示例17: processAssert
/**
* Assert that Samples links are present on the downloadable product on front-end.
*
* @param CatalogProductView $productView
* @param DownloadableProduct $product
* @param Browser $browser
* @return void
*/
public function processAssert(CatalogProductView $productView, DownloadableProduct $product, Browser $browser)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$fixtureSampleLinks = $this->prepareFixtureData($product);
$pageOptions = $productView->getViewBlock()->getOptions($product);
$pageSampleLinks = isset($pageOptions['downloadable_options']['downloadable_sample']) ? $this->preparePageData($pageOptions['downloadable_options']['downloadable_sample']) : [];
$error = $this->verifyData($fixtureSampleLinks, $pageSampleLinks);
\PHPUnit_Framework_Assert::assertEmpty($error, $error);
}
开发者ID:cewolf2002,项目名称:magento,代码行数:17,代码来源:AssertDownloadableSamplesData.php
示例18: processAssert
/**
* Assert that banner is absent on Shopping Cart page.
*
* @param Browser $browser
* @param CatalogProductSimple $product
* @param CatalogProductView $catalogProductView
* @param Banner $banner
* @param CheckoutCart $checkoutCart
* @param Cache $adminCache
* @return void
*/
public function processAssert(Browser $browser, CatalogProductSimple $product, CatalogProductView $catalogProductView, Banner $banner, CheckoutCart $checkoutCart, Cache $adminCache)
{
// Flush cache
$adminCache->open();
$adminCache->getPageActions()->flushCacheStorage();
$adminCache->getMessagesBlock()->waitSuccessMessage();
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$catalogProductView->getViewBlock()->addToCart($product);
\PHPUnit_Framework_Assert::assertFalse($checkoutCart->getBannerViewBlock()->checkWidgetBanners($banner), 'Banner is present on Shopping Cart page.');
}
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:21,代码来源:AssertBannerNotInShoppingCart.php
示例19: 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.');
}
开发者ID:cewolf2002,项目名称:magento,代码行数:19,代码来源:AssertReviewLinksIsPresentOnProductPage.php
示例20: processAssert
/**
* Assert that created gift card account can be verified on the frontend in Shopping Cart.
*
* @param Customer $customer
* @param Browser $browser
* @param CatalogProductSimple $product
* @param CatalogProductView $catalogProductView
* @param GiftCardAccount $giftCardAccount
* @param CheckoutCart $checkoutCart
* @param string $code
* @return void
*/
public function processAssert(Customer $customer, Browser $browser, CatalogProductSimple $product, CatalogProductView $catalogProductView, GiftCardAccount $giftCardAccount, CheckoutCart $checkoutCart, $code)
{
$this->objectManager->create('Mage\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$catalogProductView->getViewBlock()->clickAddToCart();
$data = $giftCardAccount->getData();
$checkoutCart->getGiftCardAccountBlock()->checkStatusAndBalance($code);
$fixtureData = ['code' => $code, 'balance' => $data['balance'], 'date_expires' => $data['date_expires']];
\PHPUnit_Framework_Assert::assertEquals($fixtureData, $checkoutCart->getCheckBlock()->getGiftCardAccountData($fixtureData));
}
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:22,代码来源:AssertGiftCardAccountStatusInShoppingCart.php
注:本文中的Magento\Mtf\Client\Browser类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论