Пример #1
0
        public void ExcluirPlanilhaCotacao(string nomePlanilhaExcluida)
        {
            MetodosComuns oMetodosComuns = new MetodosComuns();
            TouchAction   novaAcao       = new TouchAction(driver);

            LoginCorreto();

            Thread.Sleep(3000);

            espera.Until(ExpectedConditions.ElementToBeClickable(btnExpandirListas));
            btnExpandirListas.Click();

            //Nesse tratamento caso não haja uma planilha para renomear o teste cria uma.
            try
            {
                var planilhaSelecionada = oMetodosComuns.CapturaElementoDaLista(driver, nomePlanilhaExcluida, "br.com.cedrotech.fastmobile.dev:id/listName");

                //oMetodosComuns.LongPressPosicoesFixas(driver, planilhaSelecionada.Location.X + 300, planilhaSelecionada.Location.Y, 100, planilhaSelecionada.Location.Y);

                oMetodosComuns.HabilitaRenomearExcluirPlanilha(driver, planilhaSelecionada);
                espera.Until(ExpectedConditions.ElementToBeClickable(btnExcluirPlanilha));
                btnExcluirPlanilha.Click();

                Thread.Sleep(1000);

                espera.Until(ExpectedConditions.ElementToBeClickable(btnConfirmacaoExclusaoSim));
                btnConfirmacaoExclusaoSim.Click();
            }
            catch
            {
                espera.Until(ExpectedConditions.ElementToBeClickable(btnCriarNovaLista));
                btnCriarNovaLista.Click();

                espera.Until(ExpectedConditions.ElementToBeClickable(campoNomeNovaPlanilha));
                campoNomeNovaPlanilha.SendKeys(nomePlanilhaExcluida);

                espera.Until(ExpectedConditions.ElementToBeClickable(btnSalvar));
                btnSalvar.Click();

                var planilhaSelecionada = oMetodosComuns.CapturaElementoDaLista(driver, nomePlanilhaExcluida, "br.com.cedrotech.fastmobile.dev:id/listName");

                //oMetodosComuns.LongPressPosicoesFixas(driver, planilhaSelecionada.Location.X + 300, planilhaSelecionada.Location.Y, 100, planilhaSelecionada.Location.Y);
                oMetodosComuns.HabilitaRenomearExcluirPlanilha(driver, planilhaSelecionada);
                espera.Until(ExpectedConditions.ElementToBeClickable(btnExcluirPlanilha));
                btnExcluirPlanilha.Click();

                Thread.Sleep(1000);

                espera.Until(ExpectedConditions.ElementToBeClickable(btnConfirmacaoExclusaoSim));
                btnConfirmacaoExclusaoSim.Click();
            }
        }