Exemplo n.º 1
0
        public void TestFindAllDefault()
        {
            //There are 3 patterns on the test image
            List <Point> points = SikuliAction.FindAll(findAllPattern);

            if (points != null)
            {
                foreach (Point point in points)
                {
                    Report.Info("X:" + point.X + "  Y: " + point.Y);
                }
                if (points.Count == 6)
                {
                    Report.Pass("Yep! They are 6...");
                }
                else
                {
                    Report.Error("Nope! They are NOT 6, they are " + points.Count);
                }
            }
            else
            {
                Report.Error("Nope! There is a problem...");
            }
        }
Exemplo n.º 2
0
        public void TestFindAllIntoRegion()
        {
            //There are 3 patterns on the test region
            Rectangle    searchRegion = new Rectangle(1, 150, 300, 100);
            List <Point> points       = SikuliAction.FindAll(findAllPattern, searchRegion);

            if (points != null)
            {
                foreach (Point point in points)
                {
                    Report.Info("X:" + point.X + "  Y: " + point.Y);
                }
                if (points.Count == 3)
                {
                    Report.Pass("Yep! They are 3...");
                }
                else
                {
                    Report.Error("Nope! They are NOT 3, they are " + points.Count);
                }
            }
            else
            {
                Report.Error("Nope! There is a problem...");
            }
        }
Exemplo n.º 3
0
        public void TestFindAllWithSimilarity90AndTimeout5()
        {
            //There are 6 patterns on the test image
            List <Point> points = SikuliAction.FindAll(findAllPattern, Similarity90, Timeout5S, Rectangle.Empty);

            if (points != null)
            {
                foreach (Point point in points)
                {
                    Report.Info("X:" + point.X + "  Y: " + point.Y);
                }
                if (points.Count == 6)
                {
                    Report.Pass("Yep! They are 6...");
                }
                else
                {
                    Report.Error("Nope! They are NOT 6, they are " + points.Count);
                }
            }
            else
            {
                Report.Error("Nope! There is a problem...");
            }
        }
Exemplo n.º 4
0
        public void DemoFindAll()
        {
            //There are 3 patterns on the test image
            List <Point> points = SikuliAction.FindAll(findAllPattern);

            if (points != null)
            {
                foreach (Point point in points)
                {
                    Console.WriteLine("X:" + point.X + "  Y: " + point.Y);
                }
                if (points.Count == 3)
                {
                    Console.WriteLine("Yep! They are 3...");
                }
                else
                {
                    Console.WriteLine("Nope! They are NOT 3, they are " + points.Count);
                }
            }
            else
            {
                Console.WriteLine("Nope! There is a problem...");
            }
        }
Exemplo n.º 5
0
        public static void isExist(string path, string failMsg, int RedotimeOut = 0)
        {
            bool returnValue = false;

            DateTime varDateTime;
            DateTime varElapseTime = DateTime.Now.AddSeconds(RedotimeOut);

            do
            {
                varDateTime = DateTime.Now;
                try
                {
                    SikuliAction.FindAll(path);
                    returnValue = true;
                    break;
                }
                catch (Exception e) { }
            } while (varDateTime <= varElapseTime);


            BaseTest.Assert.IsTrue(returnValue, failMsg);
        }