public IList <FloatingMatchSettings> GetRegions(EyesBase eyesBase, EyesScreenshot 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);
        }
示例#2
0
        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(EyesBase eyesBase, EyesScreenshot 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);
        }
示例#5
0
        public IList <IMutableRegion> GetRegions(EyesBase eyesBase, EyesScreenshot 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);
        }
示例#6
0
        public IList <FloatingMatchSettings> GetRegions(EyesBase eyesBase, EyesScreenshot 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_
                }
            });
        }