本文整理汇总了PHP中mage\cms\test\page\CmsIndex::open方法的典型用法代码示例。如果您正苦于以下问题:PHP CmsIndex::open方法的具体用法?PHP CmsIndex::open怎么用?PHP CmsIndex::open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mage\cms\test\page\CmsIndex
的用法示例。
在下文中一共展示了CmsIndex::open方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Login customer.
*
* @return void
*/
public function run()
{
$this->cmsIndex->open();
$this->cmsIndex->getTopLinksBlock()->openAccount();
if ($this->cmsIndex->getLinksBlock()->isLinkVisible("Log Out")) {
$this->cmsIndex->getLinksBlock()->openLink("Log Out");
$this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page');
$this->cmsIndex->getTopLinksBlock()->openAccount();
}
$this->cmsIndex->getLinksBlock()->openLink("Log In");
$this->customerAccountLogin->getLoginBlock()->login($this->customer);
}
示例2: processAssert
/**
* Assert that event block is absent on category/product pages.
*
* @param CmsIndex $cmsIndex
* @param CatalogCategoryView $catalogCategoryView
* @param CatalogProductSimple $product
* @param CatalogProductView $catalogProductView
* @param Cache $adminCache
* @return void
*/
public function processAssert(CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, CatalogProductSimple $product, CatalogProductView $catalogProductView, Cache $adminCache)
{
// Flush cache
$adminCache->open();
$adminCache->getPageActions()->flushCacheStorage();
$adminCache->getMessagesBlock()->waitSuccessMessage();
$categoryName = $product->getCategoryIds()[0];
$cmsIndex->open();
$cmsIndex->getTopmenu()->selectCategory($categoryName);
\PHPUnit_Framework_Assert::assertFalse($catalogCategoryView->getEventBlock()->isVisible(), "Event block is present on Category page.");
$cmsIndex->open();
$cmsIndex->getTopmenu()->selectCategory($categoryName);
$catalogCategoryView->getListProductBlock()->openProductViewPage($product->getName());
\PHPUnit_Framework_Assert::assertFalse($catalogProductView->getEventBlock()->isVisible(), "Event block is present on Product page.");
}
示例3: isNotDisplayingOnFrontendAssert
/**
* Verify product displaying on frontend.
*
* @param InjectableFixture $product
* @return array
*/
protected function isNotDisplayingOnFrontendAssert(InjectableFixture $product)
{
$errors = [];
//Check that product is not available by url
$this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
if ($this->catalogProductView->getViewBlock()->isVisible()) {
$errors[] = '- product view block is visible in product page.';
}
//Check that product can't be found
$this->cmsIndex->open()->getSearchBlock()->search($product->getSku());
if ($this->catalogSearchResult->getListProductBlock()->isProductVisible($product)) {
$errors[] = '- successful product search.';
}
//Check that product is not available in category page
$categoryName = $product->hasData('category_ids') ? $product->getCategoryIds()[0] : $this->category->getName();
$this->cmsIndex->open()->getTopmenu()->selectCategory($categoryName);
$isProductVisible = $this->catalogCategoryView->getListProductBlock()->isProductVisible($product);
$bottomToolBar = $this->catalogCategoryView->getBottomToolbar();
while (!$isProductVisible && $bottomToolBar->nextPage()) {
$isProductVisible = $this->catalogCategoryView->getListProductBlock()->isProductVisible($product);
}
if ($isProductVisible) {
$errors[] = "- product with name '{$product->getName()}' is found in this category.";
}
return $errors;
}
示例4: processAssert
/**
* Assert that Wishlist can't be find by another Customer (or guest) via "Wishlist Search".
*
* @param CustomerAccountLogout $customerAccountLogout
* @param CmsIndex $cmsIndex
* @param CatalogCategoryView $catalogCategoryView
* @param SearchResult $searchResult
* @param CatalogCategory $category
* @param Customer $customer
* @param Wishlist $wishlist
* @return void
*/
public function processAssert(CustomerAccountLogout $customerAccountLogout, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, SearchResult $searchResult, CatalogCategory $category, Customer $customer, Wishlist $wishlist)
{
$customerAccountLogout->open();
$cmsIndex->open()->getTopmenu()->selectCategory($category->getName());
$catalogCategoryView->getWishlistSearchBlock()->searchByCustomer($customer);
\PHPUnit_Framework_Assert::assertFalse($searchResult->getWishlistSearchResultBlock()->isWishlistVisibleInGrid($wishlist), "Multiple wishlist is visible on wishlist search result page.");
}
示例5: processAssert
/**
* Assert that products' MAP has been applied before checkout.
*
* @param CatalogCategory $category
* @param Customer $customer
* @param Address $address
* @param CatalogCategoryView $catalogCategoryView
* @param CmsIndex $cmsIndex
* @param CatalogProductView $catalogProductView
* @param CheckoutCart $cart
* @param CheckoutOnepage $checkoutOnePage
* @param array $products
* @return void
*/
public function processAssert(CatalogCategory $category, Customer $customer, Address $address, CatalogCategoryView $catalogCategoryView, CmsIndex $cmsIndex, CatalogProductView $catalogProductView, CheckoutCart $cart, CheckoutOnepage $checkoutOnePage, array $products)
{
for ($i = 0; $i < count($products); $i++) {
$cart->getCartBlock()->clearShoppingCart();
$productName = $products[$i]->getName();
$cmsIndex->open();
$cmsIndex->getTopmenu()->selectCategory($category->getName());
// Check that price is not present on category page.
$listProductBlock = $catalogCategoryView->getListProductBlock();
$productPriceBlock = $listProductBlock->getProductPriceBlock($productName);
$productPriceBlock->clickForPrice();
\PHPUnit_Framework_Assert::assertFalse($productPriceBlock->getMapBlock()->isPriceVisible(), 'Price is present in MSRP dialog on category page.');
// Check that price is not present on product page.
$listProductBlock->openProductViewPage($productName);
\PHPUnit_Framework_Assert::assertFalse($catalogProductView->getViewBlock()->getPriceBlock()->isRegularPriceVisible(), 'Price is present in View block on product page.');
// Check that price is not present on cart.
$catalogProductView->getViewBlock()->addToCart($products[$i]);
\PHPUnit_Framework_Assert::assertTrue($cart->getCartBlock()->getCartItem($products[$i])->isMsrpVisible(), "MSRP link is not visible in cart.");
// Check that price is present on review block in onepage checkout page.
$cart->getCartBlock()->getProceedToCheckoutBlock()->proceedToCheckout();
$checkoutMethodBlock = $checkoutOnePage->getLoginBlock();
$billingBlock = $checkoutOnePage->getBillingBlock();
$paymentMethodBlock = $checkoutOnePage->getPaymentMethodsBlock();
$shippingBlock = $checkoutOnePage->getShippingMethodBlock();
$checkoutMethodBlock->guestCheckout();
$checkoutMethodBlock->clickContinue();
$billingBlock->fillBilling($address, $customer);
$billingBlock->clickContinue();
$shippingBlock->selectShippingMethod(['shipping_service' => 'Flat Rate', 'shipping_method' => 'Fixed']);
$shippingBlock->clickContinue();
$paymentMethodBlock->selectPaymentMethod(['method' => 'checkmo']);
$paymentMethodBlock->clickContinue();
\PHPUnit_Framework_Assert::assertEquals(number_format($products[$i]->getPrice(), 2), $checkoutOnePage->getReviewBlock()->getTotalBlock()->getData('subtotal'), "Subtotal in checkout one page for {$productName} is not equal to expected.");
}
}
示例6: 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.');
}
示例7: test
/**
* Run create existing customer account on frontend test.
*
* @param Customer $customer
* @return void
*/
public function test(Customer $customer)
{
//Steps
$this->cmsIndex->open();
$this->cmsIndex->getTopLinksBlock()->openAccount();
$this->cmsIndex->getLinksBlock()->openLink('Register');
$this->customerAccountCreate->getRegisterForm()->registerCustomer($customer);
}
示例8: checkEventStatusOnProductPage
/**
* Event block has $this->eventStatus on Product Page.
*
* @return void
*/
protected function checkEventStatusOnProductPage()
{
$categoryName = $this->product->getDatafieldConfig('category_ids')['source']->getProductCategory()->getName();
$this->cmsIndex->open();
$this->cmsIndex->getTopmenu()->selectCategory($categoryName);
$this->catalogCategoryView->getListProductBlock()->openProductViewPage($this->product->getName());
\PHPUnit_Framework_Assert::assertEquals($this->eventStatus, $this->catalogProductView->getEventBlock()->getEventStatus(), 'Wrong event status is displayed.');
}
示例9: processAssert
/**
* Assert that Magento successfully installed.
*
* @param InstallWizardEnd $installWizardEnd
* @param CmsIndex $cmsIndex
* @param string $successInstallMessage
* @return void
*/
public function processAssert(InstallWizardEnd $installWizardEnd, CmsIndex $cmsIndex, $successInstallMessage)
{
// Check InstallWizardEnd page title text.
\PHPUnit_Framework_Assert::assertEquals($successInstallMessage, $installWizardEnd->getMainBlock()->getTitle());
// Check if header block on CmsIndex page is visible.
$cmsIndex->open();
\PHPUnit_Framework_Assert::assertTrue($cmsIndex->getHeaderBlock()->isVisible());
}
示例10: processAssert
/**
* Assert that Catalog Price Rule is applied for product(s) in Catalog
* according to Priority(Priority/Stop Further Rules Processing).
*
* @param InjectableFixture $product
* @param CmsIndex $cmsIndex
* @param CatalogCategoryView $catalogCategoryView
* @param array $prices
* @return void
*/
public function processAssert(InjectableFixture $product, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, array $prices)
{
$cmsIndex->open();
$cmsIndex->getTopmenu()->selectCategory($product->getCategoryIds()[0]);
$formPrices = $this->getFormPrices($product, $catalogCategoryView);
$fixturePrices = $this->prepareFixturePrices($prices);
$diff = $this->verifyData($fixturePrices, $formPrices);
\PHPUnit_Framework_Assert::assertEmpty($diff, $diff . "\n On: " . date('l jS \\of F Y h:i:s A'));
}
示例11: processAssert
/**
* Assert that Catalog Price Rule is applied for product(s) in Shopping Cart
* according to Priority(Priority/Stop Further Rules Processing).
*
* @param InjectableFixture $product
* @param CatalogProductView $pageCatalogProductView
* @param CmsIndex $cmsIndex
* @param CatalogCategoryView $catalogCategoryView
* @param CheckoutCart $pageCheckoutCart
* @param array $prices
* @return void
*/
public function processAssert(InjectableFixture $product, CatalogProductView $pageCatalogProductView, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, CheckoutCart $pageCheckoutCart, array $prices)
{
$cmsIndex->open();
$cmsIndex->getTopmenu()->selectCategory($product->getCategoryIds()[0]);
$catalogCategoryView->getListProductBlock()->openProductViewPage($product->getName());
$pageCatalogProductView->getViewBlock()->addToCart($product);
$actualGrandTotal = $pageCheckoutCart->getCartBlock()->getCartItem($product)->getCartItemTypePrice('price');
\PHPUnit_Framework_Assert::assertEquals($prices['grand_total'], $actualGrandTotal);
}
示例12: processAssert
/**
* Check that after input some text(e.g. product name) into search field, drop-down window is appeared.
* Window contains requested entity and number of quantity.
*
* @param CmsIndex $cmsIndex
* @param CatalogSearchQuery $catalogSearch
* @return void
*/
public function processAssert(CmsIndex $cmsIndex, CatalogSearchQuery $catalogSearch)
{
$cmsIndex->open();
$searchBlock = $cmsIndex->getSearchBlock();
$queryText = $catalogSearch->getQueryText();
$searchBlock->fillSearch($queryText);
$isVisible = $catalogSearch->hasData('num_results') ? $searchBlock->isSuggestSearchVisible($queryText, $catalogSearch->getNumResults()) : $searchBlock->isSuggestSearchVisible($queryText);
\PHPUnit_Framework_Assert::assertTrue($isVisible, 'Block "Suggest Search" when searching was not found.');
}
示例13: processAssert
/**
* Assert that product is absent in the category page.
*
* @param CatalogCategoryView $catalogCategoryView
* @param CmsIndex $cmsIndex
* @param InjectableFixture $product
* @param CatalogCategory $category
* @return void
*/
public function processAssert(CatalogCategoryView $catalogCategoryView, CmsIndex $cmsIndex, InjectableFixture $product, CatalogCategory $category)
{
$cmsIndex->open();
$cmsIndex->getTopmenu()->selectCategory($category->getName());
$isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product);
while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) {
$isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product);
}
\PHPUnit_Framework_Assert::assertFalse($isProductVisible, 'Product is present on category page.');
}
示例14: processAssert
/**
* Assert that created CMS block displayed on frontend category page (in order to assign block to category:
* go to category page> Display settings> CMS Block).
*
* @param CmsIndex $cmsIndex
* @param CmsBlock $cmsBlock
* @param CatalogCategoryView $catalogCategoryView
* @param FixtureFactory $fixtureFactory
* @return void
*/
public function processAssert(CmsIndex $cmsIndex, CmsBlock $cmsBlock, CatalogCategoryView $catalogCategoryView, FixtureFactory $fixtureFactory)
{
$category = $fixtureFactory->createByCode('catalogCategory', ['dataSet' => 'default_subcategory', 'data' => ['display_mode' => 'Static block and products', 'landing_page' => $cmsBlock->getTitle()]]);
$category->persist();
$cmsIndex->open();
$cmsIndex->getTopmenu()->selectCategory($category->getName());
$categoryViewContent = $catalogCategoryView->getViewBlock()->getText();
$cmsBlockContent = explode("\n", $categoryViewContent);
\PHPUnit_Framework_Assert::assertContains($cmsBlock->getContent(), $cmsBlockContent);
}
示例15: checkEventBlockOnPage
/**
* Check event block on visibility on specified page.
*
* @param string $page
* @param bool $positive [optional]
* @return void
*/
protected function checkEventBlockOnPage($page, $positive = true)
{
$this->cmsIndex->open();
$this->cmsIndex->getTopmenu()->selectCategory($this->categoryName);
if ($page == 'product_page') {
$this->catalogCategoryView->getListProductBlock()->openProductViewPage($this->productName);
}
$eventBlockVisibility = $this->catalogProductView->getEventBlock()->isVisible();
$positive == true ? \PHPUnit_Framework_Assert::assertTrue($eventBlockVisibility, "EventBlock is absent on {$page} page.") : \PHPUnit_Framework_Assert::assertFalse($eventBlockVisibility, "EventBlock is present on {$page} page.");
}