コード例 #1
0
        public void OpenCashMethod()
        {
            MultiClubesFunctions mcFunctions = new MultiClubesFunctions();

            var dc = new DesiredCapabilities();

            dc.SetCapability("app", @"\\tsidev\Triade\Application\Dev\MultiClubes\System\MultiClubes\MultiClubes.UI.application");
            dc.SetCapability("debugConnectToRunningApp", true);
            RemoteWebDriver driver = new RemoteWebDriver(new Uri("http://*****:*****@100");
                mcFunctions.SearchElementByIdAndClick("buttonUser");
                mcFunctions.SearchElementByIdAndClick("buttonOK");
            }
        }
コード例 #2
0
        public void SendUsernameAndPassword()
        {
            MultiClubesFunctions mcFunctions = new MultiClubesFunctions();

            mcFunctions.SearchElementByIdAndSendKeys("textBoxUsername", "qualidade");
            mcFunctions.SearchElementByIdAndSendKeys("textBoxPassword", "DeZer0@100");
            mcFunctions.SearchElementByIdAndClick("button");
        }
コード例 #3
0
        public void AcessarCentraldeAtendimento_6237()
        {
            MultiClubesFunctions McFunctions = new MultiClubesFunctions();
            MultiClubesMenus McMenus = new MultiClubesMenus();

            var dc = new DesiredCapabilities();
            dc.SetCapability("app", @"\\tsidev\Triade\Application\Dev\MultiClubes\System\MultiClubes\MultiClubes.UI.application");
            dc.SetCapability("debugConnectToRunningApp", true);
            RemoteWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:9999"), dc);

            McMenus.AcessarMenuOperacaoTituloCentralDeAtendimento();

            this.UIMap.ProcurarTextoCentralDeAtendimento();
            this.UIMap.ProcurarTextoLocalizeOSocio();
            McFunctions.CloseWindow("Central de atendimento");
        }
コード例 #4
0
        public void CloseCashMethod()
        {
            MultiClubesFunctions mcFunctions = new MultiClubesFunctions();
            MultiClubesMenus     mcMenus     = new MultiClubesMenus();

            var dc = new DesiredCapabilities();

            dc.SetCapability("app", @"\\tsidev\Triade\Application\Dev\MultiClubes\System\MultiClubes\MultiClubes.UI.application");
            dc.SetCapability("debugConnectToRunningApp", true);
            RemoteWebDriver driver = new RemoteWebDriver(new Uri("http://*****:*****@100");

            driver.FindElement(By.Id("buttonUser")).Click();
            mcFunctions.WaitForElementLoad(By.Id("buttonOK"));
            driver.FindElement(By.Id("buttonOK")).Click();
        }
コード例 #5
0
        public void CheckTestTrashMethod()
        {
            Console.WriteLine(DateTime.Now.ToString("HH:mm:ss"));

            MultiClubesFunctions mcFunctions = new MultiClubesFunctions();
            MultiClubesMenus     mcMenus     = new MultiClubesMenus();

            var dc = new DesiredCapabilities();

            dc.SetCapability("app", @"\\tsidev\Triade\Application\Dev\MultiClubes\System\MultiClubes\MultiClubes.UI.application");
            dc.SetCapability("debugConnectToRunningApp", true);
            RemoteWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:9999"), dc);

            while ((driver.FindElement(By.Id("FormMain")).FindElements(By.Name("Cancelar")).Count > 0)
                   ||
                   (driver.FindElement(By.Id("FormMain")).FindElements(By.Name("OK")).Count > 0)
                   ||
                   (driver.FindElement(By.Id("FormMain")).FindElements(By.Name("Fechar")).Count > 2))
            {
                try
                {
                    if ((driver.FindElement(By.Name("Fechar")).Displayed))
                    {
                        driver.FindElement(By.Name("Fechar")).Click();
                    }
                    if ((driver.FindElement(By.Name("Cancelar")).Displayed))
                    {
                        driver.FindElement(By.Name("Cancelar")).Click();
                    }
                    if ((driver.FindElement(By.Name("OK")).Displayed))
                    {
                        driver.FindElement(By.Name("OK")).Click();
                    }
                }
                catch (Exception)
                {
                }
            }

            if (driver.FindElement(By.Id("FormMain")).FindElements(By.Name("Fechar")).Count > 1)
            {
                mcMenus.AcessarMenuArquivoSair();
                Thread.Sleep(500);
                if (driver.FindElements(By.Name("Erro")).Count > 0)
                {
                    string errorMessage = driver.FindElement(By.Id("ContentText")).GetAttribute("Name");
                    driver.FindElement(By.Name("OK")).Click();

                    if (errorMessage == "Finalize o atendimento para sair.")
                    {
                        while (driver.FindElement(By.Id("FormMain")).FindElements(By.Name("Fechar")).Count > 2)
                        {
                            mcFunctions.CloseWindow();
                        }
                        mcFunctions.FinalizarAtendimentoTitulo();
                        mcFunctions.CloseWindow("Central de atendimento");
                        mcMenus.AcessarMenuArquivoSair();
                        if (driver.FindElements(By.Name("Erro")).Count > 0)
                        {
                            errorMessage = driver.FindElement(By.Id("ContentText")).GetAttribute("Name");
                            driver.FindElement(By.Name("OK")).Click();
                        }
                    }
                    if (errorMessage == "Feche o caixa para finalizar o sistema.")
                    {
                        CloseCash closecash = new CloseCash();
                        closecash.CloseCashMethod();
                        mcMenus.AcessarMenuArquivoSair();
                    }
                }
                Console.WriteLine("MultiClubes fechado pelo CheckTestTrash.cs");
            }
            Console.WriteLine(DateTime.Now.ToString("HH:mm:ss"));
        }