-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Discover] Unskip doc link functional test #66884
Changes from all commits
9896d89
0a673db
838c2ca
989b586
c3f69f3
11b093e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,38 +19,33 @@ | |
|
||
import expect from '@kbn/expect'; | ||
|
||
const TEST_COLUMN_NAMES = ['@message']; | ||
const TEST_FILTER_COLUMN_NAMES = [ | ||
['extension', 'jpg'], | ||
['geo.src', 'IN'], | ||
]; | ||
|
||
export default function({ getService, getPageObjects }) { | ||
const docTable = getService('docTable'); | ||
const testSubjects = getService('testSubjects'); | ||
const PageObjects = getPageObjects(['common', 'discover', 'timePicker']); | ||
const esArchiver = getService('esArchiver'); | ||
const retry = getService('retry'); | ||
|
||
// FLAKY: https://github.com/elastic/kibana/issues/62281 | ||
describe.skip('doc link in discover', function contextSize() { | ||
describe('doc link in discover', function contextSize() { | ||
before(async function() { | ||
await esArchiver.loadIfNeeded('logstash_functional'); | ||
await PageObjects.common.navigateToApp('discover'); | ||
await PageObjects.timePicker.setDefaultAbsoluteRange(); | ||
await PageObjects.discover.waitForDocTableLoadingComplete(); | ||
for (const columnName of TEST_COLUMN_NAMES) { | ||
await PageObjects.discover.clickFieldListItemAdd(columnName); | ||
} | ||
for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) { | ||
await PageObjects.discover.clickFieldListItem(columnName); | ||
await PageObjects.discover.clickFieldListPlusFilter(columnName, value); | ||
} | ||
}); | ||
|
||
it('should open the doc view of the selected document', async function() { | ||
// navigate to the doc view | ||
await docTable.clickRowToggle({ rowIndex: 0 }); | ||
await (await docTable.getRowActions({ rowIndex: 0 }))[1].click(); | ||
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. Here is the point where some failures happened. Maybe the navigation wasn't rendered / to late?
but the screens I've got were not usefull, since they were scrolled down. In a future failure there should be a useful screen, also I thought that maybe a bit of sleep could prevent a possible race condition between opening the document detail and clicking the row action button. 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.
Sounds like what you want is a 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. Actually, even better: // click the open action
await retry.try(async () => {
const rowActions = await docTable.getRowActions({ rowIndex: 0 });
if (!rowActions.length) {
throw new Error('row actions empty, trying again')
}
await rowActions[1].click()
}) 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. agreed and adapted the code for this case, recent flaky run also just finished successfully (https://kibana-ci.elastic.co/job/kibana+flaky-test-suite-runner/465). |
||
|
||
// click the open action | ||
await retry.try(async () => { | ||
const rowActions = await docTable.getRowActions({ rowIndex: 0 }); | ||
if (!rowActions.length) { | ||
throw new Error('row actions empty, trying again'); | ||
} | ||
await rowActions[1].click(); | ||
}); | ||
|
||
const hasDocHit = await testSubjects.exists('doc-hit'); | ||
expect(hasDocHit).to.be(true); | ||
|
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.
It's no necessary for the test to add columns and filters