From 9394c789a4cd06459ae8a81d3e37706b510a8821 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Sat, 14 Nov 2026 23:31:11 +0700 Subject: [PATCH 1/2] fix(ci): draw no editor frame on focus loss, show one WinUI test window at a time, check ClickHouse's port, update Flatpak runtimes on a volume --- .github/workflows/build-linux.yml | 4 + .../test-fixtures/src/clickhouse_fixture.rs | 7 +- .../docs/decisions/0002-sql-editor-control.md | 2 +- windows/src/TablePro.Editor/SqlEditor.Ime.cs | 5 + windows/tests/Shared/WinUiApp.cs | 24 +++- .../tests/TablePro.Editor.Tests/CaretTests.cs | 109 ++++++++++++++++++ .../tests/TablePro.Editor.Tests/EditorHost.cs | 6 +- 7 files changed, 153 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 3c3180c49c..c8d2b68efd 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -460,6 +460,10 @@ jobs: container: image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-51 options: --privileged + # Docker copies the image's runtimes into the volume. On AWS-hosted runners, updating a runtime that sits in + # an image layer fails with "Invalid cross-device link" (run 43615225881). + volumes: + - flatpak-system:/var/lib/flatpak steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: diff --git a/core/crates/test-fixtures/src/clickhouse_fixture.rs b/core/crates/test-fixtures/src/clickhouse_fixture.rs index 7c6784af8c..e67e829a28 100644 --- a/core/crates/test-fixtures/src/clickhouse_fixture.rs +++ b/core/crates/test-fixtures/src/clickhouse_fixture.rs @@ -435,6 +435,11 @@ mod tests { }; assert_eq!(reason, "no answer within 8 seconds"); assert!(state.starts_with("status running, "), "{state}"); - assert!(logs.contains("Listening for http://0.0.0.0:8124"), "{logs}"); + // 26.8.36 and 26.3 bind 0.0.0.0 and 26.8.37 binds `::`: the image picks the address, the config the port. + assert!( + logs.lines() + .any(|line| line.contains("Listening for http://") && line.trim_end().ends_with(":8124")), + "{logs}" + ); } } diff --git a/windows/docs/decisions/0002-sql-editor-control.md b/windows/docs/decisions/0002-sql-editor-control.md index c4068cb408..dd52a4fd87 100644 --- a/windows/docs/decisions/0002-sql-editor-control.md +++ b/windows/docs/decisions/0002-sql-editor-control.md @@ -38,7 +38,7 @@ - A SwapChainPanel holds a composition swap chain (flip sequential, three buffers, at most two frames waiting). A frame starts only when the swap chain can take it, through its frame latency object, so Present never blocks the UI thread. Direct3D 11 runs on the GPU, or WARP when there is none or software rendering is asked for. Direct2D draws on it, DirectWrite lays out each visible line. - Every editor on a UI thread draws on one Direct3D and Direct2D device, as the grid's rows do (0003), and the first editor to find it lost replaces it for the rest. Each editor has its own device context and swap chain. TabView unloads a tab's content on every switch, so a hidden editor gives back its swap chain (`SetSwapChain(null)`) and keeps its layouts and brushes; showing it again makes one swap chain. - Line layouts are cached by text and colors, so lines that shift after an edit keep theirs; only the edited line is laid out again. A line over 4,096 characters is laid out in a slice around the visible columns. -- A frame is drawn on the UI thread when something changed, and many changes before it give one frame. It holds the gutter, current line band, find matches, selections, text and IME marks. The carets are a composition visual of their own over the swap chain, one sprite per visible caret, as WinUI's TextBox keeps its caret in an element of its own (`TextBoxView.cpp`, `EnsureCaretElement`). SwapChainPanel draws its swap chain first (`SwapChainPanel.cpp`, `GetChildrenInRenderOrder`), so the panel's child visual lies above it. A frame places the sprites at the positions it laid out, snapped to pixels; a blink, focus or the window's activation only shows or hides the visual, with no frame. On `windows-2025` (run 43277097648) focus and a 5 second blink of 10 toggles presented 11 frames when the frame held the caret, and 0 with the visual. The caret blinks at the system rate, with the system caret width, and stops after the system caret timeout (`SPI_GETCARETTIMEOUT`, 5 seconds when the call fails) with no input, shown, as a Win32 edit control's does. In an inactive window (`InputActivationListener`) it is hidden and nothing blinks, as Win32's About Carets asks. +- A frame is drawn on the UI thread when something changed, and many changes before it give one frame. It holds the gutter, current line band, find matches, selections, text and IME marks. The carets are a composition visual of their own over the swap chain, one sprite per visible caret, as WinUI's TextBox keeps its caret in an element of its own (`TextBoxView.cpp`, `EnsureCaretElement`). SwapChainPanel draws its swap chain first (`SwapChainPanel.cpp`, `GetChildrenInRenderOrder`), so the panel's child visual lies above it. A frame places the sprites at the positions it laid out, snapped to pixels; a blink, focus or the window's activation only shows or hides the visual, with no frame. On `windows-2025` (run 43277097648) focus and a 5 second blink of 10 toggles presented 11 frames when the frame held the caret, and 0 with the visual. WinUI raises LostFocus on the focused editor when another window takes the activation, and GotFocus when it comes back (run 43614838421), so focus leaving clears the composition and draws only when one was shown. The caret blinks at the system rate, with the system caret width, and stops after the system caret timeout (`SPI_GETCARETTIMEOUT`, 5 seconds when the call fails) with no input, shown, as a Win32 edit control's does. In an inactive window (`InputActivationListener`) it is hidden and nothing blinks, as Win32's About Carets asks. - Why a SwapChainPanel and not Composition drawing surfaces: one surface, presented when something changed, and a frame time measured from input to present; the same model as Windows Terminal. Surfaces per line would add their own management for scrolling that this cost does not need. - Colors: theme resources for the chrome. In high contrast the system colors, selected text in the highlight text color, and no syntax colors. - DPI: the buffer is in pixels and the panel's composition scale shrinks it back. Ctrl+wheel, Ctrl+= and Ctrl+- zoom. diff --git a/windows/src/TablePro.Editor/SqlEditor.Ime.cs b/windows/src/TablePro.Editor/SqlEditor.Ime.cs index d4f48bccc1..2722df2635 100644 --- a/windows/src/TablePro.Editor/SqlEditor.Ime.cs +++ b/windows/src/TablePro.Editor/SqlEditor.Ime.cs @@ -79,6 +79,11 @@ public void Commit(string text) public void ShowComposition(string text, int caret, IReadOnlyList runs) { + // Every focus loss clears the composition; with none shown, the swap chain has nothing new to draw. + if (text.Length == 0 && editor._composition.Length == 0) + { + return; + } editor._composition = text; editor._compositionCaret = caret; editor._compositionRuns = runs; diff --git a/windows/tests/Shared/WinUiApp.cs b/windows/tests/Shared/WinUiApp.cs index ba391db0a3..99fd27dfe7 100644 --- a/windows/tests/Shared/WinUiApp.cs +++ b/windows/tests/Shared/WinUiApp.cs @@ -12,6 +12,8 @@ namespace TablePro.Testing; internal static class WinUiApp { private static readonly Lazy> s_queue = new(StartAsync); + private static readonly TaskCompletionSource s_desktopTaken = new(TaskCreationOptions.RunContinuationsAsynchronously); + private static Mutex? s_desktop; public static Window Window { get; private set; } = null!; @@ -20,7 +22,10 @@ internal static class WinUiApp public static async Task RunAsync(Func body) { - var queue = await s_queue.Value.WaitAsync(TimeSpan.FromSeconds(90)); + var started = s_queue.Value; + // Waiting for the other WinUI test process to end is not a WinUI start that hung. + await s_desktopTaken.Task.WaitAsync(TimeSpan.FromMinutes(5)); + var queue = await started.WaitAsync(TimeSpan.FromSeconds(90)); var done = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); queue.TryEnqueue(async () => { @@ -62,6 +67,8 @@ private static Task StartAsync() { try { + TakeDesktop(); + s_desktopTaken.TrySetResult(); WinRT.ComWrappersSupport.InitializeComWrappers(); Application.Start(callback => { @@ -76,6 +83,7 @@ private static Task StartAsync() } catch (Exception ex) { + s_desktopTaken.TrySetResult(); ready.TrySetException(ex); } }) @@ -87,6 +95,20 @@ private static Task StartAsync() thread.Start(); return ready.Task; } + + // dotnet test runs the editor and grid test processes at once, and each window took the other's activation. + private static void TakeDesktop() + { + s_desktop = new Mutex(false, @"Local\TablePro.WinUiTests"); + try + { + s_desktop.WaitOne(); + } + catch (AbandonedMutexException) + { + // The process that held it ended, which hands it to this one. + } + } } // An app with no XAML files, so the WinUI controls' types come from their own metadata provider. diff --git a/windows/tests/TablePro.Editor.Tests/CaretTests.cs b/windows/tests/TablePro.Editor.Tests/CaretTests.cs index 8bb07c8ef5..404197688d 100644 --- a/windows/tests/TablePro.Editor.Tests/CaretTests.cs +++ b/windows/tests/TablePro.Editor.Tests/CaretTests.cs @@ -1,8 +1,10 @@ using System.Diagnostics; using System.Globalization; using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; using TablePro.Testing; using TerraFX.Interop.Windows; +using Windows.Graphics; using static TerraFX.Interop.Windows.Windows; namespace TablePro.Editor.Tests; @@ -70,6 +72,95 @@ public Task TheCaretBlinksWithNoFrameAndStopsAfterTheCaretTimeout() }); } + // Focus leaving the editor drew a whole frame though nothing on the swap chain changed. + [Fact] + public Task FocusLeavingTheEditorAndComingBackDrawsNoFrame() + { + return WinUiApp.RunAsync(async () => + { + var editor = new SqlEditor { Text = "SELECT 1;" }; + var other = new Button + { + Content = "Other", + HorizontalAlignment = HorizontalAlignment.Left, + VerticalAlignment = VerticalAlignment.Top, + }; + try + { + Assert.True(await EditorHost.ShowAsync(editor, other), "the editor drew no frame"); + WinUiApp.Window.Activate(); + await FramesAsync(3); + Assert.SkipUnless(editor.IsInActiveWindow, "The test window is not the active window."); + Assert.True(editor.Focus(FocusState.Programmatic)); + await FramesAsync(3); + Assert.True(editor.IsCaretShown, "no caret shown after focus"); + var frames = 0; + editor.FramePresented += (_, _) => frames++; + + Assert.True(other.Focus(FocusState.Programmatic)); + await FramesAsync(3); + Assert.Equal(FocusState.Unfocused, editor.FocusState); + Assert.False(editor.IsCaretShown, "the caret is shown after focus left"); + Assert.True(editor.Focus(FocusState.Programmatic)); + await FramesAsync(3); + Assert.True(editor.IsCaretShown, "no caret shown after focus came back"); + Assert.Equal(0, frames); + } + finally + { + EditorHost.Clear(); + editor.Dispose(); + } + }); + } + + // Another test process opening its window took the activation and drew a frame in the timeout test. + [Fact] + public Task AnotherWindowTakingTheActivationDrawsNoFrame() + { + return WinUiApp.RunAsync(async () => + { + var editor = new SqlEditor { Text = "SELECT 1;" }; + try + { + Assert.True(await EditorHost.ShowAsync(editor), "the editor drew no frame"); + WinUiApp.Window.Activate(); + await FramesAsync(3); + Assert.SkipUnless(editor.IsInActiveWindow, "The test window is not the active window."); + Assert.True(editor.Focus(FocusState.Programmatic)); + await FramesAsync(3); + var frames = 0; + editor.FramePresented += (_, _) => frames++; + + var other = new Window { Title = "Other" }; + other.AppWindow.MoveAndResize(new RectInt32(120, 120, 480, 320)); + try + { + other.Activate(); + await UntilAsync(() => !editor.IsInActiveWindow); + Assert.SkipWhen(editor.IsInActiveWindow, "The other window did not take the activation."); + await FramesAsync(3); + Assert.False(editor.IsCaretShown, "the caret is shown in an inactive window"); + } + finally + { + other.Close(); + } + WinUiApp.Window.Activate(); + await UntilAsync(() => editor.IsInActiveWindow); + Assert.SkipUnless(editor.IsInActiveWindow, "The test window did not get the activation back."); + await FramesAsync(3); + Assert.True(editor.IsCaretShown, "no caret shown once the window was active again"); + Assert.Equal(0, frames); + } + finally + { + EditorHost.Clear(); + editor.Dispose(); + } + }); + } + // Read from the screen: the caret's visual draws over the swap chain and the blink hides it. [Fact] public Task TheCaretShowsOverTheTextAndTheBlinkHidesIt() @@ -114,6 +205,24 @@ public Task TheCaretShowsOverTheTextAndTheBlinkHidesIt() }); } + private static async Task FramesAsync(int count) + { + for (var i = 0; i < count; i++) + { + await WinUiApp.NextFrameAsync(); + } + } + + private static async Task UntilAsync(Func condition) + { + var cancel = TestContext.Current.CancellationToken; + var waited = Stopwatch.StartNew(); + while (!condition() && waited.Elapsed < TimeSpan.FromSeconds(5)) + { + await Task.Delay(20, cancel); + } + } + // Once the compositor has had time to show the caret's state; null when a blink changed it meanwhile. private static async Task ReadScreenAsync(SqlEditor editor, bool shown, int x, int y) { diff --git a/windows/tests/TablePro.Editor.Tests/EditorHost.cs b/windows/tests/TablePro.Editor.Tests/EditorHost.cs index b95fae4186..88f9c72cd2 100644 --- a/windows/tests/TablePro.Editor.Tests/EditorHost.cs +++ b/windows/tests/TablePro.Editor.Tests/EditorHost.cs @@ -13,7 +13,7 @@ internal static class EditorHost private static Grid? s_host; // False when the editor drew no frame. - public static async Task ShowAsync(SqlEditor editor) + public static async Task ShowAsync(SqlEditor editor, UIElement? beside = null) { var presented = false; void OnFrame(object? sender, EditorFrame frame) => presented = true; @@ -23,6 +23,10 @@ public static async Task ShowAsync(SqlEditor editor) var host = Host(); host.Children.Clear(); host.Children.Add(editor); + if (beside is not null) + { + host.Children.Add(beside); + } for (var i = 0; i < 300 && !presented; i++) { await WinUiApp.NextFrameAsync(); From 9f0d44f85c6d032c15273410de6e00b5b9e7daf0 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Sun, 15 Nov 2026 01:35:35 +0700 Subject: [PATCH 2/2] test(windows): read a status that may have no UIA Name without throwing --- windows/tests/TablePro.App.UITests/AppSession.cs | 6 ++++-- windows/tests/TablePro.App.UITests/BrowseObjectsTests.cs | 4 ++-- windows/tests/TablePro.App.UITests/RunStatementTests.cs | 5 +++-- .../tests/TablePro.App.UITests/SafeModeAndReconnectTests.cs | 6 +++--- windows/tests/TablePro.App.UITests/ShareTests.cs | 2 +- windows/tests/TablePro.App.UITests/ShellPolishTests.cs | 4 +++- windows/tests/TablePro.App.UITests/TabWindowTests.cs | 2 +- windows/tests/TablePro.App.UITests/TableEditingTests.cs | 2 +- 8 files changed, 18 insertions(+), 13 deletions(-) diff --git a/windows/tests/TablePro.App.UITests/AppSession.cs b/windows/tests/TablePro.App.UITests/AppSession.cs index bb1bb79ac8..0047d89207 100644 --- a/windows/tests/TablePro.App.UITests/AppSession.cs +++ b/windows/tests/TablePro.App.UITests/AppSession.cs @@ -472,14 +472,16 @@ private InvalidOperationException Failure(string message, bool screen = false) return new InvalidOperationException(message + exited + log); } + // A status has no UIA Name while its text is empty, and FlaUI's Name throws for it then. + public static string TextOf(AutomationElement element) => element.Properties.Name.ValueOrDefault ?? string.Empty; + public static string WaitForText(AutomationElement element, Func done) { var text = string.Empty; Retry.WhileFalse( () => { - // A status may have no UIA Name until its asynchronous result arrives. - text = element.Properties.Name.ValueOrDefault ?? string.Empty; + text = TextOf(element); return done(text); }, Wait, diff --git a/windows/tests/TablePro.App.UITests/BrowseObjectsTests.cs b/windows/tests/TablePro.App.UITests/BrowseObjectsTests.cs index d3e966d6cb..cff5de37fe 100644 --- a/windows/tests/TablePro.App.UITests/BrowseObjectsTests.cs +++ b/windows/tests/TablePro.App.UITests/BrowseObjectsTests.cs @@ -23,7 +23,7 @@ public void ATriggerOpensItsDefinitionReadOnlyAndInAnEditor(string theme) app.FindByName("Track", tree); app.TypeInto("Query 1", CreateTrigger); app.Chord( - () => app.Find("QueryStatus").Name.StartsWith("Done", StringComparison.Ordinal), + () => AppSession.TextOf(app.Find("QueryStatus")).StartsWith("Done", StringComparison.Ordinal), VirtualKeyShort.CONTROL, VirtualKeyShort.ENTER); @@ -61,7 +61,7 @@ public void ARunIsKeptInHistoryAndOpensAgainAndOffersExport(string theme) app.FindByName("Track", app.Find("ObjectTree")); app.TypeInto("Query 1", CountTracks); app.Chord( - () => app.Find("QueryStatus").Name.StartsWith("Rows: 1", StringComparison.Ordinal), + () => AppSession.TextOf(app.Find("QueryStatus")).StartsWith("Rows: 1", StringComparison.Ordinal), VirtualKeyShort.CONTROL, VirtualKeyShort.ENTER); Assert.Equal("3503", app.WaitForCell(app.Find("ResultsGrid"), 0, 0, value => value == "3503")); diff --git a/windows/tests/TablePro.App.UITests/RunStatementTests.cs b/windows/tests/TablePro.App.UITests/RunStatementTests.cs index c53739120a..bc82387c76 100644 --- a/windows/tests/TablePro.App.UITests/RunStatementTests.cs +++ b/windows/tests/TablePro.App.UITests/RunStatementTests.cs @@ -17,7 +17,7 @@ public void RunStatementRunsOnlyTheStatementAtTheCursorAndSelectsIt(string theme app.FindByName("Track", app.Find("ObjectTree")); app.TypeInto("Query 1", TwoSelects); app.Chord( - () => app.Find("QueryStatus").Name.StartsWith("Rows: 1", StringComparison.Ordinal), + () => AppSession.TextOf(app.Find("QueryStatus")).StartsWith("Rows: 1", StringComparison.Ordinal), VirtualKeyShort.CONTROL, VirtualKeyShort.SHIFT, VirtualKeyShort.ENTER); @@ -66,7 +66,8 @@ public void ARunPastTheResultLimitKeepsTheNewestAndSaysHowManyWent(string theme) app.FindByName("Track", app.Find("ObjectTree")); app.TypeInto("Query 1", "SELECT 1 AS a; SELECT 2 AS b; SELECT 3 AS c; SELECT 4 AS d"); app.Chord( - () => app.Find("QueryStatus").Name.EndsWith("2 earlier results were dropped.", StringComparison.Ordinal), + () => AppSession.TextOf(app.Find("QueryStatus")) + .EndsWith("2 earlier results were dropped.", StringComparison.Ordinal), VirtualKeyShort.CONTROL, VirtualKeyShort.ENTER); diff --git a/windows/tests/TablePro.App.UITests/SafeModeAndReconnectTests.cs b/windows/tests/TablePro.App.UITests/SafeModeAndReconnectTests.cs index 586bb12d3d..163a04f43c 100644 --- a/windows/tests/TablePro.App.UITests/SafeModeAndReconnectTests.cs +++ b/windows/tests/TablePro.App.UITests/SafeModeAndReconnectTests.cs @@ -23,7 +23,7 @@ public void EmptyingATableAsksFirstAndCancelRunsNothing(string theme) app.Screenshot("39-run-asked"); app.CloseDialog(); app.TypeInto("Query 1", "SELECT COUNT(*) = 3503 FROM Track;"); - app.Chord(() => app.Find("QueryStatus").Name.StartsWith("Rows: 1", StringComparison.Ordinal), + app.Chord(() => AppSession.TextOf(app.Find("QueryStatus")).StartsWith("Rows: 1", StringComparison.Ordinal), VirtualKeyShort.CONTROL, VirtualKeyShort.ENTER); Assert.Equal("1", app.WaitForCell(app.Find("ResultsGrid"), 0, 0, value => value == "1")); } @@ -54,7 +54,7 @@ public void ReconnectAsksBeforeRollingBackAndBringsTheTabsBack(string theme) Assert.True(rolledBack); Assert.Equal(Update, AppSession.EditorText(app.FindEditor("Query 1")).TrimEnd('\r', '\n')); app.TypeInto("Query 1", "SELECT COUNT(*) FROM Track WHERE TrackId = 1 AND Name = 'Pending';"); - app.Chord(() => app.Find("QueryStatus").Name.StartsWith("Rows: 1", StringComparison.Ordinal), + app.Chord(() => AppSession.TextOf(app.Find("QueryStatus")).StartsWith("Rows: 1", StringComparison.Ordinal), VirtualKeyShort.CONTROL, VirtualKeyShort.ENTER); Assert.Equal("0", app.WaitForCell(app.Find("ResultsGrid"), 0, 0, value => value == "0")); } @@ -101,7 +101,7 @@ public void ReconnectingWhileAQueryRunsBringsItsTabBack(string theme) private static void AnswerRuns(AppSession app) { app.TypeInto("Query 1", "SELECT 42 AS answer;"); - app.Chord(() => app.Find("QueryStatus").Name.StartsWith("Rows: 1", StringComparison.Ordinal), + app.Chord(() => AppSession.TextOf(app.Find("QueryStatus")).StartsWith("Rows: 1", StringComparison.Ordinal), VirtualKeyShort.CONTROL, VirtualKeyShort.ENTER); Assert.Equal("42", app.WaitForCell(app.Find("ResultsGrid"), 0, 0, value => value == "42")); } diff --git a/windows/tests/TablePro.App.UITests/ShareTests.cs b/windows/tests/TablePro.App.UITests/ShareTests.cs index dd44f4a460..a1399dfbd8 100644 --- a/windows/tests/TablePro.App.UITests/ShareTests.cs +++ b/windows/tests/TablePro.App.UITests/ShareTests.cs @@ -17,7 +17,7 @@ public void AResultAndAQueryOpenTheShareSheetWhichAsksToSignIn(string theme) app.FindByName("Track", app.Find("ObjectTree")); app.TypeInto("Query 1", "SELECT TrackId, Name FROM Track"); app.Chord( - () => app.Find("QueryStatus").Name.StartsWith("Rows: ", StringComparison.Ordinal), + () => AppSession.TextOf(app.Find("QueryStatus")).StartsWith("Rows: ", StringComparison.Ordinal), VirtualKeyShort.CONTROL, VirtualKeyShort.ENTER); var grid = app.Find("ResultsGrid"); diff --git a/windows/tests/TablePro.App.UITests/ShellPolishTests.cs b/windows/tests/TablePro.App.UITests/ShellPolishTests.cs index 61747c116a..30d5939932 100644 --- a/windows/tests/TablePro.App.UITests/ShellPolishTests.cs +++ b/windows/tests/TablePro.App.UITests/ShellPolishTests.cs @@ -305,7 +305,9 @@ public void ATableKeepsItsPageSizeAndGoesToAPageInsideItsCount(string theme) app.Click(app.Find("PageSizeButton"), () => app.TryFindMenuItem("100 rows") is not null); app.Screenshot("29-page-size-menu"); - app.Click(app.FindMenuItem("100 rows"), () => status.Name.StartsWith("1-100 ", StringComparison.Ordinal)); + app.Click( + app.FindMenuItem("100 rows"), + () => AppSession.TextOf(status).StartsWith("1-100 ", StringComparison.Ordinal)); Assert.Matches(PagedStatus("1-100"), status.Name); Assert.Equal("100 rows", app.Find("PageSizeButton").Name); var goTo = app.Find("GoToPageButton"); diff --git a/windows/tests/TablePro.App.UITests/TabWindowTests.cs b/windows/tests/TablePro.App.UITests/TabWindowTests.cs index 197afc270f..2c31e43dc4 100644 --- a/windows/tests/TablePro.App.UITests/TabWindowTests.cs +++ b/windows/tests/TablePro.App.UITests/TabWindowTests.cs @@ -204,7 +204,7 @@ public void ClosingATabWindowOrExitingAsksBeforeRollingBack(string theme) app.Find("PrimaryButton", torn).AsButton().Invoke(); app.WaitForClose(SampleWindow); app.TypeInto("Query 1", "SELECT COUNT(*) FROM Track WHERE TrackId = 1 AND Name = 'Pending';"); - app.Chord(() => app.Find("QueryStatus").Name.StartsWith("Rows: 1", StringComparison.Ordinal), + app.Chord(() => AppSession.TextOf(app.Find("QueryStatus")).StartsWith("Rows: 1", StringComparison.Ordinal), VirtualKeyShort.CONTROL, VirtualKeyShort.ENTER); Assert.Equal("0", app.WaitForCell(app.Find("ResultsGrid"), 0, 0, value => value == "0")); } diff --git a/windows/tests/TablePro.App.UITests/TableEditingTests.cs b/windows/tests/TablePro.App.UITests/TableEditingTests.cs index 9ebdccf91c..f54c5ca001 100644 --- a/windows/tests/TablePro.App.UITests/TableEditingTests.cs +++ b/windows/tests/TablePro.App.UITests/TableEditingTests.cs @@ -70,7 +70,7 @@ public void ATableTabKeepsEditsPendingPreviewsTheirSqlAndSavesThem(string theme) app.Chord(() => app.TryFind("SqlEditor") is { IsOffscreen: false }, VirtualKeyShort.CONTROL, VirtualKeyShort.KEY_1); var names = string.Join(", ", new[] { Renamed, Added, deleted }.Select(name => "'" + name.Replace("'", "''", StringComparison.Ordinal) + "'")); app.TypeInto("Query 1", $"SELECT COUNT(*) FROM Artist WHERE Name IN ({names});"); - app.Chord(() => app.Find("QueryStatus").Name.StartsWith("Rows: 1", StringComparison.Ordinal), + app.Chord(() => AppSession.TextOf(app.Find("QueryStatus")).StartsWith("Rows: 1", StringComparison.Ordinal), VirtualKeyShort.CONTROL, VirtualKeyShort.ENTER); Assert.Equal("2", app.WaitForCell(app.Find("ResultsGrid"), 0, 0, value => value == "2")); }