Skip to content

Commit

Permalink
Add Test to Verify Endpoint App Landing Page (#57129)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlie-pichette committed Feb 7, 2020
1 parent e6be475 commit d72a715
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions x-pack/test/functional/apps/endpoint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export default function({ loadTestFile }: FtrProviderContext) {
this.tags('ciGroup7');

loadTestFile(require.resolve('./feature_controls'));
loadTestFile(require.resolve('./landing_page'));
});
}
24 changes: 24 additions & 0 deletions x-pack/test/functional/apps/endpoint/landing_page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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 }: FtrProviderContext) => {
const pageObjects = getPageObjects(['common', 'endpoint']);

describe('Endpoint landing page', function() {
this.tags('ciGroup7');
before(async () => {
await pageObjects.common.navigateToApp('endpoint');
});

it('Loads the endpoint app', async () => {
const welcomeEndpointMessage = await pageObjects.endpoint.welcomeEndpointTitle();
expect(welcomeEndpointMessage).to.be('Hello World');
});
});
};
17 changes: 17 additions & 0 deletions x-pack/test/functional/page_objects/endpoint_page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* 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 EndpointPageProvider({ getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');

return {
async welcomeEndpointTitle() {
return await testSubjects.getVisibleText('welcomeTitle');
},
};
}
2 changes: 2 additions & 0 deletions x-pack/test/functional/page_objects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import { CopySavedObjectsToSpacePageProvider } from './copy_saved_objects_to_spa
import { LensPageProvider } from './lens_page';
import { InfraMetricExplorerProvider } from './infra_metric_explorer';
import { RoleMappingsPageProvider } from './role_mappings_page';
import { EndpointPageProvider } from './endpoint_page';

// just like services, PageObjects are defined as a map of
// names to Providers. Merge in Kibana's or pick specific ones
Expand Down Expand Up @@ -78,4 +79,5 @@ export const pageObjects = {
copySavedObjectsToSpace: CopySavedObjectsToSpacePageProvider,
lens: LensPageProvider,
roleMappings: RoleMappingsPageProvider,
endpoint: EndpointPageProvider,
};

0 comments on commit d72a715

Please sign in to comment.