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);
        }
예제 #3
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_)
            });
        }
예제 #4
0
        private static bool GetHasDom_(IEyesBase eyes, TestResults results)
        {
            SessionResults sessionResults = TestUtils.GetSessionResults(eyes.ApiKey, results);

            ActualAppOutput[] actualAppOutputs = sessionResults.ActualAppOutput;
            Assert.AreEqual(1, actualAppOutputs.Length);
            bool hasDom = actualAppOutputs[0].Image.HasDom;

            return(hasDom);
        }
        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_)
            });
        }
예제 #7
0
        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 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);
        }
예제 #10
0
        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);
        }
예제 #12
0
 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_
         }
     });
 }
예제 #13
0
        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_
                }
            });
        }
예제 #14
0
        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 });
 }
예제 #16
0
 public IList <AccessibilityRegionByRectangle> GetRegions(IEyesBase eyesBase, IEyesScreenshot screenshot)
 {
     return(new AccessibilityRegionByRectangle[] { this });
 }