Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions windows/tests/TablePro.App.UITests/SafeModeAndReconnectTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public void ReconnectAsksBeforeRollingBackAndBringsTheTabsBack(string theme)
app.TypeInto("Query 1", Update);
app.Chord(() => app.TryFind("CommitButton") is { IsOffscreen: false }, VirtualKeyShort.CONTROL, VirtualKeyShort.ENTER);

Reconnect(app);
ReconnectUntilAsked(app);
app.CloseDialog();
Assert.True(app.Find("CommitButton").IsEnabled);

Reconnect(app);
ReconnectUntilAsked(app);
app.Screenshot("40-reconnect-asked");
app.PressDialogButton();
var rolledBack = Retry.WhileFalse(
Expand Down Expand Up @@ -111,4 +111,15 @@ private static void Reconnect(AppSession app)
app.Click(app.Find("DatabaseMenu"), () => app.TryFindMenuItem("Reconnect") is not null);
app.FindMenuItem("Reconnect").Patterns.Invoke.Pattern.Invoke();
}

// The prompt opens after the menu item returns, and until then CloseButton finds the tab's own close button.
private static void ReconnectUntilAsked(AppSession app)
{
Reconnect(app);
var asked = Retry.WhileFalse(
() => app.TryFind("PrimaryButton") is not null,
AppSession.Wait,
throwOnTimeout: false).Success;
Assert.True(asked, "Reconnect did not ask about the open transaction.");
}
}
Loading