public IList <FloatingMatchSettings> GetRegions(IEyesBase eyesBase, IEyesScreenshot screenshot) { ReadOnlyCollection <IWebElement> elements = ((SeleniumEyes)eyesBase).GetDriver().FindElements(selector_); IList <FloatingMatchSettings> retVal = new List <FloatingMatchSettings>(); foreach (IWebElement element in elements) { Rectangle r = EyesSeleniumUtils.GetVisibleElementBounds(element); Point pTag = screenshot.ConvertLocation(r.Location, CoordinatesTypeEnum.CONTEXT_RELATIVE, CoordinatesTypeEnum.SCREENSHOT_AS_IS); retVal.Add( new FloatingMatchSettings() { Left = pTag.X, Top = pTag.Y, Width = r.Width, Height = r.Height, MaxLeftOffset = maxLeftOffset_, MaxUpOffset = maxUpOffset_, MaxRightOffset = maxRightOffset_, MaxDownOffset = maxDownOffset_ } ); } return(retVal); }
public IList <FloatingMatchSettings> GetRegions(IEyesBase eyesBase, IEyesScreenshot screenshot) { ReadOnlyCollection <IWebElement> elements = ((Eyes)eyesBase).GetDriver().FindElements(selector_); IList <FloatingMatchSettings> retVal = new List <FloatingMatchSettings>(); double scaleRatio = ((Eyes)eyesBase).GetScaleRatioForRegions(); foreach (IWebElement element in elements) { Region r = new Region(element.Location, element.Size); r = r.Scale(scaleRatio); Point pTag = screenshot.ConvertLocation(r.Location, CoordinatesTypeEnum.CONTEXT_RELATIVE, CoordinatesTypeEnum.SCREENSHOT_AS_IS); retVal.Add( new FloatingMatchSettings() { Left = pTag.X, Top = pTag.Y, Width = r.Width, Height = r.Height, MaxLeftOffset = maxLeftOffset_, MaxUpOffset = maxUpOffset_, MaxRightOffset = maxRightOffset_, MaxDownOffset = maxDownOffset_ } ); } return(retVal); }
public IList <AccessibilityRegionByRectangle> GetRegions(IEyesBase eyesBase, IEyesScreenshot screenshot) { Rectangle r = EyesSeleniumUtils.GetVisibleElementBounds(element_); Point pTag = screenshot.ConvertLocation(r.Location, CoordinatesTypeEnum.CONTEXT_RELATIVE, CoordinatesTypeEnum.SCREENSHOT_AS_IS); return(new AccessibilityRegionByRectangle[] { new AccessibilityRegionByRectangle(new Rectangle(pTag, r.Size), regionType_) }); }
public IList <IMutableRegion> GetRegions(IEyesBase eyesBase, IEyesScreenshot screenshot) { if (!(element_ is EyesRemoteWebElement eyesElement)) { eyesElement = new EyesRemoteWebElement(eyesBase.Logger, ((SeleniumEyes)eyesBase).GetDriver(), element_); } Rectangle r = EyesSeleniumUtils.GetVisibleElementBounds(eyesElement); Point pTag = screenshot.ConvertLocation(r.Location, CoordinatesTypeEnum.CONTEXT_RELATIVE, CoordinatesTypeEnum.SCREENSHOT_AS_IS); return(new MutableRegion[] { new MutableRegion(pTag.X, pTag.Y, r.Width, r.Height) }); }
public IList <AccessibilityRegionByRectangle> GetRegions(IEyesBase eyesBase, IEyesScreenshot screenshot) { double scaleRatio = ((Eyes)eyesBase).GetScaleRatioForRegions(); Region r = new Region(element_.Location, element_.Size); r = r.Scale(scaleRatio); Point pTag = screenshot.ConvertLocation(r.Location, CoordinatesTypeEnum.CONTEXT_RELATIVE, CoordinatesTypeEnum.SCREENSHOT_AS_IS); return(new AccessibilityRegionByRectangle[] { new AccessibilityRegionByRectangle(new Rectangle(pTag, r.Size), regionType_) }); }
public IList <IMutableRegion> GetRegions(IEyesBase eyesBase, IEyesScreenshot screenshot) { IWebElement element = element_; double scaleRatio = ((Eyes)eyesBase).GetScaleRatioForRegions(); Region r = new Region(element.Location, element.Size); r = r.Scale(scaleRatio); eyesBase.Logger.Verbose("screenshot: {0}", screenshot); Point pTag = screenshot.ConvertLocation(r.Location, CoordinatesTypeEnum.CONTEXT_RELATIVE, CoordinatesTypeEnum.SCREENSHOT_AS_IS); return(new MutableRegion[] { new MutableRegion(pTag.X, pTag.Y, r.Width, r.Height) }); }
public IList <AccessibilityRegionByRectangle> GetRegions(IEyesBase eyesBase, IEyesScreenshot screenshot) { ReadOnlyCollection <IWebElement> elements = ((SeleniumEyes)eyesBase).GetDriver().FindElements(selector_); IList <AccessibilityRegionByRectangle> retVal = new List <AccessibilityRegionByRectangle>(); foreach (IWebElement element in elements) { Rectangle r = EyesSeleniumUtils.GetVisibleElementBounds(element); Point pTag = screenshot.ConvertLocation(r.Location, CoordinatesTypeEnum.CONTEXT_RELATIVE, CoordinatesTypeEnum.SCREENSHOT_AS_IS); retVal.Add(new AccessibilityRegionByRectangle(new Rectangle(pTag, r.Size), regionType_)); } return(retVal); }
public AppOutput(string title, Location location, IEyesScreenshot screenshot, string domUrl = null, RectangleSize viewport = null) { Title = title; Location = location; ScreenshotUrl = null; DomUrl = domUrl; Viewport = viewport; Screenshot = screenshot; using (MemoryStream stream = new MemoryStream()) { screenshot.Image.Save(stream, ImageFormat.Png); ScreenshotBytes = stream.ToArray(); } }
public IList <IMutableRegion> GetRegions(IEyesBase eyesBase, IEyesScreenshot screenshot) { EyesWebDriver driver = ((SeleniumEyes)eyesBase).GetDriver(); ReadOnlyCollection <IWebElement> elements = driver.FindElements(selector_); IList <IMutableRegion> mutableRegions = new List <IMutableRegion>(); foreach (IWebElement element in elements) { Rectangle r = EyesSeleniumUtils.GetVisibleElementBounds(element); Point pTag = screenshot.ConvertLocation(r.Location, CoordinatesTypeEnum.CONTEXT_RELATIVE, CoordinatesTypeEnum.SCREENSHOT_AS_IS); mutableRegions.Add(new MutableRegion(pTag.X, pTag.Y, r.Width, r.Height)); } return(mutableRegions); }
public IList <AccessibilityRegionByRectangle> GetRegions(IEyesBase eyesBase, IEyesScreenshot screenshot) { ReadOnlyCollection <IWebElement> elements = ((Eyes)eyesBase).GetDriver().FindElements(selector_); IList <AccessibilityRegionByRectangle> retVal = new List <AccessibilityRegionByRectangle>(); double scaleRatio = ((Eyes)eyesBase).GetScaleRatioForRegions(); foreach (IWebElement element in elements) { Region r = new Region(element.Location, element.Size); r = r.Scale(scaleRatio); Point pTag = screenshot.ConvertLocation(r.Location, CoordinatesTypeEnum.CONTEXT_RELATIVE, CoordinatesTypeEnum.SCREENSHOT_AS_IS); retVal.Add(new AccessibilityRegionByRectangle(new Rectangle(pTag, r.Size), regionType_)); } return(retVal); }
public IList <IMutableRegion> GetRegions(IEyesBase eyesBase, IEyesScreenshot screenshot) { IWebDriver driver = ((Eyes)eyesBase).GetDriver(); ReadOnlyCollection <IWebElement> elements = driver.FindElements(selector_); IList <IMutableRegion> mutableRegions = new List <IMutableRegion>(); double scaleRatio = ((Eyes)eyesBase).GetScaleRatioForRegions(); foreach (IWebElement element in elements) { Region r = new Region(element.Location, element.Size); r = r.Scale(scaleRatio); Point pTag = screenshot.ConvertLocation(r.Location, CoordinatesTypeEnum.CONTEXT_RELATIVE, CoordinatesTypeEnum.SCREENSHOT_AS_IS); mutableRegions.Add(new MutableRegion(pTag.X, pTag.Y, r.Width, r.Height)); } return(mutableRegions); }
public IList <FloatingMatchSettings> GetRegions(IEyesBase eyesBase, IEyesScreenshot screenshot) { return(new FloatingMatchSettings[] { new FloatingMatchSettings() { Left = rect_.Left, Top = rect_.Top, Width = rect_.Width, Height = rect_.Height, MaxLeftOffset = maxLeftOffset_, MaxUpOffset = maxUpOffset_, MaxRightOffset = maxRightOffset_, MaxDownOffset = maxDownOffset_ } }); }
public IList <FloatingMatchSettings> GetRegions(IEyesBase eyesBase, IEyesScreenshot screenshot) { Rectangle r = EyesSeleniumUtils.GetVisibleElementBounds(element_); Point pTag = screenshot.ConvertLocation(r.Location, CoordinatesTypeEnum.CONTEXT_RELATIVE, CoordinatesTypeEnum.SCREENSHOT_AS_IS); return(new FloatingMatchSettings[] { new FloatingMatchSettings() { Left = pTag.X, Top = pTag.Y, Width = r.Width, Height = r.Height, MaxLeftOffset = maxLeftOffset_, MaxUpOffset = maxUpOffset_, MaxRightOffset = maxRightOffset_, MaxDownOffset = maxDownOffset_ } }); }
public IList <FloatingMatchSettings> GetRegions(IEyesBase eyesBase, IEyesScreenshot screenshot) { double scaleRatio = ((Eyes)eyesBase).GetScaleRatioForRegions(); Region r = new Region(element_.Location, element_.Size); r = r.Scale(scaleRatio); Point pTag = screenshot.ConvertLocation(r.Location, CoordinatesTypeEnum.CONTEXT_RELATIVE, CoordinatesTypeEnum.SCREENSHOT_AS_IS); return(new FloatingMatchSettings[] { new FloatingMatchSettings() { Left = pTag.X, Top = pTag.Y, Width = r.Width, Height = r.Height, MaxLeftOffset = maxLeftOffset_, MaxUpOffset = maxUpOffset_, MaxRightOffset = maxRightOffset_, MaxDownOffset = maxDownOffset_ } }); }
public IList <IMutableRegion> GetRegions(IEyesBase eyesBase, IEyesScreenshot screenshot) { return(new IMutableRegion[] { region }); }
public IList <AccessibilityRegionByRectangle> GetRegions(IEyesBase eyesBase, IEyesScreenshot screenshot) { return(new AccessibilityRegionByRectangle[] { this }); }