HookActionsTest.txt 2.3 KB

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