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


PHP CmsIndex::open方法代码示例

本文整理汇总了PHP中Magento\Cms\Test\Page\CmsIndex::open方法的典型用法代码示例。如果您正苦于以下问题:PHP CmsIndex::open方法的具体用法?PHP CmsIndex::open怎么用?PHP CmsIndex::open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Cms\Test\Page\CmsIndex的用法示例。


在下文中一共展示了CmsIndex::open方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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: 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

示例4: checkRecentlyViewedBlockOnCategory

 /**
  * Check that block Recently Viewed contains product on category page
  *
  * @param CatalogProductSimple $productSimple
  * @param Category $category
  * @return void
  */
 protected function checkRecentlyViewedBlockOnCategory(CatalogProductSimple $productSimple, Category $category)
 {
     $this->cmsIndex->open();
     $this->cmsIndex->getTopmenu()->selectCategoryByName($category->getName());
     $products = $this->catalogCategoryView->getViewBlock()->getProductsFromRecentlyViewedBlock();
     \PHPUnit_Framework_Assert::assertTrue(in_array($productSimple->getName(), $products), 'Product' . $productSimple->getName() . ' is absent on Recently Viewed block on Category page.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:14,代码来源:AssertWidgetRecentlyViewedProducts.php

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

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

 /**
  * Search Terms Report.
  *
  * @param string $product
  * @param int $countProducts
  * @param int $countSearch
  * @return array
  */
 public function test($product, $countProducts, $countSearch)
 {
     // Preconditions
     $productName = $this->createProducts($product, $countProducts);
     // Steps
     $this->cmsIndex->open();
     $this->searchProducts($productName, $countSearch);
     $this->searchIndex->open();
     return ['productName' => $productName];
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:18,代码来源:SearchTermsReportEntityTest.php

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

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

示例11: addToCardPresentOnProduct

 /**
  * "Add to cart" button is display on Product page
  *
  * @return void
  */
 protected function addToCardPresentOnProduct()
 {
     $this->cmsIndex->open();
     $this->cmsIndex->getTopmenu()->selectCategoryByName($this->product->getCategoryIds()[0]);
     $this->catalogCategoryView->getListProductBlock()->openProductViewPage($this->product->getName());
     \PHPUnit_Framework_Assert::assertTrue($this->catalogProductView->getViewBlock()->checkAddToCardButton(), "Button 'Add to Card' is absent on Product page.");
 }
开发者ID:aiesh,项目名称:magento2,代码行数:12,代码来源:AssertAddToCartButtonPresent.php

示例12: processAssert

 /**
  * Assert that apache redirect works by opening category page and asserting index.php in its url
  *
  * @param Category $category
  * @param CmsIndex $homePage
  * @param BrowserInterface $browser
  */
 public function processAssert(Category $category, CmsIndex $homePage, BrowserInterface $browser)
 {
     $category->persist();
     $homePage->open();
     $homePage->getTopmenu()->selectCategoryByName($category->getName());
     \PHPUnit_Framework_Assert::assertTrue(strpos($browser->getUrl(), 'index.php') === false, 'Apache redirect for category does not work.');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:14,代码来源:AssertRewritesEnabled.php

示例13: isNotDisplayingOnFrontendAssert

 /**
  * Verify product displaying on frontend
  *
  * @param FixtureInterface $product
  * @return array
  */
 protected function isNotDisplayingOnFrontendAssert(FixtureInterface $product)
 {
     $errors = [];
     // Check the product page is not available
     // TODO fix initialization url for frontend page
     $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $titleBlock = $this->catalogProductView->getTitleBlock();
     if ($titleBlock->getTitle() !== self::NOT_FOUND_MESSAGE) {
         $errors[] = '- the headline on the page does not match, the text should be -> "' . self::NOT_FOUND_MESSAGE . '".';
     }
     $this->cmsIndex->open();
     $this->cmsIndex->getSearchBlock()->search($product->getSku());
     if ($this->catalogSearchResult->getListProductBlock()->isProductVisible($product->getName())) {
         $errors[] = '- successful product search.';
     }
     $categoryName = $product->hasData('category_ids') ? $product->getCategoryIds()[0] : $this->category->getName();
     $this->cmsIndex->open();
     $this->cmsIndex->getTopmenu()->selectCategoryByName($categoryName);
     $isProductVisible = $this->catalogCategoryView->getListProductBlock()->isProductVisible($product->getName());
     while (!$isProductVisible && $this->catalogCategoryView->getBottomToolbar()->nextPage()) {
         $isProductVisible = $this->catalogCategoryView->getListProductBlock()->isProductVisible($product->getName());
     }
     if ($isProductVisible) {
         $errors[] = "- product with name '{$product->getName()}' is found in this category.";
     }
     return $errors;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:33,代码来源:AssertProductIsNotDisplayingOnFrontend.php

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

示例15: processAssert

 /**
  * Check whether the attribute filter is displayed on the frontend in Layered navigation.
  *
  * @param CatalogCategoryView $catalogCategoryView
  * @param InjectableFixture $product
  * @param CatalogProductAttribute $attribute
  * @param CmsIndex $cmsIndex
  * @param FixtureFactory $fixtureFactory
  * @return void
  */
 public function processAssert(CatalogCategoryView $catalogCategoryView, InjectableFixture $product, CatalogProductAttribute $attribute, CmsIndex $cmsIndex, FixtureFactory $fixtureFactory)
 {
     $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'product_with_category_with_anchor', 'data' => ['category_ids' => ['presets' => null, 'category' => $product->getDataFieldConfig('category_ids')['source']->getCategories()[0]]]])->persist();
     $cmsIndex->open()->getTopmenu()->selectCategoryByName($product->getCategoryIds()[0]);
     $label = $attribute->hasData('manage_frontend_label') ? $attribute->getManageFrontendLabel() : $attribute->getFrontendLabel();
     \PHPUnit_Framework_Assert::assertTrue(in_array($label, $catalogCategoryView->getLayeredNavigationBlock()->getFilters()), 'Attribute is absent in layered navigation on category page.');
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:17,代码来源:AssertProductAttributeIsFilterable.php


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