/// <summary> /// Set value of a DataGridCell and then verify /// </summary> /// <param name="value">Value to set</param> /// <param name="shouldClick">Should click before setting text (yes/no)</param> /// <param name="shouldVerify">Indicate whether or not to verify</param> /// <param name="window">Window to perform text entry on</param> public void SetValue(string value, bool shouldClick = true, bool shouldVerify = true, Window window = null) { ReportActionValue("SetValue", value); if (window == null) { window = WorkSpace.MainWindow.Window; } if (shouldClick) { UIItem.Click(); } window.Keyboard.Enter(value); window.Keyboard.PressSpecialKey(KeyboardInput.SpecialKeys.RETURN); CaptureImage(); if (shouldVerify) { var friendlyMessage = ConstructFriendlyMessage(Resources.FriendlyDataGridCellSetMsg, value); QAAssert.Contains(Value, value, friendlyMessage); } }
/// <summary> /// Set value of a TableCell and then verify /// </summary> /// <param name="value">Value to set</param> /// <param name="shouldClick">Should click before setting text (yes/no)</param> /// <param name="shouldVerify">Indicate whether or not to verify</param> public void SetValue(string value, bool shouldClick = true, bool shouldVerify = true) { ReportActionValue("SetValue", value); if (shouldClick) { UIItem.Click(); } WorkSpace.MainWindow.Keyboard.Enter(value); WorkSpace.MainWindow.Keyboard.PressSpecialKey(KeyboardInput.SpecialKeys.RETURN); Thread.Sleep(100); CaptureImage(); if (shouldVerify) { var friendlyMessage = ConstructFriendlyMessage(Resources.FriendlyDataGridCellSetMsg, value); // Decimal places are often affixed to the end of the text // so ensure expected text is a subset of actual text QAAssert.Contains(Value, value, friendlyMessage); } }