kibana/x-pack/test/functional/page_objects/index_management_page.ts
Brandon Kobel 4584a8b570
Elastic License 2.0 (#90099)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:12:39 -08:00

55 lines
1.9 KiB
TypeScript

/*
* 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';
export function IndexManagementPageProvider({ getService }: FtrProviderContext) {
const find = getService('find');
const testSubjects = getService('testSubjects');
return {
async sectionHeadingText() {
return await testSubjects.getVisibleText('appTitle');
},
async reloadIndices() {
await testSubjects.click('reloadIndicesButton');
},
async reloadIndicesButton() {
return await testSubjects.find('reloadIndicesButton');
},
async toggleRollupIndices() {
await testSubjects.click('checkboxToggles-rollupToggle');
},
async getIndexList() {
const table = await find.byCssSelector('table');
const $ = await table.parseDomContent();
return $.findTestSubjects('indexTableRow')
.toArray()
.map((row) => {
return {
indexName: $(row).findTestSubject('indexTableIndexNameLink').text(),
indexHealth: $(row).findTestSubject('indexTableCell-health').text(),
indexStatus: $(row).findTestSubject('indexTableCell-status').text(),
indexPrimary: $(row).findTestSubject('indexTableCell-primary').text(),
indexReplicas: $(row).findTestSubject('indexTableCell-replica').text(),
indexDocuments: $(row)
.findTestSubject('indexTableCell-documents')
.text()
.replace('documents', ''),
indexSize: $(row).findTestSubject('indexTableCell-size').text(),
};
});
},
async changeTabs(
tab: 'indicesTab' | 'data_streamsTab' | 'templatesTab' | 'component_templatesTab'
) {
await testSubjects.click(tab);
},
};
}