PersistenceActionGroupAppendingTest.txt 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. namespace Magento\AcceptanceTest\_default\Backend;
  3. use Magento\FunctionalTestingFramework\AcceptanceTester;
  4. use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore;
  5. use Magento\FunctionalTestingFramework\DataGenerator\Handlers\PersistedObjectHandler;
  6. use \Codeception\Util\Locator;
  7. use Yandex\Allure\Adapter\Annotation\Features;
  8. use Yandex\Allure\Adapter\Annotation\Stories;
  9. use Yandex\Allure\Adapter\Annotation\Title;
  10. use Yandex\Allure\Adapter\Annotation\Description;
  11. use Yandex\Allure\Adapter\Annotation\Parameter;
  12. use Yandex\Allure\Adapter\Annotation\Severity;
  13. use Yandex\Allure\Adapter\Model\SeverityLevel;
  14. use Yandex\Allure\Adapter\Annotation\TestCaseId;
  15. /**
  16. */
  17. class PersistenceActionGroupAppendingTestCest
  18. {
  19. /**
  20. * @param AcceptanceTester $I
  21. * @throws \Exception
  22. */
  23. public function _before(AcceptanceTester $I)
  24. {
  25. $I->amGoingTo("create entity that has the stepKey: createDataACTIONGROUPBEFORE");
  26. PersistedObjectHandler::getInstance()->createEntity(
  27. "createDataACTIONGROUPBEFORE",
  28. "hook",
  29. "entity",
  30. [],
  31. null
  32. );
  33. $I->amGoingTo("update entity that has the createdDataKey: createDataACTIONGROUPBEFORE");
  34. PersistedObjectHandler::getInstance()->updateEntity(
  35. "createDataACTIONGROUPBEFORE",
  36. "hook",
  37. "newEntity",
  38. []
  39. );
  40. $I->amGoingTo("delete entity that has the createDataKey: createDataACTIONGROUPBEFORE");
  41. PersistedObjectHandler::getInstance()->deleteEntity(
  42. "createDataACTIONGROUPBEFORE",
  43. "hook"
  44. );
  45. $I->amGoingTo("get entity that has the stepKey: getDataACTIONGROUPBEFORE");
  46. PersistedObjectHandler::getInstance()->getEntity(
  47. "getDataACTIONGROUPBEFORE",
  48. "hook",
  49. "someEneity",
  50. [],
  51. null
  52. );
  53. $I->comment(PersistedObjectHandler::getInstance()->retrieveEntityField('createData', 'field', 'hook'));
  54. }
  55. /**
  56. * @Features({"TestModule"})
  57. * @Parameter(name = "AcceptanceTester", value="$I")
  58. * @param AcceptanceTester $I
  59. * @return void
  60. * @throws \Exception
  61. */
  62. public function PersistenceActionGroupAppendingTest(AcceptanceTester $I)
  63. {
  64. $I->amGoingTo("create entity that has the stepKey: createDataACTIONGROUP");
  65. PersistedObjectHandler::getInstance()->createEntity(
  66. "createDataACTIONGROUP",
  67. "test",
  68. "entity",
  69. [],
  70. null
  71. );
  72. $I->amGoingTo("update entity that has the createdDataKey: createDataACTIONGROUP");
  73. PersistedObjectHandler::getInstance()->updateEntity(
  74. "createDataACTIONGROUP",
  75. "test",
  76. "newEntity",
  77. []
  78. );
  79. $I->amGoingTo("delete entity that has the createDataKey: createDataACTIONGROUP");
  80. PersistedObjectHandler::getInstance()->deleteEntity(
  81. "createDataACTIONGROUP",
  82. "test"
  83. );
  84. $I->amGoingTo("get entity that has the stepKey: getDataACTIONGROUP");
  85. PersistedObjectHandler::getInstance()->getEntity(
  86. "getDataACTIONGROUP",
  87. "test",
  88. "someEneity",
  89. [],
  90. null
  91. );
  92. $I->comment(PersistedObjectHandler::getInstance()->retrieveEntityField('createDataACTIONGROUP', 'field', 'test'));
  93. }
  94. }