本文整理汇总了PHP中Magento\Mtf\Client\Browser::getUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Browser::getUrl方法的具体用法?PHP Browser::getUrl怎么用?PHP Browser::getUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Mtf\Client\Browser
的用法示例。
在下文中一共展示了Browser::getUrl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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 Browser $browser
* @return void
*/
public function processAssert(CmsIndex $cmsIndex, CatalogSearchQuery $searchTerm, Browser $browser)
{
$errors = [];
$this->searchBlock = $cmsIndex->open()->getSearchBlock();
if ($searchTerm->hasData('display_in_terms') && $searchTerm->getDisplayInTerms() === 'Yes') {
$errors = !$this->isSugestSearchisVisible($searchTerm) ? '- block "Suggest Search" when searching was not found' : [];
}
$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, $errors);
}
示例2: processAssert
/**
* Assert that displayed category data on category page equals to passed from fixture.
*
* @param CatalogCategory $category
* @param CatalogCategory $initialCategory
* @param FixtureFactory $fixtureFactory
* @param CatalogCategoryView $categoryView
* @param Browser $browser
* @return void
*/
public function processAssert(CatalogCategory $category, CatalogCategory $initialCategory, FixtureFactory $fixtureFactory, CatalogCategoryView $categoryView, Browser $browser)
{
$product = $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'default', 'data' => ['category_ids' => ['category' => $initialCategory]]]);
$categoryData = array_merge($initialCategory->getData(), $category->getData());
$product->persist();
$url = $_ENV['app_frontend_url'] . strtolower($category->getUrlKey()) . '.html';
$browser->open($url);
\PHPUnit_Framework_Assert::assertEquals($url, $browser->getUrl(), 'Wrong page URL.');
if (isset($categoryData['name'])) {
\PHPUnit_Framework_Assert::assertEquals(strtoupper($categoryData['name']), $categoryView->getTitleBlock()->getTitle(), 'Wrong page title.');
}
if (isset($categoryData['description'])) {
\PHPUnit_Framework_Assert::assertEquals($categoryData['description'], $categoryView->getViewBlock()->getDescription(), 'Wrong category description.');
}
if (isset($categoryData['default_sort_by'])) {
$sortBy = strtolower($categoryData['default_sort_by']);
$sortType = $categoryView->getTopToolbar()->getSelectSortType();
\PHPUnit_Framework_Assert::assertEquals($sortBy, $sortType, 'Wrong sorting type.');
}
}
示例3: test
/**
* Run create customer segment test.
*
* @param Customer $customer
* @param CustomerSegment $customerSegment
* @param CustomerSegment $customerSegmentConditions
* @param array $salesRule
* @param Browser $browser
* @return void
*/
public function test(Customer $customer, CustomerSegment $customerSegment, CustomerSegment $customerSegmentConditions, array $salesRule, Browser $browser)
{
// Preconditions
$customer->persist();
$replacement = $this->prepareReplacement($customer);
// Steps
$this->customerSegmentIndex->open();
$this->customerSegmentIndex->getPageActionsBlock()->addNew();
$this->customerSegmentNew->getCustomerSegmentForm()->fill($customerSegment);
$this->customerSegmentNew->getPageMainActions()->saveAndContinue();
// Retrieve customer segment id
preg_match('@id/(\\d+)/@', $browser->getUrl(), $matches);
$customerSegmentId = $matches[1];
$this->customerSegmentEdit->getCustomerSegmentForm()->openTab('conditions');
$this->customerSegmentEdit->getCustomerSegmentForm()->fillForm($customerSegmentConditions, null, $replacement);
$this->customerSegmentEdit->getPageMainActions()->save();
$this->createCartPriceRule($salesRule, $customerSegmentId);
}
示例4: processAssert
/**
* Assert that you will be redirected to url from dataset.
*
* @param CmsIndex $cmsIndex
* @param Browser $browser
* @param CatalogSearchQuery $searchTerm
* @return void
*/
public function processAssert(CmsIndex $cmsIndex, Browser $browser, CatalogSearchQuery $searchTerm)
{
$cmsIndex->open()->getSearchBlock()->search($searchTerm->getSynonymFor());
\PHPUnit_Framework_Assert::assertEquals($searchTerm->getRedirect(), $browser->getUrl(), 'Redirect by synonym was not executed.');
}