|
| 1 | +/* |
| 2 | + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one |
| 3 | + * or more contributor license agreements. Licensed under the Elastic License; |
| 4 | + * you may not use this file except in compliance with the Elastic License. |
| 5 | + */ |
| 6 | + |
| 7 | +export default function ({ getService, getPageObjects }) { |
| 8 | + const kibanaServer = getService('kibanaServer'); |
| 9 | + const es = getService('legacyEs'); |
| 10 | + const PageObjects = getPageObjects(['settings', 'common']); |
| 11 | + |
| 12 | + describe('"Create Index Pattern" wizard', function () { |
| 13 | + before(async function () { |
| 14 | + // delete .kibana index and then wait for Kibana to re-create it |
| 15 | + await kibanaServer.uiSettings.replace({}); |
| 16 | + await PageObjects.settings.navigateTo(); |
| 17 | + await PageObjects.settings.clickKibanaIndexPatterns(); |
| 18 | + }); |
| 19 | + |
| 20 | + describe('data streams', () => { |
| 21 | + it('can be an index pattern', async () => { |
| 22 | + await es.transport.request({ |
| 23 | + path: '/_index_template/generic-logs', |
| 24 | + method: 'PUT', |
| 25 | + body: { |
| 26 | + index_patterns: ['logs-*', 'test_data_stream'], |
| 27 | + template: { |
| 28 | + mappings: { |
| 29 | + properties: { |
| 30 | + '@timestamp': { |
| 31 | + type: 'date', |
| 32 | + }, |
| 33 | + }, |
| 34 | + }, |
| 35 | + }, |
| 36 | + data_stream: {}, |
| 37 | + }, |
| 38 | + }); |
| 39 | + |
| 40 | + await es.transport.request({ |
| 41 | + path: '/_data_stream/test_data_stream', |
| 42 | + method: 'PUT', |
| 43 | + }); |
| 44 | + |
| 45 | + await PageObjects.settings.createIndexPattern('test_data_stream', false); |
| 46 | + |
| 47 | + await es.transport.request({ |
| 48 | + path: '/_data_stream/test_data_stream', |
| 49 | + method: 'DELETE', |
| 50 | + }); |
| 51 | + }); |
| 52 | + }); |
| 53 | + }); |
| 54 | +} |
0 commit comments