Skip to content

Commit 6377d52

Browse files
committed
wait for table body to be visible
1 parent f8e2d64 commit 6377d52

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

  • x-pack/solutions/security/packages/kbn-scout-security/src/playwright/fixtures/test/page_objects

x-pack/solutions/security/packages/kbn-scout-security/src/playwright/fixtures/test/page_objects/alerts_table.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,25 @@ import { ScoutPage, Locator, expect } from '@kbn/scout';
1010
const PAGE_URL = 'security/alerts';
1111

1212
export class AlertsTablePage {
13+
public detectionsAlertsPage: Locator;
1314
public alertRow: Locator;
14-
public alertsTable: Locator;
15+
public alertsTableBody: Locator;
1516

1617
constructor(private readonly page: ScoutPage) {
18+
this.detectionsAlertsPage = this.page.testSubj.locator('detectionsAlertsPage');
1719
this.alertRow = this.page.locator('div.euiDataGridRow');
18-
this.alertsTable = this.page.testSubj.locator('alertsTable');
20+
this.alertsTableBody = this.page.testSubj
21+
.locator('alertsTable')
22+
.locator(`[data-test-subj='euiDataGridBody']`);
1923
}
2024

2125
async navigate() {
22-
return this.page.gotoApp(PAGE_URL);
26+
await this.page.gotoApp(PAGE_URL);
27+
await this.detectionsAlertsPage.waitFor({ state: 'visible' });
2328
}
2429

2530
async expandAlertDetailsFlyout(ruleName: string) {
26-
await this.page.waitForLoadingIndicatorHidden();
27-
await this.alertsTable.waitFor({ state: 'visible' });
31+
await this.alertsTableBody.waitFor({ state: 'visible' });
2832
// Filter alert by unique rule name
2933
const row = this.alertRow.filter({ hasText: ruleName });
3034
await expect(

0 commit comments

Comments
 (0)