Skip to content

Commit

Permalink
[test] Migrates kibana_sample_data_flights_index_pattern esArchive to…
Browse files Browse the repository at this point in the history
… kbnArchiver

Signed-off-by: Tyler Smalley <[email protected]>
  • Loading branch information
Tyler Smalley committed Jun 22, 2021
1 parent 42fc797 commit efea975
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 474 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const find = getService('find');
const security = getService('security');
const PageObjects = getPageObjects(['visualize']);
Expand All @@ -22,13 +22,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
before(async () => {
await PageObjects.visualize.initTests();
await security.testUser.setRoles(['kibana_admin', 'kibana_sample_admin']);
await esArchiver.load(
'test/functional/fixtures/es_archiver/kibana_sample_data_flights_index_pattern'
await kibanaServer.importExport.load(
'test/functional/fixtures/kbn_archiver/sample_data_flights_index_pattern.json'
);
await visualize.navigateToNewVisualization();
await visualize.clickInputControlVis();
});

after(async () => {
await kibanaServer.importExport.unload(
'test/functional/fixtures/kbn_archiver/sample_data_flights_index_pattern.json'
);
await security.testUser.restoreDefaults();
});

it('should add filter with scripted field', async () => {
await visEditor.addInputControl('range');
await visEditor.setFilterParams(0, 'kibana_sample_data_flights', 'hour_of_day');
Expand All @@ -50,12 +57,5 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(controlFilters).to.have.length(2);
expect(await controlFilters[1].getVisibleText()).to.equal('AvgTicketPrice: $400 to $999');
});

after(async () => {
await esArchiver.unload(
'test/functional/fixtures/es_archiver/kibana_sample_data_flights_index_pattern'
);
await security.testUser.restoreDefaults();
});
});
}
Binary file not shown.
Loading

0 comments on commit efea975

Please sign in to comment.