Пример #1
0
        public void loadData()
        {
            string  oldSelectedTestCase = getSelectedCTF();
            Sistema oldSelectedSistema  = selectedSistema;

            this.cleanData();

            sistemas = Sistema_DAO.getAllSistemas();
            sistemaComboBox.ItemsSource = sistemas;

            if (oldSelectedSistema != null)
            {
                foreach (Sistema item in sistemaComboBox.Items)
                {
                    if (item.Id == oldSelectedSistema.Id)
                    {
                        sistemaComboBox.SelectedItem = item;
                    }
                }
            }

            if (oldSelectedTestCase != null)
            {
                foreach (TestCase item in ctfBox.Items)
                {
                    if (item.Codigo == oldSelectedTestCase)
                    {
                        ctfBox.SelectedValue = item;
                    }
                }
            }

            //sistemaComboBox.SelectedItem = selectedSistema;
            //selectedSistema = sistemas[0];
        }
Пример #2
0
 public void loadData()
 {
     sistemas = Sistema_DAO.getAllSistemas();
     sistemasGrid.DataContext         = this;
     sistemasGrid.ItemsSource         = sistemas;
     sistemasGrid.AutoGenerateColumns = true;
 }
Пример #3
0
        public ActionResult Novo()
        {
            CadastroCasoTesteViewModel viewModel = new CadastroCasoTesteViewModel()
            {
                sistemas = Sistema_DAO.getAllSistemas().AsEnumerable <Sistema>()
            };

            return(View(viewModel));
        }
Пример #4
0
        // GET: TestCase/Random
        public ViewResult Random()
        {
            Random          randomizer    = new Random();
            List <Sistema>  sistemas      = Sistema_DAO.getAllSistemas().ToList();
            Sistema         randomSistema = sistemas[randomizer.Next(0, sistemas.Count)];
            List <TestCase> testCases     = TestCase_DAO.GetAllFromSistema(randomSistema);
            var             testCase      = testCases[randomizer.Next(0, testCases.Count)];

            return(View(testCase));
        }
Пример #5
0
        public TestSuiteView(MainWindow mainWindow)
        {
            InitializeComponent();
            this.mainWindow          = mainWindow;
            testSuiteBox.DataContext = this;

            //TestSuites = new ObservableCollection<TestSuite>(TestSuite.getTestSuitesExample());
            sistemas = Sistema_DAO.getAllSistemas();
            sistemaComboBox.ItemsSource = sistemas;
            DataContext = this;
        }
Пример #6
0
        public void loadData()
        {
            sistemas = Sistema_DAO.getAllSistemas();
            sistemasBox.ItemsSource = sistemas;

            if (selectedSistema != null)
            {
                telas = Tela_DAO.getAllTelas(selectedSistema);
                telasGrid.ItemsSource = telas;
            }
        }
Пример #7
0
        public void loadData()
        {
            Sistema sistemaSelecionado = null;
            Tela    telaSelecionada    = null;

            if (sistemaCombo.SelectedItem != null)
            {
                sistemaSelecionado = (Sistema)sistemaCombo.SelectedItem;
            }

            if (telaCombo.SelectedItem != null)
            {
                telaSelecionada = (Tela)telaCombo.SelectedItem;
            }

            sistemas = Sistema_DAO.getAllSistemas();
            sistemaCombo.ItemsSource = sistemas;
            sistemaCombo.Items.Refresh();

            if (sistemaSelecionado != null)
            {
                foreach (Sistema item in sistemaCombo.Items)
                {
                    if (item.Id == sistemaSelecionado.Id)
                    {
                        sistemaCombo.SelectedItem = item;
                    }
                }
            }



            if (telaSelecionada != null)
            {
                foreach (Tela item in telaCombo.Items)
                {
                    if (item.Id == telaSelecionada.Id)
                    {
                        telaCombo.SelectedItem = item;
                    }
                }
            }


            telaCombo.Items.Refresh();

            if (selectedTela != null)
            {
                acoes = AcaoDyn_DAO.getAllActionsFromTela(selectedTela);
                acaoGrid.ItemsSource = acoes;
            }
        }
Пример #8
0
        // GET: TestSuite
        public ActionResult Index()
        {
            //Recuperar Todas os TestSuite possíveis
            List <Sistema>   sistemas      = Sistema_DAO.getAllSistemas().ToList();
            List <TestSuite> allTestSuites = new List <TestSuite>();

            foreach (Sistema sis in sistemas)
            {
                allTestSuites.AddRange(TestSuite_DAO.getTestSuitesFromSistema(sis));
            }

            return(View(allTestSuites));
        }
Пример #9
0
 public ActionResult TelasSistema(int sistemaId, int?id)
 {
     if (id.HasValue)
     {
         return(Content("Sistema ID=" + sistemaId.ToString() + "\n" + "IdTela=" + id.ToString() + "não implementado ainda"));
     }
     else
     {
         List <Sistema> sistemas = Sistema_DAO.getAllSistemas().ToList();
         List <Screen>  telas    = Tela_DAO.getAllTelas(sistemas.First(x => x.Id == sistemaId)).ToList();
         return(View(telas));
     }
 }
Пример #10
0
        public ActionResult Criar(CadastroCasoTesteViewModel vModel)
        {
            TestCase _testCase = vModel.testCase;

            if (!ModelState.IsValid)
            {
                var viewModel = new CadastroCasoTesteViewModel()
                {
                    testCase = _testCase,
                    sistemas = Sistema_DAO.getAllSistemas()
                };
                return(View("Novo", viewModel));
            }
            else
            {
                _testCase.SistemaPai = Sistema_DAO.getAllSistemas().First(x => x.Id == _testCase.sistemaPaiId);
                _testCase.Salvar();
                return(RedirectToAction("Index", "TestCase"));
            }
        }
Пример #11
0
 public void Salvar()
 {
     Sistema_DAO.Salvar(this);
 }
Пример #12
0
 public void Update()
 {
     Sistema_DAO.Update(this);
 }
Пример #13
0
 public void Deletar()
 {
     Sistema_DAO.Deletar(this);
 }
Пример #14
0
        // GET: Tela
        public ActionResult Index()
        {
            List <Sistema> sistemas = Sistema_DAO.getAllSistemas().ToList();

            return(View(sistemas));
        }
Пример #15
0
 private void refresh()
 {
     sistemas = Sistema_DAO.getAllSistemas();
     sistemasComboBox.DataContext = this;
     sistemasComboBox.ItemsSource = sistemas;
 }
Пример #16
0
        public void refresh()
        {
            sistemasComboBox.DataContext = this;
            telasCombo.DataContext       = this;
            sistemas = Sistema_DAO.getAllSistemas();
            sistemasComboBox.ItemsSource = sistemas;

            scintilla = new ScintillaNET.Scintilla();
            scintilla.StyleResetDefault();
            scintilla.Styles[ScintillaNET.Style.Default].Font = "Monaco";
            scintilla.Styles[ScintillaNET.Style.Default].Size = 10;
            scintilla.StyleClearAll();
            scintilla.AutomaticFold = (AutomaticFold.Show | AutomaticFold.Click | AutomaticFold.Change);
            scintilla.Dock          = DockStyle.Fill;


            // Configure the CPP (C#) lexer styles
            scintilla.Styles[ScintillaNET.Style.Cpp.Default].ForeColor        = Color.Silver;
            scintilla.Styles[ScintillaNET.Style.Cpp.Comment].ForeColor        = Color.FromArgb(0, 128, 0);     // Green
            scintilla.Styles[ScintillaNET.Style.Cpp.CommentLine].ForeColor    = Color.FromArgb(0, 128, 0);     // Green
            scintilla.Styles[ScintillaNET.Style.Cpp.CommentLineDoc].ForeColor = Color.FromArgb(128, 128, 128); // Gray
            scintilla.Styles[ScintillaNET.Style.Cpp.Number].ForeColor         = Color.Olive;
            scintilla.Styles[ScintillaNET.Style.Cpp.Word].ForeColor           = Color.Blue;
            scintilla.Styles[ScintillaNET.Style.Cpp.Word2].ForeColor          = Color.Blue;
            scintilla.Styles[ScintillaNET.Style.Cpp.String].ForeColor         = Color.FromArgb(163, 21, 21); // Red
            scintilla.Styles[ScintillaNET.Style.Cpp.Character].ForeColor      = Color.FromArgb(163, 21, 21); // Red
            scintilla.Styles[ScintillaNET.Style.Cpp.Verbatim].ForeColor       = Color.FromArgb(163, 21, 21); // Red
            scintilla.Styles[ScintillaNET.Style.Cpp.StringEol].BackColor      = Color.Pink;
            scintilla.Styles[ScintillaNET.Style.Cpp.Operator].ForeColor       = Color.Purple;
            scintilla.Styles[ScintillaNET.Style.Cpp.Preprocessor].ForeColor   = Color.Maroon;
            scintilla.Lexer = Lexer.Cpp;


            // Set the keywords
            scintilla.SetKeywords(0, "abstract as base break case catch checked continue default delegate do else event explicit extern false finally fixed for foreach goto if implicit in interface internal is lock namespace new null object operator out override params private protected public readonly ref return sealed sizeof stackalloc switch this throw true try typeof unchecked unsafe using virtual while");
            scintilla.SetKeywords(1, "var bool byte char class const decimal double enum float int long sbyte short static string struct uint ulong ushort void");
            winFormHost.Child = scintilla;



            AutocompleteMenu menu = new AutocompleteMenu();

            menu.TargetControlWrapper = new ScintillaWrapper(scintilla);


            List <string> arqs = Directory.GetFiles("source-codes").ToList();


            List <string> arqsContent = new List <string>();

            foreach (var arq in arqs)
            {
                arqsContent.Add(File.ReadAllText(arq, Encoding.Default));
            }

            string[] snippets = arqsContent.ToArray();


            //string[] snippets = { "//Input Template\nBrowser.Wait.Until(ExpectedConditions.FrameToBeAvailableAndSwitchToIt(\"principal\"));\nBy modoDeProcura = By.Name(\"elementName\");\nBrowser.Wait.Until(ExpectedConditions.ElementExists(modoDeProcura));\nIWebElement inputElement = Browser.Driver.FindElement(modoDeProcura);\ninputElement.SendKeys(Parametro);\nPassou = true;",
            //                        "//Button Template\nBrowser.Wait.Until(ExpectedConditions.FrameToBeAvailableAndSwitchToIt(\"toolbar\"));\nBy modoDeProcura = By.Id(\"elementId\");\nBrowser.Wait.Until(ExpectedConditions.ElementExists(modoDeProcura));\nIWebElement btn_Element = Browser.Driver.FindElement(modoDeProcura);\nbtn_Element.Click();\nPassou = true;",
            //                        "//RadioButton Template\n//Mudar para o Frame que contém o elemento\nBrowser.Wait.Until(ExpectedConditions.FrameToBeAvailableAndSwitchToIt(\"principal\"));\nint opt = 0;\n//Colocar elementos referentes a ordem\nif (Parametro.ToUpper() == \"MÉDICO\")\nopt = 0;\nif (Parametro.ToUpper() == \"ODONTOLÓGICO\")\nopt = 1;\n//Seletor Do Elemento\nBy modoDeProcura = By.Name(\"elementName\");\nBrowser.Wait.Until(ExpectedConditions.ElementExists(modoDeProcura));\nIWebElement radioBtn_Element = Browser.Driver.FindElements(modoDeProcura)[opt];\nradioBtn_Element.Click();\nPassou = true;",
            //                        "//CheckBox Template\n //Mudar para o Frame que contém o elemento\nBrowser.Wait.Until(ExpectedConditions.FrameToBeAvailableAndSwitchToIt(\"principal\"));\nstring opt = \"\";\n//Colocar elementos referentes a ordem\nif (Parametro.ToUpper() == \"AMBULATÓRIO / CONSULTÓRIO\")\nopt = \"regime_1\";\nif (Parametro.ToUpper() == \"SADT\")\nopt = \"regime_2\";\nif (Parametro.ToUpper() == \"INTERNAÇÃO HOSPITALAR\")\nopt = \"regime_3\";\nif (Parametro.ToUpper() == \"HOSPITAL DIA\")\nopt = \"regime_4\";\n//Seletor Do Elemento\nBy modoDeProcura = By.Name(opt);\nBrowser.Wait.Until(ExpectedConditions.ElementExists(modoDeProcura));\nIWebElement checkBox_Element = Browser.Driver.FindElement(modoDeProcura);\ncheckBox_Element.Click();\nPassou = true;",
            //                        "//Dropdown Template\nBrowser.Wait.Until(ExpectedConditions.FrameToBeAvailableAndSwitchToIt(\"principal\"));\nBy modoDeProcura = By.Name(\"element_name\");\nBrowser.Wait.Until(ExpectedConditions.ElementExists(modoDeProcura));\nvar dropDownElement = new SelectElement(Browser.Driver.FindElement(modoDeProcura));\ndropDownElement.SelectByText(Parametro);\nPassou = true;",
            //                        "//Javascript Command\nBrowser.Wait.Until(ExpectedConditions.FrameToBeAvailableAndSwitchToIt(\"menu\"));\nBrowser.Sleep(3);\n//Comando javascript referente ao acesso da função (verificar menu)\nBrowser.JSexec.ExecuteScript(@\"\nSelecionarMenu('../../ans/asp/ans1025a.asp?cod_funcao=F&pt=Finalizar\nReferência&pprf=ADMIN&pprm=N,N,N,N,N,S&pcf=ANS20.4&pm=2&pr=S', '');\n\");\nBrowser.Sleep(3);\nPassou = true;",
            //                        "//Alerta\nBrowser.Wait.Until(ExpectedConditions.AlertIsPresent());\nBrowser.Driver.SwitchTo().Alert().Accept();",
            //                        "//VERIFICADOR\ntry\n{\nBrowser.Wait.Until(ExpectedConditions.FrameToBeAvailableAndSwitchToIt(\"menu\"));\nPassou = true;\n}\ncatch (Exception ex)\n{\nPassou = false;\n}\n//Se o resultado esperado é a FALHA, então inverta o sucesso.\nif (Parametro.ToUpper() == \"SIM\")\n{\nPassou = Passou;\n}\nelse //\"NÃO\"\n{\nPassou = !Passou;\n}",
            //                        };
            //string[] snippets = { "if(^)\n{\n}", "if(^)\n{\n}\nelse\n{\n}", "for(^;;)\n{\n}", "while(^)\n{\n}", "do${\n^}while();", "switch(^)\n{\n\tcase : break;\n}" };
            menu.Items = snippets;

            //scintilla.TextChanged += scintilla_TextChanged;

            //scintilla.ContextMenu = new System.Windows.Forms.ContextMenu();
            //scintilla.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Template INPUT"));
        }