Skip to content

Commit bf04daf

Browse files
committed
Add getting started FTR tests to config for FF, and fix broken code
1 parent 487036e commit bf04daf

File tree

19 files changed

+530
-79
lines changed

19 files changed

+530
-79
lines changed

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: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const ConsoleTutorialsGroup = () => {
3131
title: i18n.translate('xpack.searchGettingStarted.consoleTutorials.basicsTitle', {
3232
defaultMessage: 'Search basics',
3333
}),
34-
dataTestSubj: 'console_tutorials_search_basics',
34+
dataTestSubj: 'consoleTutorialsSearchBasics',
3535
description: i18n.translate(
3636
'xpack.searchGettingStarted.consoleTutorials.basicsDescription',
3737
{
@@ -47,7 +47,7 @@ export const ConsoleTutorialsGroup = () => {
4747
title: i18n.translate('xpack.searchGettingStarted.consoleTutorials.semanticTitle', {
4848
defaultMessage: 'Intro to semantic search',
4949
}),
50-
dataTestSubj: 'console_tutorials_semantic_search',
50+
dataTestSubj: 'consoleTutorialsSemanticSearch',
5151
description: i18n.translate(
5252
'xpack.searchGettingStarted.consoleTutorials.semanticDescription',
5353
{
@@ -63,7 +63,7 @@ export const ConsoleTutorialsGroup = () => {
6363
title: i18n.translate('xpack.searchGettingStarted.consoleTutorials.esqlTitle', {
6464
defaultMessage: 'ES|QL fundamentals',
6565
}),
66-
dataTestSubj: 'console_tutorials_esql',
66+
dataTestSubj: 'consoleTutorialsEsql',
6767
description: i18n.translate('xpack.searchGettingStarted.consoleTutorials.esqlDescription', {
6868
defaultMessage:
6969
"Learn how to use Elastic's piped query language to simplify data investigations.",
@@ -77,7 +77,7 @@ export const ConsoleTutorialsGroup = () => {
7777
// title: i18n.translate('xpack.searchGettingStarted.consoleTutorials.tsdsTitle', {
7878
// defaultMessage: 'Time series data streams',
7979
// }),
80-
// dataTestSubj: 'console_tutorials_tsds',
80+
// dataTestSubj: 'consoleTutorialsTsds',
8181
// description: i18n.translate('xpack.searchHomepage.consoleTutorials.tsdsDescription', {
8282
// defaultMessage:
8383
// 'Learn how to use a time series data stream (TSDS) to store timestamped metrics data.',
@@ -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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
4141
searchInferenceEndpoints: {
4242
pathname: '/app/elasticsearch/relevance/inference_endpoints',
4343
},
44+
searchOverview: {
45+
pathname: '/app/elasticsearch/overview',
46+
},
4447
},
4548
};
4649
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
2525
'--xpack.spaces.defaultSolution=es', // Default to Search Solution
2626
`--uiSettings.overrides.searchPlayground:searchModeEnabled=true`,
2727
`--uiSettings.overrides.agentBuilder:enabled=true`,
28+
'--feature_flags.overrides.searchSolution.gettingStartedEnabled=true',
2829
],
2930
},
3031
// load tests in the index file

0 commit comments

Comments
 (0)