PtlCapabilities extends DesiredCapabilities { public String getPlatformName() { Platform platform = getPlatform(); if (platform != null) { return platform.name(); } else { return toString(getCapability("platformName")); } } PtlCapabilities(Map<String, ?> rawMap);  PtlCapabilities(Capabilities other); static List<PtlCapabilities[]> readCapabilities(); String getPlatformName(); String getPlatformVersion(); String getDeviceName();  }
@Test public void getPlatformName_platformがある場合() throws Exception { Map<String, Object> map = new LinkedHashMap<String, Object>(); map.put("platform", "WINDOWS"); map.put("platformName", "hoge"); PtlCapabilities capabilities = new PtlCapabilities(map); assertThat(capabilities.getPlatformName(), is("WINDOWS")); }
@Test public void getPlatformName_platformが無い場合() throws Exception { Map<String, Object> map = new LinkedHashMap<String, Object>(); map.put("platformName", "hoge"); PtlCapabilities capabilities = new PtlCapabilities(map); assertThat(capabilities.getPlatformName(), is("hoge")); }