|
1 |
| -using System.ComponentModel; |
| 1 | +using System.ComponentModel; |
2 | 2 | using System.Windows.Media;
|
3 | 3 | using MaterialDesignThemes.UITests.Samples.DialogHost;
|
4 | 4 |
|
@@ -315,4 +315,37 @@ await Wait.For(async () =>
|
315 | 315 |
|
316 | 316 | recorder.Success();
|
317 | 317 | }
|
| 318 | + |
| 319 | + [Fact] |
| 320 | + [Description("Issue 3069")] |
| 321 | + public async Task DialogHost_WithOpenDialog_ShowsPopupWhenLoaded() |
| 322 | + { |
| 323 | + await using var recorder = new TestRecorder(App); |
| 324 | + |
| 325 | + IVisualElement<Grid> rootGrid = (await LoadUserControl<LoadAndUnloadControl>()).As<Grid>(); |
| 326 | + |
| 327 | + IVisualElement<Button> loadButton = await rootGrid.GetElement<Button>("LoadDialogHost"); |
| 328 | + IVisualElement<Button> unloadButton = await rootGrid.GetElement<Button>("UnloadDialogHost"); |
| 329 | + IVisualElement<Button> toggleButton = await rootGrid.GetElement<Button>("ToggleIsOpen"); |
| 330 | + |
| 331 | + IVisualElement<DialogHost> dialogHost = await rootGrid.GetElement<DialogHost>("DialogHost"); |
| 332 | + IVisualElement<Button> closeButton = await dialogHost.GetElement<Button>("CloseButton"); |
| 333 | + |
| 334 | + await toggleButton.LeftClick(); |
| 335 | + |
| 336 | + await Wait.For(async () => Assert.True(await dialogHost.GetIsOpen())); |
| 337 | + await Wait.For(async () => Assert.True(await closeButton.GetIsVisible())); |
| 338 | + |
| 339 | + await unloadButton.LeftClick(); |
| 340 | + |
| 341 | + await Wait.For(async () => Assert.False(await closeButton.GetIsVisible())); |
| 342 | + |
| 343 | + await loadButton.LeftClick(); |
| 344 | + |
| 345 | + await Wait.For(async () => Assert.True(await closeButton.GetIsVisible())); |
| 346 | + |
| 347 | + await closeButton.LeftClick(); |
| 348 | + |
| 349 | + await Wait.For(async () => Assert.False(await dialogHost.GetIsOpen())); |
| 350 | + } |
318 | 351 | }
|
0 commit comments