本文整理汇总了PHP中Magento\Mtf\Client\BrowserInterface类的典型用法代码示例。如果您正苦于以下问题:PHP BrowserInterface类的具体用法?PHP BrowserInterface怎么用?PHP BrowserInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BrowserInterface类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: processAssert
/**
* Assert that you will be redirected to url from dataset
*
* @param CmsIndex $cmsIndex
* @param BrowserInterface $browser
* @param CatalogSearchQuery $searchTerm
* @return void
*/
public function processAssert(CmsIndex $cmsIndex, BrowserInterface $browser, CatalogSearchQuery $searchTerm)
{
$cmsIndex->open()->getSearchBlock()->search($searchTerm->getSynonymFor());
$windowUrl = $browser->getUrl();
$redirectUrl = $searchTerm->getRedirect();
\PHPUnit_Framework_Assert::assertEquals($windowUrl, $redirectUrl, 'Redirect by synonym was not executed.' . PHP_EOL . "Expected: " . $redirectUrl . PHP_EOL . "Actual: " . $windowUrl);
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:15,代码来源:AssertSearchTermSynonymOnFrontend.php
示例2: processAssert
/**
* Assert that the category cannot be accessed from the navigation bar in the frontend
*
* @param CmsIndex $cmsIndex
* @param Category $category
* @param BrowserInterface $browser
* @return void
*/
public function processAssert(CmsIndex $cmsIndex, Category $category, BrowserInterface $browser)
{
$cmsIndex->open();
\PHPUnit_Framework_Assert::assertFalse($cmsIndex->getTopmenu()->isCategoryVisible($category->getName()), 'Category can be accessed from the navigation bar in the frontend.');
$browser->open($_ENV['app_frontend_url'] . $category->getUrlKey() . '.html');
\PHPUnit_Framework_Assert::assertEquals(self::NOT_FOUND_MESSAGE, $cmsIndex->getTitleBlock()->getTitle(), 'Wrong page is displayed.');
}
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:15,代码来源:AssertCategoryIsNotActive.php
示例3: processAssert
/**
* Assert that product rating is not displayed on frontend on product review
*
* @param CatalogProductView $catalogProductView
* @param CatalogProductSimple $product
* @param Rating $productRating
* @param BrowserInterface $browser
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, CatalogProductSimple $product, Rating $productRating, BrowserInterface $browser)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$catalogProductView->getReviewSummary()->getAddReviewLink()->click();
$reviewForm = $catalogProductView->getReviewFormBlock();
\PHPUnit_Framework_Assert::assertFalse($reviewForm->isVisibleRating($productRating), 'Product rating "' . $productRating->getRatingCode() . '" is displayed.');
}
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:16,代码来源:AssertProductRatingNotInProductPage.php
示例4: processAssert
/**
* Assert that apache redirect works by opening category page and asserting index.php in its url.
*
* @param CatalogCategory $category
* @param CmsIndex $homePage
* @param BrowserInterface $browser
*/
public function processAssert(CatalogCategory $category, CmsIndex $homePage, BrowserInterface $browser)
{
$category->persist();
$homePage->open();
$homePage->getTopmenu()->selectCategory($category->getName());
\PHPUnit_Framework_Assert::assertTrue(strpos($browser->getUrl(), 'index.php') === false, 'Apache redirect for category does not work.');
}
开发者ID:MikeTayC,项目名称:magento.dev,代码行数:14,代码来源:AssertRewritesEnabled.php
示例5: processAssert
/**
* Assert that created entity was found on search page
*
* @param UrlRewrite $initialRewrite
* @param UrlRewrite $urlRewrite
* @param BrowserInterface $browser
* @param CatalogCategoryView $categoryView
* @return void
*/
public function processAssert(UrlRewrite $initialRewrite, UrlRewrite $urlRewrite, BrowserInterface $browser, CatalogCategoryView $categoryView)
{
$urlRequestPath = $urlRewrite->hasData('request_path') ? $urlRewrite->getRequestPath() : $initialRewrite->getRequestPath();
$browser->open($_ENV['app_frontend_url'] . $urlRequestPath);
$entity = $urlRewrite->getDataFieldConfig('target_path')['source']->getEntity()->getName();
\PHPUnit_Framework_Assert::assertTrue($categoryView->getListProductBlock()->isProductVisible($entity), "Created entity '{$entity}' isn't found.");
}
开发者ID:shabbirvividads,项目名称:magento2,代码行数:16,代码来源:AssertUrlRewriteCustomSearchRedirect.php
示例6: processAssert
/**
* Assert that displayed price view for bundle product on product page equals passed from fixture.
*
* @param CatalogProductView $catalogProductView
* @param BrowserInterface $browser
* @param BundleProduct $product
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, BrowserInterface $browser, BundleProduct $product)
{
//Open product view page
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
//Process assertions
$this->assertPrice($product, $catalogProductView);
}
开发者ID:nja78,项目名称:magento2,代码行数:15,代码来源:AssertBundlePriceView.php
示例7: processAssert
/**
* Assert that Secure Urls Enabled.
*
* @param BrowserInterface $browser
* @param Dashboard $dashboard
* @param CustomerAccountLogin $customerAccountLogin
* @return void
*/
public function processAssert(BrowserInterface $browser, Dashboard $dashboard, CustomerAccountLogin $customerAccountLogin)
{
$dashboard->open();
\PHPUnit_Framework_Assert::assertTrue(strpos($browser->getUrl(), 'https://') !== false, 'Secure Url is not displayed on backend.');
$customerAccountLogin->open();
\PHPUnit_Framework_Assert::assertTrue(strpos($browser->getUrl(), 'https://') !== false, 'Secure Url is not displayed on frontend.');
}
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:15,代码来源:AssertSecureUrlEnabled.php
示例8: processAssert
/**
* Check that Shopping Cart is empty, opened page contains text "You have no items in your shopping cart.
* Click here to continue shopping." where 'here' is link that leads to index page
*
* @param CheckoutCart $checkoutCart
* @param BrowserInterface $browser
* @return void
*/
public function processAssert(CheckoutCart $checkoutCart, BrowserInterface $browser)
{
$checkoutCart->open();
$cartEmptyBlock = $checkoutCart->getCartEmptyBlock();
\PHPUnit_Framework_Assert::assertEquals(self::TEXT_EMPTY_CART, $cartEmptyBlock->getText(), 'Wrong text on empty cart page.');
$cartEmptyBlock->clickLinkToMainPage();
\PHPUnit_Framework_Assert::assertEquals($_ENV['app_frontend_url'], $browser->getUrl(), 'Wrong link to main page on empty cart page.');
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:AssertCartIsEmpty.php
示例9: processAssert
/**
* Assert that outside redirect was success
*
* @param UrlRewrite $urlRewrite
* @param BrowserInterface $browser
* @param UrlRewrite|null $initialRewrite [optional]
* @return void
*/
public function processAssert(UrlRewrite $urlRewrite, BrowserInterface $browser, UrlRewrite $initialRewrite = null)
{
$urlRequestPath = $urlRewrite->hasData('request_path') ? $urlRewrite->getRequestPath() : $initialRewrite->getRequestPath();
$urlTargetPath = $urlRewrite->hasData('target_path') ? $urlRewrite->getTargetPath() : $initialRewrite->getTargetPath();
$browser->open($_ENV['app_frontend_url'] . $urlRequestPath);
$browserUrl = $browser->getUrl();
\PHPUnit_Framework_Assert::assertEquals($browserUrl, $urlTargetPath, 'URL rewrite redirect false.' . "\nExpected: " . $urlTargetPath . "\nActual: " . $browserUrl);
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:AssertUrlRewriteSuccessOutsideRedirect.php
示例10: 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.');
}
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:18,代码来源:AssertProductAttributeIsComparable.php
示例11: processAssert
/**
* Check that product available by new URL on the front
*
* @param UrlRewrite $urlRewrite
* @param CatalogProductView $catalogProductView
* @param BrowserInterface $browser
* @param InjectableFixture $product
* @return void
*/
public function processAssert(UrlRewrite $urlRewrite, CatalogProductView $catalogProductView, BrowserInterface $browser, InjectableFixture $product = null)
{
$browser->open($_ENV['app_frontend_url'] . $urlRewrite->getRequestPath());
if ($product === null) {
$product = $urlRewrite->getDataFieldConfig('target_path')['source']->getEntity();
}
\PHPUnit_Framework_Assert::assertEquals($catalogProductView->getTitleBlock()->getTitle(), $product->getName(), 'URL rewrite product redirect false.' . "\nExpected: " . $product->getName() . "\nActual: " . $catalogProductView->getTitleBlock()->getTitle());
}
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:17,代码来源:AssertUrlRewriteProductRedirect.php
示例12: 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
示例13: processAssert
/**
* Assert check URL rewrite custom redirect
*
* @param UrlRewrite $urlRewrite
* @param BrowserInterface $browser
* @param CmsIndex $cmsIndex
* @return void
*/
public function processAssert(UrlRewrite $urlRewrite, BrowserInterface $browser, CmsIndex $cmsIndex)
{
$browser->open($_ENV['app_frontend_url'] . $urlRewrite->getRequestPath());
$entity = $urlRewrite->getDataFieldConfig('target_path')['source']->getEntity();
$title = $entity->hasData('name') ? $entity->getName() : $entity->getContentHeading();
$pageTitle = $cmsIndex->getTitleBlock()->getTitle();
\PHPUnit_Framework_Assert::assertEquals($pageTitle, $title, 'URL rewrite product redirect false.' . "\nExpected: " . $title . "\nActual: " . $pageTitle);
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:AssertUrlRewriteCustomRedirect.php
示例14: 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 BrowserInterface $browser
* @param BundleProduct $originalProduct [optional]
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, BundleProduct $product, CheckoutCart $checkoutCartView, BrowserInterface $browser, BundleProduct $originalProduct = null)
{
$checkoutCartView->open()->getCartBlock()->clearShoppingCart();
//Open product view page
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
//Process assertions
$this->assertPrice($product, $catalogProductView, $checkoutCartView, $originalProduct);
}
开发者ID:nja78,项目名称:magento2,代码行数:21,代码来源:AssertBundlePriceType.php
示例15: 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
示例16: processAssert
/**
* Assert that created CMS page with 'Status' - Disabled displays with '404 Not Found' message on Frontend.
*
* @param CmsPage $cms
* @param FrontCmsIndex $frontCmsIndex
* @param CmsPageIndex $cmsIndex
* @param BrowserInterface $browser
* @return void
*/
public function processAssert(CmsPage $cms, FrontCmsIndex $frontCmsIndex, CmsPageIndex $cmsIndex, BrowserInterface $browser)
{
$cmsIndex->open();
$filter = ['title' => $cms->getTitle()];
$cmsIndex->getCmsPageGridBlock()->searchAndPreview($filter);
$browser->selectWindow();
\PHPUnit_Framework_Assert::assertEquals(self::NOT_FOUND_MESSAGE, $frontCmsIndex->getTitleBlock()->getTitle(), 'Wrong page is displayed.');
}
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:17,代码来源:AssertCmsPageDisabledOnFrontend.php
示例17: processAssert
/**
* Assert that product review Not available on product page
*
* @param CatalogProductView $catalogProductView
* @param Review $reviewInitial
* @param BrowserInterface $browser
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, Review $reviewInitial, BrowserInterface $browser)
{
/** @var CatalogProductSimple $product */
$product = $reviewInitial->getDataFieldConfig('entity_id')['source']->getEntity();
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$reviewBlock = $catalogProductView->getCustomerReviewBlock();
$catalogProductView->getViewBlock()->selectTab('Reviews');
\PHPUnit_Framework_Assert::assertFalse($reviewBlock->isVisibleReviewItem(), 'Error, product review is displayed.');
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:17,代码来源:AssertProductReviewNotOnProductPage.php
示例18: 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.");
}
开发者ID:QiuLihua83,项目名称:magento-ee,代码行数:20,代码来源:AssertGiftRegistryActiveInShoppingCart.php
示例19: processAssert
/**
* Assert that deleted configurable attributes are absent on product page on frontend.
*
* @param CatalogProductAttribute[] $deletedProductAttributes
* @param BrowserInterface $browser
* @param CatalogProductView $catalogProductView
* @param ConfigurableProduct $product
* @return void
*/
public function processAssert(array $deletedProductAttributes, BrowserInterface $browser, CatalogProductView $catalogProductView, ConfigurableProduct $product)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$pageOptions = $catalogProductView->getViewBlock()->getOptions($product)['configurable_options'];
foreach ($deletedProductAttributes as $attribute) {
$attributeLabel = $attribute->getFrontendLabel();
\PHPUnit_Framework_Assert::assertFalse(isset($pageOptions[$attributeLabel]), "Configurable attribute '{$attributeLabel}' found on product page on frontend.");
}
}
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:18,代码来源:AssertConfigurableAttributesAbsentOnProductPage.php
示例20: processAssert
/**
* Assert Sample block for downloadable product on front-end
*
* @param CatalogProductView $productView
* @param DownloadableProduct $product
* @param BrowserInterface $browser
* @return void
*/
public function processAssert(CatalogProductView $productView, DownloadableProduct $product, BrowserInterface $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:kidaa30,项目名称:magento2-platformsh,代码行数:17,代码来源:AssertDownloadableSamplesData.php
注:本文中的Magento\Mtf\Client\BrowserInterface类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论