From a50af77d706d8625d715bfb3103257442d9073c7 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 22 May 2024 15:14:45 +0200 Subject: [PATCH] Fix E2E tests on CI (#100) * Fix E2E tests on CI * Filter for service name prior to locating --- .../DistributedFixture/ApmUIBrowserContext.cs | 7 +++++++ .../DistributedFixture/DotNetRunApplication.cs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/Elastic.OpenTelemetry.EndToEndTests/DistributedFixture/ApmUIBrowserContext.cs b/tests/Elastic.OpenTelemetry.EndToEndTests/DistributedFixture/ApmUIBrowserContext.cs index a66bb01..0158088 100644 --- a/tests/Elastic.OpenTelemetry.EndToEndTests/DistributedFixture/ApmUIBrowserContext.cs +++ b/tests/Elastic.OpenTelemetry.EndToEndTests/DistributedFixture/ApmUIBrowserContext.cs @@ -94,6 +94,13 @@ public async Task WaitForServiceOnOverview(IPage page) var servicesHeader = page.GetByRole(AriaRole.Heading, new() { Name = "Services" }); await servicesHeader.WaitForAsync(new() { State = WaitForSelectorState.Visible, Timeout = timeout }); + //service.name : dotnet-e2e-* + var queryBar = page.GetByRole(AriaRole.Textbox, new() { Name = "Start typing to search and filter the APM page" }); + await queryBar.WaitForAsync(new() { State = WaitForSelectorState.Visible, Timeout = timeout }); + + await queryBar.FillAsync(_serviceName); + await queryBar.PressAsync("Enter"); + Exception? observed = null; var refreshTimeout = (float)TimeSpan.FromSeconds(5).TotalMilliseconds; diff --git a/tests/Elastic.OpenTelemetry.EndToEndTests/DistributedFixture/DotNetRunApplication.cs b/tests/Elastic.OpenTelemetry.EndToEndTests/DistributedFixture/DotNetRunApplication.cs index 5f77b92..59a6f28 100644 --- a/tests/Elastic.OpenTelemetry.EndToEndTests/DistributedFixture/DotNetRunApplication.cs +++ b/tests/Elastic.OpenTelemetry.EndToEndTests/DistributedFixture/DotNetRunApplication.cs @@ -83,7 +83,7 @@ private LongRunningArguments CreateStartArgs() if (processIdMatch.Success) ProcessId = int.Parse(processIdMatch.Groups["processid"].Value); - return l.Line.StartsWith(" Application started."); + return l.Line.Contains("Application started."); } }; }