예제 #1
0
        public void EmissaoDeRemessa_8679()
        {
            MultiClubesFunctions mcFunctions = new MultiClubesFunctions();
            MultiClubesMenus     mcMenus     = new MultiClubesMenus();

            string folderPath = "C:/TestesAutomatizados/TestResults";
            string fileName   = "REMESSA" + DateTime.Now.ToString("_dd_MM_yyyy_HH_mm_ss") + ".rem";
            string filePath   = folderPath + "/" + fileName;

            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.AcessarMenuOperacaoFinanceiroTransacoesBancariasRemessasAnteriores();

            mcFunctions.WaitForElementLoad(By.Id("listView"));
            driver.FindElement(By.Id("listView")).FindElements(By.Id(""))[0].Click();

            mcFunctions.SearchElementByIdAndClick("buttonOptions");
            mcFunctions.SearchElementByNameAndClick("Desfazer");

            mcFunctions.SearchElementByNameAndClick("Sim", true);
            mcFunctions.WaitForElementLoad(By.Id("OPERATION_FINANCIAL+BANK+REMITTANCE_HISTORY"));
            mcFunctions.CloseWindow("Remessas anteriores", "OPERATION_FINANCIAL+BANK+REMITTANCE_HISTORY");

            mcMenus.AcessarMenuOperacaoFinanceiroTransacoesBancariasEmissaoDeRemessa();

            mcFunctions.SearchElementByIdAndClick("comboBoxDunInstitution", true);
            mcFunctions.SearchElementByNameAndClick("BANRISUL BOLETO");

            mcFunctions.SearchElementByIdAndClick("comboBoxRemittanceType");
            mcFunctions.SearchElementByNameAndClick("Impressão");

            mcFunctions.SearchElementByIdAndSendKeys("textBoxFileName", filePath);

            mcFunctions.SearchElementByIdAndClick("buttonOK");
            mcFunctions.SearchElementByNameAndClick("Sim", true);

            bool finishedRemittance = false;

            if (driver.FindElements(By.Name("Erro")).Count > 0)
            {
                Assert.Fail(driver.FindElement(By.Id("ContentText")).GetAttribute("Name"));
            }
            else if (driver.FindElements(By.Name("Concluído")).Count > 0)
            {
                finishedRemittance = true;
            }
            Assert.IsTrue(finishedRemittance, "Gerou a cobrança com sucesso");
            Assert.IsTrue(File.Exists(filePath), "Arquivo criado com sucesso");

            mcFunctions.SearchElementByIdAndClick("buttonOK");
            mcFunctions.CloseWindow("Emissão de remessa", "OPERATION_FINANCIAL+BANK+REMITTANCE_GENERATION");
        }
예제 #2
0
        public void ReemissaoDeRemessa_7483()
        {
            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.AcessarMenuOperacaoFinanceiroTransacoesBancariasRemessasAnteriores();

            McFunctions.WaitForElementLoad(By.Id("listView"), 15);
            driver.FindElement(By.Id("listView")).FindElements(By.Id(""))[0].Click();

            string fileName = driver.FindElement(By.Id("listView")).FindElements(By.Id(""))[0].GetAttribute("Name");

            McFunctions.SearchElementByIdAndClick("buttonOptions", true);
            McFunctions.SearchElementByNameAndClick("Reemitir", true);

            McFunctions.WaitForElementLoad(By.Id("textBoxFolder"));

            string folderPath = "C:/TestesAutomatizados/TestResults";

            McFunctions.SearchElementByIdAndSendKeys("textBoxFolder", folderPath);

            McFunctions.SearchElementByIdAndClick("buttonOK");

            McFunctions.WaitForElementLoad(By.Name("Concluído"), 10);
            McFunctions.SearchElementByIdAndClick("buttonOK");

            McFunctions.CloseWindow("Diretório Saída Remessa");
            McFunctions.CloseWindow("Remessas anteriores");

            string filePath = folderPath + "/" + fileName;

            Assert.IsTrue(File.Exists(filePath), "Arquivo gerado corretamente");
        }