本文整理汇总了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();
}
示例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');
}
}
示例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.");
}
示例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();
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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();
}
示例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();
}
示例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();
}
示例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.');
}
示例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.');
}