protected override void InternalExecute(ICommandAdapter adapter) {
            EasyTestTracer.Tracer.LogText("MainParameter=" + Parameters.MainParameter.Value);
            var activeWindowControl = adapter.CreateTestControl(TestControlType.Dialog, null);
            var windowHandleInfo = GetWindowHandle(activeWindowControl);
            if (!windowHandleInfo.Value)
                ExecuteAdditionalCommands(adapter);

            var testImage = GetTestImage(windowHandleInfo.Key);
            var filename = GetFilename(adapter);

            try {
                if (File.Exists(filename)) {
                    CompareAndSave(filename, testImage, adapter);
                }
                else {
                    SaveActualImage(testImage, filename);
                    throw new CommandException(String.Format("'{0}' master copy was not found", filename), StartPosition);
                }
            }
            finally {
                if (!windowHandleInfo.Value && this.ParameterValue("ToggleNavigation", true) && _additionalCommands) {
                    ToggleNavigation(adapter);
                }
            }
        }
예제 #2
0
 protected override void InternalExecute(ICommandAdapter adapter){
     var actionCommand = new ActionCommand();
     var parameterList = actionCommand.Parameters;
     parameterList.MainParameter=new MainParameter("Navigation");
     parameterList.ExtraParameter = Parameters.MainParameter;
     actionCommand.Execute(adapter);
 }
예제 #3
0
 protected override void InternalExecute(ICommandAdapter adapter){
     if (!adapter.IsWinAdapter()&&Parameters["Action"]==null){
         Parameters.Add(new Parameter("Action","Edit",true,StartPosition));
     }
     base.InternalExecute(adapter);
     _adapter = adapter;
 }
예제 #4
0
 protected override void InternalExecute(ICommandAdapter adapter){
     var helper = new MultiLineComparisionHelper();
     string messageText = null;
     foreach (Parameter parameter in Parameters){
         if (parameter.Name == "Message"){
             if (messageText == null){
                 ITestControl testControl = adapter.CreateTestControl(TestControlType.Dialog, "");
                 messageText = testControl.GetInterface<IControlReadOnlyText>().Text;
             }
             string compareResult = helper.Compare("HandleDialog", parameter, messageText, "dialog message");
             if (!string.IsNullOrEmpty(compareResult)){
                 throw new AdapterOperationException(compareResult);
             }
         }
     }
     if (Parameters["Caption"] != null){
         ITestControl testControl = adapter.CreateTestControl(TestControlType.Dialog, "");
         string caption = testControl.GetInterface<ITestWindow>().Caption;
         string compareResult = helper.Compare("HandleDialog", Parameters["Caption"], caption, "dialog caption");
         if (!string.IsNullOrEmpty(compareResult)){
             throw new AdapterOperationException(compareResult);
         }
     }
     if (Parameters["Respond"] != null){
         new ActionCommand().DoAction(adapter, Parameters["Respond"].Value, null);
     }
     if (Parameters["Close"] != null && Parameters["Close"].Value == "True"){
         ITestControl testControl = adapter.CreateTestControl(TestControlType.Dialog, "");
         testControl.GetInterface<ITestWindow>().Close();
     }
 }
예제 #5
0
 private void ProccessUserRole(ICommandAdapter adapter) {
     var processRecordCommand = new XpandProcessRecordCommand();
     processRecordCommand.Parameters.MainParameter = new MainParameter("");
     processRecordCommand.Parameters.Add(new Parameter("Name", this.ParameterValue("EditRole", "User"), true, StartPosition));
     processRecordCommand.Parameters.Add(new Parameter("Action", "Edit", true, StartPosition));
     processRecordCommand.Execute(adapter);
 }
 private void CompareAndSave(string filename, Image testImage, ICommandAdapter adapter) {
     var threshold = this.ParameterValue<byte>("ImageDiffThreshold", 3);
     var localImage = Image.FromFile(filename);
     var masks = GetMasks(adapter).ToArray();
     var validDiffPercentace = this.ParameterValue("ValidDiffPercentage", 10);
     if (!masks.Any()) {
         var maskRectangle = GetMaskRectangle(adapter);
         if (maskRectangle != Rectangle.Empty) {
             CreateMask(filename, testImage, maskRectangle);                    
         } else {
             maskRectangle=new Rectangle(0,0,testImage.Width-1,testImage.Height-1);
         }
         var isValidPercentage = IsValidPercentage(testImage, maskRectangle, threshold, validDiffPercentace, localImage);
         if (!isValidPercentage)
             SaveImages(filename, testImage, threshold, localImage, maskRectangle);
     }
     var height = this.ParameterValue("MaskHeight", 0);
     var width = this.ParameterValue("MaskWidth", 0);
     foreach (var mask in masks) {
         var maskImage = mask;
         if (width > 0 && height > 0) {
             maskImage = (Bitmap)maskImage.ResizeRectangle(width, height);
         }
         var isValidPercentage = IsValidPercentage(testImage, maskImage, threshold, validDiffPercentace, localImage);
         if (!isValidPercentage)
             SaveImages(filename, testImage, threshold, localImage, maskImage);
     }
 }
예제 #7
0
 protected override void InternalExecute(ICommandAdapter adapter){
     if (this.ParameterValue<bool>("InBin")){
         var testAlias = _testParameters.GetAlias("WinAppBin", "WebAppBin");
         var path = Path.Combine(testAlias.Value,Parameters.MainParameter.Value);
         if (File.Exists(path))
             File.Delete(path);
     }
 }
예제 #8
0
 protected override void InternalExecute(ICommandAdapter adapter) {
     NavigateToRole(adapter);
     foreach (var targetType in Parameters.MainParameter.Value.Split(';')) {
         ProccessUserRole(adapter);
         CreateNewTypePermission(adapter, targetType);
     }
     NavigateToRole(adapter);
 }
 protected override void InternalExecute(ICommandAdapter adapter){
     var comparisionHelper = new MultiLineComparisionHelper();
     foreach (Parameter parameter in Parameters){
         string fieldValue = CheckFieldValuesCommand.GetFieldValue(adapter, parameter.Name);
         string errorMessage = comparisionHelper.Compare("CheckFieldValues", parameter, fieldValue, "field value");
         if (!string.IsNullOrEmpty(errorMessage))
             throw new TestException(errorMessage, parameter.PositionInScript);
     }
 }
예제 #10
0
 protected override void InternalExecute(ICommandAdapter adapter){
     if (Parameters["MoveMouseTo"]!=null){
         var point = this.ParameterValue<Point>("MoveMouseTo");
         _simulator.Mouse.MoveMouseTo(point.X, point.Y);
     }
     if (!string.IsNullOrEmpty(Parameters.MainParameter.Value)){
         _simulator.Mouse.CallMethod(Parameters.MainParameter.Value);
     }
 }
예제 #11
0
 protected override void InternalExecute(ICommandAdapter adapter){
     var mainParameter = Parameters.MainParameter;
     IntPtr windowHandle = Win32Declares.WindowFocus.GetForegroundWindow();
     if (!string.IsNullOrEmpty(mainParameter.Value)){
         windowHandle = Win32Declares.WindowHandles.FindWindowByCaption(IntPtr.Zero, mainParameter.Value);
         if (windowHandle == IntPtr.Zero)
             throw new CommandException(String.Format("Cannot find window {0}", mainParameter.Value),StartPosition);
     }
     WindowAutomation.CloseWindow(windowHandle);
 }
예제 #12
0
 private void TryClosePopupWindow(ICommandAdapter adapter){
     try{
         var command = new OptionalActionCommand();
         command.Parameters.MainParameter = new MainParameter("Close");
         command.Parameters.ExtraParameter = new MainParameter();
         command.Execute(adapter);
     }
     catch (Exception e){
         Console.WriteLine(e);
     }
 }
예제 #13
0
 private bool SaveAndCloseActionAvailable(ICommandAdapter adapter) {
     try {
         var actionAvailableCommand = new ActionAvailableCommand();
         actionAvailableCommand.Parameters.MainParameter = new MainParameter("Save and Close");
         actionAvailableCommand.Parameters.ExtraParameter = new MainParameter();
         actionAvailableCommand.Execute(adapter);
         return true;
     }
     catch (AdapterOperationException) {
         return false;
     }
 }
예제 #14
0
파일: Tasinir.cs 프로젝트: ionixNet/TKYS
        public static IEnumerable<TasinirComboEntity> CreateItemsSource(ICommandAdapter cmd, int duzey, string startsWidth)
        {
            SqlQuery q = "SELECT Id, Adi, TasinirKodu FROM TasinirKod".ToQuery();
            q.Sql(" WHERE (LEN(TasinirKodu)- LEN(REPLACE(TasinirKodu,'.',''))) = @0", duzey);

            if (!String.IsNullOrEmpty(startsWidth))
            {
                q.Sql(" AND TasinirKodu like '" +  startsWidth + "%'", ConditionOperator.StartsWith);
            }

            return cmd.Query<TasinirComboEntity>(q);
        }
 protected override void InternalExecute(ICommandAdapter adapter){
     var binPath = _testParameters.GetBinPath();
     if (this.ParameterValue<bool>("CheckInBin")){
         Parameters.MainParameter.Value = Path.Combine(binPath,Path.GetFileName(Parameters.MainParameter.Value) + "");
     }
     if (!ExpectException)
         base.InternalExecute(adapter);
     else{
         string fullFileName = GetFullFileName(Parameters.MainParameter.Value);
         if (!File.Exists(fullFileName))
             throw new CommandException(string.Format("File exists. {0}", fullFileName),StartPosition);
     }
 }
예제 #16
0
파일: Tasinir.cs 프로젝트: mehmetgoren/TKYS
        public static IEnumerable<TasinirComboEntity> CreateItemsSource(ICommandAdapter cmd, int duzey, string startsWidth)
        {
            SelectSql sql = new SelectSql();
            sql.Custom("SELECT Id, Adi, TasinirKodu FROM TasinirKod".ToQuery());

            sql.Where(" (LEN(TasinirKodu)- LEN(REPLACE(TasinirKodu,'.',''))) = @0".ToQuery(duzey));

            if (!String.IsNullOrEmpty(startsWidth))
            {
                sql.Where("TasinirKodu", ConditionOperator.StartsWith, startsWidth);
            }

            return cmd.Query<TasinirComboEntity>(sql.ToQuery());
        }
예제 #17
0
 protected override void InternalExecute(ICommandAdapter adapter){
     EasyTestTracer.Tracer.InProcedure(Name);
     var windowHandle = GetWindowHandle();
     var windowSize = SetActiveWindowSizeCommand.GetWindowSize(Parameters.MainParameter.Value);
     if (adapter.IsWinAdapter())
         WindowAutomation.ResizeWindow(windowHandle, windowSize);
     else{
         var setActiveWindowSizeCommand = new SetActiveWindowSizeCommand();
         setActiveWindowSizeCommand.Parameters.MainParameter=Parameters.MainParameter;
         setActiveWindowSizeCommand.Execute(adapter);
     }
     WindowAutomation.MoveWindow(windowHandle, new Point(0, 0));
     EasyTestTracer.Tracer.OutProcedure(Name);
 }
        protected override void InternalExecute(ICommandAdapter adapter) {
            int deltaDays = GetIntegerParameterValue("Days");
            int deltaHours = GetIntegerParameterValue("Hours");
            int deltaMinutes = GetIntegerParameterValue("Minutes");
            string cultureName = Parameters["Culture"] != null ? Parameters["Culture"].Value : null;
            CultureInfo currentCulture =
                cultureName != null ? CultureInfo.GetCultureInfo(cultureName) : null;
            string fieldName = Parameters.MainParameter.Value;

            ITestControl testControl = adapter.CreateTestControl(TestControlType.Field, fieldName);
            DateTime dateTime = DateTime.Now.Add(new TimeSpan(deltaDays, deltaHours, deltaMinutes, 0));
            string dateTimeValue = currentCulture != null ?
                                       dateTime.ToString(currentCulture) : dateTime.ToString(CultureInfo.InvariantCulture);
            testControl.GetInterface<IControlText>().Text = dateTimeValue;
        }
예제 #19
0
 protected override void InternalExecute(ICommandAdapter adapter){
     var sqlConnection = new SqlConnection(Parameters.MainParameter.Value);
     sqlConnection.Open();
     foreach (var parameter in Parameters.Where(parameter => parameter.Name.Contains("Command"))){
         var sqlCommand = sqlConnection.CreateCommand();
         sqlCommand.CommandText = parameter.Value;
         if (parameter.Name.StartsWith("Scalar")){
             var scalar = sqlCommand.ExecuteScalar();
             if (scalar+""!=Parameters["Result"+parameter.Name.Replace("ScalarCommand","")].Value)
                 throw new CommandException(string.Format("{0} result is {1}", parameter.Name, scalar),StartPosition);
         }
         else
             sqlCommand.ExecuteNonQuery();
     }
 }
예제 #20
0
 protected override void InternalExecute(ICommandAdapter adapter){
     var sendKeysParameter = Parameters[SendKeys];
     if (sendKeysParameter != null && (adapter.IsWinAdapter())) {
         var sendKeysCommand = new SendKeysCommand().SynchWith(this);
         sendKeysCommand.Parameters.MainParameter = new MainParameter(Parameters.First().Value);
         sendKeysCommand.Execute(adapter);
     }
     else {
         var processRecordCommand = new FillFormCommand();
         processRecordCommand.SynchWith(this);
         if (sendKeysParameter != null)
             processRecordCommand.Parameters.Remove(sendKeysParameter);
         processRecordCommand.Execute(adapter);
     }
 }
예제 #21
0
 private ITestControl GetTestControl(ICommandAdapter adapter){
     ITestControl testControl;
     try{
         testControl = adapter.GetNavigationTestControl();
     }
     catch (WarningException){
         TryClosePopupWindow(adapter);
         if (!adapter.IsControlExist(TestControlType.Action, "Close")){
             var handleDialogCommand = new HandleDialogCommand();
             handleDialogCommand.Parameters.Add(new Parameter("Respond", "No", true, StartPosition));
             handleDialogCommand.Execute(adapter);
         }
         testControl = adapter.GetNavigationTestControl();
     }
     return testControl;
 }
예제 #22
0
 protected override void InternalExecute(ICommandAdapter adapter) {
     if (adapter.IsWinAdapter()) {
         SaveAndCloseAction(adapter);
     }
     else {
         if (SaveAndCloseActionAvailable(adapter)) {
             SaveAndCloseAction(adapter);
         }
         else {
             var actionCommand = new ActionCommand();
             actionCommand.Parameters.MainParameter = new MainParameter("OK");
             actionCommand.Parameters.ExtraParameter = new MainParameter();
             actionCommand.Execute(adapter);
         }
     }
 }
예제 #23
0
 protected override void InternalExecute(ICommandAdapter adapter) {
     using (var sqlConnection = new SqlConnection(GetConnectionString())) {
         sqlConnection.Open();
         using (var sqlCommand = sqlConnection.CreateCommand()) {
             var dbName = this.ParameterValue<string>("DBName");
             sqlCommand.CommandText = "ALTER DATABASE " + dbName + " SET SINGLE_USER WITH ROLLBACK IMMEDIATE";
             try {
                 sqlCommand.ExecuteNonQuery();
             }
             catch (SqlException) {
                 return;
             }
             sqlCommand.CommandText = "Drop database " + dbName;
             sqlCommand.ExecuteNonQuery();
         }
     }
 }
예제 #24
0
 protected override void InternalExecute(ICommandAdapter adapter){
     if (adapter.IsControlExist(TestControlType.Action, LogonCaption)){
         adapter.CreateTestControl(TestControlType.Action, LogonCaption).GetInterface<IControlAct>().Act(null);
     }
     int itemsCount = adapter.GetNavigationTestControl().GetInterface<IGridBase>().GetRowCount();
     for (int i = 0; i < itemsCount; i++){
         var testControl = GetTestControl(adapter);
         var gridBase = testControl.GetInterface<IGridBase>();
         string navigationItemName = gridBase.GetCellValue(i, new List<IGridColumn>(gridBase.Columns)[0]);
         if (!string.IsNullOrEmpty(navigationItemName)){
             EasyTestTracer.Tracer.LogText(string.Format("EnumerateNavigationItem '{0}'", navigationItemName));
             var controlActionItems = testControl.FindInterface<IControlActionItems>();
             if (controlActionItems != null && controlActionItems.IsEnabled(navigationItemName)){
                 try{
                     testControl.GetInterface<IControlAct>().Act(navigationItemName);
                 }
                 catch (Exception e){
                     throw new CommandException(string.Format("The 'Navigation' action execution failed. Navigation item: {0}\r\nInner Exception: {1}",navigationItemName, e.Message), StartPosition);
                 }
                 if (adapter.IsControlExist(TestControlType.Action, "New")){
                     try{
                         adapter.CreateTestControl(TestControlType.Action, "New").FindInterface<IControlAct>().Act("");
                     }
                     catch (Exception e){
                         throw new CommandException(string.Format("The 'New' action execution failed. Navigation item: {0}\r\nInner Exception: {1}",navigationItemName, e.Message), StartPosition);
                     }
                     if (adapter.IsControlExist(TestControlType.Action, "Cancel")){
                         try{
                             var cancelActionTestControl =adapter.CreateTestControl(TestControlType.Action, "Cancel");
                             if (cancelActionTestControl.GetInterface<IControlEnabled>().Enabled){
                                 cancelActionTestControl.FindInterface<IControlAct>().Act(null);
                             }
                         }
                         catch (Exception e){
                             throw new CommandException(string.Format("The 'Cancel' action execution failed. Navigation item: {0}\r\nInner Exception: {1}",navigationItemName, e.Message), StartPosition);
                         }
                     }
                     var command = new OptionalActionCommand();
                     command.Parameters.MainParameter = new MainParameter("Yes");
                     command.Parameters.ExtraParameter = new MainParameter();
                     command.Execute(adapter);
                 }
             }
         }
     }
 }
예제 #25
0
 protected override void InternalExecute(ICommandAdapter adapter){
     var focusWindowCommand=new FocusWindowCommand();
     focusWindowCommand.Execute(adapter);
     var sleepCommand = new SleepCommand();
     sleepCommand.Parameters.MainParameter = new MainParameter("300");
     sleepCommand.Execute(adapter);
     var simulator=new InputSimulator();
     if (!string.IsNullOrEmpty(Parameters.MainParameter.Value))
         simulator.Keyboard.TextEntry(Parameters.MainParameter.Value);
     var keysParameter = Parameters["Keys"];
     if (keysParameter != null){
         foreach (var key in keysParameter.Value.Split(';')){
             var keyCode = (VirtualKeyCode) Enum.Parse(typeof (VirtualKeyCode), key);
             simulator.Keyboard.KeyPress(keyCode);
         }
     }
 }
예제 #26
0
 private void CopyModel(ICommandAdapter adapter, string binPath, string model, string modelFile){
     var copyFileCommand = new CopyFileCommand();
     string destinationFile = Path.Combine(binPath, model);
     var deleteFileCommand = new DeleteFileCommand();
     deleteFileCommand.Parameters.MainParameter = new MainParameter(destinationFile);
     deleteFileCommand.Execute(adapter);
     copyFileCommand.Execute(adapter, _testParameters, modelFile, destinationFile);
     if (this.ParameterValue<bool>(IsExternalModel)){
         var actionCommand = new ActionCommand();
         actionCommand.Parameters.MainParameter = new MainParameter("Parameter");
         actionCommand.Parameters.ExtraParameter = new MainParameter(Path.GetFileNameWithoutExtension(model));
         actionCommand.Execute(adapter);
         actionCommand = new ActionCommand();
         actionCommand.Parameters.MainParameter = new MainParameter("Action");
         actionCommand.Parameters.ExtraParameter=new MainParameter("LoadModel");
         actionCommand.Execute(adapter);
     }
 }
예제 #27
0
        protected override void InternalExecute(ICommandAdapter adapter){
            EasyTestTracer.Tracer.InProcedure(GetType().Name + ".Execute");
            EasyTestTracer.Tracer.LogText(Environment.NewLine + Text);
            var testAlias = _testParameters.GetAlias("WinAppBin", "WebAppBin");
            if (string.IsNullOrEmpty(Parameters.MainParameter.Value)){
                var modelFile = Directory.GetFiles(_testParameters.ScriptsPath, "*.xafml", SearchOption.TopDirectoryOnly).Single();
                CopyModel(adapter, testAlias, GetUserXafml(modelFile), modelFile);
            }
            else{
                var modelFiles = Parameters.MainParameter.Value.Split(';');
                for (int i = 0; i < modelFiles.Length; i++){
                    var path = Path.Combine(_testParameters.ScriptsPath, modelFiles[i] + ".xafml");
                    var userXafml = GetUserXafml(path,i);
                    CopyModel(adapter, testAlias, userXafml, path);
                }
            }

            EasyTestTracer.Tracer.OutProcedure(GetType().Name + ".Execute");
        }
예제 #28
0
        public virtual void ProcessRecord(ICommandAdapter adapter, string tableName, string actionName,
            string[] columnCaptions, string[] cellValues){
            if (!adapter.IsControlExist(TestControlType.Table, tableName)){
                throw new CommandException(
                    string.Format("Cannot find the '{0}' control, OperationTag:'{1}'", tableName, TestControlType.Table),
                    StartPosition);
            }
            ITestControl testTable = adapter.CreateTestControl(TestControlType.Table, tableName);
            var table = testTable.GetInterface<IGridBase>();
            IGridColumn actionColumn = null;
            int rowCount = table.GetRowCount();
            if (rowCount == 0 && cellValues.Length > 0){
                string message = string.IsNullOrEmpty(tableName)
                    ? "The table is empty"
                    : string.Format("The '{0}' table is empty", tableName);
                throw new AdapterOperationException(message);
            }

            int rowIndex = -1;
            if (cellValues.Length > 0){
                var testControl = testTable.FindInterface<IGridRowsSelection>();
                if (testControl != null && !string.IsNullOrEmpty(actionName)){
                    testControl.ClearSelection();
                    //B158392
                    rowIndex = GetRowIndex(testTable, rowCount, columnCaptions, cellValues);
                    testControl.SelectRow(rowIndex);
                }
                else{
                    rowIndex = GetRowIndex(testTable, rowCount, columnCaptions, cellValues);
                }
                if (rowIndex == -1){
                    throw new AdapterOperationException(
                        string.Format("The record with the '{0}' value was not found. Checked values: {1}",
                            string.Join(", ", cellValues), GridControlHelper.GetFormatTableValues(null)));
                }
                var gridHelper = new GridControlHelper(testTable);
                List<IGridColumn> columnList = gridHelper.GetColumnIndexes(columnCaptions, false);
                if (columnList.Count > 0)
                    actionColumn = columnList[0];
            }
            Act(actionName, rowIndex, actionColumn, testTable);
        }
예제 #29
0
        protected override void InternalExecute(ICommandAdapter adapter){
            var navigateCommand = new NavigateCommand();
            navigateCommand.Parameters.MainParameter = new MainParameter("Default.My Details");
            navigateCommand.Execute(adapter);
            
            var actionCommand = new ActionCommand();
            actionCommand.Parameters.MainParameter = new MainParameter("Change My Password");
            actionCommand.Parameters.ExtraParameter = new MainParameter();
            actionCommand.Execute(adapter);

            var fillFormCommand = new FillFormCommand();
            var password = Parameters.MainParameter.Value+"";
            fillFormCommand.Parameters.Add(new Parameter("New Password",password,true,StartPosition));
            fillFormCommand.Parameters.Add(new Parameter("Confirm Password", password, true, StartPosition));
            fillFormCommand.Execute(adapter);

            actionCommand = new ActionCommand();
            actionCommand.Parameters.MainParameter = new MainParameter("OK");
            actionCommand.Parameters.ExtraParameter = new MainParameter();
            actionCommand.Execute(adapter);
        }
예제 #30
0
 protected override void InternalExecute(ICommandAdapter adapter){
     var sendKeysParameter = Parameters[SendKeys];
     if (sendKeysParameter != null && (adapter.IsWinAdapter())) {
         var sendKeysCommand = new SendKeysCommand().SynchWith(this);
         sendKeysCommand.Parameters.MainParameter = new MainParameter(Parameters.First().Value);
         sendKeysCommand.Execute(adapter);
     }
     else {
         var processRecordCommand = new FillFormCommand();
         processRecordCommand.SynchWith(this);
         if (sendKeysParameter != null)
             processRecordCommand.Parameters.Remove(sendKeysParameter);
         try{
             processRecordCommand.Execute(adapter);
         }
         catch (Exception){
             if (ExpectException)
                 throw;
             if (this.ParameterValue("Throw", true))
                 throw;
         }
     }
 }
예제 #31
0
 internal ActionRepository(ICommandAdapter cmd)
     : base(cmd)
 {
 }
예제 #32
0
 protected override void InternalExecute(ICommandAdapter adapter)
 {
 }
예제 #33
0
        protected override void InternalExecute(ICommandAdapter adapter)
        {
            var intPtr = Win32Declares.WindowFocus.GetForegroundWindow();

            Win32Declares.Window.ShowScrollBar(intPtr, Win32Declares.Window.ShowScrollBarEnum.SB_BOTH, false);
        }
예제 #34
0
 public static bool IsWinAdapter(this ICommandAdapter instance)
 {
     return(Adapter is IXpandTestWinAdapter);
 }
예제 #35
0
 protected override void InternalExecute(ICommandAdapter adapter)
 {
     Environment.SetEnvironmentVariable(Parameters.MainParameter.Value, Parameters["Value"].Value, EnvironmentVariableTarget.Machine);
 }
예제 #36
0
 public static TestApplication GetTestApplication(this ICommandAdapter adapter)
 {
     return(adapter is WebCommandAdapter ? (TestApplication)EasyTestWebApplication.Instance : EasyTestWinApplication.Instance);
 }
예제 #37
0
 protected override void InternalExecute(ICommandAdapter adapter)
 {
     WindowAutomation.KillFocus();
 }
예제 #38
0
        protected override void ExecuteCore(ICommandAdapter adapter)
        {
            var command = new ActionCommand("OK");

            command.Execute(adapter);
        }
예제 #39
0
 protected override void ExecuteCore(ICommandAdapter adapter)
 {
     Thread.Sleep(Convert.ToInt32(Parameters.MainParameter.Value));
 }
예제 #40
0
 public static void DeleteAllProducts(this ICommandAdapter adapter)
 {
     adapter.Execute(new SelectObjectsCommand <Product>(product => product.ProductName, new [] { "ProductName0", "ProductName1" }));
     adapter.Execute(new ActionDeleteCommand());
 }
예제 #41
0
 public static async Task TestMicrosoftService(this ICommandAdapter commandAdapter, Func <Task> whenConnected)
 => await commandAdapter.TestCloudService(singInCaption
예제 #42
0
 protected override void ExecuteCore(ICommandAdapter adapter)
 {
     Win32Declares.Window.MoveWindow(Win32Declares.WindowFocus.GetForegroundWindow(), _x, _y, _width, _height, _repaint);
     Thread.Sleep(500);
 }
 private static void ExecuteSilent(ICommandAdapter adapter, Command command)
 {
     command.Execute(adapter);
 }
 public static TestApplication GetTestApplication(this ICommandAdapter adapter)
 => adapter.GetType().Name == "WebCommandAdapter" || adapter.IsInstanceOf("DevExpress.ExpressApp.EasyTest.BlazorAdapter.CommandAdapter")
         ? EasyTestWebApplication.Instance : EasyTestWinApplication.Instance;
예제 #45
0
 protected abstract void ExecuteCore(ICommandAdapter adapter);
예제 #46
0
 protected override void ExecuteCore(ICommandAdapter adapter)
 {
     new FillObjectViewCommand(("User Name", "Admin")).Execute(adapter);
     new ActionCommand("Log In").Execute(adapter);
 }
예제 #47
0
        protected override void ExecuteCore(ICommandAdapter adapter)
        {
            var inputSimulator = new Common.InputSimulator.InputSimulator();

            inputSimulator.Keyboard.TextEntry(_text);
        }
예제 #48
0
 public ActionRepository(ICommandAdapter cmd)
     : base(cmd)
 {
 }
예제 #49
0
 public static async Task TestGoogleService(this ICommandAdapter commandAdapter, Func <Task> whenConnected)
 => await commandAdapter.TestCloudService(_ => commandAdapter.AuthenticateGoogle(whenConnected), "Google",
        protected override void ExecuteCore(ICommandAdapter adapter)
        {
            var command = _inlineEditor?(Command)this.ConvertTo <FillRecordCommand>():this.ConvertTo <FillFieldCommand>();

            adapter.Execute(command);
        }
 internal MenuRepository(ICommandAdapter cmd)
     : base(cmd)
 {
 }
 public AppSettingRepository(ICommandAdapter cmd)
     : base(cmd)
 {
 }
예제 #53
0
 protected override void ExecuteCore(ICommandAdapter adapter)
 {
     new ActionCommand("Log Off").Execute(adapter);
 }
 protected override void ExecuteCore(ICommandAdapter adapter)
 {
     this.ConnvertTo <ClearSelectionCommand>().Execute(adapter);
 }
예제 #55
0
        public static IntPtr GetMainWindowHandle(this ICommandAdapter adapter)
        {
            var mainWindowHandle = ((IXpandEasyTestCommandAdapter)adapter).MainWindowHandle;

            return(adapter.IsWinAdapter() ? Process.GetProcessById(mainWindowHandle.ToInt32()).MainWindowHandle : mainWindowHandle);
        }
예제 #56
0
 public static async System.Threading.Tasks.Task TestGoogleTasksService(this ICommandAdapter commandAdapter)
 => await commandAdapter.TestOfficeCloudService("Cloud.Google Task", nameof(Task.Subject));
 public static IObservable <Unit> Execute(this ICommandAdapter adapter, Action retriedAction)
 => Observable.Defer(() => Observable.Start(retriedAction)).RetryWithBackoff();
        public static async Task TestMicrosoftCalendarService(this ICommandAdapter commandAdapter)
        {
            await commandAdapter.TestOfficeCloudService("Microsoft");

            await commandAdapter.TestOfficeCloudService("Cloud.Microsoft Event", nameof(Event.Subject));
        }
        public static async Task TestGoogleCalendarService(this ICommandAdapter commandAdapter)
        {
            await commandAdapter.TestOfficeCloudService("Google");

            await commandAdapter.TestOfficeCloudService("Cloud.Google Event", nameof(Event.Subject));
        }
예제 #60
0
 internal AppSettingRepository(ICommandAdapter cmd)
     : base(cmd)
 {
 }