From 8a4d66d22734c7232b27ed49624b75f0861f38d4 Mon Sep 17 00:00:00 2001 From: "dmytro.turushev" Date: Mon, 27 Jun 2016 18:54:41 +0300 Subject: [PATCH 1/3] Add setting for combobox choose item delay to fix problem with longer animation. --- .../Configuration/CoreAppXmlConfiguration.cs | 7 +++++++ src/TestStack.White/Configuration/ICoreConfiguration.cs | 1 + src/TestStack.White/UIItems/ListBoxItems/ListItem.cs | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/TestStack.White/Configuration/CoreAppXmlConfiguration.cs b/src/TestStack.White/Configuration/CoreAppXmlConfiguration.cs index 861734bf..d69dd86d 100644 --- a/src/TestStack.White/Configuration/CoreAppXmlConfiguration.cs +++ b/src/TestStack.White/Configuration/CoreAppXmlConfiguration.cs @@ -31,6 +31,7 @@ static CoreAppXmlConfiguration() DefaultValues.Add("InProc", false); DefaultValues.Add("ComboBoxItemsPopulatedWithoutDropDownOpen", false); DefaultValues.Add("ComboBoxItemSelectionTimeout", 1000); + DefaultValues.Add("ComboBoxItemSelectDelay", 10); DefaultValues.Add("RawInputQueueProcessingTime", 50); DefaultValues.Add("RawElementBasedSearch", false); DefaultValues.Add("MaxElementSearchDepth", 10); @@ -164,6 +165,12 @@ public virtual int ComboBoxItemSelectionTimeout set { SetUsedValue("ComboBoxItemSelectionTimeout", value); } } + public virtual int ComboBoxItemSelectDelay + { + get { return Convert.ToInt32(UsedValues["ComboBoxItemSelectDelay"]); } + set { SetUsedValue("ComboBoxItemSelectDelay", value); } + } + public virtual int RawInputQueueProcessingTime { get { return Convert.ToInt32(UsedValues["RawInputQueueProcessingTime"]); } diff --git a/src/TestStack.White/Configuration/ICoreConfiguration.cs b/src/TestStack.White/Configuration/ICoreConfiguration.cs index 0850f679..82051d5d 100644 --- a/src/TestStack.White/Configuration/ICoreConfiguration.cs +++ b/src/TestStack.White/Configuration/ICoreConfiguration.cs @@ -33,6 +33,7 @@ public interface ICoreConfiguration bool InProc { get; set; } bool ComboBoxItemsPopulatedWithoutDropDownOpen { get; set; } int ComboBoxItemSelectionTimeout { get; set; } + int ComboBoxItemSelectDelay { get; set; } int RawInputQueueProcessingTime { get; set; } bool RawElementBasedSearch { get; set; } int MaxElementSearchDepth { get; set; } diff --git a/src/TestStack.White/UIItems/ListBoxItems/ListItem.cs b/src/TestStack.White/UIItems/ListBoxItems/ListItem.cs index 3ebee982..3500e9ea 100644 --- a/src/TestStack.White/UIItems/ListBoxItems/ListItem.cs +++ b/src/TestStack.White/UIItems/ListBoxItems/ListItem.cs @@ -81,7 +81,7 @@ private static void WaitForBoundsToStabilise(IUIItem item) Retry.For(() => { var oldBounds = item.Bounds; - Thread.Sleep(10); + Thread.Sleep(CoreAppXmlConfiguration.Instance.ComboBoxItemSelectDelay); return oldBounds.Equals(item.Bounds); }, TimeSpan.FromSeconds(1), TimeSpan.FromMilliseconds(10)); } From fbb3a4bca4bde01cec6106583ac9591d35972315 Mon Sep 17 00:00:00 2001 From: "dmytro.turushev" Date: Mon, 27 Jun 2016 19:18:58 +0300 Subject: [PATCH 2/3] Removed ignore attribute from ComboBox tests, fixed by setting. --- src/TestStack.White.UITests/App.config | 1 + .../ControlTests/ListControls/ComboBoxTests.cs | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/TestStack.White.UITests/App.config b/src/TestStack.White.UITests/App.config index 74ff35fc..20949af6 100644 --- a/src/TestStack.White.UITests/App.config +++ b/src/TestStack.White.UITests/App.config @@ -9,6 +9,7 @@ + diff --git a/src/TestStack.White.UITests/ControlTests/ListControls/ComboBoxTests.cs b/src/TestStack.White.UITests/ControlTests/ListControls/ComboBoxTests.cs index b8a2f91e..1d7e9de3 100644 --- a/src/TestStack.White.UITests/ControlTests/ListControls/ComboBoxTests.cs +++ b/src/TestStack.White.UITests/ControlTests/ListControls/ComboBoxTests.cs @@ -9,8 +9,6 @@ namespace TestStack.White.UITests.ControlTests.ListControls { [TestFixture(WindowsFramework.WinForms)] [TestFixture(WindowsFramework.Wpf)] - [Category("NeedsFix")] - [Ignore("NeedsFix")] public class ComboBoxTests : WhiteUITestBase { protected ComboBox ComboBoxUnderTest { get; set; } From 2d7221231f4a2287dffde98cfd2d6821e9f956fa Mon Sep 17 00:00:00 2001 From: "dmytro.turushev" Date: Mon, 27 Jun 2016 19:45:00 +0300 Subject: [PATCH 3/3] Ignore only winforms test because of cannot get child count only in winforms --- .../ControlTests/ListControls/ComboBoxTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TestStack.White.UITests/ControlTests/ListControls/ComboBoxTests.cs b/src/TestStack.White.UITests/ControlTests/ListControls/ComboBoxTests.cs index 1d7e9de3..f76bbc39 100644 --- a/src/TestStack.White.UITests/ControlTests/ListControls/ComboBoxTests.cs +++ b/src/TestStack.White.UITests/ControlTests/ListControls/ComboBoxTests.cs @@ -7,7 +7,8 @@ namespace TestStack.White.UITests.ControlTests.ListControls { - [TestFixture(WindowsFramework.WinForms)] + //[TestFixture(WindowsFramework.WinForms)] + // Problem with WinForms tests [TestFixture(WindowsFramework.Wpf)] public class ComboBoxTests : WhiteUITestBase {