Skip to content

Commit 0e0b1b0

Browse files
committed
Fix flakes in footer tests
1 parent 75b8a7b commit 0e0b1b0

File tree

3 files changed

+19
-39
lines changed

3 files changed

+19
-39
lines changed

x-pack/solutions/search/test/functional_search/tests/search_getting_started.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,22 +174,19 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
174174

175175
describe('Footer content', function () {
176176
it('renders Search Labs callout and navigates correctly', async () => {
177-
await pageObjects.searchGettingStarted.expectFooterCallout(
178-
'gettingStartedSearchLabs',
179-
'search-labs'
180-
);
177+
const href = await testSubjects.getAttribute('gettingStartedSearchLabs-btn', 'href');
178+
expect(href).to.contain('search-labs');
181179
});
182180
it('renders Python Notebooks callout and navigates correctly', async () => {
183-
await pageObjects.searchGettingStarted.expectFooterCallout(
184-
'gettingStartedOpenNotebooks',
185-
'search-labs/tutorials/examples'
186-
);
181+
const href = await testSubjects.getAttribute('gettingStartedOpenNotebooks-btn', 'href');
182+
expect(href).to.contain('search-labs/tutorials/examples');
187183
});
188184
it('renders Elasticsearch Documentation callout and navigates correctly', async () => {
189-
await pageObjects.searchGettingStarted.expectFooterCallout(
190-
'gettingStartedViewDocumentation',
191-
'docs/solutions/search/get-started'
185+
const href = await testSubjects.getAttribute(
186+
'gettingStartedViewDocumentation-btn',
187+
'href'
192188
);
189+
expect(href).to.contain('docs/solutions/search/get-started');
193190
});
194191
});
195192
});

x-pack/solutions/search/test/page_objects/search_getting_started_page.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,5 @@ export function SearchGettingStartedProvider({ getService }: FtrProviderContext)
4141
await testSubjects.existOrFail(tstSubjId);
4242
expect(await testSubjects.getVisibleText(tstSubjId)).contain(value);
4343
},
44-
async expectFooterCallout(calloutDataTestSubj: string, calloutUrl: string) {
45-
await testSubjects.existOrFail(calloutDataTestSubj);
46-
await testSubjects.existOrFail(`${calloutDataTestSubj}-btn`);
47-
await testSubjects.click(`${calloutDataTestSubj}-btn`);
48-
await retry.tryWithRetries(
49-
'wait for URL to change',
50-
async () => {
51-
expect(await browser.getCurrentUrl()).to.contain(calloutUrl);
52-
},
53-
{ initialDelay: 200, retryCount: 5, retryDelay: 500 }
54-
);
55-
},
5644
};
5745
}

x-pack/solutions/search/test/serverless/functional/test_suites/search_getting_started.ts

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
9292
});
9393

9494
describe('Footer content', function () {
95-
it('renders Search Labs callout and navigates correctly', async () => {
96-
await pageObjects.searchGettingStarted.expectFooterCallout(
97-
'gettingStartedSearchLabs',
98-
'search-labs'
99-
);
95+
it('renders Python Notebooks callout and navigates correctly', async () => {
96+
const href = await testSubjects.getAttribute('gettingStartedOpenNotebooks-btn', 'href');
97+
expect(href).to.contain('search-labs/tutorials/examples');
10098
});
10199
});
102100
});
@@ -219,22 +217,19 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
219217

220218
describe('Footer content', function () {
221219
it('renders Search Labs callout and navigates correctly', async () => {
222-
await pageObjects.searchGettingStarted.expectFooterCallout(
223-
'gettingStartedSearchLabs',
224-
'search-labs'
225-
);
220+
const href = await testSubjects.getAttribute('gettingStartedSearchLabs-btn', 'href');
221+
expect(href).to.contain('search-labs');
226222
});
227223
it('renders Python Notebooks callout and navigates correctly', async () => {
228-
await pageObjects.searchGettingStarted.expectFooterCallout(
229-
'gettingStartedOpenNotebooks',
230-
'search-labs/tutorials/examples'
231-
);
224+
const href = await testSubjects.getAttribute('gettingStartedOpenNotebooks-btn', 'href');
225+
expect(href).to.contain('search-labs/tutorials/examples');
232226
});
233227
it('renders Elasticsearch Documentation callout and navigates correctly', async () => {
234-
await pageObjects.searchGettingStarted.expectFooterCallout(
235-
'gettingStartedViewDocumentation',
236-
'docs/solutions/search/get-started'
228+
const href = await testSubjects.getAttribute(
229+
'gettingStartedViewDocumentation-btn',
230+
'href'
237231
);
232+
expect(href).to.contain('docs/solutions/search/get-started');
238233
});
239234
});
240235
});

0 commit comments

Comments
 (0)