-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing Failing test: Chrome X-Pack UI Functional Tests.x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alert_create_flyout·ts - Actions and Triggers app create alert should successfully test valid es_query alert #114917
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
dbaffca
Unskipping test
ymao1 943deb3
Commenting out fix and fixing another test
ymao1 244ae2b
Fixing functional test
ymao1 6f70ceb
Fixing functional test agaaaiiinn
ymao1 4eeab2f
Merge branch 'master' of https://github.com/elastic/kibana into flaky…
ymao1 31db7ea
Fixing the actual flake
ymao1 f0fb1eb
Splitting into two tests
ymao1 7629222
Maybe this time
ymao1 1912c64
Merge branch 'master' of https://github.com/elastic/kibana into flaky…
ymao1 e19c7fd
Merge branch 'main' of https://github.com/elastic/kibana into flaky-t…
ymao1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
|
||
import expect from '@kbn/expect'; | ||
import { asyncForEach } from '@kbn/std'; | ||
import { omit } from 'lodash'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
import { generateUniqueKey } from '../../lib/get_test_data'; | ||
|
||
|
@@ -103,8 +104,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { | |
await testSubjects.click('test.always-firing-SelectOption'); | ||
} | ||
|
||
// FLAKY https://github.com/elastic/kibana/issues/112749 | ||
describe.skip('create alert', function () { | ||
describe('create alert', function () { | ||
before(async () => { | ||
await pageObjects.common.navigateToApp('triggersActions'); | ||
await testSubjects.click('rulesTab'); | ||
|
@@ -154,14 +154,13 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { | |
expect(toastTitle).to.eql(`Created rule "${alertName}"`); | ||
await pageObjects.triggersActionsUI.searchAlerts(alertName); | ||
const searchResultsAfterSave = await pageObjects.triggersActionsUI.getAlertsList(); | ||
expect(searchResultsAfterSave).to.eql([ | ||
{ | ||
name: alertName, | ||
tagsText: '', | ||
alertType: 'Index threshold', | ||
interval: '1m', | ||
}, | ||
]); | ||
const searchResultAfterSave = searchResultsAfterSave[0]; | ||
expect(omit(searchResultAfterSave, 'duration')).to.eql({ | ||
name: `${alertName}Index threshold`, | ||
tags: '', | ||
interval: '1 min', | ||
}); | ||
expect(searchResultAfterSave.duration).to.match(/\d{2}:\d{2}:\d{2}.\d{3}/); | ||
|
||
// clean up created alert | ||
const alertsToDelete = await getAlertsByName(alertName); | ||
|
@@ -205,14 +204,12 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { | |
expect(toastTitle).to.eql(`Created rule "${alertName}"`); | ||
await pageObjects.triggersActionsUI.searchAlerts(alertName); | ||
const searchResultsAfterSave = await pageObjects.triggersActionsUI.getAlertsList(); | ||
expect(searchResultsAfterSave).to.eql([ | ||
{ | ||
name: alertName, | ||
tagsText: '', | ||
alertType: 'Always Firing', | ||
interval: '1m', | ||
}, | ||
]); | ||
const searchResultAfterSave = searchResultsAfterSave[0]; | ||
expect(omit(searchResultAfterSave, 'duration')).to.eql({ | ||
name: `${alertName}Always Firing`, | ||
tags: '', | ||
interval: '1 min', | ||
}); | ||
|
||
// clean up created alert | ||
const alertsToDelete = await getAlertsByName(alertName); | ||
|
@@ -239,14 +236,12 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { | |
await new Promise((resolve) => setTimeout(resolve, 1000)); | ||
await pageObjects.triggersActionsUI.searchAlerts(alertName); | ||
const searchResultsAfterSave = await pageObjects.triggersActionsUI.getAlertsList(); | ||
expect(searchResultsAfterSave).to.eql([ | ||
{ | ||
name: alertName, | ||
tagsText: '', | ||
alertType: 'Always Firing', | ||
interval: '1m', | ||
}, | ||
]); | ||
const searchResultAfterSave = searchResultsAfterSave[0]; | ||
expect(omit(searchResultAfterSave, 'duration')).to.eql({ | ||
name: `${alertName}Always Firing`, | ||
tags: '', | ||
interval: '1 min', | ||
}); | ||
|
||
// clean up created alert | ||
const alertsToDelete = await getAlertsByName(alertName); | ||
|
@@ -278,6 +273,15 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { | |
await testSubjects.existOrFail('testQuerySuccess'); | ||
await testSubjects.missingOrFail('testQueryError'); | ||
|
||
await testSubjects.click('cancelSaveAlertButton'); | ||
await testSubjects.existOrFail('confirmAlertCloseModal'); | ||
await testSubjects.click('confirmAlertCloseModal > confirmModalConfirmButton'); | ||
}); | ||
|
||
it('should show error when es_query is invalid', async () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the test that I split into 2 tests. |
||
const alertName = generateUniqueKey(); | ||
await defineEsQueryAlert(alertName); | ||
|
||
// Invalid query | ||
await testSubjects.setValue('queryJsonEditor', '{"query":{"foo":{}}}', { | ||
clearWithKeyboard: true, | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests should have been updated with this PR but were missed since this test suite was skipped at the time.