|
17 | 17 | * under the License. |
18 | 18 | */ |
19 | 19 |
|
20 | | -import expect from '@kbn/expect'; |
21 | | - |
22 | | -const TEST_COLUMN_NAMES = ['@message']; |
23 | 20 | const TEST_FILTER_COLUMN_NAMES = [ |
24 | 21 | ['extension', 'jpg'], |
25 | | - ['geo.src', 'IN'], |
26 | 22 | [ |
27 | 23 | 'agent', |
28 | 24 | 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.50 Safari/534.24', |
29 | 25 | ], |
30 | 26 | ]; |
31 | 27 |
|
32 | 28 | export default function ({ getService, getPageObjects }) { |
| 29 | + const retry = getService('retry'); |
33 | 30 | const browser = getService('browser'); |
34 | 31 | const docTable = getService('docTable'); |
35 | 32 | const PageObjects = getPageObjects(['common', 'context', 'discover', 'timePicker']); |
36 | 33 |
|
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() { |
39 | 35 | before(async function () { |
| 36 | + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); |
40 | 37 | 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 | | - ); |
47 | 38 | for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) { |
48 | 39 | await PageObjects.discover.clickFieldListItem(columnName); |
49 | 40 | await PageObjects.discover.clickFieldListPlusFilter(columnName, value); |
50 | 41 | } |
51 | 42 | }); |
52 | 43 |
|
53 | 44 | 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 | + }); |
66 | 61 | }); |
67 | 62 | }); |
68 | 63 | } |
0 commit comments