Skip to content
Open
2 changes: 1 addition & 1 deletion src/Api/Concerns/InteractsWithElements.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function hover(string $selector): self
/**
* Right-click the element matching the given selector.
*/
public function rightClick(string $text): Webpage
public function rightClick(string $text): self
{
$this->guessLocator($text)->click([
'button' => 'right',
Expand Down
12 changes: 6 additions & 6 deletions src/Api/Concerns/MakesConsoleAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ trait MakesConsoleAssertions
/**
* Asserts there are no console logs or JavaScript errors on the page.
*/
public function assertNoSmoke(): Webpage
public function assertNoSmoke(): self
{
$this->assertNoConsoleLogs();
$this->assertNoJavaScriptErrors();
Expand All @@ -31,7 +31,7 @@ public function assertNoSmoke(): Webpage
/**
* Asserts there are no broken images on the page.
*/
public function assertNoBrokenImages(): Webpage
public function assertNoBrokenImages(): self
{
$this->page->waitForLoadState('load');

Expand All @@ -50,15 +50,15 @@ public function assertNoBrokenImages(): Webpage
/**
* Asserts there are no missing images on the page.
*/
public function assertNoMissingImages(): Webpage
public function assertNoMissingImages(): self
{
return $this->assertNoBrokenImages();
}

/**
* Asserts there are no console logs on the page.
*/
public function assertNoConsoleLogs(): Webpage
public function assertNoConsoleLogs(): self
{
$consoleLogs = $this->page->consoleLogs();

Expand All @@ -75,7 +75,7 @@ public function assertNoConsoleLogs(): Webpage
/**
* Asserts there are no JavaScript errors on the page.
*/
public function assertNoJavaScriptErrors(): Webpage
public function assertNoJavaScriptErrors(): self
{
$javaScriptErrors = $this->page->javaScriptErrors();

Expand All @@ -92,7 +92,7 @@ public function assertNoJavaScriptErrors(): Webpage
/**
* Asserts the accessibility of the page.
*/
public function assertNoAccessibilityIssues(int $level = 1): Webpage
public function assertNoAccessibilityIssues(int $level = 1): self
{
$this->page->waitForLoadState('networkidle');
$this->page->waitForFunction('document.readyState === "complete"');
Expand Down
Loading