diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f663b52a..76bc61b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ env: jobs: Test: - runs-on: windows-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-dotnet@v3 diff --git a/tests/Ignis.Tests.Components.HeadlessUI/DialogTests.razor b/tests/Ignis.Tests.Components.HeadlessUI/DialogTests.razor index 35be3fa1..1397ffbd 100644 --- a/tests/Ignis.Tests.Components.HeadlessUI/DialogTests.razor +++ b/tests/Ignis.Tests.Components.HeadlessUI/DialogTests.razor @@ -246,14 +246,12 @@ var openButton = cut.Find($"#{openButtonId}"); openButton.Click(); - await Task.Delay(400); - - var closeButton = cut.Find($"#{closeButtonId}"); + var closeButton = cut.WaitForElement($"#{closeButtonId}"); Assert.True(outlet.Contains(closeButton)); closeButton.Click(); - await Task.Delay(300); + await Task.Delay(400); outlet = cut.Find($"#{outletId}"); Assert.Empty(outlet.Children); diff --git a/tests/Ignis.Tests.Components.HeadlessUI/ListboxTests.razor b/tests/Ignis.Tests.Components.HeadlessUI/ListboxTests.razor index 68c6bf58..ffecdc14 100644 --- a/tests/Ignis.Tests.Components.HeadlessUI/ListboxTests.razor +++ b/tests/Ignis.Tests.Components.HeadlessUI/ListboxTests.razor @@ -51,27 +51,26 @@ Services.AddSingleton(); JSInterop.Mode = JSRuntimeMode.Loose; - + const string openButtonId = "open-button"; const string listboxButtonId = "listbox-button"; const string intOptionId = nameof(Int32); var cut = Render(@); - + var openButton = cut.Find($"#{openButtonId}"); openButton.Click(); - await Task.Delay(400); - - var listboxButton = cut.Find($"#{listboxButtonId}"); + var listboxButton = cut.WaitForElement($"#{listboxButtonId}"); listboxButton.Click(); var intOption = cut.Find($"#{intOptionId}"); intOption.Click(); - await Task.Delay(200); - - var listbox = cut.FindComponent>(); - Assert.Equal(typeof(int), listbox.Instance.Value); + cut.WaitForAssertion(() => + { + var listbox = cut.FindComponent>(); + Assert.Equal(typeof(int), listbox.Instance.Value); + }); } } \ No newline at end of file