Added snapshot restore smoke test to ensure the app has loaded. (#39812) (#40459)

* Added snapshot restore smoke test to ensure the app has loaded.

* Fixed linting issues.

* Updated test to reflect changes to Snapshot and Restore's name.

* Fixed merge update.
This commit is contained in:
John Dorlus 2019-07-07 20:40:41 +00:00 committed by GitHub
parent ccd01c3a40
commit 3fba213e7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,31 @@
/*
* 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 { KibanaFunctionalTestDefaultProviders } from '../../../types/providers';
// eslint-disable-next-line import/no-default-export
export default ({ getPageObjects, getService }: KibanaFunctionalTestDefaultProviders) => {
const pageObjects = getPageObjects(['common', 'snapshotRestore']);
const log = getService('log');
describe('Home page', function() {
this.tags('smoke');
before(async () => {
await pageObjects.common.navigateToApp('snapshotRestore');
});
it('Loads the app', async () => {
const appTitle = 'Snapshot and Restore';
await log.debug(`Checking for app title to be ${appTitle}`);
const appTitleText = await pageObjects.snapshotRestore.appTitleText();
expect(appTitleText).to.be(appTitle);
const repositoriesButton = await pageObjects.snapshotRestore.registerRepositoryButton();
expect(await repositoriesButton.isDisplayed()).to.be(true);
});
});
};

View file

@ -0,0 +1,15 @@
/*
* 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 { KibanaFunctionalTestDefaultProviders } from '../../../types/providers';
// eslint-disable-next-line import/no-default-export
export default ({ loadTestFile }: KibanaFunctionalTestDefaultProviders) => {
describe('Snapshots app', function() {
this.tags('ciGroup1');
loadTestFile(require.resolve('./home_page'));
});
};

View file

@ -29,6 +29,7 @@ import {
UptimePageProvider,
LicenseManagementPageProvider,
IndexLifecycleManagementPageProvider,
SnapshotRestorePageProvider
} from './page_objects';
import {
@ -114,6 +115,7 @@ export default async function ({ readConfigFile }) {
resolve(__dirname, './apps/index_patterns'),
resolve(__dirname, './apps/license_management'),
resolve(__dirname, './apps/index_lifecycle_management'),
resolve(__dirname, './apps/snapshot_restore')
],
// define the name and providers for services that should be
@ -181,6 +183,7 @@ export default async function ({ readConfigFile }) {
uptime: UptimePageProvider,
rollup: RollupPageProvider,
licenseManagement: LicenseManagementPageProvider,
snapshotRestore: SnapshotRestorePageProvider,
indexLifecycleManagement: IndexLifecycleManagementPageProvider
},
@ -287,6 +290,10 @@ export default async function ({ readConfigFile }) {
pathname: '/app/kibana',
hash: '/management/elasticsearch/index_lifecycle_management',
},
snapshotRestore: {
pathname: '/app/kibana',
hash: '/management/elasticsearch/snapshot_restore',
},
apm: {
pathname: '/app/apm',
},

View file

@ -24,3 +24,4 @@ export { RollupPageProvider } from './rollup_page';
export { UptimePageProvider } from './uptime_page';
export { LicenseManagementPageProvider } from './license_management_page';
export { IndexLifecycleManagementPageProvider } from './index_lifecycle_management_page';
export { SnapshotRestorePageProvider } from './snapshot_restore_page';

View file

@ -0,0 +1,22 @@
/*
* 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 { KibanaFunctionalTestDefaultProviders } from '../../types/providers';
export const SnapshotRestorePageProvider = ({
getService,
}: KibanaFunctionalTestDefaultProviders) => {
const testSubjects = getService('testSubjects');
return {
async appTitleText() {
return await testSubjects.getVisibleText('appTitle');
},
async registerRepositoryButton() {
return await testSubjects.find('registerRepositoryButton');
},
};
};