當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CmsIndex::getCmsPageBlock方法代碼示例

本文整理匯總了PHP中Magento\Cms\Test\Page\CmsIndex::getCmsPageBlock方法的典型用法代碼示例。如果您正苦於以下問題:PHP CmsIndex::getCmsPageBlock方法的具體用法?PHP CmsIndex::getCmsPageBlock怎麽用?PHP CmsIndex::getCmsPageBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Cms\Test\Page\CmsIndex的用法示例。


在下文中一共展示了CmsIndex::getCmsPageBlock方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: run

 /**
  * Login customer.
  *
  * @return void
  */
 public function run()
 {
     $this->logoutCustomerOnFrontend->run();
     $this->cmsIndex->getLinksBlock()->openLink('Sign In');
     $this->cmsIndex->getCmsPageBlock()->waitPageInit();
     $this->customerAccountLogin->getLoginBlock()->login($this->customer);
     $this->cmsIndex->getCmsPageBlock()->waitPageInit();
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:13,代碼來源:LoginCustomerOnFrontendStep.php

示例2: run

 /**
  * Logout customer
  *
  * @return void
  */
 public function run()
 {
     $this->cmsIndex->open();
     $this->cmsIndex->getCmsPageBlock()->waitPageInit();
     if ($this->cmsIndex->getLinksBlock()->isLinkVisible("Log Out")) {
         $this->cmsIndex->getLinksBlock()->openLink("Log Out");
         $this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page');
     }
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:14,代碼來源:LogoutCustomerOnFrontendStep.php

示例3: processAssert

 /**
  * Assert that customer success log out.
  *
  * @param CustomerAccountIndex $customerAccountIndex
  * @param CmsIndex $cmsIndex
  * @return void
  */
 public function processAssert(CustomerAccountIndex $customerAccountIndex, CmsIndex $cmsIndex)
 {
     $customerAccountIndex->open();
     $cmsIndex->getCmsPageBlock()->waitPageInit();
     $cmsIndex->getLinksBlock()->openLink('Sign Out');
     $cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible(self::LOGOUT_PAGE_TITLE);
     $cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible(self::HOME_PAGE_TITLE);
     $cmsIndex->getCmsPageBlock()->waitPageInit();
     \PHPUnit_Framework_Assert::assertTrue($cmsIndex->getLinksBlock()->isLinkVisible('Sign In'), "Customer wasn't logged out.");
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:17,代碼來源:AssertCustomerLogout.php

示例4: run

 /**
  * Logout customer.
  *
  * @return void
  */
 public function run()
 {
     $this->customerAccount->open();
     $this->cmsIndex->getCmsPageBlock()->waitPageInit();
     if ($this->cmsIndex->getTitleBlock()->getTitle() != 'Customer Login') {
         $this->cmsIndex->getLinksBlock()->openLink('Sign Out');
         $this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page');
         $this->cmsIndex->getCmsPageBlock()->waitPageInit();
     }
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:15,代碼來源:LogoutCustomerOnFrontendStep.php

示例5: run

 /**
  * Login customer.
  *
  * @return void
  */
 public function run()
 {
     $this->cmsIndex->open();
     $this->cmsIndex->getCmsPageBlock()->waitPageInit();
     if ($this->cmsIndex->getLinksBlock()->isLinkVisible("Log Out")) {
         $this->cmsIndex->getLinksBlock()->openLink("Log Out");
         $this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page');
     }
     $this->cmsIndex->getLinksBlock()->openLink("Log In");
     $this->customerAccountLogin->getLoginBlock()->login($this->customer);
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:16,代碼來源:LoginCustomerOnFrontendStep.php

示例6: processAssert

 /**
  * Assert that prices on order review and customer order pages are equal to specified in dataset.
  *
  * @param array $prices
  * @param InjectableFixture $product
  * @param CheckoutCart $checkoutCart
  * @param CheckoutOnepage $checkoutOnepage
  * @param CheckoutOnepageSuccess $checkoutOnepageSuccess
  * @param CustomerOrderView $customerOrderView
  * @param CmsIndex $cmsIndex
  * @return void
  */
 public function processAssert(array $prices, InjectableFixture $product, CheckoutCart $checkoutCart, CheckoutOnepage $checkoutOnepage, CheckoutOnepageSuccess $checkoutOnepageSuccess, CustomerOrderView $customerOrderView, CmsIndex $cmsIndex)
 {
     $this->checkoutOnepage = $checkoutOnepage;
     $this->customerOrderView = $customerOrderView;
     $checkoutCart->getProceedToCheckoutBlock()->proceedToCheckout();
     $cmsIndex->getCmsPageBlock()->waitPageInit();
     $shippingMethod = ['shipping_service' => 'Flat Rate', 'shipping_method' => 'Fixed'];
     $checkoutOnepage->getShippingMethodBlock()->selectShippingMethod($shippingMethod);
     $checkoutOnepage->getShippingMethodBlock()->clickContinue();
     $checkoutOnepage->getPaymentBlock()->selectPaymentMethod(['method' => 'checkmo']);
     $actualPrices = [];
     $actualPrices = $this->getReviewPrices($actualPrices, $product);
     $actualPrices = $this->getReviewTotals($actualPrices);
     $prices = $this->preparePrices($prices);
     //Order review prices verification
     $message = 'Prices on order review should be equal to defined in dataset.';
     \PHPUnit_Framework_Assert::assertEquals(array_diff_key($prices, ['cart_item_price_excl_tax' => null, 'cart_item_price_incl_tax' => null]), $actualPrices, $message);
     $checkoutOnepage->getPaymentBlock()->placeOrder();
     $checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId();
     $checkoutOnepageSuccess->getSuccessBlock()->openOrder();
     $actualPrices = [];
     $actualPrices = $this->getOrderPrices($actualPrices, $product);
     $actualPrices = $this->getOrderTotals($actualPrices);
     //Frontend order prices verification
     $message = 'Prices on order view page should be equal to defined in dataset.';
     \PHPUnit_Framework_Assert::assertEquals($prices, $actualPrices, $message);
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:39,代碼來源:AbstractAssertTaxCalculationAfterCheckout.php

示例7: processAssert

 /**
  * Add created variable to page and assert that Custom Variable is displayed on frontend page and has
  * correct data according to dataset.
  *
  * @param SystemVariable $customVariable
  * @param CmsIndex $cmsIndex
  * @param SystemVariable $variable
  * @param FixtureFactory $fixtureFactory
  * @param BrowserInterface $browser
  * @param Store $storeOrigin
  * @param SystemVariable $customVariableOrigin
  * @return void
  */
 public function processAssert(SystemVariable $customVariable, CmsIndex $cmsIndex, SystemVariable $variable, FixtureFactory $fixtureFactory, BrowserInterface $browser, Store $storeOrigin = null, SystemVariable $customVariableOrigin = null)
 {
     $cmsPage = $fixtureFactory->createByCode('cmsPage', ['dataset' => 'default', 'data' => ['content' => ['content' => '{{customVar code=' . $customVariable->getCode() . '}}']]]);
     $cmsPage->persist();
     $browser->open($_ENV['app_frontend_url'] . $cmsPage->getIdentifier());
     $cmsIndex->getStoreSwitcherBlock()->selectStoreView('Default Store View');
     $htmlValue = $customVariableOrigin ? $this->getHtmlValue($customVariable, $customVariableOrigin) : strip_tags($customVariable->getHtmlValue());
     $pageContent = $cmsIndex->getCmsPageBlock()->getPageContent();
     $this->checkVariable($htmlValue, $pageContent);
     if ($storeOrigin !== null) {
         $cmsIndex->getStoreSwitcherBlock()->selectStoreView($storeOrigin->getName());
         $htmlValue = strip_tags($customVariable->getHtmlValue());
         if ($htmlValue === '') {
             $htmlValue = strip_tags($variable->getHtmlValue());
         }
         $pageContent = $cmsIndex->getCmsPageBlock()->getPageContent();
         $this->checkVariable($htmlValue, $pageContent);
     }
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:32,代碼來源:AssertCustomVariableInPage.php

示例8: test

 /**
  * Share wish list.
  *
  * @param Customer $customer
  * @param CatalogProductSimple $product
  * @param array $sharingInfo
  * @return void
  */
 public function test(Customer $customer, CatalogProductSimple $product, array $sharingInfo)
 {
     //Steps
     $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     $this->objectManager->create('Magento\\Wishlist\\Test\\TestStep\\AddProductsToWishlistStep', ['products' => [$product]])->run();
     $this->wishlistIndex->getMessagesBlock()->waitSuccessMessage();
     $this->wishlistIndex->getWishlistBlock()->clickShareWishList();
     $this->cmsIndex->getCmsPageBlock()->waitPageInit();
     $this->wishlistShare->getSharingInfoForm()->fillForm($sharingInfo);
     $this->wishlistShare->getSharingInfoForm()->shareWishlist();
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:19,代碼來源:ShareWishlistEntityTest.php

示例9: test

 /**
  * Share wish list
  *
  * @param BrowserInterface $browser
  * @param Customer $customer
  * @param CatalogProductSimple $product
  * @param array $sharingInfo
  * @return void
  */
 public function test(BrowserInterface $browser, Customer $customer, CatalogProductSimple $product, array $sharingInfo)
 {
     //Steps
     $this->loginCustomer($customer);
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $this->catalogProductView->getViewBlock()->clickAddToWishlist();
     $this->wishlistIndex->getMessagesBlock()->waitSuccessMessage();
     $this->wishlistIndex->getWishlistBlock()->clickShareWishList();
     $this->cmsIndex->getCmsPageBlock()->waitPageInit();
     $this->wishlistShare->getSharingInfoForm()->fillForm($sharingInfo);
     $this->wishlistShare->getSharingInfoForm()->shareWishlist();
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:21,代碼來源:ShareWishlistEntityTest.php

示例10: test

 /**
  * Run Update Customer Entity test
  *
  * @param Customer $initialCustomer
  * @param Customer $customer
  * @param Address $address
  * @param AssertCustomerInfoSuccessSavedMessage $assertCustomerInfoSuccessSavedMessage
  * @return void
  */
 public function test(Customer $initialCustomer, Customer $customer, Address $address, AssertCustomerInfoSuccessSavedMessage $assertCustomerInfoSuccessSavedMessage)
 {
     // Preconditions
     $initialCustomer->persist();
     // Steps
     $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $initialCustomer])->run();
     $this->customerAccountIndex->getInfoBlock()->openEditContactInfo();
     $this->customerAccountEdit->getAccountInfoForm()->fill($customer);
     $this->customerAccountEdit->getAccountInfoForm()->submit();
     \PHPUnit_Framework_Assert::assertThat($this->getName(), $assertCustomerInfoSuccessSavedMessage);
     $this->cmsIndex->getCmsPageBlock()->waitPageInit();
     $this->customerAccountIndex->getDashboardAddress()->editBillingAddress();
     $this->customerAddressEdit->getEditForm()->fill($address);
     $this->customerAddressEdit->getEditForm()->saveAddress();
 }
開發者ID:koliaGI,項目名稱:magento2,代碼行數:24,代碼來源:UpdateCustomerFrontendEntityTest.php

示例11: processAssert

 /**
  * Assert that created widget displayed on frontent on Home page and on Advanced Search and
  * after click on widget link on frontend system redirects you to cms page.
  *
  * @param CmsIndex $cmsIndex
  * @param Widget $widget
  * @param AdminCache $adminCache
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, Widget $widget, AdminCache $adminCache)
 {
     // Flush cache
     $adminCache->open();
     $adminCache->getActionsBlock()->flushMagentoCache();
     $adminCache->getMessagesBlock()->waitSuccessMessage();
     $cmsIndex->open();
     $widgetText = $widget->getParameters()['anchor_text'];
     \PHPUnit_Framework_Assert::assertTrue($cmsIndex->getWidgetView()->isWidgetVisible($widget, $widgetText), 'Widget with type CmsPageLink is absent on Home page.');
     $title = isset($widget->getParameters()['node']) ? $widget->getParameters()['entities'][0]->getLabel() : $widget->getParameters()['entities'][0]->getContentHeading();
     $cmsIndex->getWidgetView()->clickToWidget($widget, $widgetText);
     $pageTitle = $cmsIndex->getCmsPageBlock()->getPageTitle();
     \PHPUnit_Framework_Assert::assertEquals($title, $pageTitle, 'Wrong page title on Cms page.');
     $cmsIndex->getFooterBlock()->openAdvancedSearch();
     \PHPUnit_Framework_Assert::assertTrue($cmsIndex->getWidgetView()->isWidgetVisible($widget, $widgetText), 'Widget with type CmsPageLink is absent on Advanced Search page.');
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:25,代碼來源:AssertWidgetCmsPageLink.php

示例12: processAssert

 /**
  * Assert that prices on order review and customer order pages are equal to specified in dataset.
  *
  * @param array $prices
  * @param InjectableFixture $product
  * @param CheckoutCart $checkoutCart
  * @param CheckoutOnepage $checkoutOnepage
  * @param CheckoutOnepageSuccess $checkoutOnepageSuccess
  * @param CustomerOrderView $customerOrderView
  * @return void
  */
 public function processAssert(array $prices, InjectableFixture $product, CheckoutCart $checkoutCart, CheckoutOnepage $checkoutOnepage, CheckoutOnepageSuccess $checkoutOnepageSuccess, CustomerOrderView $customerOrderView, CmsIndex $cmsIndex)
 {
     $this->checkoutOnepage = $checkoutOnepage;
     $this->customerOrderView = $customerOrderView;
     $checkoutCart->getProceedToCheckoutBlock()->proceedToCheckout();
     $cmsIndex->getCmsPageBlock()->waitPageInit();
     $checkoutOnepage->getPaymentBlock()->selectPaymentMethod(['method' => 'checkmo']);
     $actualPrices = [];
     $actualPrices = $this->getReviewPrices($actualPrices, $product);
     $actualPrices = $this->getReviewTotals($actualPrices);
     $prices = $this->preparePrices($prices);
     //Order review prices verification
     $message = 'Prices on order review should be equal to defined in dataset.';
     \PHPUnit_Framework_Assert::assertEquals($prices, array_filter($actualPrices), $message);
     $checkoutOnepage->getPaymentBlock()->placeOrder();
     $checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId();
     $checkoutOnepageSuccess->getSuccessBlock()->openOrder();
     $actualPrices = [];
     $actualPrices = $this->getOrderPrices($actualPrices, $product);
     $actualPrices = $this->getOrderTotals($actualPrices);
     //Frontend order prices verification
     $message = 'Prices on order view page should be equal to defined in dataset.';
     \PHPUnit_Framework_Assert::assertEquals($prices, array_filter($actualPrices), $message);
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:35,代碼來源:AbstractAssertTaxCalculationAfterCheckoutDownloadable.php

示例13: processAssert

 /**
  * Assert wish list is empty
  *
  * @param CmsIndex $cmsIndex
  * @param WishlistIndex $wishlistIndex
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, WishlistIndex $wishlistIndex)
 {
     $cmsIndex->getCmsPageBlock()->waitPageInit();
     $cmsIndex->getLinksBlock()->openLink("My Wish List");
     \PHPUnit_Framework_Assert::assertTrue($wishlistIndex->getWishlistBlock()->isEmptyBlockVisible(), 'Wish List is not empty.');
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:13,代碼來源:AssertWishlistIsEmpty.php


注:本文中的Magento\Cms\Test\Page\CmsIndex::getCmsPageBlock方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。