|
| 1 | +<?php |
| 2 | +namespace Magento\AcceptanceTest\_generated\Backend; |
| 3 | + |
| 4 | +use Magento\FunctionalTestingFramework\AcceptanceTester; |
| 5 | +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler; |
| 6 | +use Magento\FunctionalTestingFramework\DataGenerator\Persist\DataPersistenceHandler; |
| 7 | +use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject; |
| 8 | +use Yandex\Allure\Adapter\Annotation\Features; |
| 9 | +use Yandex\Allure\Adapter\Annotation\Stories; |
| 10 | +use Yandex\Allure\Adapter\Annotation\Title; |
| 11 | +use Yandex\Allure\Adapter\Annotation\Description; |
| 12 | +use Yandex\Allure\Adapter\Annotation\Parameter; |
| 13 | +use Yandex\Allure\Adapter\Annotation\Severity; |
| 14 | +use Yandex\Allure\Adapter\Model\SeverityLevel; |
| 15 | +use Yandex\Allure\Adapter\Annotation\TestCaseId; |
| 16 | + |
| 17 | +/** |
| 18 | + */ |
| 19 | +class PersistedReplacementCest |
| 20 | +{ |
| 21 | + /** |
| 22 | + * @var DataPersistenceHandler $createData1; |
| 23 | + */ |
| 24 | + protected $createData1; |
| 25 | + |
| 26 | + public function _before(AcceptanceTester $I) |
| 27 | + { |
| 28 | + $I->amGoingTo("create entity that has the mergeKey: createData1"); |
| 29 | + $replacementPerson = DataObjectHandler::getInstance()->getObject("replacementPerson"); |
| 30 | + $this->createData1 = new DataPersistenceHandler($replacementPerson); |
| 31 | + $this->createData1->createEntity(); |
| 32 | + } |
| 33 | + |
| 34 | + /** |
| 35 | + * @Parameter(name = "AcceptanceTester", value="$I") |
| 36 | + * @param AcceptanceTester $I |
| 37 | + * @return void |
| 38 | + */ |
| 39 | + public function PersistedReplacementTest(AcceptanceTester $I) |
| 40 | + { |
| 41 | + $I->amGoingTo("create entity that has the mergeKey: testScopeData"); |
| 42 | + $replacementPerson = DataObjectHandler::getInstance()->getObject("replacementPerson"); |
| 43 | + $testScopeData = new DataPersistenceHandler($replacementPerson); |
| 44 | + $testScopeData->createEntity(); |
| 45 | + $I->amGoingTo("create entity that has the mergeKey: uniqueData"); |
| 46 | + $uniquePerson = DataObjectHandler::getInstance()->getObject("uniquePerson"); |
| 47 | + $uniqueData = new DataPersistenceHandler($uniquePerson); |
| 48 | + $uniqueData->createEntity(); |
| 49 | + $I->amOnPage("/success/success2.html"); |
| 50 | + $I->amOnPage($testScopeData->getCreatedDataByName('firstname') . ".html"); |
| 51 | + $I->amOnPage($this->createData1->getCreatedDataByName('firstname') . ".html"); |
| 52 | + $I->amOnPage("/" . $testScopeData->getCreatedDataByName('firstname') . "/" . $testScopeData->getCreatedDataByName('lastname') . ".html"); |
| 53 | + $I->amOnPage("/" . $this->createData1->getCreatedDataByName('firstname') . "/" . $this->createData1->getCreatedDataByName('lastname') . ".html"); |
| 54 | + $I->click("#element ." . $testScopeData->getCreatedDataByName('firstname')); |
| 55 | + $I->click("#" . $testScopeData->getCreatedDataByName('firstname') . " .success"); |
| 56 | + $I->click("#John-Doe ." . $testScopeData->getCreatedDataByName('lastname')); |
| 57 | + $I->click("#" . $testScopeData->getCreatedDataByName('firstname') . " ." . $testScopeData->getCreatedDataByName('lastname')); |
| 58 | + $I->click("#" . $this->createData1->getCreatedDataByName('firstname') . " ." . $this->createData1->getCreatedDataByName('lastname')); |
| 59 | + $I->fillField("#sample", "Hello " . $testScopeData->getCreatedDataByName('firstname') . " " . $testScopeData->getCreatedDataByName('lastname')); |
| 60 | + $I->fillField("#sample", "Hello " . $this->createData1->getCreatedDataByName('firstname') . " " . $this->createData1->getCreatedDataByName('lastname')); |
| 61 | + $I->searchAndMultiSelectOption("#selector", [$testScopeData->getCreatedDataByName('lastname')]); |
| 62 | + $I->searchAndMultiSelectOption("#selector", [$this->createData1->getCreatedDataByName('lastname')]); |
| 63 | + $I->amOnPage($uniqueData->getCreatedDataByName('firstname') . ".html"); |
| 64 | + $I->amOnPage("/" . $uniqueData->getCreatedDataByName('firstname') . "/" . $uniqueData->getCreatedDataByName('lastname') . ".html"); |
| 65 | + $I->click("#element ." . $uniqueData->getCreatedDataByName('firstname')); |
| 66 | + $I->click("#" . $uniqueData->getCreatedDataByName('firstname') . " .success"); |
| 67 | + $I->click("#" . $uniqueData->getCreatedDataByName('firstname')); |
| 68 | + $I->dragAndDrop($uniqueData->getCreatedDataByName('firstname'), $uniqueData->getCreatedDataByName('firstname')); |
| 69 | + $I->dragAndDrop("#element ." . $uniqueData->getCreatedDataByName('firstname'), "#" . $uniqueData->getCreatedDataByName('firstname') . " .success"); |
| 70 | + } |
| 71 | +} |
0 commit comments