List of usage examples for org.openqa.selenium ImmutableCapabilities ImmutableCapabilities
public ImmutableCapabilities(String k1, Object v1, String k2, Object v2)
From source file:org.openqa.grid.selenium.node.ChromeMutatorTest.java
License:Apache License
@Test public void shouldDoNothingIfCapabilitiesUsedToConfigureMutatorAreNotChromeBased() { ImmutableCapabilities config = new ImmutableCapabilities("browserName", "foo", CAPABILITY, ImmutableMap.of("binary", "cake")); ImmutableCapabilities caps = new ImmutableCapabilities("browserName", "chrome"); ImmutableCapabilities seen = new FirefoxMutator(config).apply(caps); assertSame(caps, seen);//w ww. j av a 2 s. c om }
From source file:org.openqa.grid.selenium.node.ChromeMutatorTest.java
License:Apache License
@Test public void shouldNotInjectIfUuidIsPresentInPayloadOnly() { ImmutableCapabilities config = new ImmutableCapabilities("browserName", "chrome", "chrome_binary", "binary"); 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.FirefoxMutatorTest.java
License:Apache License
@Test public void shouldDoNothingIfCapabilitiesUsedToConfigureMutatorAreNotFirefoxBased() { ImmutableCapabilities config = new ImmutableCapabilities("browserName", "foo", "firefox_binary", "cake"); ImmutableCapabilities caps = new ImmutableCapabilities("browserName", "firefox"); ImmutableCapabilities seen = new FirefoxMutator(config).apply(caps); assertSame(caps, seen);//from w w w. j a va 2s.c o m }
From source file:org.openqa.grid.selenium.node.FirefoxMutatorTest.java
License:Apache License
@Test public void shouldInjectBinaryIfGeckoDriverOptionUnsetButLegacyOptionSet() { ImmutableCapabilities caps = new ImmutableCapabilities("browserName", "firefox", FIREFOX_OPTIONS, ImmutableMap.of("binary", "cheese")); ImmutableCapabilities seen = new FirefoxMutator(defaultConfig).apply(caps); assertEquals(defaultConfig.getCapability(BINARY), seen.getCapability(BINARY)); @SuppressWarnings("unchecked") Map<String, Object> options = (Map<String, Object>) seen.getCapability(FIREFOX_OPTIONS); assertEquals("cheese", options.get("binary")); }
From source file:org.openqa.grid.selenium.node.FirefoxMutatorTest.java
License:Apache License
@Test public void shouldInjectMarionetteValueNoMatterWhat() { ImmutableCapabilities caps = new ImmutableCapabilities("browserName", "firefox", MARIONETTE, "cheese"); ImmutableCapabilities seen = new FirefoxMutator(defaultConfig).apply(caps); assertEquals(defaultConfig.getCapability(MARIONETTE), seen.getCapability(MARIONETTE)); }