Skip to content

Commit

Permalink
Extend the browsers that will be augmented to provide webstorage
Browse files Browse the repository at this point in the history
List of browsers has been determined by looking at the current set of
browsers that implement `WebStorage`
  • Loading branch information
shs96c committed Sep 21, 2021
1 parent 9e4122b commit 3971e29
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion java/src/org/openqa/selenium/remote/html5/AddWebStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<WebStorage> {

@Override
public Predicate<Capabilities> 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
Expand Down

0 comments on commit 3971e29

Please sign in to comment.