-
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 #141 from magento-qmt/mavericks
[Mavericks] Navigation menu test and test maintenance
- Loading branch information
Showing
250 changed files
with
7,803 additions
and
4,088 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
dev/tests/functional/lib/Magento/Mtf/Fixture/DataSource.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,62 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Mtf\Fixture; | ||
|
||
use Magento\Mtf\Fixture\FixtureInterface; | ||
|
||
/** | ||
* Parent fixture data source class. | ||
*/ | ||
class DataSource implements FixtureInterface | ||
{ | ||
/** | ||
* Data set configuration settings. | ||
* | ||
* @var array | ||
*/ | ||
protected $params; | ||
|
||
/** | ||
* Value data. | ||
* | ||
* @var array | ||
*/ | ||
protected $data; | ||
|
||
/** | ||
* Persist entity. | ||
* | ||
* @return void | ||
*/ | ||
public function persist() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Return prepared data set. | ||
* | ||
* @param string $key [optional] | ||
* @return mixed | ||
* | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function getData($key = null) | ||
{ | ||
return $this->data; | ||
} | ||
|
||
/** | ||
* Return data set configuration settings. | ||
* | ||
* @return array | ||
*/ | ||
public function getDataConfig() | ||
{ | ||
return $this->params; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
dev/tests/functional/tests/app/Magento/AdminNotification/Test/TestCase/NavigateMenuTest.xml
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,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> | ||
<testCase name="Magento\Backend\Test\TestCase\NavigateMenuTest"> | ||
<variation name="NavigateMenuTest1"> | ||
<data name="menuItem" xsi:type="string">System > Notifications</data> | ||
<data name="pageTitle" xsi:type="string">Notifications</data> | ||
<constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> | ||
</variation> | ||
</testCase> | ||
</config> |
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
25 changes: 25 additions & 0 deletions
25
dev/tests/functional/tests/app/Magento/Backend/Test/Block/Page/Error.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,25 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Backend\Test\Block\Page; | ||
|
||
use Magento\Mtf\Block\Block; | ||
|
||
/** | ||
* 404 error backend block. | ||
*/ | ||
class Error extends Block | ||
{ | ||
/** | ||
* Get block text content. | ||
* | ||
* @return string | ||
*/ | ||
public function getContent() | ||
{ | ||
return $this->_rootElement->getText(); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
use Magento\Mtf\Block\Block; | ||
|
||
/** | ||
* Main block. | ||
* Main dashboard block. | ||
*/ | ||
class Main extends Block | ||
{ | ||
|
50 changes: 50 additions & 0 deletions
50
...sts/functional/tests/app/Magento/Backend/Test/Constraint/AssertBackendPageIsAvailable.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 © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Backend\Test\Constraint; | ||
|
||
use Magento\Backend\Test\Fixture\GlobalSearch; | ||
use Magento\Backend\Test\Page\Adminhtml\Dashboard; | ||
use Magento\Mtf\Constraint\AbstractConstraint; | ||
|
||
/** | ||
* Assert backend page title and it's availability. | ||
*/ | ||
class AssertBackendPageIsAvailable extends AbstractConstraint | ||
{ | ||
const ERROR_TEXT = '404 Error'; | ||
|
||
/** | ||
* Assert that backend page has correct title and 404 Error is absent on the page. | ||
* | ||
* @param Dashboard $dashboard | ||
* @param string $pageTitle | ||
* @return void | ||
*/ | ||
public function processAssert(Dashboard $dashboard, $pageTitle) | ||
{ | ||
\PHPUnit_Framework_Assert::assertEquals( | ||
$pageTitle, | ||
$dashboard->getTitleBlock()->getTitle(), | ||
'Invalid page title is displayed.' | ||
); | ||
\PHPUnit_Framework_Assert::assertNotContains( | ||
self::ERROR_TEXT, | ||
$dashboard->getErrorBlock()->getContent(), | ||
"404 Error is displayed on '$pageTitle' page." | ||
); | ||
} | ||
|
||
/** | ||
* Returns a string representation of the object. | ||
* | ||
* @return string | ||
*/ | ||
public function toString() | ||
{ | ||
return 'Backend has correct title and 404 page content is absent.'; | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertStoreCanBeLocalized.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,59 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Backend\Test\Constraint; | ||
|
||
use Magento\Store\Test\Fixture\Store; | ||
use Magento\Mtf\Constraint\AbstractConstraint; | ||
use Magento\Backend\Test\Page\Adminhtml\SystemConfig; | ||
use Magento\Cms\Test\Page\CmsIndex; | ||
|
||
/** | ||
* Assert that store can be localized. | ||
*/ | ||
class AssertStoreCanBeLocalized extends AbstractConstraint | ||
{ | ||
/** | ||
* Assert that locale options can be changed and checks new text on index page. | ||
* | ||
* @param SystemConfig $systemConfig | ||
* @param Store $store | ||
* @param CmsIndex $cmsIndex | ||
* @param string $locale | ||
* @param string $welcomeText | ||
* @return void | ||
*/ | ||
public function processAssert(SystemConfig $systemConfig, Store $store, CmsIndex $cmsIndex, $locale, $welcomeText) | ||
{ | ||
// Set locale options | ||
$systemConfig->open(); | ||
$systemConfig->getPageActions()->selectStore($store->getGroupId() . "/" . $store->getName()); | ||
$configGroup = $systemConfig->getForm()->getGroup('Locale Options'); | ||
$configGroup->open(); | ||
$configGroup->setValue('select-groups-locale-fields-code-value', $locale); | ||
$systemConfig->getPageActions()->save(); | ||
$systemConfig->getMessagesBlock()->waitSuccessMessage(); | ||
|
||
// Check presents income text on index page | ||
$cmsIndex->open(); | ||
$cmsIndex->getStoreSwitcherBlock()->selectStoreView($store->getName()); | ||
|
||
\PHPUnit_Framework_Assert::assertTrue( | ||
$cmsIndex->getSearchBlock()->isPlaceholderContains($welcomeText), | ||
"Locale not applied." | ||
); | ||
} | ||
|
||
/** | ||
* Returns a string representation of the object. | ||
* | ||
* @return string | ||
*/ | ||
public function toString() | ||
{ | ||
return 'Store locale has changed successfully.'; | ||
} | ||
} |
Oops, something went wrong.