* handle viewing sample dashboards on default dist * re-work change to not break jest test * Update snap for addition of data-test-subj Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
d9becbb052
commit
6a23965971
4 changed files with 18 additions and 5 deletions
|
@ -14,6 +14,7 @@ exports[`should render popover when appLinks is not empty 1`] = `
|
|||
</EuiButton>
|
||||
}
|
||||
closePopover={[Function]}
|
||||
data-test-subj="launchSampleDataSetecommerce"
|
||||
display="inlineBlock"
|
||||
hasArrow={true}
|
||||
id="sampleDataLinksecommerce"
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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');
|
||||
|
@ -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');
|
||||
|
@ -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');
|
||||
|
@ -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');
|
||||
|
|
|
@ -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) {
|
||||
|
@ -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}`);
|
||||
|
|
Loading…
Reference in a new issue