From 3971e299b32261ed966f3a2f13cf4e1e03d4b443 Mon Sep 17 00:00:00 2001 From: Simon Mavi Stewart Date: Mon, 20 Sep 2021 21:07:50 +0100 Subject: [PATCH] Extend the browsers that will be augmented to provide webstorage List of browsers has been determined by looking at the current set of browsers that implement `WebStorage` --- .../openqa/selenium/remote/html5/AddWebStorage.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/java/src/org/openqa/selenium/remote/html5/AddWebStorage.java b/java/src/org/openqa/selenium/remote/html5/AddWebStorage.java index 5fcf5df0fa2c5..29bb881b307a6 100644 --- a/java/src/org/openqa/selenium/remote/html5/AddWebStorage.java +++ b/java/src/org/openqa/selenium/remote/html5/AddWebStorage.java @@ -20,17 +20,27 @@ import org.openqa.selenium.Capabilities; import org.openqa.selenium.html5.WebStorage; import org.openqa.selenium.remote.AugmenterProvider; +import org.openqa.selenium.remote.BrowserType; import org.openqa.selenium.remote.ExecuteMethod; import java.util.function.Predicate; +import static org.openqa.selenium.remote.BrowserType.CHROME; +import static org.openqa.selenium.remote.BrowserType.EDGE; +import static org.openqa.selenium.remote.BrowserType.FIREFOX; +import static org.openqa.selenium.remote.BrowserType.OPERA; import static org.openqa.selenium.remote.CapabilityType.SUPPORTS_WEB_STORAGE; public class AddWebStorage implements AugmenterProvider { @Override public Predicate isApplicable() { - return caps -> caps.is(SUPPORTS_WEB_STORAGE); + return caps -> + FIREFOX.equals(caps.getBrowserName()) || + CHROME.equals(caps.getBrowserName()) || + EDGE.equals(caps.getBrowserName()) || + OPERA.equals(caps.getBrowserName()) || + caps.is(SUPPORTS_WEB_STORAGE); } @Override