예제 #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");
        }