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


PHP BrowserInterface::getUrl方法代码示例

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


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

 /**
  * Assert that Secure Urls Enabled.
  *
  * @param BrowserInterface $browser
  * @param Dashboard $dashboard
  * @param CustomerAccountLogin $customerAccountLogin
  * @return void
  */
 public function processAssert(BrowserInterface $browser, Dashboard $dashboard, CustomerAccountLogin $customerAccountLogin)
 {
     $dashboard->open();
     \PHPUnit_Framework_Assert::assertTrue(strpos($browser->getUrl(), 'https://') !== false, 'Secure Url is not displayed on backend.');
     $customerAccountLogin->open();
     \PHPUnit_Framework_Assert::assertTrue(strpos($browser->getUrl(), 'https://') !== false, 'Secure Url is not displayed on frontend.');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:15,代码来源:AssertSecureUrlEnabled.php

示例3: processAssert

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

示例4: processAssert

 /**
  * Assert that outside redirect was success
  *
  * @param UrlRewrite $urlRewrite
  * @param BrowserInterface $browser
  * @param UrlRewrite|null $initialRewrite [optional]
  * @return void
  */
 public function processAssert(UrlRewrite $urlRewrite, BrowserInterface $browser, UrlRewrite $initialRewrite = null)
 {
     $urlRequestPath = $urlRewrite->hasData('request_path') ? $urlRewrite->getRequestPath() : $initialRewrite->getRequestPath();
     $urlTargetPath = $urlRewrite->hasData('target_path') ? $urlRewrite->getTargetPath() : $initialRewrite->getTargetPath();
     $browser->open($_ENV['app_frontend_url'] . $urlRequestPath);
     $browserUrl = $browser->getUrl();
     \PHPUnit_Framework_Assert::assertEquals($browserUrl, $urlTargetPath, 'URL rewrite redirect false.' . "\nExpected: " . $urlTargetPath . "\nActual: " . $browserUrl);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:AssertUrlRewriteSuccessOutsideRedirect.php

示例5: processAssert

 /**
  * Check that Shopping Cart is empty, opened page contains text "You have no items in your shopping cart.
  * Click here to continue shopping." where 'here' is link that leads to index page
  *
  * @param CheckoutCart $checkoutCart
  * @param BrowserInterface $browser
  * @return void
  */
 public function processAssert(CheckoutCart $checkoutCart, BrowserInterface $browser)
 {
     $checkoutCart->open();
     $cartEmptyBlock = $checkoutCart->getCartEmptyBlock();
     \PHPUnit_Framework_Assert::assertEquals(self::TEXT_EMPTY_CART, $cartEmptyBlock->getText(), 'Wrong text on empty cart page.');
     $cartEmptyBlock->clickLinkToMainPage();
     \PHPUnit_Framework_Assert::assertEquals($_ENV['app_frontend_url'], $browser->getUrl(), 'Wrong link to main page on empty cart page.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:AssertCartIsEmpty.php

示例6: processAssert

 /**
  * Assert that created CMS Page URL Rewrite lead to appropriate page in frontend.
  *
  * @param UrlRewrite $urlRewrite
  * @param CmsPage $cmsPage
  * @param SystemVariableNew $systemVariableNew
  * @param BrowserInterface $browser
  * @return void
  */
 public function processAssert(UrlRewrite $urlRewrite, CmsPage $cmsPage, SystemVariableNew $systemVariableNew, BrowserInterface $browser)
 {
     $browser->open($_ENV['app_frontend_url'] . $urlRewrite->getRequestPath());
     if ($urlRewrite->hasData('store_id')) {
         $store = explode('/', $urlRewrite->getStoreId());
         $systemVariableNew->getFormPageActions()->selectStoreView($store[2]);
     }
     $url = $urlRewrite->getRedirectType() == 'No' ? $urlRewrite->getRequestPath() : $cmsPage->getTitle();
     \PHPUnit_Framework_Assert::assertEquals($_ENV['app_frontend_url'] . $url, $browser->getUrl(), 'URL rewrite CMS Page redirect false.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:19,代码来源:AssertUrlRewriteCmsPageRedirect.php

示例7: assertGeneralInformation

 /**
  * Assert category general information
  *
  * @param Category $category
  * @param array $categoryData
  * @return void
  */
 protected function assertGeneralInformation(Category $category, array $categoryData)
 {
     $categoryUrl = $this->getCategoryUrl($category);
     \PHPUnit_Framework_Assert::assertEquals($categoryUrl, $this->browser->getUrl(), 'Wrong page URL.' . "\nExpected: " . $categoryUrl . "\nActual: " . $this->browser->getUrl());
     if (isset($categoryData['name'])) {
         $title = $this->categoryViewPage->getTitleBlock()->getTitle();
         \PHPUnit_Framework_Assert::assertEquals($categoryData['name'], $title, 'Wrong page title.' . "\nExpected: " . $categoryData['name'] . "\nActual: " . $title);
     }
     if (isset($categoryData['description'])) {
         $description = $this->categoryViewPage->getViewBlock()->getDescription();
         \PHPUnit_Framework_Assert::assertEquals($categoryData['description'], $description, 'Wrong category description.' . "\nExpected: " . $categoryData['description'] . "\nActual: " . $description);
     }
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:20,代码来源:AssertCategoryPage.php

示例8: verifySearchEngineOptimization

 /**
  * Verify category Search Engine Optimization data:
  * # URL
  * # Meta Title
  *
  * @param array $categoryData
  * @return array
  */
 protected function verifySearchEngineOptimization(array $categoryData)
 {
     $errorMessage = [];
     $categoryUrl = $this->getCategoryUrl($this->category);
     if ($categoryUrl != $this->browser->getUrl()) {
         $errorMessage[] = 'Wrong page URL.' . "\nExpected: " . $categoryUrl . "\nActual: " . $this->browser->getUrl();
     }
     if (isset($categoryData['meta_title'])) {
         $actual = $this->categoryViewPage->getMetaInformation()->getTitle();
         if ($categoryData['meta_title'] != $actual) {
             $errorMessage[] = 'Wrong page title.' . "\nExpected: " . $categoryData['meta_title'] . "\nActual: " . $actual;
         }
     }
     return $errorMessage;
 }
开发者ID:uibar,项目名称:lavinia2,代码行数:23,代码来源:AssertCategoryPage.php

示例9: openDownloadableLink

 /**
  * Open Downloadable Link.
  *
  * @param OrderInjectable $order
  * @param int $downloads
  * @return void
  */
 protected function openDownloadableLink(OrderInjectable $order, $downloads)
 {
     $customerLogin = $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $order->getDataFieldConfig('customer_id')['source']->getCustomer()]);
     $customerLogin->run();
     $this->customerAccount->getAccountMenuBlock()->openMenuItem('My Downloadable Products');
     $downloadableProductsUrl = $this->browser->getUrl();
     foreach ($order->getEntityId()['products'] as $product) {
         foreach ($product->getDownloadableLinks()['downloadable']['link'] as $link) {
             for ($i = 0; $i < $downloads; $i++) {
                 $this->browser->open($this->customerProducts->getMainBlock()->getLinkUrl($link['title']));
                 $this->browser->open($downloadableProductsUrl);
             }
         }
     }
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:22,代码来源:DownloadProductsReportEntityTest.php

示例10: processAssert

 /**
  * Assert that after save a search term:
  *  - it displays in the Search field at the top of the page if type set of characters passed from fixture
  *  - after click 'Go' of Search field opens a results page if it was not specified Redirect URL
  *  - after click 'Go' of Search field a customer search redirects to a specific page (passed from fixture)
  *    if it was specified Redirect URL
  *
  * @param CmsIndex $cmsIndex
  * @param CatalogSearchQuery $searchTerm
  * @param BrowserInterface $browser
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CatalogSearchQuery $searchTerm, BrowserInterface $browser)
 {
     $errors = [];
     $this->searchBlock = $cmsIndex->open()->getSearchBlock();
     if ($searchTerm->hasData('display_in_terms') && $searchTerm->getDisplayInTerms() === 'Yes') {
         $errors = $this->checkSuggestSearch($searchTerm);
     }
     $this->searchBlock->search($searchTerm->getQueryText());
     $windowUrl = $browser->getUrl();
     $redirectUrl = $searchTerm->getRedirect();
     if ($windowUrl !== $redirectUrl) {
         $errors[] = '- url window (' . $windowUrl . ') does not match the url redirect(' . $redirectUrl . ')';
     }
     \PHPUnit_Framework_Assert::assertEmpty($errors, 'When checking on the frontend "Search terms" arose following errors:' . PHP_EOL . implode(PHP_EOL, $errors));
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:27,代码来源:AssertSearchTermOnFrontend.php

示例11: processAssert

 /**
  * Assert that you will be not redirected to url from dataset
  *
  * @param CmsIndex $cmsIndex
  * @param CatalogSearchQuery $searchTerm
  * @param BrowserInterface $browser
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, BrowserInterface $browser, CatalogSearchQuery $searchTerm)
 {
     $cmsIndex->open()->getSearchBlock()->search($searchTerm->getSynonymFor());
     \PHPUnit_Framework_Assert::assertNotEquals($browser->getUrl(), $searchTerm->getRedirect(), 'Url in the browser corresponds to Url in fixture (redirect has been performed).' . PHP_EOL . 'Search term: "' . $searchTerm->getQueryText() . '"');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:13,代码来源:AssertSearchSynonymNotOnFrontend.php

示例12: processAssert

 /**
  * Assert that old Category URL lead to appropriate Category in frontend
  *
  * @param Category $category
  * @param BrowserInterface $browser
  * @param Category $initialCategory
  * @return void
  */
 public function processAssert(Category $category, BrowserInterface $browser, Category $initialCategory)
 {
     $browser->open($_ENV['app_frontend_url'] . $initialCategory->getUrlKey() . '.html');
     \PHPUnit_Framework_Assert::assertEquals($browser->getUrl(), $_ENV['app_frontend_url'] . strtolower($category->getUrlKey()) . '.html', 'URL rewrite category redirect false.');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:13,代码来源:AssertCategoryRedirect.php

示例13: processAssert

 /**
  * Assert check URL rewrite category redirect
  *
  * @param UrlRewrite $urlRewrite
  * @param Category $category
  * @param BrowserInterface $browser
  * @return void
  */
 public function processAssert(UrlRewrite $urlRewrite, Category $category, BrowserInterface $browser)
 {
     $browser->open($_ENV['app_frontend_url'] . $urlRewrite->getRequestPath());
     $url = $urlRewrite->getRedirectType() == 'No' ? $urlRewrite->getRequestPath() : $category->getUrlKey() . '.html';
     \PHPUnit_Framework_Assert::assertEquals($browser->getUrl(), $_ENV['app_frontend_url'] . $url, 'URL rewrite category redirect false.' . "\nExpected: " . $_ENV['app_frontend_url'] . $url . "\nActual: " . $browser->getUrl());
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:14,代码来源:AssertUrlRewriteCategoryRedirect.php


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