Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.6] handle viewing sample dashboards on default dist (#57510) #57627

Merged
merged 1 commit into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export class SampleDataViewDataButton extends React.Component {
closePopover={this.closePopover}
panelPaddingSize="none"
anchorPosition="downCenter"
data-test-subj={`launchSampleDataSet${this.props.id}`}
>
<EuiContextMenu initialPanelId={0} panels={panels} />
</EuiPopover>
Expand Down
8 changes: 4 additions & 4 deletions test/functional/apps/home/_sample_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) {
});

it('should launch sample flights data set dashboard', async () => {
await PageObjects.home.launchSampleDataSet('flights');
await PageObjects.home.launchSampleDashboard('flights');
await PageObjects.header.waitUntilLoadingHasFinished();
await renderable.waitForRender();
const todayYearMonthDay = moment().format('MMM D, YYYY');
Expand All @@ -96,7 +96,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) {
});

it('should render visualizations', async () => {
await PageObjects.home.launchSampleDataSet('flights');
await PageObjects.home.launchSampleDashboard('flights');
await PageObjects.header.waitUntilLoadingHasFinished();
await renderable.waitForRender();
log.debug('Checking pie charts rendered');
Expand All @@ -115,7 +115,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) {
});

it('should launch sample logs data set dashboard', async () => {
await PageObjects.home.launchSampleDataSet('logs');
await PageObjects.home.launchSampleDashboard('logs');
await PageObjects.header.waitUntilLoadingHasFinished();
await renderable.waitForRender();
const todayYearMonthDay = moment().format('MMM D, YYYY');
Expand All @@ -127,7 +127,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) {
});

it('should launch sample ecommerce data set dashboard', async () => {
await PageObjects.home.launchSampleDataSet('ecommerce');
await PageObjects.home.launchSampleDashboard('ecommerce');
await PageObjects.header.waitUntilLoadingHasFinished();
await renderable.waitForRender();
const todayYearMonthDay = moment().format('MMM D, YYYY');
Expand Down
13 changes: 12 additions & 1 deletion test/functional/page_objects/home_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@

import { FtrProviderContext } from '../ftr_provider_context';

export function HomePageProvider({ getService }: FtrProviderContext) {
export function HomePageProvider({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const retry = getService('retry');
const find = getService('find');
const PageObjects = getPageObjects(['common']);
let isOss = true;

class HomePage {
async clickSynopsis(title: string) {
Expand Down Expand Up @@ -63,6 +66,14 @@ export function HomePageProvider({ getService }: FtrProviderContext) {
});
}

async launchSampleDashboard(id: string) {
await this.launchSampleDataSet(id);
isOss = await PageObjects.common.isOss();
if (!isOss) {
await find.clickByLinkText('Dashboard');
}
}

async launchSampleDataSet(id: string) {
await this.addSampleDataSet(id);
await testSubjects.click(`launchSampleDataSet${id}`);
Expand Down