Skip to content

Commit

Permalink
Clear localStorage on reset() and add changelog for v1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
robertfausk committed Apr 14, 2020
1 parent f958330 commit 9377d09
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
1.0.4 / 2020-04-14
==================

Fixes:

* Clear localStorage on reset()

1.0.3 / 2020-03-28
==================

Expand Down
4 changes: 4 additions & 0 deletions src/PantherDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Facebook\WebDriver\Interactions\Internal\WebDriverCoordinates;
use Facebook\WebDriver\Interactions\WebDriverActions;
use Facebook\WebDriver\Internal\WebDriverLocatable;
use Facebook\WebDriver\JavaScriptExecutor;
use Facebook\WebDriver\WebDriverDimension;
use Facebook\WebDriver\WebDriverElement;
use Facebook\WebDriver\WebDriverHasInputDevices;
Expand Down Expand Up @@ -143,6 +144,9 @@ public function reset()
if ($history) {
$history->clear();
}
if ($this->client->getWebDriver() instanceof JavaScriptExecutor) {
$this->executeScript('localStorage.clear();');
}
// not sure if we should also close all windows
// $lastWindowHandle = \end($this->client->getWindowHandles());
// if ($lastWindowHandle) {
Expand Down

0 comments on commit 9377d09

Please sign in to comment.