Beispiel #1
0
        public void ChangePaymentGateway(string paymentGateway)
        {
            MultiClubesMenus mcMenus = new MultiClubesMenus();

            mcMenus.AcessarMenuAdministracaoConfiguracoes();

            TreatWaitScreen();

            Keyboard.SendKeys("{END}");

            new Actions(driver).MoveToElement(driver.FindElement(By.Name("Regras de pagamento"))).Click(driver.FindElement(By.Name("Regras de pagamento"))).Build().Perform();
            driver.FindElement(By.Id("linkLabelDefaultEcommerce")).Click();

            WaitForElementLoad(By.Id("comboBoxGateway"));

            driver.FindElement(By.Id("comboBoxGateway")).Click();
            driver.FindElement(By.Name(paymentGateway)).Click();

            IWebElement firstCheckbox = driver.FindElement(By.Id("controlCreditCardSelect")).FindElements(By.Id(""))[0];

            new Actions(driver).MoveToElement(firstCheckbox).ContextClick(firstCheckbox).Build().Perform();

            driver.FindElement(By.Name("Todos")).Click();

            driver.FindElement(By.Id("buttonOK")).Click();
            driver.FindElement(By.Id("buttonOK")).Click();

            TreatWaitScreen();
        }
Beispiel #2
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");
        }
Beispiel #3
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();
        }
        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"));
        }