Skip to content

Commit f702e67

Browse files
seialkalividuni94
authored andcommitted
[Search] FTR tests and fixes for Getting Started page (elastic#241442)
## Summary This PR adds FTR test for the Getting Started page, as well as a fix for a bug that was picked up by the tests. NOTE: I'm aware we should be moving over to Scout, but I thought it might be easier (for me at least) to get these tests up and running first and then convert them to Scout afterwards. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)~ - [ ] ~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials~ - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] ~If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~ - [ ] ~This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations.~ - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] ~The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)~ - [ ] ~Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.~
1 parent 229d8c9 commit f702e67

File tree

20 files changed

+585
-76
lines changed

20 files changed

+585
-76
lines changed

packages/kbn-optimizer/limits.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pageLoadAssetSize:
140140
screenshotMode: 2351
141141
screenshotting: 3252
142142
searchAssistant: 6150
143-
searchGettingStarted: 6600
143+
searchGettingStarted: 7327
144144
searchHomepage: 7962
145145
searchIndices: 9991
146146
searchInferenceEndpoints: 8071

x-pack/solutions/search/plugins/search_getting_started/public/components/connect_code/code_box.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ export const CodeBox = ({ selectedLanguage, codeBlockLanguage }: Props) => {
4545
}, [selectedExample, codeParams]);
4646

4747
return (
48-
<EuiCodeBlock isCopyable fontSize="m" language={codeBlockLanguage} overflowHeight={700}>
48+
<EuiCodeBlock
49+
isCopyable
50+
fontSize="m"
51+
language={codeBlockLanguage}
52+
overflowHeight={700}
53+
data-test-subj="gettingStartedExampleCode"
54+
>
4955
{codeExample}
5056
</EuiCodeBlock>
5157
);

x-pack/solutions/search/plugins/search_getting_started/public/components/footer/footer_links.tsx

Lines changed: 0 additions & 66 deletions
This file was deleted.

x-pack/solutions/search/plugins/search_getting_started/public/components/footer/index.tsx

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,82 @@ import {
1313
EuiSpacer,
1414
useCurrentEuiBreakpoint,
1515
} from '@elastic/eui';
16+
import { i18n } from '@kbn/i18n';
17+
1618
import { DocCallouts } from './doc_callouts';
17-
import { footerLinks } from './footer_links';
19+
import { docLinks } from '../../common/doc_links';
20+
interface DocLinkItem {
21+
id: string;
22+
title: string;
23+
description: string;
24+
buttonLabel: string;
25+
buttonHref: string;
26+
dataTestSubj: string;
27+
}
1828

1929
export const GettingStartedFooter = () => {
2030
const currentBreakpoint = useCurrentEuiBreakpoint();
31+
32+
const footerLinks: DocLinkItem[] = [
33+
{
34+
id: 'searchLabs',
35+
title: i18n.translate('xpack.gettingStarted.searchLabs.title', {
36+
defaultMessage: 'Search Labs',
37+
}),
38+
description: i18n.translate('xpack.gettingStarted.searchLabs.description', {
39+
defaultMessage:
40+
'Explore the latest articles and tutorials on using Elasticsearch for AI/ML-powered search experiences.',
41+
}),
42+
buttonLabel: i18n.translate('xpack.gettingStarted.searchLabs.buttonText', {
43+
defaultMessage: 'Visit Elasticsearch Labs',
44+
}),
45+
buttonHref: docLinks.visitSearchLabs,
46+
dataTestSubj: 'gettingStartedSearchLabs',
47+
},
48+
{
49+
id: 'pythonNotebooks',
50+
title: i18n.translate('xpack.gettingStarted.pythonNotebooks.title', {
51+
defaultMessage: 'Python notebooks',
52+
}),
53+
description: i18n.translate('xpack.gettingStarted.pythonNotebooks.description', {
54+
defaultMessage:
55+
'A range of executable Python notebooks available to easily test features in a virtual environment.',
56+
}),
57+
buttonLabel: i18n.translate('xpack.gettingStarted.pythonNotebooks.buttonText', {
58+
defaultMessage: 'Browse our notebooks',
59+
}),
60+
buttonHref: docLinks.notebooksExamples,
61+
dataTestSubj: 'gettingStartedOpenNotebooks',
62+
},
63+
{
64+
id: 'elasticsearchDocs',
65+
title: i18n.translate('xpack.gettingStarted.elasticsearchDocs.title', {
66+
defaultMessage: 'Elasticsearch documentation',
67+
}),
68+
description: i18n.translate('xpack.gettingStarted.elasticsearchDocumentation.description', {
69+
defaultMessage:
70+
'Comprehensive reference material to help you learn, build, and deploy search solutions with Elasticsearch.',
71+
}),
72+
buttonLabel: i18n.translate('xpack.gettingStarted.elasticsearchDocumentation.buttonText', {
73+
defaultMessage: 'View documentation',
74+
}),
75+
buttonHref: docLinks.elasticsearchDocs,
76+
dataTestSubj: 'gettingStartedViewDocumentation',
77+
},
78+
];
2179
return (
2280
<>
2381
<EuiHorizontalRule />
2482
<EuiSpacer size="xxl" />
2583
<EuiFlexGroup direction={currentBreakpoint === 'xl' ? 'row' : 'column'}>
2684
{footerLinks.map((item) => (
27-
<EuiFlexItem key={item.id} data-test-subj={`${item.id}Section`}>
85+
<EuiFlexItem key={item.dataTestSubj} data-test-subj={item.dataTestSubj}>
2886
<DocCallouts
2987
title={item.title}
3088
description={item.description}
3189
buttonHref={item.buttonHref}
3290
buttonLabel={item.buttonLabel}
33-
dataTestSubj={item.dataTestSubj}
91+
dataTestSubj={`${item.dataTestSubj}-btn`}
3492
/>
3593
</EuiFlexItem>
3694
))}

x-pack/solutions/search/plugins/search_getting_started/public/components/header/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const SearchGettingStartedHeader: React.FC = () => {
7171
<EuiFlexItem grow={false}>
7272
<EuiButtonEmpty
7373
aria-label={skipAndGoHomeLabel}
74-
data-test-subj="elasticLLMCostsTourCloseBtn"
74+
data-test-subj="skipAndGoHomeBtn"
7575
onClick={() => {
7676
application.navigateToApp(SEARCH_HOMEPAGE);
7777
}}

x-pack/solutions/search/plugins/search_getting_started/public/components/search_getting_started.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ export const SearchGettingStartedPage: React.FC = () => {
2525

2626
return (
2727
<SearchGettingStartedPageTemplate>
28-
<EuiPageTemplate.Section paddingSize="xl" grow={false}>
28+
<EuiPageTemplate.Section data-test-subj="gettingStartedHeader" paddingSize="xl" grow={false}>
2929
<SearchGettingStartedHeader />
3030
</EuiPageTemplate.Section>
31-
<EuiPageTemplate.Section paddingSize="xl">
31+
<EuiPageTemplate.Section data-test-subj="gettingStartedConsoleTutorials" paddingSize="xl">
3232
<ConsoleTutorialsGroup />
3333
</EuiPageTemplate.Section>
3434
<EuiPageTemplate.Section data-test-subj="gettingStartedCodeExamples">
3535
<SearchGettingStartedConnectCode />
3636
</EuiPageTemplate.Section>
37-
<EuiPageTemplate.Section>
37+
<EuiPageTemplate.Section data-test-subj="gettingStartedFooter">
3838
<GettingStartedFooter />
3939
</EuiPageTemplate.Section>
4040
</SearchGettingStartedPageTemplate>

x-pack/solutions/search/plugins/search_getting_started/public/components/tutorials/console_tutorials_group.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export const ConsoleTutorialsGroup = () => {
114114
onClick={() => {
115115
tutorial.buttonRef.current?.click();
116116
}}
117+
data-test-subj={tutorial.dataTestSubj}
117118
footer={
118119
<TryInConsoleButton
119120
type="button"
@@ -124,7 +125,7 @@ export const ConsoleTutorialsGroup = () => {
124125
sharePlugin={share}
125126
consolePlugin={consolePlugin}
126127
telemetryId={tutorial.dataTestSubj}
127-
data-test-subj={tutorial.dataTestSubj}
128+
data-test-subj={`${tutorial.dataTestSubj}-btn`}
128129
buttonProps={{ buttonRef: tutorial.buttonRef }}
129130
content={
130131
<FormattedMessage

x-pack/solutions/search/plugins/search_getting_started/public/plugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import type {
1919
SearchGettingStartedAppPluginStartDependencies,
2020
SearchGettingStartedServicesContextDeps,
2121
} from './types';
22+
import { docLinks } from './common/doc_links';
2223

2324
export class SearchGettingStartedPlugin
2425
implements
@@ -49,6 +50,7 @@ export class SearchGettingStartedPlugin
4950
async mount({ element, history }: AppMountParameters) {
5051
const { renderApp } = await import('./application');
5152
const [coreStart, depsStart] = await core.getStartServices();
53+
docLinks.setDocLinks(coreStart.docLinks.links);
5254
const services: SearchGettingStartedServicesContextDeps = {
5355
...depsStart,
5456
history,

x-pack/solutions/search/test/functional_search/config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
4141
searchInferenceEndpoints: {
4242
pathname: '/app/elasticsearch/relevance/inference_endpoints',
4343
},
44+
searchOverview: {
45+
pathname: '/app/elasticsearch/overview',
46+
},
47+
searchHomepage: {
48+
pathname: '/app/elasticsearch/home',
49+
},
50+
searchGettingStarted: {
51+
pathname: '/app/elasticsearch/getting_started',
52+
},
4453
},
4554
};
4655
}

0 commit comments

Comments
 (0)