From 0f7ca4b86ebc8c614916a3cfb901450e2295e21b Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 16 Jan 2024 12:48:46 +0100 Subject: [PATCH] Adding details to `reloadPage()` Please doublecheck: 1. Is this really true? I couldn't verify this in the source code - don't know what `DriverCommand::REFRESH` actually does. 2. Is `['css' => 'body']` the best selector here? --- src/Codeception/Module/WebDriver.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Codeception/Module/WebDriver.php b/src/Codeception/Module/WebDriver.php index 4ae01c4..fe6eab4 100644 --- a/src/Codeception/Module/WebDriver.php +++ b/src/Codeception/Module/WebDriver.php @@ -2279,7 +2279,9 @@ public function typeInPopup(string $keys): void } /** - * Reloads the current page. + * Reloads the current page, as if the user would click into the url bar and hit enter, + * i.e. form fields are cleared. If you want to reload and keep the contents of form fields + * (i.e. as if the user would press F%), use `$I->pressKey(['css' => 'body'], \Facebook\WebDriver\WebDriverKeys::F5);` */ public function reloadPage(): void {