Example usage for org.openqa.selenium Platform LINUX

List of usage examples for org.openqa.selenium Platform LINUX

Introduction

In this page you can find the example usage for org.openqa.selenium Platform LINUX.

Prototype

Platform LINUX

To view the source code for org.openqa.selenium Platform LINUX.

Click Source Link

Usage

From source file:com.rmn.qa.AutomationRunRequestTest.java

License:Open Source License

@Test
// Tests that two run request objects match each other when option fields are not set on the first object
public void testMatchesOtherRunRequestOptionalParameters() {
    String uuid = "testUuid";
    String browser = "firefox";
    String browserVersion = null;
    Platform os = null;/*from w  w  w .j a va2 s  .  c  om*/
    AutomationRunRequest first = new AutomationRunRequest(uuid, null, browser, browserVersion, os);
    AutomationRunRequest second = new AutomationRunRequest(uuid, null, browser, "20", Platform.LINUX);
    Assert.assertTrue("Run requests should match", first.matchesCapabilities(second));
}

From source file:com.rmn.qa.AutomationRunRequestTest.java

License:Open Source License

@Test
// Tests that two run request objects do NOT match each other since the optional fields are on the first object
public void testDoesntMatchesOtherRunRequestNonOptionalParametersNull() {
    String uuid = "testUuid";
    String browser = "firefox";
    String browserVersion = null;
    Platform os = null;/*w w  w. ja v a  2  s. c om*/
    AutomationRunRequest first = new AutomationRunRequest(uuid, null, browser, "20", Platform.LINUX);
    AutomationRunRequest second = new AutomationRunRequest(uuid, null, browser, browserVersion, os);
    Assert.assertFalse("Run requests should not match", first.matchesCapabilities(second));
}

From source file:com.rmn.qa.AutomationRunRequestTest.java

License:Open Source License

@Test
// Tests that two run request objects do NOT match each other since the optional fields are on the second object
public void testDoesntMatchesOtherRunRequestNonOptionalParameters() {
    String uuid = "testUuid";
    String browser = "firefox";
    String browserVersion = null;
    Platform os = Platform.WINDOWS;//  www .j  av a  2s .c  o  m
    AutomationRunRequest first = new AutomationRunRequest(uuid, null, browser, "20", Platform.LINUX);
    AutomationRunRequest second = new AutomationRunRequest(uuid, null, browser, browserVersion, os);
    Assert.assertFalse("Run requests should match", first.matchesCapabilities(second));
}

From source file:com.rmn.qa.AutomationRunRequestTest.java

License:Open Source License

@Test
// Tests that two run request objects match each other
public void testMatchesCapabilities() {
    String uuid = "testUuid";
    String browser = "firefox";
    String browserVersion = "20";
    Platform os = Platform.LINUX;
    Map<String, Object> map = Maps.newHashMap();
    map.put(CapabilityType.BROWSER_NAME, browser);
    map.put(CapabilityType.VERSION, browserVersion);
    map.put(CapabilityType.PLATFORM, os);
    AutomationRunRequest first = new AutomationRunRequest(uuid, null, browser, browserVersion, os);
    Assert.assertTrue("Capabilities should match", first.matchesCapabilities(map));
}

From source file:com.rmn.qa.AutomationRunRequestTest.java

License:Open Source License

@Test
// Tests that two run request objects dont match each other due to incorrect browser
public void testMatchesCapabilitiesBadBrowser() {
    String uuid = "testUuid";
    String browser = "firefox";
    String browserVersion = "20";
    Platform os = Platform.LINUX;
    Map<String, Object> map = Maps.newHashMap();
    map.put(CapabilityType.BROWSER_NAME, browser);
    map.put(CapabilityType.VERSION, browserVersion);
    map.put(CapabilityType.PLATFORM, os);
    AutomationRunRequest first = new AutomationRunRequest(uuid, null, "badBrowser", browserVersion, os);
    Assert.assertFalse("Capabilities should match", first.matchesCapabilities(map));
}

From source file:com.rmn.qa.AutomationRunRequestTest.java

License:Open Source License

@Test
// Tests that two run request objects dont match each other due to incorrect browser version
public void testMatchesCapabilitiesBadVersion() {
    String uuid = "testUuid";
    String browser = "firefox";
    String browserVersion = "20";
    Platform os = Platform.LINUX;
    Map<String, Object> map = Maps.newHashMap();
    map.put(CapabilityType.BROWSER_NAME, browser);
    map.put(CapabilityType.VERSION, browserVersion);
    map.put(CapabilityType.PLATFORM, os);
    AutomationRunRequest first = new AutomationRunRequest(uuid, null, browser, "123", os);
    Assert.assertFalse("Capabilities should match", first.matchesCapabilities(map));
}

From source file:com.rmn.qa.AutomationRunRequestTest.java

License:Open Source License

@Test
// Tests that two run request objects dont match each other due to incorrect os
public void testMatchesCapabilitiesBadOs() {
    String uuid = "testUuid";
    String browser = "firefox";
    String browserVersion = "20";
    Platform os = Platform.LINUX;
    Map<String, Object> map = Maps.newHashMap();
    map.put(CapabilityType.BROWSER_NAME, browser);
    map.put(CapabilityType.VERSION, browserVersion);
    map.put(CapabilityType.PLATFORM, os);
    AutomationRunRequest first = new AutomationRunRequest(uuid, null, browser, browserVersion,
            Platform.WINDOWS);/*  ww  w  .  j av  a2s.  c om*/
    Assert.assertFalse("Capabilities should match", first.matchesCapabilities(map));
}

From source file:com.rmn.qa.AutomationRunRequestTest.java

License:Open Source License

@Test
// Tests that two run request objects do NOT match each other since the optional fields are on the second object
public void testMatchesCapabilitiesNonOptionalParameters() {
    String uuid = "testUuid";
    String browser = "firefox";
    String browserVersion = "21";
    Platform os = Platform.LINUX;
    Map<String, Object> map = Maps.newHashMap();
    map.put(CapabilityType.BROWSER_NAME, browser);
    map.put(CapabilityType.VERSION, "20");
    map.put(CapabilityType.PLATFORM, Platform.MAC);
    AutomationRunRequest first = new AutomationRunRequest(uuid, null, browser, browserVersion, os);
    Assert.assertFalse("Capabilities should NOT match", first.matchesCapabilities(map));
}

From source file:com.rmn.qa.AutomationRunRequestTest.java

License:Open Source License

@Test
// Tests that two run request objects do NOT match each other since the optional fields are on the second object
public void testMatchesFactoryMethod() {
    String uuid = "testUuid";
    String browser = "firefox";
    String browserVersion = "25";
    Platform os = Platform.LINUX;
    Map<String, Object> map = Maps.newHashMap();
    map.put(CapabilityType.BROWSER_NAME, browser);
    map.put(CapabilityType.VERSION, browserVersion);
    map.put(CapabilityType.PLATFORM, os);
    AutomationRunRequest first = new AutomationRunRequest(uuid, null, browser, browserVersion, os);
    AutomationRunRequest second = AutomationRunRequest.requestFromCapabilities(map);
    Assert.assertEquals("Factory method should have generated an equal request", first, second);
}

From source file:com.rmn.qa.AutomationRunRequestTest.java

License:Open Source License

@Test
// Tests that a platform of 'ANY' matches another otherwise non-matching OS
public void testOsMatchesAnyRequests() {
    String uuid = "testUuid";
    String browser = "firefox";
    String browserVersion = "25";
    Platform os = Platform.ANY;//from ww  w  .  j  ava 2  s .  c  o  m
    Map<String, Object> map = new HashMap<>();
    map.put(CapabilityType.BROWSER_NAME, browser);
    map.put(CapabilityType.VERSION, browserVersion);
    map.put(CapabilityType.PLATFORM, os.toString());
    AutomationRunRequest first = new AutomationRunRequest(uuid, null, browser, browserVersion, Platform.LINUX);
    AutomationRunRequest second = AutomationRunRequest.requestFromCapabilities(map);
    Assert.assertTrue("Requests should be equal", first.matchesCapabilities(second));
    Assert.assertTrue("Requests should be equal", second.matchesCapabilities(first));
}