List of usage examples for org.openqa.selenium ImmutableCapabilities ImmutableCapabilities
public ImmutableCapabilities(String k1, Object v1, String k2, Object v2, String k3, Object v3)
From source file:org.openqa.grid.selenium.node.ChromeMutatorTest.java
License:Apache License
@Test public void shouldInjectIfConfigUuidMatches() { ImmutableCapabilities config = new ImmutableCapabilities("browserName", "chrome", "chrome_binary", "binary", GridNodeConfiguration.CONFIG_UUID_CAPABILITY, "123"); ImmutableCapabilities caps = new ImmutableCapabilities("browserName", "chrome", CAPABILITY, ImmutableMap.of(), GridNodeConfiguration.CONFIG_UUID_CAPABILITY, "123"); ImmutableCapabilities seen = new ChromeMutator(config).apply(caps); Map<String, Object> options = (Map<String, Object>) seen.getCapability(CAPABILITY); assertEquals(options.get("binary"), config.getCapability("chrome_binary")); }
From source file:org.openqa.grid.selenium.node.ChromeMutatorTest.java
License:Apache License
@Test public void shouldNotInjectIfConfigUuidDoesNotMatch() { ImmutableCapabilities config = new ImmutableCapabilities("browserName", "chrome", "chrome_binary", "binary", GridNodeConfiguration.CONFIG_UUID_CAPABILITY, "uuid"); ImmutableCapabilities caps = new ImmutableCapabilities("browserName", "chrome", CAPABILITY, ImmutableMap.of("binary", "cheese"), GridNodeConfiguration.CONFIG_UUID_CAPABILITY, "123"); ImmutableCapabilities seen = new ChromeMutator(config).apply(caps); Map<String, Object> options = (Map<String, Object>) seen.getCapability(CAPABILITY); assertEquals(options.get("binary"), "cheese"); }
From source file:org.openqa.grid.selenium.node.ChromeMutatorTest.java
License:Apache License
@Test public void shouldNotInjectIfUuidIsPresentInConfigOnly() { ImmutableCapabilities config = new ImmutableCapabilities("browserName", "chrome", "chrome_binary", "binary", GridNodeConfiguration.CONFIG_UUID_CAPABILITY, "uuid"); ImmutableCapabilities caps = new ImmutableCapabilities("browserName", "chrome", CAPABILITY, ImmutableMap.of("binary", "cheese")); ImmutableCapabilities seen = new ChromeMutator(config).apply(caps); Map<String, Object> options = (Map<String, Object>) seen.getCapability(CAPABILITY); assertEquals(options.get("binary"), "cheese"); }
From source file:org.openqa.grid.selenium.node.FirefoxMutatorTest.java
License:Apache License
@Test public void shouldInjectBinaryIfLegacyOptionUnsetButGeckoDriverOptionSet() { ImmutableCapabilities caps = new ImmutableCapabilities("browserName", "firefox", BINARY, "cheese", FIREFOX_OPTIONS, ImmutableMap.of()); ImmutableCapabilities seen = new FirefoxMutator(defaultConfig).apply(caps); assertEquals("cheese", seen.getCapability(BINARY)); @SuppressWarnings("unchecked") Map<String, Object> options = (Map<String, Object>) seen.getCapability(FIREFOX_OPTIONS); assertEquals(defaultConfig.getCapability(BINARY), options.get("binary")); }
From source file:org.openqa.grid.selenium.node.FirefoxMutatorTest.java
License:Apache License
@Test public void shouldNotInjectIfUuidIsPresentInPayloadOnly() { ImmutableCapabilities caps = new ImmutableCapabilities("browserName", "firefox", MARIONETTE, "cheese", GridNodeConfiguration.CONFIG_UUID_CAPABILITY, "123"); ImmutableCapabilities seen = new FirefoxMutator(defaultConfig).apply(caps); assertEquals("cheese", seen.getCapability(MARIONETTE)); }