protected override void ExecuteTestRun(WindowsFramework framework) { RunTest(SelectItemNotVisibleBecauseOfScrollBar); RunTest(ListItemContainingTextbox, WindowsFramework.Wpf); RunTest(FindNonExistentObject, WindowsFramework.Wpf); RunTest(ListBoxWithScrollBarWithChangingItems, WindowsFramework.Wpf); }
protected override void ExecuteTestRun(WindowsFramework framework) { listBoxUnderTest = MainWindow.Get<ListBox>("CheckedListBox"); RunTest(CanCheckItem); RunTest(CheckSelectedItem); RunTest(CheckUncheckItem); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectInputControls(); RunTest(() => GetDate(DateTime.Today), WindowsFramework.WinForms); RunTest(() => GetDate(null), WindowsFramework.Wpf, WindowsFramework.Silverlight); RunTest(SetDate); }
public static SearchCriteria ByControlType(Type testControlType, WindowsFramework framework) { var searchCriteria = new SearchCriteria(SearchConditionFactory.CreateForControlType(testControlType, framework)); searchCriteria.InferCustomItemType(testControlType); return(searchCriteria); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectOtherControls(); RunTest(Click); RunTest(ClickablePoint, WindowsFramework.Wpf); //TODO Figure out why this fails for Windows Forms RunTest(ClickHyperlinkFromLabel, WindowsFramework.Wpf); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectOtherControls(); RunTest(Click); RunTest(ClickablePoint, WindowsFramework.Wpf); //TODO Figure out why this fails for Windows Forms RunTest(ClickHyperlinkFromLabel, WindowsFramework.Wpf); }
public static SimpleSearchCondition CreateForControlType(Type testControlType, WindowsFramework framework) { ControlType controlType = testControlType.IsCustomType() ? CustomControlTypeMapping.ControlType(testControlType) : ControlDictionary.Instance.GetControlType(testControlType, framework); return CreateForControlType(controlType); }
internal static SearchCriteria ForMenuBar(WindowsFramework framework) { var searchCriteria = new SearchCriteria(SearchConditionFactory.CreateForControlType(typeof(MenuBar), framework.ToString())); return(searchCriteria.NotIdentifiedByText("System Menu Bar")); }
void GetPopupMenuItems(WindowsFramework framework) { MainWindow.Get<ListBox>("ListBoxWithVScrollBar").RightClick(); var popup = MainWindow.Popup; int numberOfItems = framework == WindowsFramework.Wpf ? 2 : 4; Assert.Equal(numberOfItems, popup.Items.Count); }
protected override void ExecuteTestRun(WindowsFramework framework) { var screen = Repository.Get <SomeGenericScreen <int, int> >(MainWindow.Title, InitializeOption.NoCache); screen.MakeWindowItemsMapDirty(); Application.ApplicationSession.Save(); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectListControls(); RunTest(()=>GetPopupMenuItems(framework)); RunTest(ClickOnPopupMenu); RunTest(ClickOnNestedMenu); }
protected override void ExecuteTestRun(WindowsFramework framework) { RunTest(GetModalWindow); RunTest(GetModalWindowBasedOnSearchCriteria); RunTest(GetControlFromModalWindowWhenSessionActive); RunTest(ThrowsWhenNotFound); }
protected override void ExecuteTestRun(WindowsFramework framework) { RunTest(SelectItemNotVisibleBecauseOfScrollBar); RunTest(ListItemContainingTextbox, WindowsFramework.Wpf); RunTest(FindNonExistentObject, WindowsFramework.Wpf); RunTest(ListBoxWithScrollBarWithChangingItems, WindowsFramework.Wpf); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectOtherControls(); RunTest(MinimumValue); RunTest(MaximumValue); RunTest(Value); }
protected WhiteUITestBase(WindowsFramework framework) { Framework = framework; CoreAppXmlConfiguration.Instance.LoggerFactory = new ConsoleFactory(LoggerLevel.Debug); screenshotDir = @"c:\FailedTestsScreenshots"; Directory.CreateDirectory(screenshotDir); }
protected WhiteUITestBase(WindowsFramework framework) { Framework = framework; CoreAppXmlConfiguration.Instance.LoggerFactory = new ConsoleFactory(LoggerLevel.Debug); screenshotDir = @"c:\FailedTestsScreenshots"; Directory.CreateDirectory(screenshotDir); }
public void RunTest() { var frameworksToRun = SupportedFrameworks(); foreach (var framework in frameworksToRun) { currentFramework = framework; using (SetMainWindow(framework)) { try { RunTest(framework); } catch (TestFailedException) { throw; } catch (Exception ex) { throw new TestFailedException(string.Format("Failed to run test for {0}", framework), ex); } } } currentFramework = null; }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectOtherControls(); RunTest(MinimumValue); RunTest(MaximumValue); RunTest(Value); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectInputControls(); RunTest(() => GetDate(DateTime.Today), WindowsFramework.WinForms); RunTest(() => GetDate(null), WindowsFramework.Wpf, WindowsFramework.Silverlight); RunTest(SetDate); }
protected override void ExecuteTestRun(WindowsFramework framework) { RunTest(GetModalWindow); RunTest(GetModalWindowBasedOnSearchCriteria); RunTest(GetControlFromModalWindowWhenSessionActive); RunTest(ThrowsWhenNotFound); }
protected override void ExecuteTestRun(WindowsFramework framework) { RunTest(FindMenuBar); RunTest(Click); RunTest(FindByAutomationId, WindowsFramework.Wpf); RunTest(FindMultiLevelMenuItem); }
protected override void ExecuteTestRun(WindowsFramework framework) { listBoxUnderTest = MainWindow.Get <ListBox>("CheckedListBox"); RunTest(CanCheckItem); RunTest(CheckSelectedItem); RunTest(CheckUncheckItem); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectListControls(); RunTest(() => GetPopupMenuItems(framework)); RunTest(ClickOnPopupMenu); RunTest(ClickOnNestedMenu); }
internal static Window Create(AutomationElement element, InitializeOption option, WindowSession windowSession) { SpecializedWindowFactory specializedWindowFactory = SpecializedWindowFactories.Find(factory => factory.DoesSpecializeInThis(element)); if (specializedWindowFactory != null) { return(specializedWindowFactory.Create(element, option, windowSession)); } var windowsFramework = new WindowsFramework(element.Current.FrameworkId); if (windowsFramework.WinForm) { return(new WinFormWindow(element, option, windowSession)); } if (windowsFramework.WPF) { return(new WPFWindow(element, WindowFactory.Desktop, option, windowSession)); } if (windowsFramework.Win32) { return(new Win32Window(element, WindowFactory.Desktop, option, windowSession)); } if (windowsFramework.UIAutomationBug) { return(null); } throw new UIItemSearchException(string.Format("{0} is not supported yet.", windowsFramework)); }
protected override void ExecuteTestRun(WindowsFramework framework) { RunTest(FindMenuBar); RunTest(Click); RunTest(FindByAutomationId, WindowsFramework.Wpf); RunTest(FindMultiLevelMenuItem); }
void GetPopupMenuItems(WindowsFramework framework) { MainWindow.Get <ListBox>("ListBoxWithVScrollBar").RightClick(); var popup = MainWindow.Popup; int numberOfItems = framework == WindowsFramework.Wpf ? 2 : 4; Assert.Equal(numberOfItems, popup.Items.Count); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectDataGridTab(); table = MainWindow.Get <Table>("DataGrid"); RunTest(GetRowTest); RunTest(GetMultipleRowsTest); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectDataGridTab(); table = MainWindow.Get<Table>("DataGrid"); RunTest(GetRowTest); RunTest(GetMultipleRowsTest); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectInputControls(); spinner = MainWindow.Get <Spinner>("NumericUpDown"); RunTest(Value); RunTest(Increment); RunTest(Decrement); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectInputControls(); spinner = MainWindow.Get<Spinner>("NumericUpDown"); RunTest(Value); RunTest(Increment); RunTest(Decrement); }
protected override void ExecuteTestRun(WindowsFramework framework) { // ReSharper disable AccessToDisposedClosure using (var window = StartScenario("CustomUIItemScenario", "CustomUIItemScenario")) { RunTest(() => FindCustomItem(window)); RunTest(() => NoDateUIItemMappingDefined(window)); } }
protected override void ExecuteTestRun(WindowsFramework framework) { var window = OpenHorizontalSliderWindow(); using (new DelegateDisposable(() => CloseSliderWindow(window))) { RunTest(()=>Find(window)); RunTest(()=>Slide(window)); } }
public void AccessKey(WindowsFramework framework) { var button = MainWindow.Get<Button>("ButtonWithTooltip"); if (framework != WindowsFramework.Wpf) Assert.Equal("Alt+B", button.AccessKey); Keyboard.HoldKey(KeyboardInput.SpecialKeys.ALT); Keyboard.Enter("B"); Keyboard.LeaveKey(KeyboardInput.SpecialKeys.ALT); Retry.For(() => Assert.Equal("Clicked", button.Text), TimeSpan.FromSeconds(2)); }
protected override void ExecuteTestRun(WindowsFramework framework) { // ReSharper disable AccessToDisposedClosure using (var window = StartScenario("CustomUIItemScenario", "CustomUIItemScenario")) { RunTest(() => FindCustomItem(window)); RunTest(() => NoDateUIItemMappingDefined(window)); } }
public static SearchCondition CreateForControlType(Type testControlType, WindowsFramework framework) { if (testControlType.IsCustomType()) return CreateForControlType(CustomControlTypeMapping.ControlType(testControlType, framework)); var controlTypes = ControlDictionary.Instance.GetControlType(testControlType, framework.FrameworkId()); if (controlTypes.Length == 1) return CreateForControlType(controlTypes[0]); return new OrSearchCondition(controlTypes.Select(CreateForControlType).ToArray()); }
protected override void ExecuteTestRun(WindowsFramework framework) { var window = OpenHorizontalSliderWindow(); using (new DelegateDisposable(() => CloseSliderWindow(window))) { RunTest(() => Find(window)); RunTest(() => Slide(window)); } }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectDataGridTab(); table = MainWindow.Get<Table>("DataGrid"); rows = table.Rows; RunTest(RowData); RunTest(GetRowAfterSortingOnAColumn); RunTest(Select); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectInputControls(); RunTest(IsReadOnly); RunTest(CopyTest); RunTest(EnterText); RunTest(EnterBulkText); RunTest(SuggestionList, WindowsFramework.WinForms); RunTest(SelectFromSuggestionList, WindowsFramework.WinForms); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectInputControls(); RunTest(IsReadOnly); RunTest(CopyTest); RunTest(EnterText); RunTest(EnterBulkText); RunTest(SuggestionList, WindowsFramework.WinForms); RunTest(SelectFromSuggestionList, WindowsFramework.WinForms); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectDataGridTab(); table = MainWindow.Get <Table>("DataGrid"); rows = table.Rows; RunTest(RowData); RunTest(GetRowAfterSortingOnAColumn); RunTest(Select); }
protected override void RunTest(WindowsFramework framework) { var window = OpenVerticalSliderWindow(); using (new DelegateDisposable(() => CloseSliderWindow(window))) { RunTest(() => Find(window)); RunTest(() => Slide(window)); } }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectOtherControls(); slider = MainWindow.Get <Slider>("Slider"); RunTest(SetValue); RunTest(LargeIncrement); RunTest(LargeDecrement); RunTest(SmallIncrement); RunTest(SmallDecrement); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectOtherControls(); slider = MainWindow.Get<Slider>("Slider"); RunTest(SetValue); RunTest(LargeIncrement); RunTest(LargeDecrement); RunTest(SmallIncrement); RunTest(SmallDecrement); }
protected override void ExecuteTestRun(WindowsFramework framework) { tab = MainWindow.Get <Tab>("ControlsTab"); RunTest(Find); RunTest(() => AssertChildrenCount(framework)); RunTest(ShouldSelectTabPage); RunTest(ShouldSelectTabPageWithName); RunTest(FindControlsInsideTab); RunTest(TabWithReverseDisplayOrderTest, WindowsFramework.WinForms); }
protected override void ExecuteTestRun(WindowsFramework framework) { tab = MainWindow.Get<Tab>("ControlsTab"); RunTest(Find); RunTest(()=>AssertChildrenCount(framework)); RunTest(ShouldSelectTabPage); RunTest(ShouldSelectTabPageWithName); RunTest(FindControlsInsideTab); RunTest(TabWithReverseDisplayOrderTest, WindowsFramework.WinForms); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectPropertyGridTab(); propertyGrid = MainWindow.Get <PropertyGrid>("PropertyGrid"); RunTest(Get); RunTest(Categories); RunTest(BrowseForValue); RunTest(CannotBrowseForValue); RunTest(Properties); RunTest(Property); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectPropertyGridTab(); propertyGrid = MainWindow.Get<PropertyGrid>("PropertyGrid"); RunTest(Get); RunTest(Categories); RunTest(BrowseForValue); RunTest(CannotBrowseForValue); RunTest(Properties); RunTest(Property); }
protected override void ExecuteTestRun(WindowsFramework framework) { RunTest(EnterAccentedChars); RunTest(EnterUnicodeCharacters); RunTest(MultilineTextBox); RunTest(ShouldSetTheValueOfATextBox); RunTest(ShouldBeAbleToPressLeftAndRightCursorKeys); RunTest(DoNotAllowToLeaveKeyWhichIsNotHeld); RunTest(CapsLock); RunTest(LeaveAllKeys); RunTest(LeaveKey); }
protected override void ExecuteTestRun(WindowsFramework framework) { RunTest(EnterAccentedChars); RunTest(EnterUnicodeCharacters); RunTest(MultilineTextBox); RunTest(ShouldSetTheValueOfATextBox); RunTest(ShouldBeAbleToPressLeftAndRightCursorKeys); RunTest(DoNotAllowToLeaveKeyWhichIsNotHeld); RunTest(CapsLock); RunTest(LeaveAllKeys); RunTest(LeaveKey); }
protected override void RunTest(WindowsFramework framework) { DataGridUnderTest = MainWindow.Get <ListView>(SearchCriteria.ByAutomationId("DataGridControl")); var customControl = MainWindow.Get(SearchCriteria.ByAutomationId("CustomDataGridControl")) as UIItem; DataGridFromCustomControlUnderTest = customControl.Get <ListView>(SearchCriteria.ByAutomationId("DataGridControl")); RunTest(() => CanGetAllItems(DataGridUnderTest)); RunTest(() => CanGetAllItems(DataGridFromCustomControlUnderTest)); RunTest(() => CanGetCell(DataGridUnderTest)); RunTest(() => CanGetCell(DataGridFromCustomControlUnderTest)); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectOtherControls(); tree = MainWindow.Get<Tree>("TreeView"); RunTest(NodeIsExpanded); RunTest(Expand); RunTest(Collapse); RunTest(Collapse); RunTest(DisplayState); RunTest(DoubleClick); RunTest(UnSelect, WindowsFramework.Wpf); // Winforms must have a selection }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectOtherControls(); tree = MainWindow.Get <Tree>("TreeView"); RunTest(NodeIsExpanded); RunTest(Expand); RunTest(Collapse); RunTest(Collapse); RunTest(DisplayState); RunTest(DoubleClick); RunTest(UnSelect, WindowsFramework.Wpf); // Winforms must have a selection }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectOtherControls(); statusStrip = MainWindow.StatusBar(InitializeOption.NoCache); RunTest(Find); RunTest(ThrowsWhenDoesNotExists); RunTest(FindLabelInsideStatusBar); RunTest(ClickOnButtonAndFindPopupMenu); RunTest(FindDropDown); RunTest(ProgressBar); RunTest(ProgressBar2); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectOtherControls(); statusStrip = MainWindow.StatusBar(InitializeOption.NoCache); RunTest(Find); RunTest(ThrowsWhenDoesNotExists); RunTest(FindLabelInsideStatusBar); RunTest(ClickOnButtonAndFindPopupMenu); RunTest(FindDropDown); RunTest(ProgressBar); RunTest(ProgressBar2); }
protected override void RunTest(WindowsFramework framework) { CoreAppXmlConfiguration.Instance.LoggerFactory = new ConsoleFactory(LoggerLevel.Debug); ComboBoxUnderTest = MainWindow.Get <ComboBox>(SearchCriteria.ByAutomationId("AComboBox")); RunTest(ListItemInComboBoxWithoutTextAvailableInitially, WindowsFramework.Wpf); RunTest(CanSelectItemAtTopOfList); RunTest(CanGetAllItems); RunTest(CanSelectItemAtBottomOfList); RunTest(CanSelectItemAtTopOfList); // Once an item is selected at the bottom of the list, White couldn't select at the top again RunTest(CanSelectByIndex); RunTest(CanSelectReallyLongText); RunTest(SetValue); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectDataGridTab(); table = MainWindow.Get<Table>("DataGrid"); TableRows rows = table.Rows; row = rows[0]; RunTest(SetTextCellValue); RunTest(GetEmptyValue); RunTest(SetCheckBoxCellValue); RunTest(SetComboBoxCellValue); RunTest(TextOnButtonCell); RunTest(Click); }
protected override void ExecuteTestRun(WindowsFramework framework) { RunTest(CellCount); RunTest(CellText); RunTest(Columns); RunTest(MultiSelect); RunTest(RowCount); RunTest(SelectBasedOnCell); RunTest(SelectRow); RunTest(SelectScrolledRow); RunTest(SelectedRow); RunTest(SelectedRows); RunTest(SelectWhenHorizontalScrollIsPresent); }
protected override void ExecuteTestRun(WindowsFramework framework) { SelectDataGridTab(); table = MainWindow.Get<Table>("DataGrid"); RunTest(Find); RunTest(TableRows); RunTest(SelectRowNotVisibleInitially); RunTest(TableHasScrollBars); RunTest(Columns); RunTest(GetRow); RunTest(FindAllTest); RunTest(IsInTop); }
protected override void ExecuteTestRun(WindowsFramework framework) { ComboBoxUnderTest = MainWindow.Get<ComboBox>(SearchCriteria.ByAutomationId("AComboBox")); RunTest(ListItemInComboBoxWithoutTextAvailableInitially, WindowsFramework.Wpf); RunTest(ComboBoxWithAutoExpandCollapsedOnceItemsAreRetrieved); RunTest(ComboBoxOnlyCollapsesWhenExpansionWasForItemRetrieval); RunTest(CanSelectItemAtTopOfList); RunTest(CanGetAllItems); RunTest(CanSelectItemAtBottomOfList); RunTest(CanSelectItemAtTopOfList); // Once an item is selected at the bottom of the list, White couldn't select at the top again RunTest(CanSelectByIndex); RunTest(CanSelectReallyLongText); RunTest(SetValue); }
void GetControlBasedOnIndex(WindowsFramework framework) { using (var window = StartScenario("GetMultipleButton", "GetMultiple")) { var button = window.Get<Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Button").AndIndex(0)); Assert.NotNull(button); var exception = Assert.Throws<AutomationException>(() => MainWindow.Get<TextBox>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Button").AndIndex(4))); var expected = framework == WindowsFramework.Wpf? "Failed to get ControlType=edit,AutomationElementIdentifiers.NameProperty=Button,Index=4": "Failed to get (ControlType=edit or ControlType=document),AutomationElementIdentifiers.NameProperty=Button,Index=4"; Assert.Equal(expected, exception.Message); } }