diff --git a/src/Browser/PantherBrowser.php b/src/Browser/PantherBrowser.php index 3b9919a..6c83d3c 100644 --- a/src/Browser/PantherBrowser.php +++ b/src/Browser/PantherBrowser.php @@ -227,4 +227,38 @@ final public function rightClick(string $selector): self return $this; } + + public function getScreenshotDir(): ?string + { + return $this->screenshotDir; + } + + public function getConsoleLogDir(): ?string + { + return $this->consoleLogDir; + } + + /** + * @return list + */ + public function getSavedScreenshots(): array + { + return $this->savedScreenshots; + } + + public function getSavedConsoleLogs(): array + { + return $this->savedConsoleLogs; + } + + public function setScreenshotDir(?string $screenshotDir): void + { + $this->screenshotDir = $screenshotDir; + } + + public function setConsoleLogDir(?string $consoleLogDir): void + { + $this->consoleLogDir = $consoleLogDir; + } + } diff --git a/tests/PantherBrowserTest.php b/tests/PantherBrowserTest.php index 3a79c11..c3e4748 100644 --- a/tests/PantherBrowserTest.php +++ b/tests/PantherBrowserTest.php @@ -38,6 +38,18 @@ public function can_use_panther_browser_as_typehint(): void ; } + /** + * @test + */ + public function can_configure_directories(): void + { + $this->browser()->setScreenshotDir($screenshotDir = '/path/to/screenshot'); + self::assertSame($this->browser()->getScreenshotDir(), $screenshotDir); + + $this->browser()->setConsoleLogDir($logDir = '/path/to/consoleLogs'); + self::assertSame($this->browser()->getScreenshotDir(), $logDir); + } + /** * @test */