From 51e5bd8185040306ee482e0baba4cce86cf2a52f Mon Sep 17 00:00:00 2001 From: Jonathan McCaffrey Date: Sat, 30 Apr 2022 00:50:46 -0400 Subject: [PATCH] test(SearchTest) Added a test for opening and closing search dialog --- Components/Inputs/SearchButtonComponent.razor | 8 +- .../Inputs/SearchIconButtonComponent.razor | 37 +++++++ .../Navigation/DesktopNavComponent.razor | 21 ++-- .../Navigation/MobileNavComponent.razor | 8 +- .../Navigation/TabletNavComponent.razor | 17 ++- IGP/Database.db | Bin 278528 -> 278528 bytes IGP/Dialog/SearchDialogComponent.razor | 8 +- IGP/wwwroot/generated/AgileTaskModels.json | 2 +- TestAutomation/BaseTest.cs | 51 +++++++++ TestAutomation/Enums/WindowType.cs | 8 ++ TestAutomation/Pages/BasePage.cs | 11 -- TestAutomation/Pages/DatabaseSinglePage.cs | 11 ++ TestAutomation/Pages/HarassCalculatorPage.cs | 73 ++++++++----- TestAutomation/Shared/BaseElement.cs | 13 +++ TestAutomation/Shared/NavigationBar.cs | 25 +++++ TestAutomation/Shared/WebsiteSearchDialog.cs | 35 ++++++ TestAutomation/TestAutomation.csproj | 2 +- .../{UnitTests.cs => TestHarassCalculator.cs} | 90 ++++------------ TestAutomation/TestSearchFeatures.cs | 35 ++++++ TestAutomation/Tests.cs | 35 ++++++ TestAutomation/Utils/Test.cs | 3 +- TestAutomation/Utils/TestMessage.cs | 6 +- TestAutomation/Utils/TestReport.cs | 29 +++-- TestAutomation/Utils/Website.cs | 102 ++++++++++++++++-- 24 files changed, 476 insertions(+), 154 deletions(-) create mode 100644 Components/Inputs/SearchIconButtonComponent.razor create mode 100644 TestAutomation/BaseTest.cs create mode 100644 TestAutomation/Enums/WindowType.cs delete mode 100644 TestAutomation/Pages/BasePage.cs create mode 100644 TestAutomation/Pages/DatabaseSinglePage.cs create mode 100644 TestAutomation/Shared/BaseElement.cs create mode 100644 TestAutomation/Shared/NavigationBar.cs create mode 100644 TestAutomation/Shared/WebsiteSearchDialog.cs rename TestAutomation/{UnitTests.cs => TestHarassCalculator.cs} (61%) create mode 100644 TestAutomation/TestSearchFeatures.cs create mode 100644 TestAutomation/Tests.cs diff --git a/Components/Inputs/SearchButtonComponent.razor b/Components/Inputs/SearchButtonComponent.razor index aaa1d9a..f06a8b1 100644 --- a/Components/Inputs/SearchButtonComponent.razor +++ b/Components/Inputs/SearchButtonComponent.razor @@ -2,7 +2,7 @@ @inject NavigationManager NavigationManager @inject IJSRuntime JsRuntime - + + + +@code { + [Parameter] + public RenderFragment ChildContent { get; set; } = default!; + + [Parameter] + public string Id { get; set; } = default!; + + private void ButtonClicked(EventArgs eventArgs) + { + SearchService.Show(); + } +} \ No newline at end of file diff --git a/Components/Navigation/DesktopNavComponent.razor b/Components/Navigation/DesktopNavComponent.razor index 3585812..9038b4b 100644 --- a/Components/Navigation/DesktopNavComponent.razor +++ b/Components/Navigation/DesktopNavComponent.razor @@ -1,9 +1,9 @@ @inherits LayoutComponentBase -@inject INavigationService navigationService +@inject INavigationService NavigationService @implements IDisposable @{ - var visibleStyle = navigationService.GetNavigationSectionId() > 0 ? "clickOffVisible" : ""; + var visibleStyle = NavigationService.GetNavigationSectionId() > 0 ? "clickOffVisible" : ""; }
@@ -12,14 +12,14 @@