Наследование: MonoBehaviour
Пример #1
0
 public MouseLLHookEventArgs(MouseButtons button, MouseActions action, int x, int y, int delta, int message)
 {
     Button = button;
     Action = action;
     Location = new Point(x, y);
     Delta = delta;
     Message = message;
 }
Пример #2
0
 private void ClicarBtnReaproveitarMateriaisOutrasCenas()
 {
     BtnReaproveitarMateriaisOutraCena.SairIFrame(Browser);
     BtnReaproveitarMateriaisOutraCena.EsperarElemento(Browser);
     if (BtnReaproveitarMateriaisOutraCena.IsElementVisible(Browser))
     {
         MouseActions.ClickATM(Browser, BtnReaproveitarMateriaisOutraCena);
     }
 }
Пример #3
0
 private void SelecionarEpisodio(string Valor)
 {
     if (Valor != "")
     {
         MouseActions.ClickATM(Browser, SlctEpisodio);
         var selecionarEpisodio = Element.Xpath("//a/div[text()='" + Valor + "']");
         MouseActions.ClickATM(Browser, selecionarEpisodio);
     }
 }
Пример #4
0
        public static void HandleErrorWindow()
        {
            var exceptionWindow = App.Container.SearchFor <WinWindow>(new { Name = "ERROR" });

            if (exceptionWindow.Exists)
            {
                MouseActions.ClickButton(exceptionWindow, "_OKButton");
            }
        }
Пример #5
0
 private void IncluirImagem()
 {
     BtnIncluirImagem.EsperarElemento(Browser);
     BtnIncluirImagem.Esperar(Browser, 600);
     if (BtnIncluirImagem.IsElementVisible(Browser))
     {
         MouseActions.ClickATM(Browser, BtnIncluirImagem);
     }
 }
        public static void ClickonRejectBtn()
        {
            var jWorkerWindow = GetWorkerSkillsWindowProperties();

            if (jWorkerWindow.Exists)
            {
                MouseActions.ClickButton(jWorkerWindow, WJobSkillsWindowConstants.RejectBtn);
            }
        }
        public static bool HandlePrintWorkTicketWindow(DataRow data)
        {
            var winInst = App.Container.SearchFor <WinWindow>(new { Name = "Print/Email Work Ticket" });

            //Actions.GetControlCollection();

            if (winInst.Exists)
            {
                var control = Actions.GetWindowChild(winInst, "_txtTicketPONum");
                Actions.SetText(control, data.ItemArray[40].ToString());

                //control = Actions.GetWindowChild(winInst, "optEmail");
                //Factory.SelectRadioButton(winInst, "optEmail", "Email");

                MouseActions.ClickButton(winInst, "btnCreateTicket");
                Playback.Wait(3000);

                PrintWindowPropertiesClickCancel(PrintWindowProperties());
                Playback.Wait(1500);
                PrintWindowPropertiesClickCancel(PrintWindowProperties());
                Playback.Wait(1500);

                var window = AssignWorkerWindowProperties();
                if (window.Exists)
                {
                    MouseActions.ClickButton(window, "btnOK");
                }
                Playback.Wait(3000);

                OvertimeWindowApproachingCancel(OvertimeApproachingWindowProperties());
                Playback.Wait(3000);

                PrintWindowPropertiesClickCancel(PrintWindowProperties());
                Playback.Wait(1500);

                var dispatchWindow = AutomationElement.RootElement.FindFirst(
                    TreeScope.Descendants,
                    new System.Windows.Automation.PropertyCondition(
                        AutomationElement.NameProperty, "Dispatch and Payout"));

                var OKButton = dispatchWindow.FindFirst(
                    TreeScope.Descendants,
                    new System.Windows.Automation.AndCondition(
                        new System.Windows.Automation.PropertyCondition(
                            AutomationElement.LocalizedControlTypeProperty, "button"),
                        new System.Windows.Automation.PropertyCondition(
                            AutomationElement.NameProperty, "OK")
                        ));

                Factory.AssertIsFalse(OKButton == null, "Couldn't find the 'OK' button.");
                Mouse.Click(OKButton.GetClickablePoint());

                return(true);
            }

            return(false);
        }
        public static void ClickOnSearchButton()
        {
            var searchWindow = GetSearchWindowProperties();
            var searchBtn    = searchWindow.Container.SearchFor <WinButton>(new { Name = "Search" });

            MouseActions.Click(searchBtn);

            Playback.Wait(5000);
        }
Пример #9
0
        public void ConsultaSimplesAutor(string NomeAutor)
        {
            AutomatedActions.SendDataATM(Browser, CampoAutor, NomeAutor);
            MouseActions.ClickATM(Browser, BuscarAutor);

            string nomedoAutor = "//table[@id='DataTables_Table_0']//div[text()='" + NomeAutor + "']";

            Assert.AreEqual(NomeAutor, ElementExtensions.GetValorAtributo(Element.Xpath(nomedoAutor), "textContent", Browser));
        }
Пример #10
0
 internal void CadastrarMaisContato(string Contato, string Telefone)
 {
     Thread.Sleep(1000);
     MouseActions.ClickATM(Browser, TipodeContato);
     SelecionarContato(Contato);
     Thread.Sleep(1000);
     MouseActions.ClickATM(Browser, ContatoTelefone);
     AutomatedActions.SendDataATM(Browser, ContatoTelefone, Telefone);
 }
Пример #11
0
 internal void btSalvarCadastro(string SalvarC)
 {
     if (SalvarC != "")
     {
         MouseActions.ClickATM(Browser, SalvarContato);
     }
     Thread.Sleep(1000);
     MouseActions.ClickATM(Browser, Element.Css("div[id='toast-container'] div[class='ng-binding ng-scope']"));
 }
Пример #12
0
        public static void ClickOnBackBtnReject()
        {
            var rejectPopUp = GetRejectPopUpProperties();

            if (rejectPopUp.Exists)
            {
                MouseActions.ClickButton(rejectPopUp, "btnBack");
            }
        }
Пример #13
0
        public static void ClickOnCancelBtn()
        {
            var wAddresWindow = GetWorkerAddressWindowProperties();

            if (wAddresWindow.Exists)
            {
                MouseActions.ClickButton(wAddresWindow, AWorkerConstants.CancelBtn);
            }
        }
Пример #14
0
 private void SelecionarDireitosMusicais(string Valor)
 {
     if (Valor != "")
     {
         MouseActions.ClickATM(Browser, SlctDireitosMusicais);
         var selecionarDireitosMusicais = Element.Xpath("//a/div[text()='" + Valor + "']");
         MouseActions.ClickATM(Browser, selecionarDireitosMusicais);
     }
 }
Пример #15
0
 public void SalvarMateriaisFixosPersonagem()
 {
     IFrameMaterialFixo.SairIFrame(Browser);
     IFrameMaterialFixo.EsperarIFrame(Browser);
     if (BtnSalvarMateriasFixosPersonagem.IsElementVisible(Browser))
     {
         MouseActions.ClickATM(Browser, BtnSalvarMateriasFixosPersonagem);
     }
 }
Пример #16
0
 private void ClicarBuscarFiltro()
 {
     BtnBuscar.EsperarElemento(Browser);
     BtnBuscar.Esperar(Browser, 1000);
     if (BtnBuscar.IsElementVisible(Browser))
     {
         MouseActions.ClickATM(Browser, BtnBuscar);
     }
 }
Пример #17
0
 private void SelecionarGeneroMusical(string Valor)
 {
     if (Valor != "")
     {
         MouseActions.ClickATM(Browser, SlctGeneroOriginal);
         var selecionarGeneroOriginal = Element.Xpath("//a/div[text()='" + Valor + "']");
         MouseActions.ClickATM(Browser, selecionarGeneroOriginal);
     }
 }
Пример #18
0
        public static void ClickOnBackBtn()
        {
            var existsWindow = GetWorkerAlreadyExistWindowProperties();

            if (existsWindow.Exists)
            {
                MouseActions.ClickButton(existsWindow, WorkerexistsPopUpConstants.BackBtn);
            }
        }
        private static void ClickOnCancelButton()
        {
            var searchWindow = GetSearchWindowProperties();
            var cancelBtn    = searchWindow.Container.SearchFor <WinButton>(new { Name = "Cancel" });

            MouseActions.Click(cancelBtn);

            Playback.Wait(5000);
        }
Пример #20
0
        public static void ClickonContinueBtnTelephone()
        {
            var tOveride = GetTelephoneOverideWindowProperties();

            if (tOveride.Exists)
            {
                MouseActions.ClickButton(tOveride, "btnContinue");
            }
        }
        public static void ClickonSaveBtn()
        {
            var addWorkerSkillsWindow = GetAddWorkerSkillsWindowProperties();

            if (addWorkerSkillsWindow.Exists)
            {
                MouseActions.ClickButton(addWorkerSkillsWindow, WorkerAddSkillsWindowConstants.SaveBtn);
            }
        }
Пример #22
0
        public void ConfirmarDePara()
        {
            Thread.Sleep(1500);
            MouseActions.ClickATM(Browser, BtnSalvar);
            Thread.Sleep(2000);
            var BtnConfirmar = Element.Xpath("//h2[text()='De/Para DDA']/..//button[@class='confirm']");

            MouseActions.ClickATM(Browser, BtnConfirmar);
        }
        public static void ClickOnRejectBtn()
        {
            var surveyWindow = GetWorkerSurveyWindowProperties();

            if (surveyWindow.Exists)
            {
                MouseActions.ClickButton(surveyWindow, SurveyConstants.RejectBtn);
            }
        }
        public static void ClickOnOkBtn()
        {
            var vertexGeoCodeWindow = GetWorkerVertexGeoCodeWindowProperties();

            if (vertexGeoCodeWindow.Exists)
            {
                MouseActions.ClickButton(vertexGeoCodeWindow, VertexGeoCodeConstants.OkBtn);
            }
        }
Пример #25
0
 private void InserirNovaFita()
 {
     InputNovaFita.EsperarElemento(Browser);
     AutomatedActions.SendDataATM(Browser, InputNovaFita, FakeHelpers.FirstName());
     if (BtnInserirNovaFita.IsElementVisible(Browser))
     {
         MouseActions.ClickATM(Browser, BtnInserirNovaFita);
     }
 }
Пример #26
0
 private void ClicarBtnReaproveitarMaterial()
 {
     BtnReaproveitarMaterial.SairIFrame(Browser);
     BtnReaproveitarMaterial.EsperarElemento(Browser);
     if (BtnReaproveitarMaterial.IsElementVisible(Browser))
     {
         MouseActions.ClickATM(Browser, BtnReaproveitarMaterial);
     }
 }
Пример #27
0
 private void SelecionarProduto(string Valor)
 {
     if (Valor != "")
     {
         AutomatedActions.SendDataATM(Browser, InpProduto, Valor);
         var selecionarProduto = Element.Css("a[title='" + Valor + "']");
         MouseActions.ClickATM(Browser, selecionarProduto);
     }
 }
Пример #28
0
        public void ValidarHistorico()
        {
            MouseActions.ClickATM(Browser, BtnHistorico);
            Thread.Sleep(3000);
            var nomeUsuarioLogado      = ElementExtensions.GetTexto(Element.Css("li[class='nav-header'] span:nth-child(1)"), Browser);
            var nomeUsuarioNoHistorico = ElementExtensions.GetTexto(Element.Css("div[role='tablist'] div[ng-repeat='item in ListJSON']:nth-child(1) b:nth-child(1)"), Browser);

            Assert.AreEqual(nomeUsuarioLogado, nomeUsuarioNoHistorico);
        }
Пример #29
0
 public void BtnFecharAlertas()
 {
     if (BtnFechar.IsElementVisible(Browser))
     {
         MouseActions.ClickATM(Browser, BtnFechar);
     }
     Thread.Sleep(2000);
     Browser.RefreshPage();
 }
Пример #30
0
        public static bool CreateNewJobOrder(DataRow dataRow)
        {
            ClickOnCreateJobOrder();
            if (VerifyCreateJobOrderWindowDisplayed())
            {
                EnterJobOrderData(dataRow);
                MouseActions.ClickButton(OpenJobOrder.JobOrderProfileWindowProperties(), "btnSearch");
                //ClickOnButton("Search");
                CustomerWindow.CustomerProfileWindow.CloseWarningWindow();

                ClickOnContinueBtn();
                CustomerWindow.CustomerProfileWindow.CloseWarningWindow();
                // Find Quote Tab/Window
                JobOrderFindQuoteWindow.EnterJobOrderFindQuoteData(dataRow);
                ClickOnContinueBtn();

                // Enter Basic Job Order Details
                BasicJobInformationWindow.EnterBasicJobInformationWindowData(dataRow);
                BasicJobInformationWindow.ClickOnContinueBtn();

                // Enter Schedule And Additional Charges Details
                ScheduleAndAdditionalChargesWindow.EnterDataInScheduleAndAdditionalChargesWindow(dataRow);
                ScheduleAndAdditionalChargesWindow.ClickOnAddNotesBtn();

                // Enter Order Notes in Schedule And Additional Charges window
                ScheduleAndAdditionalChargesWindow.EnterDataInJobOrderNotesWindow(dataRow);

                // Focus back to Schedule And Additional Charges window
                ScheduleAndAdditionalChargesWindow.ClickOnContinueBtn();

                //Enter data in Requirements window
                RequirementsWindow.EnterDatainRequirementsWindow(dataRow);
                //RequirementsWindow.ClickOnButton("Continue >");
                //Playback.Wait(3000);

                //Enter data in Pre-Qualifying Requirements Window
                //Playback.Wait(2000);
                //CustomerWindow.CustomerProfileWindow.CloseWarningWindow();
                PreQualifyingQuestionsWindow.ClickonSaveButton();
                Playback.Wait(2000);
                //CustomerWindow.CustomerProfileWindow.CloseWarningWindow();
                PreQualifyingQuestionsWindow.HandleChooseLocationWindow();
                Playback.Wait(2000);
                //CustomerWindow.CustomerProfileWindow.CloseWarningWindow();
                //Playback.Wait(2000);
                PreQualifyingQuestionsWindow.HandleWorkLocationWindow();
                Playback.Wait(2000);
                CustomerWindow.CustomerProfileWindow.CloseWarningWindow();
                Playback.Wait(3000);

                var status = PreQualifyingQuestionsWindow.HandleAlertWindow();

                return(status);
            }
            return(false);
        }
Пример #31
0
        public static void AddNewNoteToCancelCallback()
        {
            var prop = GetAddNoteWindowProperties();

            SelectAnInvoiceNumberFromGrid(prop);

            Actions.SetText(prop, ARControls.Notes,
                            "This is a note to cancel call back. This note is just for testing purpose.");
            MouseActions.ClickButton(prop, ARControls.SaveNotes);
        }
Пример #32
0
 private void Click(MouseActions action, Coordinate point, bool moveCursor)
 {
     ActivateIfNeeded();
     int x = 0;
     int y = 0;
     MouseFlag absflag = MouseFlag.Empty;
     if(moveCursor)
     {
         SetCursorPosition(point);
     }
     else
     {
         Point pt = point.ToAbsolute(this);
         x = pt.X;
         y = pt.Y;
         absflag = MouseFlag.Absolute;
     }
     switch(action)
     {
         case MouseActions.LeftClick:
         {
             InputSimulator.SimulateClickPress(MouseFlag.LeftDown | absflag, MouseFlag.LeftUp | absflag, x, y);
             break;
         }
         case MouseActions.LeftDown:
         {
             InputSimulator.SimulateClick(MouseFlag.LeftDown | absflag, x, y);
             break;
         }
         case MouseActions.LeftUp:
         {
             InputSimulator.SimulateClick(MouseFlag.LeftUp | absflag, x, y);
             break;
         }
         case MouseActions.MiddleClick:
         {
             InputSimulator.SimulateClickPress(MouseFlag.MiddleDown | absflag, MouseFlag.MiddleUp | absflag, x, y);
             break;
         }
         case MouseActions.MiddleDown:
         {
             InputSimulator.SimulateClick(MouseFlag.MiddleDown | absflag, x, y);
             break;
         }
         case MouseActions.MiddleUp:
         {
             InputSimulator.SimulateClick(MouseFlag.MiddleUp | absflag, x, y);
             break;
         }
         case MouseActions.RightClick:
         {
             InputSimulator.SimulateClickPress(MouseFlag.RightDown | absflag, MouseFlag.RightUp | absflag, x, y);
             break;
         }
         case MouseActions.RightDown:
         {
             InputSimulator.SimulateClick(MouseFlag.RightDown | absflag, x, y);
             break;
         }
         case MouseActions.RightUp:
         {
             InputSimulator.SimulateClick(MouseFlag.RightUp | absflag, x, y);
             break;
         }
         case MouseActions.X1Click:
         {
             InputSimulator.SimulateClickPress(MouseFlag.XDown | absflag, MouseFlag.XUp | absflag, 1, x, y);
             break;
         }
         case MouseActions.X1Down:
         {
             InputSimulator.SimulateClick(MouseFlag.XDown | absflag, 1, x, y);
             break;
         }
         case MouseActions.X1Up:
         {
             InputSimulator.SimulateClick(MouseFlag.XUp | absflag, 1, x, y);
             break;
         }
         case MouseActions.X2Click:
         {
             InputSimulator.SimulateClickPress(MouseFlag.XDown | absflag, MouseFlag.XUp | absflag, 2, x, y);
             break;
         }
         case MouseActions.X2Down:
         {
             InputSimulator.SimulateClick(MouseFlag.XDown | absflag, 2, x, y);
             break;
         }
         case MouseActions.X2Up:
         {
             InputSimulator.SimulateClick(MouseFlag.XUp | absflag, 2, x, y);
             break;
         }
         default:
         {
             throw new ArgumentException("Invalid action.", "action");
         }
     }
 }
Пример #33
0
 /*
 public virtual void InstantClick(MouseActions action, Coordinate point)
 {
     Click(action, point, false);
 }
 */
 public virtual void Click(MouseActions action, Coordinate point)
 {
     Click(action, point, true);
 }
Пример #34
0
 private void EntradaImagen_MouseDown(object sender, MouseEventArgs e)
 {
         switch (e.Button) {
                 case MouseButtons.Left:
                         if (CropRect.Contains(e.Location)) {
                                 MouseAction = MouseActions.Drag;
                                 StartPoint.X = e.X - CropRect.X;
                                 StartPoint.Y = e.Y - CropRect.Y;
                         } else {
                                 MouseAction = MouseActions.Draw;
                                 StartPoint = e.Location;
                         }
                         break;
                 case MouseButtons.Middle:
                         MouseAction = MouseActions.Drag;
                         StartPoint.X = e.X - CropRect.X;
                         StartPoint.Y = e.Y - CropRect.Y;
                         break;
         }
 }
Пример #35
0
 private void EntradaImagen_MouseUp(object sender, MouseEventArgs e)
 {
         MouseAction = MouseActions.None;
 }