Light and Dark Mode Test
+This is a test for both light and dark modes.
+diff --git a/src/Api/PendingAwaitablePage.php b/src/Api/PendingAwaitablePage.php index f8aad8d9..d61d8010 100644 --- a/src/Api/PendingAwaitablePage.php +++ b/src/Api/PendingAwaitablePage.php @@ -70,6 +70,17 @@ public function inLightMode(): self ]); } + /** + * Allows you to run all tests in both color modes. + */ + public function inLightAndDarkMode(): ArrayablePendingAwaitablePage + { + return new ArrayablePendingAwaitablePage([ + $this->inLightMode(), + $this->inDarkMode(), + ]); + } + /** * Allows you to set a different locale, timezone, and location for the page. */ diff --git a/tests/Browser/Visit/SingleUrl.php b/tests/Browser/Visit/SingleUrl.php index 0f160719..f4ef48b0 100644 --- a/tests/Browser/Visit/SingleUrl.php +++ b/tests/Browser/Visit/SingleUrl.php @@ -73,6 +73,72 @@ $page->assertScreenshotMatches(); })->with(ColorScheme::cases())->skipOnCI(); +it('may visit a page in both light and dark modes', function (): void { + Route::get('/', fn (): string => ' + +
+This is a test for both light and dark modes.
+