Ejemplo n.º 1
0
        public void verifyPromoVideo()
        {
            String promoVideoImageName = cf.readingXMLFile("AdminPortal", "Video_Management", "PromoVideoImageName", "Config.xml");

            String promoVideoPath = Environment.CurrentDirectory + "\\Upload\\Sikuli\\" + promoVideoImageName;

            Console.WriteLine("promoVideoPath   :" + promoVideoPath);

            Pattern ptnFreePromoVideo = new Pattern(promoVideoPath);

            Sikuli4Net.sikuli_REST.Screen s = new Sikuli4Net.sikuli_REST.Screen();

            Assert.AreEqual(true, s.Exists(ptnFreePromoVideo));
        }
        public Boolean sikuliAuthLogin(String Browser)
        {
            Pattern ImgChromeUsername = new Pattern(authImagePath + "\\ChromeAuthUsername.png");
            Pattern ImgChromePassword = new Pattern(authImagePath + "\\ChromeAuthPassword.png");
            Pattern ImgChromeLogIn    = new Pattern(authImagePath + "\\ChromeAuthLogIn.png");

            adminLogin = false;

            s = new Sikuli4Net.sikuli_REST.Screen();

            Thread.Sleep(5000);

            try
            {
                username = cf.readingXMLFile("AdminPortal", "Login", "userName", "Config.xml");

                password = cf.readingXMLFile("AdminPortal", "Login", "passWord", "Config.xml");

                if (Browser.Equals("Chrome"))
                {
                    s.Wait(ImgChromeUsername, 60);

                    s.Type(ImgChromeUsername, username);

                    s.Type(ImgChromePassword, password);

                    s.Click(ImgChromeLogIn, true);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);

                adminLogin = false;
            }

            return(adminLogin);
        }