Skip to content

Commit c83fd87

Browse files
test: Fix Service Dashboards Scout wait (strict progressbar locator) (elastic#267796)
## Summary - Replaced `getByRole('progressbar')` in `DashboardsTab.waitForDashboardsToLoad` with a wait for `apmMainTemplateServiceAgentLoader` to be hidden. The generic progressbar role matched multiple concurrent EUI loaders (chrome, environment filter, service title, etc.) and caused Playwright **strict mode** failures. - Extended `waitForTabLoad` on the dashboards tab to wait for the same main template loader after the unified search bar is visible, matching `MetricsTab` / `ServiceDetailsPage.goToPage` and stabilizing navigation before the unlink test. ## Testing - Ran `service_dashboards.spec.ts` locally — passed. Expect serverless observability Scout (`local-serverless-observability_complete`) to validate after CI merges. Cc flaky Scout/serverless monitoring: worth confirming stability once merged. Closes elastic#256350 Made with [Cursor](https://cursor.com) Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent fd52301 commit c83fd87

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • x-pack/solutions/observability/plugins/apm/test/scout/ui/fixtures/page_objects/service_details

x-pack/solutions/observability/plugins/apm/test/scout/ui/fixtures/page_objects/service_details/dashboards_tab.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,15 @@ export class DashboardsTab extends ServiceDetailsTab {
3030
await this.page
3131
.getByTestId('apmUnifiedSearchBar')
3232
.waitFor({ state: 'visible', timeout: EXTENDED_TIMEOUT });
33+
await this.page
34+
.getByTestId('apmMainTemplateServiceAgentLoader')
35+
.waitFor({ state: 'hidden', timeout: EXTENDED_TIMEOUT });
3336
}
3437

3538
public async waitForDashboardsToLoad(): Promise<void> {
36-
await expect(this.page.getByRole('progressbar')).toBeHidden({ timeout: EXTENDED_TIMEOUT });
39+
await this.page
40+
.getByTestId('apmMainTemplateServiceAgentLoader')
41+
.waitFor({ state: 'hidden', timeout: EXTENDED_TIMEOUT });
3742
await this.addServiceDashboardButton.waitFor({ state: 'visible', timeout: EXTENDED_TIMEOUT });
3843
}
3944

0 commit comments

Comments
 (0)