Skip to content

Commit

Permalink
Fix functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Apr 20, 2021
1 parent adc8666 commit 789409d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions test/functional/apps/discover/_shared_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const browser = getService('browser');
const toasts = getService('toasts');
const deployment = getService('deployment');
const docTable = getService('docTable');
const dataGrid = getService('dataGrid');

describe('shared links', function describeIndexTests() {
let baseUrl: string;
Expand Down Expand Up @@ -99,11 +99,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
',sort:!())';
await browser.navigateTo(expectedUrl);
await PageObjects.discover.waitUntilSearchingHasFinished();
const url = await browser.getCurrentUrl();
// url fallback default sort should have been pushed to URL
expect(url).to.contain('sort:!(!(%27@timestamp%27,desc))');
const firstRow = await docTable.getRow({ rowIndex: 0 });
const firstRowText = await firstRow.getVisibleText();
await retry.waitFor('url to contain default sorting', async () => {
// url fallback default sort should have been pushed to URL
const url = await browser.getCurrentUrl();
return url.includes('sort:!(!(%27@timestamp%27,desc))');
});

const row = await dataGrid.getRow({ rowIndex: 0 });
const firstRowText = await Promise.all(
row.map(async (cell) => await cell.getVisibleText())
);

// sorting requested by ES should be correct
expect(firstRowText).to.contain('Sep 22, 2015 @ 23:50:13.253');
});
Expand Down

0 comments on commit 789409d

Please sign in to comment.