-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #853 from magento-epam/pr1
[Epam] Extend functional test sprint 1 - Tasks: - MTO-112: [Variation] Use Layered Navigation by Price (Navigation Step = Manual, MySQL) - MTO-108: [Test] Observe Different Base Currency per Website - MTO-117: [Variation] Use attribute in the Advanced Search - MTO-109: [Variation] Create and use XML Sitemap with submission to Robots.txt
- Loading branch information
Showing
19 changed files
with
832 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...tests/app/Magento/CatalogSearch/Test/Constraint/AssertAdvancedSearchAttributeIsAbsent.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* Copyright © 2013-2017 Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\CatalogSearch\Test\Constraint; | ||
|
||
use Magento\Catalog\Test\Fixture\CatalogProductAttribute; | ||
use Magento\CatalogSearch\Test\Page\AdvancedSearch; | ||
use Magento\Mtf\Constraint\AbstractConstraint; | ||
use Magento\Mtf\Util\Command\Cli\Indexer; | ||
|
||
/** | ||
* Assert that created custom product attribute is absent in the advanced search form on the frontend. | ||
*/ | ||
class AssertAdvancedSearchAttributeIsAbsent extends AbstractConstraint | ||
{ | ||
/** | ||
* Assert that created custom product attribute is absent in the advanced search form on the frontend. | ||
* | ||
* @param CatalogProductAttribute $attribute | ||
* @param AdvancedSearch $advancedSearch | ||
* @param Indexer $cli | ||
* @return void | ||
*/ | ||
public function processAssert(CatalogProductAttribute $attribute, AdvancedSearch $advancedSearch, Indexer $cli) | ||
{ | ||
$cli->reindex(); | ||
$advancedSearch->open(); | ||
$formLabels = $advancedSearch->getForm()->getFormLabels(); | ||
$label = $attribute->hasData('manage_frontend_label') | ||
? $attribute->getManageFrontendLabel() | ||
: $attribute->getFrontendLabel(); | ||
\PHPUnit_Framework_Assert::assertFalse( | ||
in_array($label, $formLabels), | ||
'Created custom product attribute is present in advanced search form on frontend but must be absent.' | ||
); | ||
} | ||
|
||
/** | ||
* Returns string representation of object. | ||
* | ||
* @return string | ||
*/ | ||
public function toString() | ||
{ | ||
return 'Created custom product attribute is absent in advanced search form on frontend.'; | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
...Magento/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnProductPageCustomWebsite.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
/** | ||
* Copyright © 2013-2017 Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\CurrencySymbol\Test\Constraint; | ||
|
||
use Magento\Mtf\Fixture\InjectableFixture; | ||
use Magento\Catalog\Test\Page\Product\CatalogProductView; | ||
use Magento\Mtf\Client\BrowserInterface; | ||
use Magento\Mtf\Constraint\AbstractConstraint; | ||
|
||
/** | ||
* Check that correct currency symbol displayed on Product Page on Custom Website. | ||
*/ | ||
class AssertCurrencySymbolOnProductPageCustomWebsite extends AbstractConstraint | ||
{ | ||
/** | ||
* Assert that correct currency symbol displayed on Product Page on Custom Website. | ||
* | ||
* @param InjectableFixture $product, | ||
* @param BrowserInterface $browser | ||
* @param CatalogProductView $catalogProductView | ||
* @param array $currencySymbol | ||
* @return void | ||
*/ | ||
public function processAssert( | ||
InjectableFixture $product, | ||
BrowserInterface $browser, | ||
CatalogProductView $catalogProductView, | ||
array $currencySymbol = [] | ||
) { | ||
$website = $product->getDataFieldConfig('website_ids')['source']->getWebsites()[0]; | ||
$url = $_ENV['app_frontend_url'] . 'websites/' . $website->getCode() . '/' . $product->getUrlKey() . '.html'; | ||
$browser->open($url); | ||
$priceBlock = $catalogProductView->getViewBlock()->getPriceBlock(); | ||
$symbolOnPage = $priceBlock->getCurrencySymbol(); | ||
|
||
\PHPUnit_Framework_Assert::assertEquals( | ||
$currencySymbol['customWebsite'], | ||
$symbolOnPage, | ||
'Wrong Currency Symbol is displayed on Product page on Custom website.' | ||
); | ||
} | ||
|
||
/** | ||
* Returns a string representation of successful assertion. | ||
* | ||
* @return string | ||
*/ | ||
public function toString() | ||
{ | ||
return "Correct Currency Symbol displayed on Product page on Custom website."; | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...p/Magento/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnProductPageMainWebsite.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
/** | ||
* Copyright © 2013-2017 Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\CurrencySymbol\Test\Constraint; | ||
|
||
use Magento\Mtf\Fixture\InjectableFixture; | ||
use Magento\Catalog\Test\Page\Product\CatalogProductView; | ||
use Magento\Mtf\Client\BrowserInterface; | ||
use Magento\Mtf\Constraint\AbstractConstraint; | ||
|
||
/** | ||
* Check that correct currency symbol displayed on Product Page on Main Website. | ||
*/ | ||
class AssertCurrencySymbolOnProductPageMainWebsite extends AbstractConstraint | ||
{ | ||
/** | ||
* Assert that correct currency symbol displayed on Product Page on Main Website. | ||
* | ||
* @param InjectableFixture $product, | ||
* @param BrowserInterface $browser | ||
* @param CatalogProductView $catalogProductView | ||
* @param array $currencySymbol | ||
* @return void | ||
*/ | ||
public function processAssert( | ||
InjectableFixture $product, | ||
BrowserInterface $browser, | ||
CatalogProductView $catalogProductView, | ||
array $currencySymbol = [] | ||
) { | ||
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); | ||
$priceBlock = $catalogProductView->getViewBlock()->getPriceBlock(); | ||
$symbolOnPage = $priceBlock->getCurrencySymbol(); | ||
|
||
\PHPUnit_Framework_Assert::assertEquals( | ||
$currencySymbol['mainWebsite'], | ||
$symbolOnPage, | ||
'Wrong Currency Symbol is displayed on Product page on the Main Website.' | ||
); | ||
} | ||
|
||
/** | ||
* Returns a string representation of successful assertion. | ||
* | ||
* @return string | ||
*/ | ||
public function toString() | ||
{ | ||
return "Correct Currency Symbol displayed on Product page on the Main Website."; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.