Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ const getPipeline = (filename: string, removeSteps = true) => {
/^x-pack\/solutions\/observability\/plugins\/apm/,
/^x-pack\/solutions\/observability\/plugins\/observability_onboarding/,
/^x-pack\/solutions\/security\/packages\/kbn-scout-security/,
/^x-pack\/solutions\/security\/plugins\/security_solution/,
/^x-pack\/solutions\/security\/plugins\/security_solution\/public\/flyout/,
])) ||
GITHUB_PR_LABELS.includes('ci:scout-ui-tests')
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,24 @@ import { ScoutPage, Locator, expect } from '@kbn/scout';
const PAGE_URL = 'security/alerts';

export class AlertsTablePage {
public detectionsAlertsContainer: Locator;
public alertRow: Locator;
public alertsTable: Locator;
public alertsTableBody: Locator;

constructor(private readonly page: ScoutPage) {
this.detectionsAlertsContainer = this.page.testSubj.locator('detectionsAlertsPage');
this.alertRow = this.page.locator('div.euiDataGridRow');
this.alertsTable = this.page.testSubj.locator('alertsTable');
this.alertsTableBody = this.page.testSubj
.locator('alertsTable')
.locator(`[data-test-subj='euiDataGridBody']`);
}

async navigate() {
return this.page.gotoApp(PAGE_URL);
await this.page.gotoApp(PAGE_URL);
}

async expandAlertDetailsFlyout(ruleName: string) {
await this.page.waitForLoadingIndicatorHidden();
await this.alertsTable.waitFor({ state: 'visible' });
await this.alertsTableBody.waitFor({ state: 'visible' });
// Filter alert by unique rule name
const row = this.alertRow.filter({ hasText: ruleName });
await expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CUSTOM_QUERY_RULE } from '@kbn/scout-security/src/playwright/constants/

const RIGHT = 'right';

spaceTest.describe('Expandable flyout state sync', { tag: ['@ess', '@svlSecurity '] }, () => {
spaceTest.describe('Expandable flyout state sync', { tag: ['@ess', '@svlSecurity'] }, () => {
let ruleName: string;
spaceTest.beforeEach(async ({ browserAuth, apiServices, scoutSpace }) => {
ruleName = `${CUSTOM_QUERY_RULE.name}_${scoutSpace.id}_${Date.now()}`;
Expand All @@ -28,6 +28,7 @@ spaceTest.describe('Expandable flyout state sync', { tag: ['@ess', '@svlSecurity
const urlBeforeAlertDetails = page.url();
expect(urlBeforeAlertDetails).not.toContain(RIGHT);

await pageObjects.alertsTablePage.detectionsAlertsContainer.waitFor({ state: 'visible' });
await pageObjects.alertsTablePage.expandAlertDetailsFlyout(ruleName);

const urlAfterAlertDetails = page.url();
Expand All @@ -37,7 +38,7 @@ spaceTest.describe('Expandable flyout state sync', { tag: ['@ess', '@svlSecurity
await expect(headerTitle).toHaveText(ruleName);

await page.reload();
await page.waitForLoadingIndicatorHidden();
await pageObjects.alertsTablePage.detectionsAlertsContainer.waitFor({ state: 'visible' });

const urlAfterReload = page.url();
expect(urlAfterReload).toContain(RIGHT);
Expand Down