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
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,16 @@ export function ObservabilityAlertsCommonProvider({
await testSubjects.click(buttonSubject);
};

const alertDataIsBeingLoaded = async () => {
return testSubjects.existOrFail('events-container-loading-true');
const selectAlertStatusFilter = async (alertStatus: AlertStatus) => {
await testSubjects.click('optionsList-control-0');
await testSubjects.click(`optionsList-control-selection-${alertStatus}`);
await testSubjects.click('optionsList-control-0');
};

const alertDataHasLoaded = async () => {
await retry.waitFor(
'Alert Table is loaded',
async () => await testSubjects.exists('events-container-loading-false', { timeout: 2500 })
async () => await testSubjects.exists('alertsTableIsLoaded', { timeout: 2500 })
);
};

Expand Down Expand Up @@ -439,7 +441,6 @@ export function ObservabilityAlertsCommonProvider({
setWorkflowStatusFilter,
getWorkflowStatusFilterValue,
setAlertStatusFilter,
alertDataIsBeingLoaded,
alertDataHasLoaded,
submitQuery,
typeInQueryBar,
Expand All @@ -457,5 +458,6 @@ export function ObservabilityAlertsCommonProvider({
navigateToAlertDetails,
createDataView,
deleteDataView,
selectAlertStatusFilter,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ export default ({ getService }: FtrProviderContext) => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/120440
describe.skip('Pagination controls', () => {
describe('Pagination controls', () => {
before(async () => {
await (await observability.alerts.pagination.getPageSizeSelector()).click();
await (await observability.alerts.pagination.getTenRowsPageSelector()).click();
await observability.alerts.common.selectAlertStatusFilter('recovered');
await retry.try(async () => {
await (await observability.alerts.pagination.getPageSizeSelector()).click();
await (await observability.alerts.pagination.getTenRowsPageSelector()).click();
});
await observability.alerts.pagination.goToFirstPage();
});

Expand All @@ -113,23 +115,20 @@ export default ({ getService }: FtrProviderContext) => {

it('Goes to nth page', async () => {
await observability.alerts.pagination.goToNthPage(3);
await observability.alerts.common.alertDataIsBeingLoaded();
await observability.alerts.common.alertDataHasLoaded();
const tableRows = await observability.alerts.common.getTableCellsInRows();
expect(tableRows.length).to.be(10);
});

it('Goes to next page', async () => {
await observability.alerts.pagination.goToNextPage();
await observability.alerts.common.alertDataIsBeingLoaded();
await observability.alerts.common.alertDataHasLoaded();
const tableRows = await observability.alerts.common.getTableCellsInRows();
expect(tableRows.length).to.be(10);
});

it('Goes to previous page', async () => {
await observability.alerts.pagination.goToPrevPage();
await observability.alerts.common.alertDataIsBeingLoaded();
await observability.alerts.common.alertDataHasLoaded();
const tableRows = await observability.alerts.common.getTableCellsInRows();
expect(tableRows.length).to.be(10);
Expand Down