mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* Added app load test for API Keys app * Fixed linting issues. * Fixed typecheck issue, edited config to enable API Keys app, and fixed typo in method name. * Config fix. * Fixed assertion for API Keys header. * Added changes per nits on PR. * Removed API Keys server config from the siem_cypress config since it's defined at the top level. Left a comment saying so. Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
77e9b2e155
commit
dd64488d0d
7 changed files with 74 additions and 4 deletions
|
@ -18,7 +18,7 @@ export const EmptyPrompt: React.FunctionComponent<Props> = ({ isAdmin, docLinks
|
|||
<EuiEmptyPrompt
|
||||
iconType="managementApp"
|
||||
title={
|
||||
<h1>
|
||||
<h1 data-test-subj="noApiKeysHeader">
|
||||
{isAdmin ? (
|
||||
<FormattedMessage
|
||||
id="xpack.security.management.apiKeys.table.emptyPromptAdminTitle"
|
||||
|
@ -53,7 +53,7 @@ export const EmptyPrompt: React.FunctionComponent<Props> = ({ isAdmin, docLinks
|
|||
</Fragment>
|
||||
}
|
||||
actions={
|
||||
<EuiButton type="primary" href="#/dev_tools">
|
||||
<EuiButton type="primary" href="#/dev_tools" data-test-subj="goToConsoleButton">
|
||||
<FormattedMessage
|
||||
id="xpack.security.management.apiKeys.table.emptyPromptConsoleButtonMessage"
|
||||
defaultMessage="Go to Console"
|
||||
|
|
29
x-pack/test/functional/apps/api_keys/home_page.ts
Normal file
29
x-pack/test/functional/apps/api_keys/home_page.ts
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
||||
const pageObjects = getPageObjects(['common', 'apiKeys']);
|
||||
const log = getService('log');
|
||||
|
||||
describe('Home page', function() {
|
||||
this.tags('smoke');
|
||||
before(async () => {
|
||||
await pageObjects.common.navigateToApp('apiKeys');
|
||||
});
|
||||
|
||||
it('Loads the app', async () => {
|
||||
log.debug('Checking for section header');
|
||||
const headerText = await (await pageObjects.apiKeys.noAPIKeysHeading()).getVisibleText();
|
||||
expect(headerText).to.be('No API keys');
|
||||
|
||||
const goToConsoleButton = await pageObjects.apiKeys.getGoToConsoleButton();
|
||||
expect(await goToConsoleButton.isDisplayed()).to.be(true);
|
||||
});
|
||||
});
|
||||
};
|
14
x-pack/test/functional/apps/api_keys/index.ts
Normal file
14
x-pack/test/functional/apps/api_keys/index.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
export default ({ loadTestFile }: FtrProviderContext) => {
|
||||
describe('API Keys app', function() {
|
||||
this.tags(['ciGroup7']);
|
||||
loadTestFile(require.resolve('./home_page'));
|
||||
});
|
||||
};
|
|
@ -49,6 +49,7 @@ export default async function({ readConfigFile }) {
|
|||
resolve(__dirname, './apps/saved_objects_management'),
|
||||
resolve(__dirname, './apps/dev_tools'),
|
||||
resolve(__dirname, './apps/apm'),
|
||||
resolve(__dirname, './apps/api_keys'),
|
||||
resolve(__dirname, './apps/index_patterns'),
|
||||
resolve(__dirname, './apps/index_management'),
|
||||
resolve(__dirname, './apps/index_lifecycle_management'),
|
||||
|
@ -69,7 +70,7 @@ export default async function({ readConfigFile }) {
|
|||
esTestCluster: {
|
||||
license: 'trial',
|
||||
from: 'snapshot',
|
||||
serverArgs: ['path.repo=/tmp/'],
|
||||
serverArgs: ['path.repo=/tmp/', 'xpack.security.authc.api_key.enabled=true'],
|
||||
},
|
||||
|
||||
kbnTestServer: {
|
||||
|
@ -159,6 +160,10 @@ export default async function({ readConfigFile }) {
|
|||
pathname: '/app/kibana',
|
||||
hash: '/management/elasticsearch/rollup_jobs/',
|
||||
},
|
||||
apiKeys: {
|
||||
pathname: '/app/kibana',
|
||||
hash: '/management/security/api_keys/',
|
||||
},
|
||||
licenseManagement: {
|
||||
pathname: '/app/kibana',
|
||||
hash: '/management/elasticsearch/license_management',
|
||||
|
|
20
x-pack/test/functional/page_objects/api_keys_page.ts
Normal file
20
x-pack/test/functional/page_objects/api_keys_page.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { FtrProviderContext } from '../ftr_provider_context';
|
||||
|
||||
export function ApiKeysPageProvider({ getService }: FtrProviderContext) {
|
||||
const testSubjects = getService('testSubjects');
|
||||
|
||||
return {
|
||||
async noAPIKeysHeading() {
|
||||
return await testSubjects.find('noApiKeysHeader');
|
||||
},
|
||||
async getGoToConsoleButton() {
|
||||
return await testSubjects.find('goToConsoleButton');
|
||||
},
|
||||
};
|
||||
}
|
|
@ -34,6 +34,7 @@ import { UpgradeAssistantProvider } from './upgrade_assistant';
|
|||
// @ts-ignore not ts yet
|
||||
import { RollupPageProvider } from './rollup_page';
|
||||
import { UptimePageProvider } from './uptime_page';
|
||||
import { ApiKeysPageProvider } from './api_keys_page';
|
||||
import { LicenseManagementPageProvider } from './license_management_page';
|
||||
import { IndexManagementPageProvider } from './index_management_page';
|
||||
import { IndexLifecycleManagementPageProvider } from './index_lifecycle_management_page';
|
||||
|
@ -69,6 +70,7 @@ export const pageObjects = {
|
|||
upgradeAssistant: UpgradeAssistantProvider,
|
||||
uptime: UptimePageProvider,
|
||||
rollup: RollupPageProvider,
|
||||
apiKeys: ApiKeysPageProvider,
|
||||
licenseManagement: LicenseManagementPageProvider,
|
||||
indexManagement: IndexManagementPageProvider,
|
||||
indexLifecycleManagement: IndexLifecycleManagementPageProvider,
|
||||
|
|
|
@ -34,7 +34,7 @@ export default async function({ readConfigFile }: FtrConfigProviderContext) {
|
|||
serverArgs: [
|
||||
...xpackFunctionalTestsConfig.get('esTestCluster.serverArgs'),
|
||||
// define custom es server here
|
||||
'xpack.security.authc.api_key.enabled=true',
|
||||
// API Keys is enabled at the top level
|
||||
'xpack.security.enabled=true',
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue