Skip to content
Merged
31 changes: 31 additions & 0 deletions x-pack/test/functional/apps/snapshot_restore/home_page.ts
Original file line number Diff line number Diff line change
@@ -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();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(similar to previous) #39193 was merged, which changed the default tab to Snapshots instead of Repositories. I think this assertion is still valid, because we show the register repository button on empty snapshot list as well, but might want to double check

Copy link
Copy Markdown
Contributor Author

@cuff-links cuff-links Jul 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This assertion still works. Thanks for the thorough eye.

expect(await repositoriesButton.isDisplayed()).to.be(true);
});
});
};
15 changes: 15 additions & 0 deletions x-pack/test/functional/apps/snapshot_restore/index.ts
Original file line number Diff line number Diff line change
@@ -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'));
});
};
9 changes: 8 additions & 1 deletion x-pack/test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
UptimePageProvider,
LicenseManagementPageProvider,
IndexLifecycleManagementPageProvider,
SnapshotRestorePageProvider
} from './page_objects';

import {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -181,7 +183,8 @@ export default async function ({ readConfigFile }) {
uptime: UptimePageProvider,
rollup: RollupPageProvider,
licenseManagement: LicenseManagementPageProvider,
indexLifecycleManagement: IndexLifecycleManagementPageProvider
indexLifecycleManagement: IndexLifecycleManagementPageProvider,
snapshotRestore: SnapshotRestorePageProvider
},

servers: kibanaFunctionalConfig.get('servers'),
Expand Down Expand Up @@ -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',
},
Expand Down
1 change: 1 addition & 0 deletions x-pack/test/functional/page_objects/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
22 changes: 22 additions & 0 deletions x-pack/test/functional/page_objects/snapshot_restore_page.ts
Original file line number Diff line number Diff line change
@@ -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');
},
};
};