This repository has been archived by the owner on Mar 31, 2024. It is now read-only.
forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 3
/
home_page.ts
96 lines (76 loc) · 3.51 KB
/
home_page.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
* 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 expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';
export default ({ getPageObjects, getService }: FtrProviderContext) => {
const testSubjects = getService('testSubjects');
const pageObjects = getPageObjects(['common', 'indexManagement', 'header']);
const log = getService('log');
const browser = getService('browser');
const retry = getService('retry');
const security = getService('security');
describe('Home page', function () {
before(async () => {
await security.testUser.setRoles(['index_management_user']);
await pageObjects.common.navigateToApp('indexManagement');
});
it('Loads the app and renders the indices tab by default', async () => {
await log.debug('Checking for section heading to say Index Management.');
const headingText = await pageObjects.indexManagement.sectionHeadingText();
expect(headingText).to.be('Index Management');
// Verify url
const url = await browser.getCurrentUrl();
expect(url).to.contain(`/indices`);
// Verify content
const indicesList = await testSubjects.exists('indicesList');
expect(indicesList).to.be(true);
const reloadIndicesButton = await pageObjects.indexManagement.reloadIndicesButton();
expect(await reloadIndicesButton.isDisplayed()).to.be(true);
});
describe('Data streams', () => {
it('renders the data streams tab', async () => {
// Navigate to the data streams tab
await pageObjects.indexManagement.changeTabs('data_streamsTab');
await pageObjects.header.waitUntilLoadingHasFinished();
// Verify url
const url = await browser.getCurrentUrl();
expect(url).to.contain(`/data_streams`);
// Verify content
await retry.waitFor('Wait until dataStream Table is visible.', async () => {
return await testSubjects.isDisplayed('dataStreamTable');
});
});
});
describe('Index templates', () => {
it('renders the index templates tab', async () => {
// Navigate to the index templates tab
await pageObjects.indexManagement.changeTabs('templatesTab');
await pageObjects.header.waitUntilLoadingHasFinished();
// Verify url
const url = await browser.getCurrentUrl();
expect(url).to.contain(`/templates`);
// Verify content
const templateList = await testSubjects.exists('templateList');
expect(templateList).to.be(true);
});
});
describe('Component templates', () => {
it('renders the component templates tab', async () => {
// Navigate to the component templates tab
await pageObjects.indexManagement.changeTabs('component_templatesTab');
await pageObjects.header.waitUntilLoadingHasFinished();
// Verify url
const url = await browser.getCurrentUrl();
expect(url).to.contain(`/component_templates`);
// Verify content. Component templates may have been created by other apps, e.g. Ingest Manager,
// so we don't make any assertion about the presence or absence of component templates.
const componentTemplateList = await testSubjects.exists('componentTemplateList');
expect(componentTemplateList).to.be(true);
});
});
});
};