@Test public void shouldRegisterDefaultProfileWhenLocatorPropertyIsNotSet() throws URISyntaxException { File locatorFile = new File(LocatorRegistryTest.class.getResource("/conf/hierarchical/locator.yml").toURI()); LocatorRegistry locatorRegistry = new LocatorRegistry(new Properties(), locatorFile); assertTrue(locatorRegistry.getLocator("my-button") instanceof ByCssSelector); assertTrue(locatorRegistry.getLocator("my-input") instanceof ByXPath); assertTrue(locatorRegistry.getLocator("my-frame") instanceof ById); assertEquals(new ByCssSelector("#mypage .mybutton"), locatorRegistry.getLocator("my-button")); assertEquals(new ByXPath(" assertEquals(new ById("myframe"), locatorRegistry.getLocator("my-frame")); }
public By getLocator(String key) { if (!registry.containsKey(key)) throw new LocatorException("Cannot find the locator with key [" + key + "]"); return registry.get(key); }
LocatorRegistry { public By getLocator(String key) { if (!registry.containsKey(key)) throw new LocatorException("Cannot find the locator with key [" + key + "]"); return registry.get(key); } }
LocatorRegistry { public By getLocator(String key) { if (!registry.containsKey(key)) throw new LocatorException("Cannot find the locator with key [" + key + "]"); return registry.get(key); } @Inject  LocatorRegistry();   LocatorRegistry(Properties properties, File... files); }
LocatorRegistry { public By getLocator(String key) { if (!registry.containsKey(key)) throw new LocatorException("Cannot find the locator with key [" + key + "]"); return registry.get(key); } @Inject  LocatorRegistry();   LocatorRegistry(Properties properties, File... files); By getLocator(String key); }
LocatorRegistry { public By getLocator(String key) { if (!registry.containsKey(key)) throw new LocatorException("Cannot find the locator with key [" + key + "]"); return registry.get(key); } @Inject  LocatorRegistry();   LocatorRegistry(Properties properties, File... files); By getLocator(String key);  }