mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Attempt to fix AlertSummaryWidget flaky test (#212107)
Fixes #198102 ## Summary The check that fails is related to status:All [here](https://github.com/elastic/kibana/blob/main/x-pack/test/observability_functional/apps/observability/pages/rule_details_page.ts#L191): ``` expect(url.includes('status%3Aall')).to.be(true); ``` It seems the status is active from the previous step: <img src="https://github.com/user-attachments/assets/8fa33035-d54a-4bfd-9e06-fff696767598" width=500 /> This PR adds a retry to accommodate a delay in changing URLs. Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
This commit is contained in:
parent
1ee97c3c8f
commit
3b1c352df9
1 changed files with 18 additions and 14 deletions
|
@ -168,14 +168,16 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
await observability.components.alertSummaryWidget.getActiveAlertSelector();
|
||||
await activeAlerts.click();
|
||||
|
||||
const url = await browser.getCurrentUrl();
|
||||
const from = 'rangeFrom:now-30d';
|
||||
const to = 'rangeTo:now';
|
||||
await retry.try(async () => {
|
||||
const url = await browser.getCurrentUrl();
|
||||
const from = 'rangeFrom:now-30d';
|
||||
const to = 'rangeTo:now';
|
||||
|
||||
expect(url.includes('tabId=alerts')).to.be(true);
|
||||
expect(url.includes('status%3Aactive')).to.be(true);
|
||||
expect(url.includes(from.replaceAll(':', '%3A'))).to.be(true);
|
||||
expect(url.includes(to.replaceAll(':', '%3A'))).to.be(true);
|
||||
expect(url.includes('tabId=alerts')).to.be(true);
|
||||
expect(url.includes('status%3Aactive')).to.be(true);
|
||||
expect(url.includes(from.replaceAll(':', '%3A'))).to.be(true);
|
||||
expect(url.includes(to.replaceAll(':', '%3A'))).to.be(true);
|
||||
});
|
||||
});
|
||||
|
||||
it('handles clicking on total alerts correctly', async () => {
|
||||
|
@ -183,14 +185,16 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
await observability.components.alertSummaryWidget.getTotalAlertSelector();
|
||||
await totalAlerts.click();
|
||||
|
||||
const url = await browser.getCurrentUrl();
|
||||
const from = 'rangeFrom:now-30d';
|
||||
const to = 'rangeTo:now';
|
||||
await retry.try(async () => {
|
||||
const url = await browser.getCurrentUrl();
|
||||
const from = 'rangeFrom:now-30d';
|
||||
const to = 'rangeTo:now';
|
||||
|
||||
expect(url.includes('tabId=alerts')).to.be(true);
|
||||
expect(url.includes('status%3Aall')).to.be(true);
|
||||
expect(url.includes(from.replaceAll(':', '%3A'))).to.be(true);
|
||||
expect(url.includes(to.replaceAll(':', '%3A'))).to.be(true);
|
||||
expect(url.includes('tabId=alerts')).to.be(true);
|
||||
expect(url.includes('status%3Aall')).to.be(true);
|
||||
expect(url.includes(from.replaceAll(':', '%3A'))).to.be(true);
|
||||
expect(url.includes(to.replaceAll(':', '%3A'))).to.be(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue