Skip to content

Commit

Permalink
add serverless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonelizabeth committed Jun 27, 2023
1 parent c022176 commit 30221f3
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
3 changes: 3 additions & 0 deletions x-pack/test_serverless/functional/config.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export function createTestConfig(options: CreateTestConfigOptions) {
observability: {
pathname: '/app/observability',
},
management: {
pathname: '/app/management',
},
},
// choose where screenshots should be saved
screenshots: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('serverless search UI', function () {
loadTestFile(require.resolve('./landing_page'));
loadTestFile(require.resolve('./management'));
});
}
66 changes: 66 additions & 0 deletions x-pack/test_serverless/functional/test_suites/search/management.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* 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 default function ({ getPageObject, getService }: FtrProviderContext) {
const commonPage = getPageObject('common');
const testSubjects = getService('testSubjects');

describe('Management', function () {
describe('Disabled UIs', () => {
const DISABLED_PLUGINS = [
{
appName: 'Upgrade Assistant',
url: '/stack/upgrade_assistant',
},
{
appName: 'Advanced Settings',
url: '/kibana/settings',
},
{
appName: 'Migrate',
url: '/data/migrate_data',
},
{
appName: 'Remote Clusters',
url: '/data/remote_clusters',
},
{
appName: 'Cross-Cluster Replication',
url: '/data/cross_cluster_replication',
},
{
appName: 'Snapshot and Restore',
url: '/data/snapshot_restore',
},
{
appName: 'Index Lifecycle Management',
url: '/data/index_lifecycle_management',
},
{
appName: 'Rollup Jobs',
url: '/data/rollup_jobs',
},
{
appName: 'License Management',
url: '/stack/license_management',
},
];

DISABLED_PLUGINS.forEach(({ appName, url }) => {
it(`${appName} is not accessible`, async () => {
await commonPage.navigateToUrl('management', url, {
shouldUseHashForSubUrl: false,
});
// If the route doesn't exist, the user will be redirected back to the Management landing page
await testSubjects.exists('managementHome');
});
});
});
});
}

0 comments on commit 30221f3

Please sign in to comment.