/// <summary>
 /// Called when a playback error occurs.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="PlaybackErrorEventArgs"/> instance containing the event data.</param>
 protected virtual void OnPlaybackError(object sender, PlaybackErrorEventArgs e)
 {
     if (e != null)
     {
         Trace.WriteLine(e.Error);
     }
 }
Exemplo n.º 2
0
 private static void Playback_PlaybackError(object sender, PlaybackErrorEventArgs e)
 {
     Playback.PlaybackError -= Playback_PlaybackError;
     isInErrorState          = true;
     CodedUITestMessage("FAILURE running test.", false);
     Playback.StopSession();
 }
        /// <summary> PlaybackError event handler. </summary>
        private static void Playback_PlaybackError(object sender, PlaybackErrorEventArgs e)
        {
            // Wait a second
            System.Threading.Thread.Sleep(1000);

            // Retry the failed test operation
            e.Result = PlaybackErrorOptions.Retry;
        }
Exemplo n.º 4
0
        /// <summary>
        /// PlaybackError event handler.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="PlaybackErrorEventArgs"/> instance containing the event data.</param>
        private static void Playback_PlaybackError(object sender, PlaybackErrorEventArgs e)
        {
            // Wait a second
            System.Threading.Thread.Sleep(1000);

            // Retry the failed test operation
            e.Result = PlaybackErrorOptions.Retry;
        }
Exemplo n.º 5
0
 private void OnNotificationSoundError(string message)
 {
     if (!ignorePlaybackError)
     {
         PlaybackErrorEventArgs args = new PlaybackErrorEventArgs(message);
         PlaybackError?.Invoke(this, args);
         ignorePlaybackError = args.Ignore;
     }
 }
Exemplo n.º 6
0
        static void PlaybackPlaybackError(object sender, PlaybackErrorEventArgs e)
        {
            //Drop image ;)
            var imageDropFilename = Path.Combine(new Bootstrap().TestContext.TestResultsDirectory, Guid.NewGuid() + ".bmp");

            using (var tempImage = new Bitmap(UITestControl.Desktop.CaptureImage()))
            {
                tempImage.Save(imageDropFilename);
            }
            new Bootstrap().TestContext.AddResultFile(imageDropFilename);
        }
 public static void Playback_PlaybackError(object sender, PlaybackErrorEventArgs e)
 {
     if (e.Error.Message.Contains("Assert failed"))
     {
         e.Result = PlaybackErrorOptions.Skip;
         Console.WriteLine("Entered If");
     }
     else
     {
         e.Result = PlaybackErrorOptions.Default;
         Console.WriteLine("Entered else");
         //EllisHome.Initialize();
     }
 }
Exemplo n.º 8
0
        private void soundNotification_PlaybackError(object sender, PlaybackErrorEventArgs e)
        {
            e.Ignore = true;

            using (FormMessage form = new FormMessage("Notification Sound Error", "Could not play custom notification sound.\n" + e.Message, MessageBoxIcon.Error)){
                form.AddButton(FormMessage.Ignore, ControlType.Cancel | ControlType.Focused);

                Button btnOpenSettings = form.AddButton("View Options");
                btnOpenSettings.Width   += 16;
                btnOpenSettings.Location = new Point(btnOpenSettings.Location.X - 16, btnOpenSettings.Location.Y);

                if (form.ShowDialog() == DialogResult.OK && form.ClickedButton == btnOpenSettings)
                {
                    OpenSettings(typeof(TabSettingsSounds));
                }
            }
        }
Exemplo n.º 9
0
        private void soundNotification_PlaybackError(object sender, PlaybackErrorEventArgs e)
        {
            e.Ignore = true;

            using (FormMessage form = new FormMessage("Notification Sound Error", "Could not play custom notification sound." + Environment.NewLine + e.Message, MessageBoxIcon.Error)){
                form.CancelButton = form.AddButton("Ignore");

                Button btnOpenSettings = form.AddButton("Open Settings");
                btnOpenSettings.Width   += 16;
                btnOpenSettings.Location = new Point(btnOpenSettings.Location.X - 16, btnOpenSettings.Location.Y);

                if (form.ShowDialog() == DialogResult.OK && form.ClickedButton == btnOpenSettings)
                {
                    OpenSettings(FormSettings.TabIndexNotification);
                }
            }
        }
Exemplo n.º 10
0
 private void PlaybackErrorHandler(object sender, PlaybackErrorEventArgs e)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 11
0
 private void sound_PlaybackError(object sender, PlaybackErrorEventArgs e)
 {
     FormMessage.Error("Notification Sound Error", "Could not play custom notification sound.\n" + e.Message, FormMessage.OK);
 }
Exemplo n.º 12
0
 private void Playback_PlaybackError(object sender, PlaybackErrorEventArgs e)
 {
     Test.Fail(GetErrorMessage());
 }
Exemplo n.º 13
0
 private void sound_PlaybackError(object sender, PlaybackErrorEventArgs e)
 {
     MessageBox.Show("Could not play custom notification sound." + Environment.NewLine + e.Message, "Notification Sound Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
 }
Exemplo n.º 14
0
 // Retry failed action error handler
 private void Playback_PlaybackError(object sender, PlaybackErrorEventArgs e)
 {
     Console.WriteLine("Retrying .... ");
     e.Result = PlaybackErrorOptions.Retry;
     Keyboard.SendKeys("{Enter}");
 }
Exemplo n.º 15
0
        //[Given(@"I wait till ""(.*)"" is not visible")]
        //[Then(@"I wait till ""(.*)"" is not visible")]
        //[When(@"I wait till ""(.*)"" is not visible")]
        //public void GivenIWaitTillIsNotVisible(string itemAutoIds)
        //{
        //    var correctedditemToFindAutoIds = GetCorrect(itemAutoIds).Split(',');
        //    var itemFound = VisualTreeWalker.GetControlFromRoot(true, 0, null, false, correctedditemToFindAutoIds);
        //    while(itemFound != null && itemFound.Exists)
        //    {
        //        Playback.Wait(100);
        //    }
        //}

        //[Given(@"I wait till ""(.*)"" is visible")]
        //[Then(@"I wait till ""(.*)"" is visible")]
        //[When(@"I wait till ""(.*)"" is visible")]
        //public void GivenIWaitTillIsVisible(string itemAutoIds)
        //{
        //    var correctedditemToFindAutoIds = GetCorrect(itemAutoIds).Split(',');
        //    _retryCount = 0;
        //    Playback.PlaybackError += PlaybackOnPlaybackError;

        //    var itemFound = VisualTreeWalker.GetControlFromRoot(true, 0, null, false, correctedditemToFindAutoIds);
        //    if(itemFound.State != ControlStates.Invisible)
        //    {
        //        Playback.PlaybackError -= PlaybackOnPlaybackError;
        //        _retryCount = 0;
        //    }
        //}

        void PlaybackOnPlaybackError(object sender, PlaybackErrorEventArgs playbackErrorEventArgs)
        {
            if(_retryCount >= 100)
            {
                throw playbackErrorEventArgs.Error;
            }
            Playback.Wait(100);
            playbackErrorEventArgs.Result = PlaybackErrorOptions.Retry;
            _retryCount++;
        }
        public static void Playback_PlaybackError(object sender, PlaybackErrorEventArgs e)
        {

            if (e.Error.Message.Contains("Assert failed"))
            {
                e.Result = PlaybackErrorOptions.Skip;
                Console.WriteLine("Entered If");

            }
            else
            {
                e.Result = PlaybackErrorOptions.Default;
                Console.WriteLine("Entered else");
                //EllisHome.Initialize();
            }
        }
Exemplo n.º 17
0
 private void OnPlaybackError(object sender, PlaybackErrorEventArgs e)
 {
     e.Result = PlaybackErrorOptions.Retry;
 }
Exemplo n.º 18
0
 private static void PlaybackErrorHandler(object sender, PlaybackErrorEventArgs e)
 {
     System.Threading.Thread.Sleep(500);
     e.Result = PlaybackErrorOptions.Retry;
 }
Exemplo n.º 19
0
 private void Player_PlaybackError(object sender, PlaybackErrorEventArgs e)
 {
     PlaybackError?.Invoke(this, e);
 }