Skip to content

Commit

Permalink
handle viewing sample dashboards on default dist
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeDr committed Feb 12, 2020
1 parent 3da8a76 commit 33a2a8b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
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
14 changes: 13 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 @@ -66,6 +69,15 @@ export function HomePageProvider({ getService }: FtrProviderContext) {
async launchSampleDataSet(id: string) {
await this.addSampleDataSet(id);
await testSubjects.click(`launchSampleDataSet${id}`);
// On OSS there's currently only sample dashboards so the launch button opens the dashboard
// but on default dist there's more items. The only tests that are calling this method are in OSS
// so they always expect Dashboard. isOss isn't really the right test. It should be based on
// the number of items.
// x-pack sample data tests seem to skip this navigation and open the saved objects directly.
isOss = await PageObjects.common.isOss();
if (!isOss) {
await find.clickByLinkText('Dashboard');
}
}

async loadSavedObjects() {
Expand Down

0 comments on commit 33a2a8b

Please sign in to comment.