DataActionsTest.txt 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 DataActionsTestCest
  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: createdInBefore");
  26. PersistedObjectHandler::getInstance()->createEntity(
  27. "createdInBefore",
  28. "hook",
  29. "entity",
  30. [],
  31. null
  32. );
  33. $I->amGoingTo("update entity that has the createdDataKey: createdInBefore");
  34. PersistedObjectHandler::getInstance()->updateEntity(
  35. "createdInBefore",
  36. "hook",
  37. "entity",
  38. []
  39. );
  40. $I->amGoingTo("delete entity that has the createDataKey: createdInBefore");
  41. PersistedObjectHandler::getInstance()->deleteEntity(
  42. "createdInBefore",
  43. "hook"
  44. );
  45. }
  46. /**
  47. * @Features({"TestModule"})
  48. * @Parameter(name = "AcceptanceTester", value="$I")
  49. * @param AcceptanceTester $I
  50. * @return void
  51. * @throws \Exception
  52. */
  53. public function DataActionsTest(AcceptanceTester $I)
  54. {
  55. $I->amGoingTo("create entity that has the stepKey: createdInTest");
  56. PersistedObjectHandler::getInstance()->createEntity(
  57. "createdInTest",
  58. "test",
  59. "entity",
  60. [],
  61. null
  62. );
  63. $I->amGoingTo("update entity that has the createdDataKey: createdInTest");
  64. PersistedObjectHandler::getInstance()->updateEntity(
  65. "createdInTest",
  66. "test",
  67. "entity",
  68. []
  69. );
  70. $I->amGoingTo("delete entity that has the createDataKey: createdInTest");
  71. PersistedObjectHandler::getInstance()->deleteEntity(
  72. "createdInTest",
  73. "test"
  74. );
  75. $I->amGoingTo("update entity that has the createdDataKey: createdInBefore");
  76. PersistedObjectHandler::getInstance()->updateEntity(
  77. "createdInBefore",
  78. "test",
  79. "entity",
  80. []
  81. );
  82. $I->amGoingTo("delete entity that has the createDataKey: createdInBefore");
  83. PersistedObjectHandler::getInstance()->deleteEntity(
  84. "createdInBefore",
  85. "test"
  86. );
  87. }
  88. }