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


PHP CmsIndex::getLinksBlock方法代碼示例

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


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

示例1: testCreateCustomer

 /**
  * Create Customer account on frontend
  *
  * @param CustomerInjectable $customer
  */
 public function testCreateCustomer(CustomerInjectable $customer)
 {
     //Steps
     $this->cmsIndex->open();
     $this->cmsIndex->getLinksBlock()->openLink('Register');
     $this->customerAccountCreate->getRegisterForm()->registerCustomer($customer);
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:12,代碼來源:CreateCustomerFrontendEntityTest.php

示例2: test

 /**
  * Create Customer account on Storefront.
  *
  * @param Customer $customer
  * @return void
  */
 public function test(Customer $customer)
 {
     // Steps
     $this->cmsIndex->open();
     $this->cmsIndex->getLinksBlock()->openLink('Create an Account');
     $this->customerAccountCreate->getRegisterForm()->registerCustomer($customer);
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:13,代碼來源:RegisterCustomerFrontendEntityTest.php

示例3: processAssert

 /**
  * Assert that link "Compare Products..." on top menu of page
  *
  * @param array $products
  * @param CmsIndex $cmsIndex
  * @return void
  */
 public function processAssert(array $products, CmsIndex $cmsIndex)
 {
     $productQty = count($products);
     $qtyOnPage = $cmsIndex->getLinksBlock()->getQtyInCompareList();
     \PHPUnit_Framework_Assert::assertEquals($productQty, $qtyOnPage, 'Qty is not correct in "Compare Products" link.');
     $compareProductUrl = '/catalog/product_compare/';
     \PHPUnit_Framework_Assert::assertTrue(strpos($cmsIndex->getLinksBlock()->getLinkUrl('Compare Products'), $compareProductUrl) !== false, 'Compare product link isn\'t lead to Compare Product Page.');
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:15,代碼來源:AssertProductCompareItemsLink.php

示例4: loginCustomerAndOpenOrderPage

 /**
  * Login customer and open Order page.
  *
  * @param Customer $customer
  * @return void
  */
 protected function loginCustomerAndOpenOrderPage(Customer $customer)
 {
     $this->cmsIndex->open();
     $loginCustomerOnFrontendStep = $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer]);
     $loginCustomerOnFrontendStep->run();
     $this->cmsIndex->getLinksBlock()->openLink('My Account');
     $this->customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Orders');
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:14,代碼來源:AbstractAssertOrderOnFrontend.php

示例5: 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

示例6: 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

示例7: testCreateExistingCustomer

 /**
  * Create Existing Customer account on frontend.
  *
  * @param Customer $customer
  * @return void
  */
 public function testCreateExistingCustomer(Customer $customer)
 {
     // Precondition
     $existingCustomer = clone $customer;
     $customer->persist();
     // Steps
     $this->cmsIndex->open();
     $this->cmsIndex->getLinksBlock()->openLink('Create an Account');
     $this->customerAccountCreate->getRegisterForm()->registerCustomer($existingCustomer);
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:16,代碼來源:CreateExistingCustomerFrontendEntity.php

示例8: 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

示例9: 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

示例10: 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

示例11: processAssert

 /**
  * Assert that category name is different on different store view.
  *
  * @param BrowserInterface $browser
  * @param CatalogCategoryView $categoryView
  * @param Category $category
  * @param Category $initialCategory
  * @param CmsIndex $cmsIndex
  * @return void
  */
 public function processAssert(BrowserInterface $browser, CatalogCategoryView $categoryView, Category $category, Category $initialCategory, CmsIndex $cmsIndex)
 {
     $cmsIndex->open();
     $cmsIndex->getLinksBlock()->waitWelcomeMessage();
     $browser->open($_ENV['app_frontend_url'] . $initialCategory->getUrlKey() . '.html');
     \PHPUnit_Framework_Assert::assertEquals($initialCategory->getName(), $categoryView->getTitleBlock()->getTitle(), 'Wrong category name is displayed for default store.');
     $store = $category->getDataFieldConfig('store_id')['source']->store->getName();
     $cmsIndex->getStoreSwitcherBlock()->selectStoreView($store);
     $cmsIndex->getLinksBlock()->waitWelcomeMessage();
     $browser->open($_ENV['app_frontend_url'] . $initialCategory->getUrlKey() . '.html');
     \PHPUnit_Framework_Assert::assertEquals($category->getName(), $categoryView->getTitleBlock()->getTitle(), 'Wrong category name is displayed for ' . $store);
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:22,代碼來源:AssertCategoryWithCustomStoreOnFrontend.php

示例12: test

 /**
  * Runs Delete Customer Address test.
  *
  * @param Customer $customer
  * @return array
  */
 public function test(Customer $customer)
 {
     $this->markTestIncomplete('Bug: MAGETWO-34634');
     // Precondition:
     $customer->persist();
     $addressToDelete = $customer->getDataFieldConfig('address')['source']->getAddresses()[1];
     // Steps:
     $this->cmsIndex->open();
     $this->cmsIndex->getLinksBlock()->openLink("Log In");
     $this->customerAccountLogin->getLoginBlock()->login($customer);
     $this->customerAccountIndex->getAccountMenuBlock()->openMenuItem('Address Book');
     $this->customerAccountIndex->getAdditionalAddressBlock()->deleteAdditionalAddress($addressToDelete);
     return ['deletedAddress' => $addressToDelete];
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:20,代碼來源:DeleteCustomerAddressTest.php

示例13: loginCustomer

 /**
  * Login customer.
  *
  * @return void
  */
 protected function loginCustomer()
 {
     if (!$this->cmsIndex->getLinksBlock()->isLinkVisible('Log Out')) {
         $this->cmsIndex->getLinksBlock()->openLink("Log In");
         $this->customerAccountLogin->getLoginBlock()->login($this->customer);
     }
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:12,代碼來源:AbstractCompareProductsTest.php

示例14: loginCustomer

 /**
  * Login customer
  *
  * @param CustomerInjectable $customer
  * @return void
  */
 protected function loginCustomer(CustomerInjectable $customer)
 {
     $this->cmsIndex->open();
     if (!$this->cmsIndex->getLinksBlock()->isLinkVisible('Log Out')) {
         $this->cmsIndex->getLinksBlock()->openLink('Log In');
         $this->customerAccountLogin->getLoginBlock()->login($customer);
     }
 }
開發者ID:buskamuza,項目名稱:magento2-skeleton,代碼行數:14,代碼來源:DeleteProductFromCustomerWishlistOnBackendTest.php

示例15: processAssert

 /**
  * Assert that product is not present in Wishlist on Frontend
  *
  * @param CustomerAccountIndex $customerAccountIndex
  * @param WishlistIndex $wishlistIndex
  * @param InjectableFixture $product
  * @param CustomerInjectable $customer
  * @param CmsIndex $cmsIndex
  * @param CustomerAccountLogin $customerAccountLogin
  * @param CustomerAccountLogout $customerAccountLogout
  * @return void
  */
 public function processAssert(CustomerAccountIndex $customerAccountIndex, WishlistIndex $wishlistIndex, InjectableFixture $product, CustomerInjectable $customer, CmsIndex $cmsIndex, CustomerAccountLogin $customerAccountLogin, CustomerAccountLogout $customerAccountLogout)
 {
     $productName = $product->getName();
     $customerAccountLogout->open();
     $cmsIndex->getLinksBlock()->openLink('Log In');
     $customerAccountLogin->getLoginBlock()->login($customer);
     $customerAccountIndex->open()->getAccountMenuBlock()->openMenuItem("My Wish List");
     \PHPUnit_Framework_Assert::assertFalse($wishlistIndex->getWishlistBlock()->getProductItemsBlock()->isProductPresent($productName), 'Product \'' . $productName . '\' is present in Wishlist on Frontend.');
 }
開發者ID:buskamuza,項目名稱:magento2-skeleton,代碼行數:21,代碼來源:AssertProductIsAbsentInWishlist.php


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