Skip to content

Commit 7a28acc

Browse files
committed
fixed incompatibilities
1 parent b8f2bd3 commit 7a28acc

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/Playwright.php

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use Codeception\Exception\ModuleException;
66
use Codeception\Module;
7+
use Codeception\TestInterface;
8+
use Exception;
79
use PHPUnit\Framework\AssertionFailedError;
810
use Symfony\Component\Process\Exception\ProcessFailedException;
911
use Symfony\Component\Process\Process;
@@ -91,17 +93,28 @@ public function _init(): void
9193
*
9294
* @param mixed $test The test case.
9395
*/
94-
public function _before(mixed $test): void
96+
public function _before(TestInterface $test): void
9597
{
96-
$this->sendCommand('_before', [$test]);
98+
$this->sendCommand('_before', [
99+
'test' => ['title' => $test->getMetadata()->getName()],
100+
]);
97101
}
98102

99103
/**
100104
* Execute actions after a test.
101105
*/
102-
public function _after(mixed $test): void
106+
public function _after(TestInterface $test): void
107+
{
108+
$this->sendCommand('_after', [
109+
'test' => ['title' => $test->getMetadata()->getName()],
110+
]);
111+
}
112+
113+
public function _failed(TestInterface $test, Exception $fail)
103114
{
104-
$this->sendCommand('_after');
115+
$this->sendCommand('_failed', [
116+
'test' => ['title' => $test->getMetadata()->getName()],
117+
]);
105118
}
106119

107120
public function _restart()

0 commit comments

Comments
 (0)