Skip to content

Commit

Permalink
[Infra UI] Unskip alerts flyout test (#163919)
Browse files Browse the repository at this point in the history
closes [#157712](#157712)
closes [#157767](#157767)
closes [#157711](#157711)

## Summary

Unskips "alerts flyouts" test. What cause the test to fail was possibly
solved by #162896


### How to test

```
yarn test:ftr:server --config x-pack/test/functional/apps/infra/config.ts     
```
```
node scripts/functional_test_runner --config=x-pack/test/functional/apps/infra/config.ts --include x-pack/test/functional/apps/infra/home_page.ts  
```

https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2888

---------

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
crespocarlos and kibanamachine authored Aug 16, 2023
1 parent 2f07bf1 commit d1240d3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
5 changes: 2 additions & 3 deletions x-pack/test/functional/apps/infra/home_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/157711
describe.skip('alerts flyouts', () => {
describe('alerts flyouts', () => {
before(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/infra/metrics_and_logs');
await pageObjects.common.navigateToApp('infraOps');
Expand All @@ -217,7 +216,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
await pageObjects.infraHome.closeAlertFlyout();
});

it('should open and close inventory alert flyout', async () => {
it('should open and close metrics threshold alert flyout', async () => {
await pageObjects.infraHome.openMetricsThresholdAlertFlyout();
await pageObjects.infraHome.closeAlertFlyout();
});
Expand Down
28 changes: 24 additions & 4 deletions x-pack/test/functional/page_objects/infra_home_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,20 +335,40 @@ export function InfraHomePageProvider({ getService, getPageObjects }: FtrProvide
await testSubjects.missingOrFail('metrics-alert-menu');
},

async dismissDatePickerTooltip() {
const isTooltipOpen = await testSubjects.exists(`waffleDatePickerIntervalTooltip`, {
timeout: 1000,
});

if (isTooltipOpen) {
await testSubjects.click(`waffleDatePickerIntervalTooltip`);
}
},

async openInventoryAlertFlyout() {
await this.dismissDatePickerTooltip();
await testSubjects.click('infrastructure-alerts-and-rules');
await testSubjects.click('inventory-alerts-menu-option');
await testSubjects.click('inventory-alerts-create-rule');

// forces date picker tooltip to close in case it pops up after Alerts and rules opens
await testSubjects.moveMouseTo('contextMenuPanelTitleButton');

await retry.tryForTime(1000, () => testSubjects.click('inventory-alerts-create-rule'));
await testSubjects.missingOrFail('inventory-alerts-create-rule', { timeout: 30000 });
await testSubjects.find('euiFlyoutCloseButton');
},

async openMetricsThresholdAlertFlyout() {
await this.dismissDatePickerTooltip();
await testSubjects.click('infrastructure-alerts-and-rules');
await testSubjects.click('metrics-threshold-alerts-menu-option');
await testSubjects.click('metrics-threshold-alerts-create-rule');

// forces date picker tooltip to close in case it pops up after Alerts and rules opens
await testSubjects.moveMouseTo('contextMenuPanelTitleButton');

await retry.tryForTime(1000, () =>
testSubjects.click('metrics-threshold-alerts-create-rule')
);
await testSubjects.missingOrFail('metrics-threshold-alerts-create-rule', { timeout: 30000 });
await testSubjects.find('euiFlyoutCloseButton');
},

async closeAlertFlyout() {
Expand Down

0 comments on commit d1240d3

Please sign in to comment.