Skip to content

Commit

Permalink
Unskip _shared_links.ts functional test (#198947)
Browse files Browse the repository at this point in the history
Apply a functional workaround to assert the test of the 2nd toast which is always the same and not flaky.
  • Loading branch information
kertal authored Nov 7, 2024
1 parent 66865d6 commit da74aa7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/functional/apps/discover/_shared_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const toasts = getService('toasts');
const deployment = getService('deployment');

// Failing: See https://github.com/elastic/kibana/issues/196627
describe.skip('shared links', function describeIndexTests() {
describe('shared links', function describeIndexTests() {
let baseUrl: string;

async function setup({ storeStateInSessionStorage }: { storeStateInSessionStorage: boolean }) {
Expand Down Expand Up @@ -179,7 +178,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await retry.waitFor('discover to open', async () => {
const resolvedUrl = await browser.getCurrentUrl();
expect(resolvedUrl).to.match(/discover/);
const { message } = await toasts.getErrorToast();
// the toast we aiming to check is usually the 2nd one, but it can also be the first one
// there are 3 same toasts here which was resolved in the next major version
// the workaround to check for the 2nd toast, which allows the test to always pass
const { message } = await toasts.getErrorToast(2);
expect(message).to.contain(
'Unable to completely restore the URL, be sure to use the share functionality.'
);
Expand Down

0 comments on commit da74aa7

Please sign in to comment.