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