Esempio n. 1
0
 private void Start()
 {
     ctf = FindObjectOfType <CTF>();
     if (ctf == null)
     {
     }
 }
        public override void Update()
        {
            this.spawnTime = 4f;
            if (this._present != null && this._present.removeFromLevel)
            {
                this._present = (CTFPresent)null;
            }
            CTFPresent ctfPresent1 = (CTFPresent)null;
            CTFPresent ctfPresent2 = (CTFPresent)null;

            foreach (CTFPresent ctfPresent3 in Level.CheckCircleAll <CTFPresent>(this.position, 16f))
            {
                if (ctfPresent3 != this._present)
                {
                    ctfPresent2 = ctfPresent3;
                }
                else
                {
                    ctfPresent1 = ctfPresent3;
                }
            }
            if (ctfPresent2 != null & ctfPresent1 != null)
            {
                if (ctfPresent2.duck != null)
                {
                    ctfPresent2.duck.ThrowItem();
                }
                Level.Remove((Thing)ctfPresent2);
                Level.Add((Thing)SmallSmoke.New(ctfPresent2.x, ctfPresent2.y));
                CTF.CaptureFlag((bool)this.team);
                SFX.Play("equip");
            }
            base.Update();
        }
Esempio n. 3
0
        public void exec()
        {
            #region Cabeçalho CTF
            CTF.Iniciar(this.Codigo);
            CTF.InformacoesIniciais(
                this.Modulo,
                this.Funcao,
                this.PreCondicao,
                this.PosCondicao,
                "Browser:" + Settings.BrowserDesc + "\tWeb:" + Settings.ServerUrl + "\tBD:" + Settings.DataBase,
                Settings.ProductVersion,
                this.SAC,
                Settings.Tester,
                DateTime.Today.ToString(@"DD/MM/YYYY"));
            //
            #endregion



            foreach (PassoDoTeste passo in Passos)
            {
                if (passo.deveExecutar)
                {
                    passo.executar();
                }
            }


            CTF.Finalizar();
        }
Esempio n. 4
0
 public void reprovar()
 {
     TotalErr++;
     this.UltimaSituacao   = false;
     this.testSituationImg = IMG_ERRO;
     Tools.ToolTipSystemTray.showErrorBalloon("Caso de Teste", "Abortado - Apresentou Falha");
     CTF.registrarErro();
     this.Salvar();
 }
Esempio n. 5
0
 public void aprovar()
 {
     TotalApr++;
     this.UltimaSituacao   = true;
     this.testSituationImg = IMG_APPR;
     Tools.ToolTipSystemTray.showAprBalloon("Caso de Teste", "Finalizado com Sucesso");
     CTF.registrarSucesso();
     this.Salvar();
 }
Esempio n. 6
0
        public static void IncluirPedidoDeConsultaEletivaParaBeneficiario()
        {
            //#region Cabeçalho CTF
            //CTF.Iniciar(TestContext.CurrentContext.Test.Properties.Get("Nome").ToString());
            //CTF.InformacoesIniciais(
            //    TestContext.CurrentContext.Test.Properties.Get("Módulo").ToString(),
            //    TestContext.CurrentContext.Test.Properties.Get("Função").ToString(),
            //    TestContext.CurrentContext.Test.Properties.Get("Pré Condição").ToString(),
            //    TestContext.CurrentContext.Test.Properties.Get("Pós Condição").ToString(),
            //    TestContext.CurrentContext.Test.Properties.Get("Ambiente").ToString(),
            //    TestContext.CurrentContext.Test.Properties.Get("Versão").ToString(),
            //    TestContext.CurrentContext.Test.Properties.Get("SAC").ToString(),
            //    TestContext.CurrentContext.Test.Properties.Get("Responsável").ToString(),
            //    DateTime.Today.ToString(@"DD/MM/YYYY"));
            //
            //#endregion


            #region Cabeçalho CTF
            CTF.Iniciar("teste-autorizacoes");
            CTF.InformacoesIniciais(
                "autorizacoes",
                "autorizacoes",
                "",
                "usuário logado",
                "Browser:IE10\tWeb:10.10.100.147\tBD:Homo_Med",
                "11",
                "N/A",
                "Peterson Andrade",
                DateTime.Today.ToString(@"DD/MM/YYYY"));
            //
            #endregion


            try
            {
                //Lista de Beneficiários Ativos
                string[] beneficiariosAtivos = { "002010625850007", "002010625853006", "004510625887000", "002010625848002", "002010625808000" };
                //
                Tela_Autorizacoes_PedidosDeAutorizacao_Inclusao.IrPara("HOMO_MED", "admin", "topdown");
                Tela_Autorizacoes_PedidosDeAutorizacao_Inclusao.informarBeneficiario(Utils.recuperarAletorio(beneficiariosAtivos));
                Tela_Autorizacoes_PedidosDeAutorizacao_Inclusao.informarTipoConsulta("CONSULTA ELETIVA");
                Tela_Autorizacoes_PedidosDeAutorizacao_Inclusao.infomarDataSolicitacaoConsulta("30/11/2016");
                CTF.inserirImagem(PrintUtils.takeSS());
                Tela_Autorizacoes_PedidosDeAutorizacao_Inclusao.clicarNaToolbar("AN");
                ////Tela_Autorizacoes_PedidosDeAutorizacao_Inclusao.moverBarraLateralParaInicio();
                Tela_Autorizacoes_PedidosDeAutorizacao_Inclusao.aguardarInclusao();
                Assert.IsTrue(Tela_Autorizacoes_PedidosDeAutorizacao_Inclusao.verificarSucessoInclusao());
                CTF.inserirImagem(PrintUtils.takeSS());
                CTF.registrarSucesso();
            }
            catch (Exception ex)
            {
                CTF.registrarErro();
                throw ex;
            }
        }
Esempio n. 7
0
        public static void ConsegueLogar()
        {
            //#region Cabeçalho CTF
            //CTF.Iniciar(TestContext.CurrentContext.Test.Properties.Get("Nome").ToString());
            //CTF.InformacoesIniciais(
            //    TestContext.CurrentContext.Test.Properties.Get("Módulo").ToString(),
            //    TestContext.CurrentContext.Test.Properties.Get("Função").ToString(),
            //    TestContext.CurrentContext.Test.Properties.Get("Pré Condição").ToString(),
            //    TestContext.CurrentContext.Test.Properties.Get("Pós Condição").ToString(),
            //    TestContext.CurrentContext.Test.Properties.Get("Ambiente").ToString(),
            //    TestContext.CurrentContext.Test.Properties.Get("Versão").ToString(),
            //    TestContext.CurrentContext.Test.Properties.Get("SAC").ToString(),
            //    TestContext.CurrentContext.Test.Properties.Get("Responsável").ToString(),
            //    DateTime.Today.ToString(@"DD/MM/YYYY"));
            ////
            //#endregion

            #region Cabeçalho CTF
            CTF.Iniciar("teste-login");
            CTF.InformacoesIniciais(
                "login",
                "login",
                "",
                "usuário logado",
                "Browser:IE10\tWeb:10.10.100.147\tBD:Homo_Med",
                "11",
                "N/A",
                "Peterson Andrade",
                DateTime.Today.ToString(@"DD/MM/YYYY"));
            //
            #endregion

            #region Passos do Caso de Teste
            //try
            //{
            Tela_Login.IrPara();
            Tela_Login.InformarBase("HOMO_MED");
            Tela_Login.InformarUsuario("admin");
            Tela_Login.InformarSenha("topdown");
            CTF.inserirImagem(Browser.Print());
            Tela_Login.ClicarEmLogar();
            Assert.IsTrue(Tela_Principal.EstaEm());
            CTF.inserirImagem(Browser.Print());
            CTF.registrarSucesso();
            //}
            //catch (Exception ex)
            //{
            //    CTF.registrarErro();
            //    throw ex;
            //}

            CTF.Finalizar();
            #endregion
        }
Esempio n. 8
0
        public void run(int stepDelay, int browser_cod)
        {
            try
            {
                //TODO: SUBSTITUIR POR URL DO SISTEMA SELECIONADO
                string baseDir             = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
                string IE_DRIVER_PATH      = Path.Combine(baseDir, "WebDriver\\IEDriverServer_Win32_2.53.1");
                string CHROME_DRIVER_PATH  = Path.Combine(baseDir, "WebDriver\\chromedriver_win32");
                string FIREFOX_DRIVER_PATH = Path.Combine(baseDir, "WebDriver\\geckodriver");
                string SAFARI_DRIVER_PATH  = Path.Combine(baseDir, "WebDriver\\chromedriver_win32");
                string EDGE_DRIVER_PATH    = Path.Combine(baseDir, "WebDriver\\edgeWebDriver");
                string OPERA_DRIVER_PATH   = Path.Combine(baseDir, "WebDriver\\operadriver_win32");

                //teste = @"D:\Peterson\Projetos\QADynamicFramework\TopDown_QA_FrameWork\WebDriver\IEDriverServer_Win32_2.53.1";
                //if (File.Exists(teste))
                //{
                //    MessageBox.Show("Existe");
                //}
                //else
                //{
                //    MessageBox.Show("Nao existe");
                //}
                //MessageBox.Show(teste);

                //Passar o Browser Desejado
                TopDown_QA_FrameWork.Browser.Initialize(this.SistemaPai.homeURL, browser_cod, IE_DRIVER_PATH, CHROME_DRIVER_PATH, FIREFOX_DRIVER_PATH, SAFARI_DRIVER_PATH, EDGE_DRIVER_PATH, OPERA_DRIVER_PATH);
                CTF.Iniciar(this.Codigo);



                this.exec(stepDelay, browser_cod);
                this.aprovar();
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message + ex.Source + ex.StackTrace);
                this.reprovar();
            }
            finally
            {
                this.postExec();
                //updateWindow();
                if (Settings.CloseBrowserAfterTestCase)
                {
                    TopDown_QA_FrameWork.Browser.Close();
                }
            }
        }
Esempio n. 9
0
        public void InsereEHabilitaNovoPrestador()
        {
            #region Cabeçalho CTF
            CTF.Iniciar(TestContext.CurrentContext.Test.Properties.Get("Nome").ToString());
            CTF.InformacoesIniciais(
                TestContext.CurrentContext.Test.Properties.Get("Módulo").ToString(),
                TestContext.CurrentContext.Test.Properties.Get("Função").ToString(),
                TestContext.CurrentContext.Test.Properties.Get("Pré Condição").ToString(),
                TestContext.CurrentContext.Test.Properties.Get("Pós Condição").ToString(),
                TestContext.CurrentContext.Test.Properties.Get("Ambiente").ToString(),
                TestContext.CurrentContext.Test.Properties.Get("Versão").ToString(),
                TestContext.CurrentContext.Test.Properties.Get("SAC").ToString(),
                TestContext.CurrentContext.Test.Properties.Get("Responsável").ToString(),
                DateTime.Today.ToString(@"DD/MM/YYYY"));
            //
            #endregion
            try
            {
                //Insere e Habilita Novo Prestador

                //Dados Cadastrais
                InclusaoPrestador.IrPara("HOMO_MED", "admin", "topdown");
                InclusaoPrestador.informarVinculacao("Credenciado");
                InclusaoPrestador.informarTipoPessoa(InclusaoPrestador.PessoaFisica);
                InclusaoPrestador.Clicar_IncluirPessoaFisica();

                //Gerando Dados Para serem Inseridos
                Pessoa.gerar();

                //Dados Cadastrais
                InclusaoPrestador.InformarNome(Pessoa.Nome);
                InclusaoPrestador.InformarNaturalidade(Pessoa.CodCidade);
                InclusaoPrestador.InformarSexo(Pessoa.Sexo);
                InclusaoPrestador.InformarNascimento(Pessoa.DataNascimento);
                InclusaoPrestador.InformarCPF(Pessoa.CPF);
                CTF.inserirImagem(Browser.Print());

                // Endereços
                InclusaoPrestador.AcessarMenu("Endereços");
                InclusaoPrestador.InformarCEP(Pessoa.CEP);
                InclusaoPrestador.InformarNumeroEndereco(Utils.GerarNumeroAleatorio(1, 1000));
                CTF.inserirImagem(Browser.Print());

                //Toolbar
                InclusaoPrestador.Clicar_icone_incluir();
                InclusaoPrestador.verificarSucessoInclusao();

                string NumeroPrestadorIncluido = InclusaoPrestador.recuperarNumeroPrestadorIncluido();
                AlteracaoPrestador.IrPara("HOMO_MED", "admin", "topdown");
                AlteracaoPrestador.InformarPrestador(NumeroPrestadorIncluido);

                //Dados Cadastrais
                InclusaoPrestador.AcessarMenu("Dados Cadastrais");
                InclusaoPrestador.InformarSiglaConselho("CRM");
                InclusaoPrestador.InformarNumeroConselho(Utils.GerarNumeroAleatorio(1000000000, 9999999999));
                InclusaoPrestador.InformarUFConselho("RJ-Rio de Janeiro");
                CTF.inserirImagem(Browser.Print());

                //Finalizar Alteração
                AlteracaoPrestador.Clicar_Botao_Alterar();


                AlteracaoPrestador.IrPara("HOMO_MED", "admin", "topdown");
                AlteracaoPrestador.InformarPrestador(NumeroPrestadorIncluido);

                //Informações Complementares
                InclusaoPrestador.AcessarMenu("Informações Complementares");
                InclusaoPrestador.InformarOperadora("1 - SEPACO AutoGestão");
                InclusaoPrestador.InformarTipoEstabelecimento_ANS("Assistência hospitalar");
                InclusaoPrestador.InformarDisponibilidadeServico_ANS("Parcial");
                InclusaoPrestador.InformarTipoContratualizacao_ANS("Direta");
                CTF.inserirImagem(Browser.Print());

                //Todo: Consertar Erros Nessa Parte de Informar Data, pq quando salva informando a data ele perde a informação do resto
                //InclusaoPrestador.InformarDataCredenciamento_ANS("10/05/1995");
                //InclusaoPrestador.InformarDataContratualizacao_ANS(Utils.dataHoje());



                //Alterar Tipo Estabelecimento
                //Selecionado
                InclusaoPrestador.AcessarMenu("Tipo Estabelecimento");
                AlteracaoPrestador.SelecionarTipoEstabelecimento(0, 0);
                AlteracaoPrestador.SelecionarTipoEstabelecimento(1, 0);
                AlteracaoPrestador.SelecionarTipoEstabelecimento(2, 0);
                AlteracaoPrestador.SelecionarTipoEstabelecimento(3, 0);
                AlteracaoPrestador.SelecionarTipoEstabelecimento(4, 0);
                AlteracaoPrestador.SelecionarTipoEstabelecimento(5, 0);
                AlteracaoPrestador.SelecionarTipoEstabelecimento(6, 0);
                AlteracaoPrestador.SelecionarTipoEstabelecimento(7, 0);
                AlteracaoPrestador.SelecionarTipoEstabelecimento(8, 0);
                //Principal?
                AlteracaoPrestador.SelecionarTipoEstabelecimento(0, 3);
                //Divulgação?
                AlteracaoPrestador.SelecionarTipoEstabelecimento(0, 4);
                AlteracaoPrestador.SelecionarTipoEstabelecimento(1, 4);
                AlteracaoPrestador.SelecionarTipoEstabelecimento(2, 4);
                AlteracaoPrestador.SelecionarTipoEstabelecimento(3, 4);
                AlteracaoPrestador.SelecionarTipoEstabelecimento(4, 4);
                AlteracaoPrestador.SelecionarTipoEstabelecimento(5, 4);
                AlteracaoPrestador.SelecionarTipoEstabelecimento(6, 4);
                AlteracaoPrestador.SelecionarTipoEstabelecimento(7, 4);
                AlteracaoPrestador.SelecionarTipoEstabelecimento(8, 4);
                CTF.inserirImagem(Browser.Print());

                //Validar Alterações
                AlteracaoPrestador.Clicar_Botao_Alterar();


                ////Dados de pagamento
                InclusaoPrestador.AcessarMenu("Dados Pagamento");
                InclusaoPrestador.InformarDataVigenciaDe("01/01/2016");
                InclusaoPrestador.InformarDataVigenciaAte("01/01/2017");
                InclusaoPrestador.InformarFormaPagamentoDasContas("Dinheiro / Cheque");
                InclusaoPrestador.SelecionarEmiteNotaFiscal("Sim");
                InclusaoPrestador.SelecionarMomentoApresentacao("Na entrega da remessa");
                CTF.inserirImagem(Browser.Print());


                ////Salvar Alterações
                AlteracaoPrestador.Clicar_Botao_Alterar();


                InclusaoPrestador.AcessarMenu("Rede Atendimento");
                AlteracaoPrestador.Clicar_Botao_AdicionarRedeAtendimento();
                AlteracaoPrestador.PesquisarRedeAtendimento();

                AlteracaoPrestador.RedeAtendimentoSelect(0, 0);
                AlteracaoPrestador.RedeAtendimentoSelect(1, 0);
                AlteracaoPrestador.RedeAtendimentoSelect(2, 0);
                AlteracaoPrestador.RedeAtendimentoSelect(3, 0);
                AlteracaoPrestador.RedeAtendimentoSelect(4, 0);

                CTF.inserirImagem(Browser.Print());

                AlteracaoPrestador.Clicar_Botao_Alterar();

                //Dados Cadastrais
                InclusaoPrestador.AcessarMenu("Informações Complementares");
                InclusaoPrestador.InformarOperadora("1 - SEPACO AutoGestão");
                InclusaoPrestador.InformarDataCredenciamento_ANS(Utils.dataHoje());
                InclusaoPrestador.InformarDataContratualizacao_ANS(Utils.dataHoje());
                CTF.inserirImagem(Browser.Print());

                AlteracaoPrestador.Clicar_Botao_Alterar();


                //Informar Endereços Atendimento
                InclusaoPrestador.AcessarMenu("Endereços Atendimento");
                AlteracaoPrestador.Clicar_Botao_AdicionarEnderecoAtendimento();
                //Informar CEP
                AlteracaoPrestador.InformarCepAtendimento(Pessoa.CEP);
                //Selecionar Tipo Logradouro (Dropdown)
                //Informar Logradouro Nome
                //Informar Numero
                AlteracaoPrestador.InformarNumeroEnderecoAtendimento(Utils.GerarNumeroAleatorio(1, 1000));
                //Informar Numero Municipio
                CTF.inserirImagem(Browser.Print());


                AlteracaoPrestador.Clicar_Botao_Alterar();

                CTF.registrarSucesso();
            }
            catch (Exception ex)
            {
                CTF.registrarErro();
                throw ex;
            }
        }
Esempio n. 10
0
        public void executar()
        {
            //Achar a Acao que está no passo

            Logger.escrever("Acao: " + acaoSelecionada.Nome + " " + acaoSelecionada.TelaPai.Nome + " " + acaoSelecionada.Id.ToString());

            if (!deveExecutar)
            {
                throw new Exception("A função não deve ser executada");
            }

            bool retorno;

            //Tratando Programação dentro da Grid
            string ParametroKeeper = Parametro;

            if (Parametro == null)
            {
                Parametro = "";
            }
            if (ParametroEhFuncao())
            {
                //é uma programação
                string funcao        = Parametro.Substring(1, Parametro.IndexOf("(") - 1);
                string parametroFunc = Parametro.Substring(Parametro.IndexOf("(") + 1, Parametro.Length - funcao.Length - 3);

                funcao = funcao.ToUpper();

                switch (funcao)
                {
                case "PARAMETRO":
                    this.Parametro = this.TestCaseParent.getPassoDoTestAtIndex(Convert.ToInt32(parametroFunc)).Parametro;
                    break;

                case "RETORNO":
                    //Recuperar Passo do Teste Específico do Caso de Teste do Qual esse Passo Pertence
                    this.Parametro = this.TestCaseParent.getPassoDoTestAtIndex(Convert.ToInt32(parametroFunc)).Retorno;
                    break;

                case "GERARCPF":
                    this.Parametro = Utils.GerarCpf();
                    break;

                case "DATAHOJE":
                    this.Parametro = Utils.dataHoje();
                    break;

                case "GERARCNS":
                    this.Parametro = Utils.geraCNS();
                    break;
                }
            }

            resultado = acaoSelecionada.Executar(Parametro);

            this.Retorno = resultado.retornoInformacao;

            //MessageBox.Show(resultado.passou.ToString() + resultado.retornoInformacao);
            //if (acaoSelecionada.acaoRetorno != null)
            //    this.Retorno = acaoSelecionada.acaoRetorno(Parametro);

            parametroComputado = Parametro;
            Parametro          = ParametroKeeper;


            if (deveFotografar)
            {
                CTF.inserirImagem(PrintUtils.takeSS());
            }
            if (resultado.passou == true)
            {
                //ok
                teveSucesso  = true;
                SituationImg = PassoDoTeste.IMG_APPR;
            }
            else
            {
                teveSucesso  = false;
                SituationImg = PassoDoTeste.IMG_ERRO;
                throw new Exception("Ação retornou FALSE (resultado esperado falhou).");
            }
        }
Esempio n. 11
0
 protected override void Start()
 {
     base.Start(); // initialize base class
     gameManager = GameObject.FindGameObjectWithTag("GameManager"); 
     _ctf = gameManager.GetComponent<CTF>();
 }
Esempio n. 12
0
        private async void Movie_CTF1DChanged(object sender, EventArgs e)
        {
            try
            {
                AdjustGridVisibility();
                if (Movie == null)
                {
                    return;
                }

                TiltSeries Series = Movie as TiltSeries;

                bool NoDataAvailable = false;
                if ((Movie.GetType() == typeof(Movie) || ShowSeriesAverage) && (Movie.PS1D == null || Movie.Simulated1D == null))
                {
                    NoDataAvailable = true;
                }
                else if (Series != null && (Series.TiltPS1D.Count <= TiltID || Series.TiltPS1D[TiltID] == null))
                {
                    NoDataAvailable = true;
                }

                if (NoDataAvailable)
                {
                    Plot1DSeriesExperimental.Values = null;
                    Plot1DSeriesSimulated.Values    = null;
                    Plot1DSeriesQuality.Values      = null;

                    return;
                }

                //ProgressCTF1D.Visibility = Visibility.Visible;
                Movie   movie           = Movie;
                decimal fittingRangeMin = FittingRangeMin;

                //await Task.Delay(1000);
                await Task.Run(() =>
                {
                    float2[] ExperimentalData = (Series == null || _ShowSeriesAverage) ? movie.PS1D : Series.TiltPS1D[TiltID];
                    float2[] SimulatedData    = (Series == null || _ShowSeriesAverage) ? movie.Simulated1D : Series.GetTiltSimulated1D(TiltID);
                    Cubic1D ScaleData         = (Series == null || _ShowSeriesAverage) ? movie.SimulatedScale : Series.TiltSimulatedScale[TiltID];

                    int N = ExperimentalData.Length * 2;

                    ChartValues <ObservablePoint> ExperimentalValues = new ChartValues <ObservablePoint>(ExperimentalData.Select(p => new ObservablePoint(p.X *N, p.Y)));
                    ChartValues <ObservablePoint> SimulatedValues    = new ChartValues <ObservablePoint>(SimulatedData.Select(p => new ObservablePoint(p.X *N, p.Y)));

                    CTF CTF         = (Series == null || _ShowSeriesAverage) ? movie.CTF : Series.GetTiltCTF(TiltID);
                    float[] Quality = CTF.EstimateQuality(ExperimentalData.Select(p => p.Y).ToArray(), ScaleData.Interp(ExperimentalData.Select(p => p.X).ToArray()), (float)fittingRangeMin, 16, true);

                    Dispatcher.Invoke(() =>
                    {
                        Plot1DSeriesExperimental.Values = ExperimentalValues;
                        Plot1DSeriesSimulated.Values    = SimulatedValues;
                        Plot1DSeriesQuality.Values      = new ChartValues <double>(Quality.Select(v => (double)Math.Max(0, v)));
                    });
                });

                AdjustYAxis();
                FittingRangeChanged(null, new DependencyPropertyChangedEventArgs());

                //ProgressCTF1D.Visibility = Visibility.Hidden;
            }
            catch
            {
            }
        }
Esempio n. 13
0
        private async void Movie_CTF2DChanged(object sender, EventArgs e)
        {
            try
            {
                AdjustGridVisibility();
                ImageSimulated2D.Visibility = Visibility.Hidden;

                if (Movie == null)
                {
                    return;
                }

                if (Movie.OptionsCTF == null || Movie.CTF == null)
                {
                    return;
                }

                this.Width  = Movie.OptionsCTF.Window;
                this.Height = Movie.OptionsCTF.Window;
                ProgressCTF2D.Visibility = Visibility.Visible;

                int Width    = Movie.OptionsCTF.Window / 2;
                CTF MovieCTF = Movie.CTF;

                //await Task.Delay(1000);
                await Task.Run(() =>
                {
                    ImageSource Simulated2D;

                    unsafe
                    {
                        float2[] SimCoords         = new float2[Width *Width];
                        fixed(float2 *SimCoordsPtr = SimCoords)
                        {
                            float2 *SimCoordsP = SimCoordsPtr;
                            for (int y = 0; y < Width; y++)
                            {
                                int ycoord  = Width - 1 - y;
                                int ycoord2 = ycoord *ycoord;
                                for (int x = 0; x < Width; x++)
                                {
                                    int xcoord    = x - Width;
                                    *SimCoordsP++ = new float2((float)Math.Sqrt(xcoord *xcoord + ycoord2) / (Width * 2), (float)Math.Atan2(ycoord, xcoord));
                                }
                            }
                        }
                        float[] Sim2D             = MovieCTF.Get2D(SimCoords, true, true, true);
                        byte[] Sim2DBytes         = new byte[Sim2D.Length];
                        fixed(byte *Sim2DBytesPtr = Sim2DBytes)
                        fixed(float *Sim2DPtr     = Sim2D)
                        {
                            byte *Sim2DBytesP = Sim2DBytesPtr;
                            float *Sim2DP     = Sim2DPtr;
                            for (int i = 0; i < Width *Width; i++)
                            {
                                *Sim2DBytesP++ = (byte)(*Sim2DP++ *128f + 127f);
                            }
                        }

                        Simulated2D = BitmapSource.Create(Width, Width, 96, 96, PixelFormats.Indexed8, BitmapPalettes.Gray256, Sim2DBytes, Width);
                        Simulated2D.Freeze();
                    }

                    Dispatcher.Invoke(() =>
                    {
                        ImageSimulated2D.Source     = Simulated2D;
                        ImageSimulated2D.Visibility = Visibility.Visible;
                    });
                });

                ProgressCTF2D.Visibility = Visibility.Hidden;
            }
            catch
            {
            }
        }
        public void IncluirNovoBeneficiarioTitular()
        {
            #region Cabeçalho CTF
            CTF.Iniciar(TestContext.CurrentContext.Test.Properties.Get("Nome").ToString());
            CTF.InformacoesIniciais(
                TestContext.CurrentContext.Test.Properties.Get("Módulo").ToString(),
                TestContext.CurrentContext.Test.Properties.Get("Função").ToString(),
                TestContext.CurrentContext.Test.Properties.Get("Pré Condição").ToString(),
                TestContext.CurrentContext.Test.Properties.Get("Pós Condição").ToString(),
                TestContext.CurrentContext.Test.Properties.Get("Ambiente").ToString(),
                TestContext.CurrentContext.Test.Properties.Get("Versão").ToString(),
                TestContext.CurrentContext.Test.Properties.Get("SAC").ToString(),
                TestContext.CurrentContext.Test.Properties.Get("Responsável").ToString(),
                DateTime.Today.ToString(@"DD/MM/YYYY"));
            //
            #endregion
            try
            {
                string[] contratosAtivos = { "8138", "8156", "8116", "9315", "9427", "8101", "6994", "7493", "8175", "541624" };
                Tela_Inclusao_de_Titular.IrPara("HOMO_MED", "admin", "topdown");
                Tela_Inclusao_de_Titular.InformarContrato(Utils.recuperarAletorio(contratosAtivos));
                CTF.inserirImagem(PrintUtils.takeSS());
                Pessoa.gerar();
                //Dados Cadastrais
                Tela_Inclusao_de_Titular.InformarCPF(Pessoa.CPF);
                Tela_Inclusao_de_Titular.InformarNome(Pessoa.Nome);
                Tela_Inclusao_de_Titular.InformarNomeCartao(Pessoa.Nome);
                Tela_Inclusao_de_Titular.InformarDataInclusao(Utils.dataHoje());
                Tela_Inclusao_de_Titular.InformarSexo(Pessoa.Sexo);
                Tela_Inclusao_de_Titular.InformarDataNascimento(Pessoa.DataNascimento);
                Tela_Inclusao_de_Titular.InformarNacionalidade("Brasileira");
                Tela_Inclusao_de_Titular.InformarMae("MARIA DA SILVA");
                Tela_Inclusao_de_Titular.InformarPai("JOAO DA SILVA");
                Tela_Inclusao_de_Titular.InformarEstadoCivil("Solteiro");
                Tela_Inclusao_de_Titular.InformarPlano();
                Tela_Inclusao_de_Titular.InformarMunicipioResidencia("7043");
                CTF.inserirImagem(PrintUtils.takeSS());

                //Documentos
                Tela_Inclusao_de_Titular.InformarNumeroDocIdentidade("5454826");
                Tela_Inclusao_de_Titular.InformarDataEmissaoIdentidade("12/12/2000");
                Tela_Inclusao_de_Titular.InformarOrgaoDeEmissaoIdentidade("MINISTÉRIO DA MARINHA");
                Tela_Inclusao_de_Titular.InformarPIS_PASEP_NIT("");
                CTF.inserirImagem(PrintUtils.takeSS());

                //Informações Complementares
                //Dados de Reembolso
                //Endereço 1
                Tela_Inclusao_de_Titular.InformarTipoEndereco("Residência");
                Tela_Inclusao_de_Titular.InformarPaisEndereco("Brasil");
                Tela_Inclusao_de_Titular.InformarCEPEndereco("24422020");
                Tela_Inclusao_de_Titular.InformarNumeroEndereco("160");

                //Dados Empresa
                Tela_Inclusao_de_Titular.InformarMatriculaFuncional("65454854542");
                Tela_Inclusao_de_Titular.InformarDataAdmissao("27/11/2016");
                //Clicar em Incluir
                Tela_Inclusao_de_Titular.moverBarraLateralParaInicio();
                Tela_Inclusao_de_Titular.ClicarEmIncluir();
                //Tela_Inclusao_de_Titular.aguardarInclusao();
                Assert.IsTrue(Tela_Inclusao_de_Titular.verificarSucessoInclusao());
                CTF.inserirImagem(PrintUtils.takeSS());

                //Aguardar a Inclusao
                //Verificar Numero de Inclusao

                CTF.registrarSucesso();
            }
            catch (Exception ex)
            {
                CTF.registrarErro();
                throw ex;
            }
        }
Esempio n. 15
0
        //hitted? jonty I thought you were better than that :(
        public void HitPlayer(World world, Vector3I pos, Player hitted, Player by, ref int restDistance, IList <BlockUpdate> updates)
        {
            //Capture the flag
            if (by.Info.isPlayingCTF)
            {
                //Friendly fire
                if ((hitted.Info.CTFBlueTeam && by.Info.CTFBlueTeam) || (hitted.Info.CTFRedTeam && by.Info.CTFRedTeam))
                {
                    by.Message("{0} is on your team!", hitted.Name);
                    return;
                }

                if (hitted.Info.canDodge)
                {
                    int dodgeChance = (new Random()).Next(0, 2);
                    if (dodgeChance == 0)
                    {
                        by.Message("{0} dodged your attack!", hitted.Name);
                        return;
                    }
                }
                //Take the hit, one in ten chance of a critical hit which does 50 damage instead of 25
                int critical = (new Random()).Next(0, 9);

                if (critical == 0)
                {
                    if (by.Info.strengthened)//critical by a strengthened enemy instantly kills
                    {
                        hitted.Info.Health = 0;
                    }
                    else
                    {
                        hitted.Info.Health -= 50;
                    }
                    world.Players.Message("{0} landed a critical shot on {1}!", 0, by.Name, hitted.Name);
                }
                else
                {
                    if (by.Info.strengthened)
                    {
                        hitted.Info.Health -= 50;
                    }
                    else
                    {
                        hitted.Info.Health -= 25;
                    }
                }

                //Create epic ASCII Health Bar

                string healthBar = "&f[&a--------&f]";
                if (hitted.Info.Health == 75)
                {
                    healthBar = "&f[&a------&8--&f]";
                }
                else if (hitted.Info.Health == 50)
                {
                    healthBar = "&f[&e----&8----&f]";
                }
                else if (hitted.Info.Health == 25)
                {
                    healthBar = "&f[&c--&8------&f]";
                }
                else if (hitted.Info.Health <= 0)
                {
                    healthBar = "&f[&8--------&f]";
                }

                if (hitted.usesCPE)
                {
                    hitted.Send(PacketWriter.MakeSpecialMessage((byte)1, healthBar));
                }
                else
                {
                    hitted.Message("You have " + hitted.Info.Health.ToString() + " health.");
                }

                //If the hit player's health is 0 or less, they die
                if (hitted.Info.Health <= 0)
                {
                    hitted.KillCTF(world, String.Format("&f{0}&S was shot by &f{1}", hitted.Name, by.Name));
                    CTF.PowerUp(by);
                    hitted.Info.CTFKills++;

                    if (hitted.Info.hasRedFlag)
                    {
                        world.Players.Message("The red flag has been returned.");
                        hitted.Info.hasRedFlag = false;

                        //Put flag back
                        BlockUpdate blockUpdate = new BlockUpdate(null, world.redFlag, Block.Red);
                        foreach (Player p in world.Players)
                        {
                            p.World.Map.QueueUpdate(blockUpdate);
                        }
                        world.redFlagTaken = false;
                    }

                    if (hitted.Info.hasBlueFlag)
                    {
                        world.Players.Message("The blue flag has been returned.");
                        hitted.Info.hasBlueFlag = false;

                        //Put flag back
                        BlockUpdate blockUpdate = new BlockUpdate(null, world.blueFlag, Block.Blue);
                        foreach (Player p in world.Players)
                        {
                            p.World.Map.QueueUpdate(blockUpdate);
                        }
                        world.blueFlagTaken = false;
                    }

                    //revive dead players with 100% health
                    hitted.Info.Health = 100;

                    if (hitted.usesCPE)
                    {
                        hitted.Send(PacketWriter.MakeSpecialMessage((byte)1, "&f[&a--------&f]"));
                    }
                    else
                    {
                        hitted.Message("You have 100 health.");
                    }
                }

                return;
            }

            //TDM and FFA
            if ((hitted.Info.isOnBlueTeam && by.Info.isOnBlueTeam) || (hitted.Info.isOnRedTeam && by.Info.isOnRedTeam))
            {
                by.Message("{0} is on your team!", hitted.ClassyName);
            }
            else
            {
                //Take the hit, one in ten chance of a critical hit which does 50 damage instead of 25
                int critical = (new Random()).Next(0, 9);

                if (critical == 0)
                {
                    hitted.Info.Health -= 50;
                    world.Players.Message("{0} landed a critical shot on {1}!", 0, by.Name, hitted.Name);
                }
                else
                {
                    hitted.Info.Health -= 25;
                }

                if (hitted.Info.Health < 0)
                {
                    hitted.Info.Health = 0;
                }

                //Create epic ASCII Health Bar

                string healthBar = "&f[&a--------&f]";
                if (hitted.Info.Health == 75)
                {
                    healthBar = "&f[&a------&8--&f]";
                }
                else if (hitted.Info.Health == 50)
                {
                    healthBar = "&f[&e----&8----&f]";
                }
                else if (hitted.Info.Health == 25)
                {
                    healthBar = "&f[&c--&8------&f]";
                }
                else
                {
                    healthBar = "&f[&8--------&f]";
                }
                hitted.Send(PacketWriter.MakeSpecialMessage((byte)1, healthBar));
                if (hitted.usesCPE)
                {
                    hitted.Send(PacketWriter.MakeSpecialMessage((byte)1, healthBar));
                }
                else
                {
                    hitted.Message("You have " + hitted.Info.Health.ToString() + " health.");
                }

                if (hitted.Info.Health == 0)
                {
                    hitted.Kill(world, String.Format("{0}&S was shot by {1}", hitted.ClassyName, hitted.ClassyName == by.ClassyName ? "theirself" : by.ClassyName));
                    updates.Add(new BlockUpdate(null, pos, Block.Air));
                    restDistance = 0;

                    //TDM
                    if (TeamDeathMatch.isOn)
                    {
                        if (hitted.Info.isPlayingTD && hitted.Info.isOnBlueTeam && by.Info.isPlayingTD) //if the player is playing TD and on blue team, +1 for Red Team Score
                        {
                            TeamDeathMatch.redScore++;
                            hitted.Info.gameDeaths++;
                            hitted.Info.totalDeathsTDM++;
                            by.Info.gameKills++;
                            by.Info.totalKillsTDM++;
                        }
                        if (hitted.Info.isPlayingTD && hitted.Info.isOnRedTeam && by.Info.isPlayingTD) //if the player is playing TD and on blue team, +1 for Red Team Score
                        {
                            TeamDeathMatch.blueScore++;
                            hitted.Info.gameDeaths++;       //counts the individual players deaths
                            hitted.Info.totalDeathsTDM++;   //tallies total TDM deaths (never gets reset)
                            by.Info.gameKills++;            //counts the individual players amount of kills
                            by.Info.totalKillsTDM++;        //tallies total TDM kills
                        }

                        //update scoreboard for all players
                        foreach (Player p in hitted.World.Players)
                        {
                            if (p.usesCPE)
                            {
                                p.Send(PacketWriter.MakeSpecialMessage((byte)2, "&cRed&f: " + TeamDeathMatch.redScore + ",&1 Blue&f: " + TeamDeathMatch.blueScore));
                            }
                            else
                            {
                                p.Message("The score is now &cRed&f: " + TeamDeathMatch.redScore + ",&1 Blue&f: " + TeamDeathMatch.blueScore);
                            }
                        }
                    }

                    //FFA
                    if (FFA.isOn())
                    {
                        if (hitted.Info.isPlayingFFA && by.Info.isPlayingFFA) //if the player is playing FFA and the person they hit is also playing
                        {
                            hitted.Info.gameDeathsFFA++;
                            hitted.Info.totalDeathsFFA++;
                            by.Info.gameKillsFFA++;
                            by.Info.totalKillsFFA++;
                        }

                        //find current kill leader
                        Player leader = new Player("");//create a temp pseudo player
                        int    kills  = 0;

                        foreach (Player p in hitted.World.Players)
                        {
                            if (p.Info.gameKillsFFA > kills)
                            {
                                kills  = p.Info.gameKillsFFA;
                                leader = p;
                            }
                        }
                        foreach (Player p in hitted.World.Players)
                        {
                            if (p.usesCPE)
                            {
                                p.Send(PacketWriter.MakeSpecialMessage((byte)2, "&eCurrent Leader&f: " + leader.Name + ", Kills: " + leader.Info.gameKillsFFA));
                            }
                        }
                    }

                    //revive dead players with 100% health
                    hitted.Info.Health = 100;

                    if (hitted.usesCPE)
                    {
                        hitted.Send(PacketWriter.MakeSpecialMessage((byte)1, "&f[&a--------&f]"));
                    }
                    else
                    {
                        hitted.Message("You have " + hitted.Info.Health.ToString() + "health.");
                    }
                }
            }
        }
Esempio n. 16
0
 protected override void Start()
 {
     base.Start(); // initialize base class
     gameManager = GameObject.FindGameObjectWithTag("GameManager");
     _ctf        = gameManager.GetComponent <CTF>();
 }
Esempio n. 17
0
        public void exec(int sleepTime, int browserCod)
        {
            #region Cabeçalho CTF
            CTF.Iniciar(this.Codigo);
            switch (browserCod)
            {
            case Browser.IE_BROWSER:
                Settings.BrowserDesc = "Internet Explorer";
                break;

            case Browser.CHROME_BROWSER:
                Settings.BrowserDesc = "Google Chrome";
                break;

            case Browser.FIREFOX_BROWSER:
                Settings.BrowserDesc = "Mozilla Firefox";
                break;

            case Browser.SAFARI_BROWSER:
                Settings.BrowserDesc = "Safari";
                break;

            case Browser.EDGE_BROWSER:
                Settings.BrowserDesc = "Microsoft Edge";
                break;

            case Browser.OPERA_BROWSER:
                Settings.BrowserDesc = "Opera";
                break;
            }
            CTF.InformacoesIniciais(
                this.Modulo,
                this.Funcao,
                this.PreCondicao,
                this.PosCondicao,
                "Browser:" + Settings.BrowserDesc + "\tWeb:" + Settings.ServerUrl + "\tBD:" + Settings.DataBase,
                Settings.ProductVersion,
                this.SAC,
                Settings.Tester,
                DateTime.Today.ToString(@"DD/MM/YYYY"));
            //
            #endregion


            //#region generate pdf
            //// Create a new PDF document
            //var dir = Directory.CreateDirectory("ctf-pdf\\" + this.SistemaPai.Nome);

            //PdfDocument document = new PdfDocument();
            //document.Info.Title = "Caso de Teste - TopDown Sistemas";

            //// Create an empty page
            //PdfPage page = document.AddPage();

            //// Get an XGraphics object for drawing
            //XGraphics gfx = XGraphics.FromPdfPage(page);

            //// Create a font
            //XFont font = new XFont("Verdana", 20, XFontStyle.Bold);

            //// Draw the text
            //gfx.DrawString(this.Codigo + " - " + this.Nome, font, XBrushes.Black, 0, 0);
            //#endregion



            Stopwatch cronometro = new Stopwatch();
            cronometro.Start();
            foreach (PassoDoTeste passo in Passos)
            {
                passo.SituationImg = PassoDoTeste.IMG_QUEST;
                passo.teveSucesso  = null;
                passo.Obs          = "";
                passo.Retorno      = "";
            }

            int pos = 30;

            foreach (PassoDoTeste passo in Passos)
            {
                if (passo.deveExecutar)
                {
                    try
                    {
                        passo.executar();
                        if (passo.acaoSelecionada.Nome.ToUpper().Trim() == "IR PARA")
                        {
                            CTF.irParaFuncionalidade(passo.telaSelecionada.Nome);
                        }
                        else
                        {
                            if (passo.ParametroEhFuncao())
                            {
                                CTF.inserirComando("", passo.acaoSelecionada.Nome, passo.parametroComputado, "", "", passo.Retorno);
                                // Draw the text
                                //pos += 50;
                                //gfx.DrawString(passo.acaoSelecionada.Nome+ " - PARAM: " + passo.parametroComputado, font, XBrushes.Black, 0, pos);
                            }
                            else
                            {
                                CTF.inserirComando("", passo.acaoSelecionada.Nome, passo.Parametro, "", "", passo.Retorno);
                                //pos +=50;
                                //gfx.DrawString(passo.acaoSelecionada.Nome + " - PARAM: " + passo.Parametro, font, XBrushes.Black, 0, pos);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        passo.Obs          = ex.Source + ": " + ex.Message + Environment.NewLine + ex.StackTrace;
                        passo.teveSucesso  = false;
                        passo.SituationImg = PassoDoTeste.IMG_ERRO;
                        Logger.escrever(ex.Message + ex.Source);
                        if (passo.acaoSelecionada.Nome.ToUpper().Contains("IR PARA"))
                        {
                            CTF.irParaFuncionalidade(passo.telaSelecionada.Nome);
                        }
                        else
                        {
                            if (passo.ParametroEhFuncao())
                            {
                                CTF.inserirComando("", passo.acaoSelecionada.Nome, passo.parametroComputado, "", "", "ERRO / " + passo.Retorno);
                            }
                            else
                            {
                                CTF.inserirComando("", passo.acaoSelecionada.Nome, passo.Parametro, "", "", "ERRO / " + passo.Retorno);
                            }
                        }
                        CTF.inserirImagemErro(PrintUtils.takeSS());

                        if (Settings.IgnorarFalha == false)
                        {
                            cronometro.Stop();
                            this.Salvar();
                            throw ex;
                        }
                        else
                        {
                            //do nth
                        }
                    }
                    finally
                    {
                        cronometro.Stop();
                        Browser.Sleep(sleepTime);
                        cronometro.Start();
                        this.Salvar();
                    }
                }
            }
            cronometro.Stop();

            if (TotalExecutado == 0)
            {
                tempoEstimado = cronometro.Elapsed;
            }
            else
            {
                tempoEstimado = TimeSpan.FromTicks((tempoEstimado.Ticks + cronometro.Elapsed.Ticks) / 2);
            }
            // Save the document...
            //document.Save(dir.FullName + "\\" + this.Codigo + ".pdf");
            CTF.Finalizar();
        }
Esempio n. 18
0
        public SkillFile(CTF.File ctf, string filename)
        {
            FileName = filename;
            var br = new ByteReader(File.ReadAllBytes(FileName));

            if (br.STRING() != FileID)
            {
                throw new Exception("Invalid file format.");
            }

            var messages = new List<CTF.Message>();

            foreach (var msg in ctf.Messages)
            {
                if (msg.SubCategory.Category.Name != "Skills")
                {
                    continue;
                }

                messages.Add(msg);
            }

            var skill_count = br.UINT();

            Skills = new List<Skill>();

            for (int i = 0; i < skill_count; i++)
            {
                var s = new Skill();

                s.Type = (SkillType)br.BYTE();

                var message_id = br.STRING();

                if (message_id == "")
                {
                    Skills.Add(null);
                    br.Skip(39);
                    continue;
                }

                var class_id = br.STRING();

                foreach (var message in messages)
                {
                    if (message.SubCategory.ID == uint.Parse(class_id) &&
                        message.ID == uint.Parse(message_id))
                    {
                        s.Message = message;
                        break;
                    }
                }

                if (s.Message == null)
                {
                    throw new Exception("Failed to find message.");
                }

                s.IconIndex = br.UINT();
                s.ProjectileAnimation = br.USHORT();
                s.CharacterAnimation = br.UINT();
                s.Honor = br.INT();
                s.Level = br.UINT();
                s.CharacterType = br.BYTE();

                var mana = br.UINT();
                if (mana > 1000000000)
                {
                    s.ManaUsageStyle = ManaUsageStyle.Percentage;
                    s.ManaUsage = mana - 1000000000;
                }
                else
                {
                    s.ManaUsageStyle = ManaUsageStyle.Fixed;
                    s.ManaUsage = mana;
                }

                var range = br.SHORT();
                if (range > 10000)
                {
                    s.IsAOE = true;
                    s.Range = (short)(range - 10000);
                }
                else
                {
                    s.IsAOE = false;
                    s.Range = range;
                }

                s.NeedsTarget = br.BYTE();

                s.Unused1 = br.BYTE();
                s.Unused2 = br.BYTE();
                s.Unused3 = br.BYTE();

                s.EffectType = br.BYTE();
                s.Multiplier = br.UINT();

                s.Unknown5 = br.UINT();

                Skills.Add(s);
            }
        }
Esempio n. 19
0
 static void Main(string[] args) => CTF.Run(args, (services) =>
 {
     services.AddTransient <IFlagFinder, FlagFinder>();
 });