Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/Fixture/files/javascript.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ <h1>Timeout Test</h1>
<hr>

<h1>Console Log Test</h1>
<button id="log">log</button>
<button id="log-error">log error</button>
<button id="throw-error">throw error</button>
<hr>
Expand Down Expand Up @@ -62,6 +63,9 @@ <h1>Console Log Test</h1>
$('#toggle').click(function() {
$('#toggle-box').toggle();
});
$('#log').click(function() {
console.log('console.log message');
});
$('#log-error').click(function() {
console.error('console.error message');
});
Expand Down
16 changes: 16 additions & 0 deletions tests/PantherBrowserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,22 @@ public function can_dump_console_log_with_console_error(): void
$this->assertStringContainsString('console.error message', \json_encode($output, \JSON_THROW_ON_ERROR));
}

/**
* @test
*/
public function can_dump_console_log_with_console_log(): void
{
$output = self::catchVarDumperOutput(function() {
$this->browser()
->visit('/javascript')
->click('log')
->dumpConsoleLog()
;
});

$this->assertStringContainsString('console.log message', \json_encode($output, JSON_THROW_ON_ERROR));
}

/**
* @test
*/
Expand Down