0

I create a gherkin scenario and implement mandatory method in the AcceptanceTester class in tests/_support/AcceptanceTester.php file.

From this file, I want to use _after method to execute some stuff after my tests are executed.

If I am in a Cest File, I can use _after method, but from the AcceptanceTester file this method is never called.

Why? How can I resolve this problem?

Oliver Maksimovic
  • 3,204
  • 3
  • 28
  • 44
spacecodeur
  • 2,206
  • 7
  • 35
  • 71

1 Answers1

1

AcceptanceTester does not support the _after method. If you look deeper into its parent class/traits, you'll see that no such method exists.

However, if you want to run your custom code before/after the test suite runs, then you can create your custom Helper class with _beforeSuite and/or _afterSuite methods, respectively. Have a look at answers posted to this question:

Run custom code after Codeception suite has finished

Oliver Maksimovic
  • 3,204
  • 3
  • 28
  • 44