-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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 #950 from magento-epam/PR-5
[Epam] Extend functional test sprint 5
- Loading branch information
Showing
32 changed files
with
1,191 additions
and
155 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
100 changes: 0 additions & 100 deletions
100
dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/ExpireAdminSessionTest.php
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/ExpireAdminSessionTest.xml
This file was deleted.
Oops, something went wrong.
101 changes: 101 additions & 0 deletions
101
dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/ExpireSessionTest.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,101 @@ | ||
<?php | ||
/** | ||
* Copyright © 2013-2017 Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Backend\Test\TestCase; | ||
|
||
use Magento\Customer\Test\Fixture\Customer; | ||
use Magento\Mtf\TestStep\TestStepFactory; | ||
use Magento\Mtf\TestCase\Injectable; | ||
|
||
/** | ||
* Steps: | ||
* | ||
* 1. Login to Admin. | ||
* 2. Create customer if needed. | ||
* 3. Apply configuration settings. | ||
* 4. Wait for session to expire. | ||
* 5. Perform asserts. | ||
* 6. Restore default configuration settings. | ||
* | ||
* @ZephyrId MAGETWO-47722, MAGETWO-47723 | ||
*/ | ||
class ExpireSessionTest extends Injectable | ||
{ | ||
/* tags */ | ||
const MVP = 'no'; | ||
/* end tags */ | ||
|
||
/** | ||
* Configuration data. | ||
* | ||
* @var string | ||
*/ | ||
private $configData; | ||
|
||
/** | ||
* Factory for Test Steps. | ||
* | ||
* @var TestStepFactory | ||
*/ | ||
private $stepFactory; | ||
|
||
/** | ||
* Injection data. | ||
* | ||
* @param TestStepFactory $stepFactory | ||
* @return void | ||
*/ | ||
public function __inject(TestStepFactory $stepFactory) | ||
{ | ||
$this->stepFactory = $stepFactory; | ||
} | ||
|
||
/** | ||
* Runs test. | ||
* | ||
* @param int $sessionLifetimeInSeconds | ||
* @param string $configData | ||
* @param Customer|null $customer | ||
* @return void | ||
*/ | ||
public function test( | ||
$sessionLifetimeInSeconds, | ||
$configData, | ||
Customer $customer = null | ||
) { | ||
$this->configData = $configData; | ||
$this->stepFactory->create( | ||
\Magento\Config\Test\TestStep\SetupConfigurationStep::class, | ||
['configData' => $this->configData] | ||
)->run(); | ||
|
||
if ($customer != null) { | ||
$customer->persist(); | ||
$this->stepFactory->create( | ||
\Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class, | ||
['customer' => $customer] | ||
)->run(); | ||
} | ||
|
||
/** | ||
* Wait admin session to expire. | ||
*/ | ||
sleep($sessionLifetimeInSeconds); | ||
} | ||
|
||
/** | ||
* Restore default configuration settings. | ||
* | ||
* @return void | ||
*/ | ||
public function tearDown() | ||
{ | ||
$this->stepFactory->create( | ||
\Magento\Config\Test\TestStep\SetupConfigurationStep::class, | ||
['configData' => $this->configData, 'rollback' => true] | ||
)->run(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/ExpireSessionTest.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,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
/** | ||
* Copyright © 2013-2017 Magento, Inc. 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\ExpireSessionTest" summary="Admin Session Expire" ticketId="MAGETWO-47723"> | ||
<variation name="ExpireSessionTestVariation1" summary="Check that session expires according with time settings applied in configuration" ticketId="MAGETWO-47722"> | ||
<data name="configData" xsi:type="string">default_cookie_lifetime_60_seconds</data> | ||
<data name="customer/dataset" xsi:type="string">default</data> | ||
<data name="sessionLifetimeInSeconds" xsi:type="number">60</data> | ||
<constraint name="Magento\Cms\Test\Constraint\AssertAuthorizationLinkIsVisibleOnStoreFront" /> | ||
</variation> | ||
<variation name="ExpireAdminSession" summary="Expire Admin Session" ticketId="MAGETWO-47723"> | ||
<data name="configData" xsi:type="string">admin_session_lifetime_60_seconds</data> | ||
<data name="sessionLifetimeInSeconds" xsi:type="number">60</data> | ||
<constraint name="Magento\Backend\Test\Constraint\AssertAdminLoginPageIsAvailable" /> | ||
</variation> | ||
</testCase> | ||
</config> |
14 changes: 14 additions & 0 deletions
14
dev/tests/functional/tests/app/Magento/Captcha/Test/Block/Form/CustomerForm.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,14 @@ | ||
<?xml version="1.0" ?> | ||
<!-- | ||
/** | ||
* Copyright © 2013-2017 Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<mapping strict="0"> | ||
<fields> | ||
<captcha> | ||
<selector>[name='captcha[user_edit]']</selector> | ||
</captcha> | ||
</fields> | ||
</mapping> |
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.