[Guided onboarding] Fix home redirect when on Cloud (#145539)

This commit is contained in:
Yulia Čech 2022-11-22 18:11:46 +01:00 committed by GitHub
parent 8e1618ac90
commit f0670b0a0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 3 deletions

View file

@ -21,6 +21,7 @@ exports[`getting started should render getting started component 1`] = `
"toString": [Function],
}
}
data-test-subj="onboarding--landing-page"
hasShadow={true}
>
<EuiTitle

View file

@ -183,7 +183,12 @@ export const GettingStarted = () => {
return (
<KibanaPageTemplate panelled={false} grow>
<EuiPageTemplate.Section alignment="center">
<EuiPanel color="plain" hasShadow css={paddingCss}>
<EuiPanel
color="plain"
hasShadow
css={paddingCss}
data-test-subj="onboarding--landing-page"
>
<EuiTitle size="l" className="eui-textCenter">
<h1>{title}</h1>
</EuiTitle>

View file

@ -198,7 +198,7 @@ export class Home extends Component<HomeProps, State> {
if (isNewKibanaInstance) {
if (isCloudEnabled) {
application.navigateToUrl('./home#/getting_started');
return;
return null;
}
return this.renderWelcome();
}

View file

@ -13,9 +13,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const browser = getService('browser');
const esArchiver = getService('esArchiver');
const PageObjects = getPageObjects(['common', 'home']);
const deployment = getService('deployment');
describe('Welcome interstitial', () => {
before(async () => {
beforeEach(async () => {
// Need to navigate to page first to clear storage before test can be run
await PageObjects.common.navigateToUrl('home', undefined);
await browser.clearLocalStorage();
@ -32,5 +33,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(await PageObjects.home.isWelcomeInterstitialDisplayed()).to.be(true);
await PageObjects.common.clickAndValidate('skipWelcomeScreen', 'homeApp');
});
it('redirects to guided onboarding landing page when on Cloud', async () => {
const isCloud = await deployment.isCloud();
if (isCloud) {
await PageObjects.common.navigateToUrl('home', '', { disableWelcomePrompt: false });
expect(await PageObjects.home.isGuidedOnboardingLandingDisplayed()).to.be(true);
}
});
});
}

View file

@ -45,6 +45,10 @@ export class HomePageObject extends FtrService {
return await this.testSubjects.isDisplayed('homeWelcomeInterstitial');
}
async isGuidedOnboardingLandingDisplayed() {
return await this.testSubjects.isDisplayed('onboarding--landing-page');
}
async getVisibileSolutions() {
const solutionPanels = await this.testSubjects.findAll('~homSolutionPanel', 2000);
const panelAttributes = await Promise.all(