[Response Ops] Fix Flaky Stack Alerts Page E2E Test (#192045)

## Summary
Resolves: https://github.com/elastic/kibana/issues/184882

### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Jiawei Wu 2024-09-06 14:18:31 -07:00 committed by GitHub
parent d968cc0929
commit bc13d8f956
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -98,8 +98,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
});
});
// FLAKY: https://github.com/elastic/kibana/issues/184882
describe.skip('Loads the page', () => {
describe('Loads the page', () => {
beforeEach(async () => {
await security.testUser.restoreDefaults();
await pageObjects.common.navigateToUrl(
@ -141,10 +140,11 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
firstSolutionFilter = quickFilters
.filter((_: number, f: any) => f.attribs['data-test-subj'].endsWith('rule types'))
.first();
expect(firstSolutionFilter).to.not.be(null);
expect(typeof firstSolutionFilter?.attr('data-test-subj')).to.be('string');
});
await testSubjects.click(firstSolutionFilter!.attr('data-test-subj'));
await testSubjects.click(firstSolutionFilter.attr('data-test-subj'));
await retry.try(async () => {
const appliedFilters = await pageObjects.triggersActionsUI.getAlertsPageAppliedFilters();
@ -165,9 +165,11 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
f.attribs['data-test-subj'].includes('Security rule types')
)
.first();
expect(filter).to.not.be(null);
expect(typeof filter?.attr('data-test-subj')).to.be('string');
});
await testSubjects.click(filter!.attr('data-test-subj'));
await testSubjects.click(filter.attr('data-test-subj'));
await retry.try(async () => {
quickFilters = await pageObjects.triggersActionsUI.getAlertsPageQuickFilters();
@ -196,10 +198,11 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
return testSubj.includes('rule types') && !testSubj.includes('Security');
})
.first();
expect(filter).to.not.be(null);
expect(typeof filter?.attr('data-test-subj')).to.be('string');
});
await testSubjects.click(filter!.attr('data-test-subj'));
await testSubjects.click(filter.attr('data-test-subj'));
await retry.try(async () => {
quickFilters = await pageObjects.triggersActionsUI.getAlertsPageQuickFilters();