Skip to content

Commit cc893f3

Browse files
authored
[Discover] Unskip context navigation functional test (#68771)
1 parent 43ed4e2 commit cc893f3

File tree

1 file changed

+19
-24
lines changed

1 file changed

+19
-24
lines changed

test/functional/apps/context/_context_navigation.js

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,52 +17,47 @@
1717
* under the License.
1818
*/
1919

20-
import expect from '@kbn/expect';
21-
22-
const TEST_COLUMN_NAMES = ['@message'];
2320
const TEST_FILTER_COLUMN_NAMES = [
2421
['extension', 'jpg'],
25-
['geo.src', 'IN'],
2622
[
2723
'agent',
2824
'Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.50 Safari/534.24',
2925
],
3026
];
3127

3228
export default function ({ getService, getPageObjects }) {
29+
const retry = getService('retry');
3330
const browser = getService('browser');
3431
const docTable = getService('docTable');
3532
const PageObjects = getPageObjects(['common', 'context', 'discover', 'timePicker']);
3633

37-
// FLAKY: https://github.com/elastic/kibana/issues/62866
38-
describe.skip('context link in discover', function contextSize() {
34+
describe('discover - context - back navigation', function contextSize() {
3935
before(async function () {
36+
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
4037
await PageObjects.common.navigateToApp('discover');
41-
await PageObjects.timePicker.setDefaultAbsoluteRange();
42-
await Promise.all(
43-
TEST_COLUMN_NAMES.map((columnName) =>
44-
PageObjects.discover.clickFieldListItemAdd(columnName)
45-
)
46-
);
4738
for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) {
4839
await PageObjects.discover.clickFieldListItem(columnName);
4940
await PageObjects.discover.clickFieldListPlusFilter(columnName, value);
5041
}
5142
});
5243

5344
it('should go back after loading', async function () {
54-
// navigate to the context view
55-
await docTable.clickRowToggle({ rowIndex: 0 });
56-
await (await docTable.getRowActions({ rowIndex: 0 }))[0].click();
57-
await PageObjects.context.waitUntilContextLoadingHasFinished();
58-
await PageObjects.context.clickSuccessorLoadMoreButton();
59-
await PageObjects.context.clickSuccessorLoadMoreButton();
60-
await PageObjects.context.clickSuccessorLoadMoreButton();
61-
await PageObjects.context.waitUntilContextLoadingHasFinished();
62-
await browser.goBack();
63-
await PageObjects.discover.waitForDocTableLoadingComplete();
64-
const hitCount = await PageObjects.discover.getHitCount();
65-
expect(hitCount).to.be('522');
45+
await retry.waitFor('user navigating to context and returning to discover', async () => {
46+
// navigate to the context view
47+
const initialHitCount = await PageObjects.discover.getHitCount();
48+
await docTable.clickRowToggle({ rowIndex: 0 });
49+
const rowActions = await docTable.getRowActions({ rowIndex: 0 });
50+
await rowActions[0].click();
51+
await PageObjects.context.waitUntilContextLoadingHasFinished();
52+
await PageObjects.context.clickSuccessorLoadMoreButton();
53+
await PageObjects.context.clickSuccessorLoadMoreButton();
54+
await PageObjects.context.clickSuccessorLoadMoreButton();
55+
await PageObjects.context.waitUntilContextLoadingHasFinished();
56+
await browser.goBack();
57+
await PageObjects.discover.waitForDocTableLoadingComplete();
58+
const hitCount = await PageObjects.discover.getHitCount();
59+
return initialHitCount === hitCount;
60+
});
6661
});
6762
});
6863
}

0 commit comments

Comments
 (0)