当前位置: 首页>>代码示例>>PHP>>正文


PHP CmsIndex::open方法代码示例

本文整理汇总了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);
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:17,代码来源:LoginCustomerOnFrontendStep.php

示例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.");
 }
开发者ID:QiuLihua83,项目名称:magento-ee,代码行数:25,代码来源:AssertCatalogEventBlockIsAbsent.php

示例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;
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:32,代码来源:AssertProductIsNotDisplayingOnFrontend.php

示例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.");
 }
开发者ID:MikeTayC,项目名称:magento.dev,代码行数:19,代码来源:AssertMultipleWishlistIsPrivate.php

示例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.");
     }
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:49,代码来源:AssertProductMapAppliedBeforeCheckout.php

示例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.');
 }
开发者ID:MikeTayC,项目名称:magento.dev,代码行数:14,代码来源:AssertRewritesEnabled.php

示例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);
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:14,代码来源:CreateExistingCustomerFrontendEntity.php

示例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.');
 }
开发者ID:MikeTayC,项目名称:magento.dev,代码行数:13,代码来源:AbstactAssertCatalogEventStatus.php

示例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());
 }
开发者ID:QiuLihua83,项目名称:magento-ee,代码行数:16,代码来源:AssertSuccessInstall.php

示例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'));
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:19,代码来源:AssertCatalogPriceRuleAppliedInCatalogPage.php

示例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);
 }
开发者ID:test3metizsoft,项目名称:test,代码行数:21,代码来源:AssertCatalogPriceRuleAppliedInShoppingCart.php

示例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.');
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:17,代码来源:AssertSuggestSearchingResult.php

示例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.');
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:19,代码来源:AssertProductOutOfStockOnCategory.php

示例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);
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:20,代码来源:AssertCmsBlockOnCategoryPage.php

示例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.");
 }
开发者ID:QiuLihua83,项目名称:magento-ee,代码行数:17,代码来源:AssertCatalogEventBlockOnFrontend.php


注:本文中的mage\cms\test\page\CmsIndex::open方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。