Skip to content

Commit 8fa72bd

Browse files
committed
[scout/apm] improve page loaded condition check
1 parent ebe23db commit 8fa72bd

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@ export class AgentConfigurationsPage {
2020

2121
async goto() {
2222
await this.page.goto(`${this.kbnUrl.app('apm')}/settings/agent-configuration`);
23-
await this.page.waitForLoadingIndicatorHidden();
23+
await this.page.testSubj.waitForSelector('apmMainContainer');
2424

2525
// Wait for the page content to load
26-
this.page.getByRole('heading', { name: 'Settings', level: 1 });
27-
28-
return this.page;
26+
await this.page.getByRole('heading', { name: 'Settings', level: 1 }).waitFor();
2927
}
3028

3129
async getCreateConfigurationButton() {
3230
// Wait for the page to be fully loaded
33-
this.page.getByRole('heading', { name: 'Configurations', exact: true });
31+
await this.page.getByRole('heading', { name: 'Configurations', exact: true }).waitFor();
3432

3533
return this.page.getByText('Create configuration');
3634
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export class AgentExplorerPage {
1616
'apm'
1717
)}/settings/agent-explorer?kuery=&agentLanguage=&serviceName=&comparisonEnabled=true&environment=ENVIRONMENT_ALL`
1818
);
19-
await this.page.waitForLoadingIndicatorHidden();
20-
this.page.getByRole('heading', { name: 'Settings', level: 1 });
19+
await this.page.testSubj.waitForSelector('apmMainContainer');
2120

22-
return this.page;
21+
// Wait for the page content to load
22+
await this.page.getByRole('heading', { name: 'Settings', level: 1 }).waitFor();
2323
}
2424
}

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ export class AnomalyDetectionPage {
1414

1515
async goto() {
1616
await this.page.goto(`${this.kbnUrl.app('apm')}/settings/anomaly-detection`);
17-
await this.page.waitForLoadingIndicatorHidden();
17+
await this.page.testSubj.waitForSelector('apmMainContainer');
1818

1919
// Wait for the page content to load
20-
this.page.getByRole('heading', { name: 'Settings', level: 1 });
21-
22-
return this.page;
20+
await this.page.getByRole('heading', { name: 'Settings', level: 1 }).waitFor();
2321
}
2422

2523
async getCreateJobButton() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ export class ServiceInventoryPage {
1212

1313
async gotoDetailedServiceInventoryWithDateSelected(start: string, end: string) {
1414
await this.page.goto(`${this.kbnUrl.app('apm')}/services?&rangeFrom=${start}&rangeTo=${end}`);
15-
return this.page.waitForLoadingIndicatorHidden();
15+
await this.page.testSubj.waitForSelector('apmUnifiedSearchBar');
1616
}
1717
}

0 commit comments

Comments
 (0)