|
| 1 | +<?php |
| 2 | +namespace Magento\AcceptanceTest\_default\Backend; |
| 3 | + |
| 4 | +use Magento\FunctionalTestingFramework\AcceptanceTester; |
| 5 | +use \Codeception\Util\Locator; |
| 6 | +use Yandex\Allure\Adapter\Annotation\Features; |
| 7 | +use Yandex\Allure\Adapter\Annotation\Stories; |
| 8 | +use Yandex\Allure\Adapter\Annotation\Title; |
| 9 | +use Yandex\Allure\Adapter\Annotation\Description; |
| 10 | +use Yandex\Allure\Adapter\Annotation\Parameter; |
| 11 | +use Yandex\Allure\Adapter\Annotation\Severity; |
| 12 | +use Yandex\Allure\Adapter\Model\SeverityLevel; |
| 13 | +use Yandex\Allure\Adapter\Annotation\TestCaseId; |
| 14 | + |
| 15 | +/** |
| 16 | + * @Description("<h3>Test files</h3>verification/TestModule/Test/BasicFunctionalTest/MagentoCliTest.xml<br>") |
| 17 | + */ |
| 18 | +class MagentoCliTestCest |
| 19 | +{ |
| 20 | + /** |
| 21 | + * @var bool |
| 22 | + */ |
| 23 | + private $isSuccess = false; |
| 24 | + |
| 25 | + /** |
| 26 | + * @param AcceptanceTester $I |
| 27 | + * @throws \Exception |
| 28 | + */ |
| 29 | + public function _after(AcceptanceTester $I) |
| 30 | + { |
| 31 | + if ($this->isSuccess) { |
| 32 | + unlink(__FILE__); |
| 33 | + } |
| 34 | + } |
| 35 | + |
| 36 | + /** |
| 37 | + * @Features({"TestModule"}) |
| 38 | + * @param AcceptanceTester $I |
| 39 | + * @return void |
| 40 | + * @throws \Exception |
| 41 | + */ |
| 42 | + public function MagentoCliTest(AcceptanceTester $I) |
| 43 | + { |
| 44 | + $magentoCli1 = $I->magentoCLI("maintenance:enable", 45, "\"stuffHere\""); // stepKey: magentoCli1 |
| 45 | + $I->comment($magentoCli1); |
| 46 | + $magentoCli2 = $I->magentoCLI("maintenance:enable", 120, "\"stuffHere\""); // stepKey: magentoCli2 |
| 47 | + $I->comment($magentoCli2); |
| 48 | + $magentoCli3 = $I->magentoCLISecret("config:set somePath " . $I->getSecret("someKey"), 45); // stepKey: magentoCli3 |
| 49 | + $I->comment($magentoCli3); // stepKey: magentoCli3 |
| 50 | + $magentoCli4 = $I->magentoCLISecret("config:set somePath " . $I->getSecret("someKey"), 120); // stepKey: magentoCli4 |
| 51 | + $I->comment($magentoCli4); // stepKey: magentoCli4 |
| 52 | + } |
| 53 | + |
| 54 | + public function _passed(AcceptanceTester $I) |
| 55 | + { |
| 56 | + // Test passed successfully. |
| 57 | + $this->isSuccess = true; |
| 58 | + } |
| 59 | +} |
0 commit comments