Skip to content

Commit

Permalink
Add performance test for many fields
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmitterdorfer committed Apr 13, 2022
1 parent dd9267a commit bc8a8e0
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/functional/fixtures/kbn_archiver/many_fields_data_view.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"attributes": {
"fieldAttrs": "{}",
"fields": "[]",
"runtimeFieldMap": "{}",
"title": "indices-stats*",
"typeMeta": "{}"
},
"coreMigrationVersion": "8.3.0",
"id": "35796250-bb09-11ec-a8e4-a9868e049a39",
"migrationVersion": {
"index-pattern": "8.0.0"
},
"references": [],
"type": "index-pattern",
"updated_at": "2022-04-13T09:07:56.793Z",
"version": "WzQwLDFd"
}
1 change: 1 addition & 0 deletions x-pack/test/performance/tests/playwright/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default function ({ loadTestFile, getService }: FtrProviderContext) {
loadTestFile(require.resolve('./flight_dashboard'));
loadTestFile(require.resolve('./web_logs_dashboard'));
loadTestFile(require.resolve('./promotion_tracking_dashboard'));
loadTestFile(require.resolve('./many_fields_discover'));

after(async () => {
await performance.shutdownBrowser();
Expand Down
58 changes: 58 additions & 0 deletions x-pack/test/performance/tests/playwright/many_fields_discover.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { FtrProviderContext } from '../../ftr_provider_context';
import { StepCtx } from '../../services/performance';

export default function manyFieldsDiscover({ getService }: FtrProviderContext) {
describe('many_fields_discover', () => {
const performance = getService('performance');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');

before(async () => {
await kibanaServer.importExport.load(
'test/functional/fixtures/kbn_archiver/many_fields_data_view'
);
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/many_fields');
});

after(async () => {
await kibanaServer.importExport.unload(
'test/functional/fixtures/kbn_archiver/many_fields_data_view'
);
await esArchiver.unload('test/functional/fixtures/es_archiver/many_fields');
});

it('many_fields_discover', async () => {
await performance.runUserJourney(
'many_fields_discover',
[
{
name: 'Go to Discover Page',
handler: async ({ page, kibanaUrl }: StepCtx) => {
await page.goto(`${kibanaUrl}/app/discover`);
await page.waitForSelector('[data-test-subj="discoverDocTable"]');
},
},
{
name: 'Expand the first document',
handler: async ({ page }) => {
const expandButtons = page.locator(
'[data-test-subj="docTableExpandToggleColumn"]'
);
await expandButtons.first().click();
await page.locator('text="Expanded document"');
}
}
],
{
requireAuth: false,
}
);
});
});
}

0 comments on commit bc8a8e0

Please sign in to comment.