public void UseTool(IHaveElements useOn) { foreach (var el in useOn.Elements) { MarkMiddleMenElementsForSkipping(el); } }
public void UseTool(IHaveElements useOn) { elementsByXpathRepetitions = new Dictionary<string, List<Element>>(); ReadLocators(useOn.Elements); MarkRepeatingXPathsToBeSkipped(); CreateGroupedElements(useOn); }
public void UseTool(IHaveElements useOn) { var name = ""; if (useOn is ElementCollection) name = (useOn as ElementCollection).Name; else if (useOn is Screen) name = (useOn as Screen).Name; else if (useOn is Element) name = (useOn as Element).Name; EnsureParentAndChildNamesDiffer(name, useOn.Elements); EnsureUniqueNamesInGroup(useOn.Elements); }
public void UseTool(IHaveElements useOn) { foreach (var irrelevant in useOn.Elements .Where(e=> IsIrrelevant(e.Name, e.LocatorType, e.Locator))) { irrelevant.SkipCodeGeneration = true; } foreach (var irrelevant in useOn.ElementCollections .Where(e => IsIrrelevant(e.Name, e.LocatorType, e.Locator))) { irrelevant.SkipCodeGeneration = true; } }
private void CreateGroupedElements(IHaveElements screen) { var repeatingElements = elementsByXpathRepetitions.Where(el => el.Value.Count() > repetitions); foreach (var item in repeatingElements) { Element parent = FindParentOf(screen.Elements, item.Value); if (parent != null) { parent.ElementCollections.Add(CreateElementGroup(item.Key, item.Value)); } else { // the screen itself is the parent screen.ElementCollections.Add(CreateElementGroup(item.Key, item.Value)); } } }
public void UseTool(IHaveElements useOn) { useOn.Elements = FilterSkippedElements(useOn.Elements); }