@@ -13,60 +13,73 @@ export default function({ getPageObjects, getService }) {
1313 const inspector = getService ( 'inspector' ) ;
1414 const find = getService ( 'find' ) ;
1515
16- describe ( 'top hits' , ( ) => {
17- before ( async ( ) => {
18- await PageObjects . maps . loadSavedMap ( 'document example top hits' ) ;
19- } ) ;
20-
21- it ( 'should not fetch any search hits' , async ( ) => {
22- await inspector . open ( ) ;
23- await inspector . openInspectorRequestsView ( ) ;
24- const requestStats = await inspector . getTableData ( ) ;
25- const hits = PageObjects . maps . getInspectorStatRowHit ( requestStats , 'Hits' ) ;
26- expect ( hits ) . to . equal ( '0' ) ; // aggregation requests do not return any documents
27- } ) ;
28-
29- it ( 'should display top hits per entity' , async ( ) => {
30- const mapboxStyle = await PageObjects . maps . getMapboxStyle ( ) ;
31- expect ( mapboxStyle . sources [ VECTOR_SOURCE_ID ] . data . features . length ) . to . equal ( 10 ) ;
32- } ) ;
33-
34- describe ( 'configuration' , ( ) => {
16+ describe ( 'geo top hits' , ( ) => {
17+ describe ( 'split on string field' , ( ) => {
3518 before ( async ( ) => {
36- await PageObjects . maps . openLayerPanel ( 'logstash' ) ;
37- // Can not use testSubjects because data-test-subj is placed range input and number input
38- const sizeInput = await find . byCssSelector (
39- `input[data-test-subj="layerPanelTopHitsSize"][type='number']`
40- ) ;
41- await sizeInput . click ( ) ;
42- await sizeInput . clearValue ( ) ;
43- await sizeInput . type ( '3' ) ;
44- await PageObjects . maps . waitForLayersToLoad ( ) ;
19+ await PageObjects . maps . loadSavedMap ( 'document example top hits' ) ;
4520 } ) ;
4621
47- after ( async ( ) => {
48- await PageObjects . maps . closeLayerPanel ( ) ;
22+ it ( 'should not fetch any search hits' , async ( ) => {
23+ await inspector . open ( ) ;
24+ await inspector . openInspectorRequestsView ( ) ;
25+ const requestStats = await inspector . getTableData ( ) ;
26+ const hits = PageObjects . maps . getInspectorStatRowHit ( requestStats , 'Hits' ) ;
27+ expect ( hits ) . to . equal ( '0' ) ; // aggregation requests do not return any documents
4928 } ) ;
5029
51- it ( 'should update top hits when configation changes ' , async ( ) => {
30+ it ( 'should display top hits per entity ' , async ( ) => {
5231 const mapboxStyle = await PageObjects . maps . getMapboxStyle ( ) ;
53- expect ( mapboxStyle . sources [ VECTOR_SOURCE_ID ] . data . features . length ) . to . equal ( 15 ) ;
32+ expect ( mapboxStyle . sources [ VECTOR_SOURCE_ID ] . data . features . length ) . to . equal ( 10 ) ;
5433 } ) ;
55- } ) ;
5634
57- describe ( 'query' , ( ) => {
58- before ( async ( ) => {
59- await PageObjects . maps . setAndSubmitQuery ( 'machine.os.raw : "win 8"' ) ;
35+ describe ( 'configuration' , ( ) => {
36+ before ( async ( ) => {
37+ await PageObjects . maps . openLayerPanel ( 'logstash' ) ;
38+ // Can not use testSubjects because data-test-subj is placed range input and number input
39+ const sizeInput = await find . byCssSelector (
40+ `input[data-test-subj="layerPanelTopHitsSize"][type='number']`
41+ ) ;
42+ await sizeInput . click ( ) ;
43+ await sizeInput . clearValue ( ) ;
44+ await sizeInput . type ( '3' ) ;
45+ await PageObjects . maps . waitForLayersToLoad ( ) ;
46+ } ) ;
47+
48+ after ( async ( ) => {
49+ await PageObjects . maps . closeLayerPanel ( ) ;
50+ } ) ;
51+
52+ it ( 'should update top hits when configation changes' , async ( ) => {
53+ const mapboxStyle = await PageObjects . maps . getMapboxStyle ( ) ;
54+ expect ( mapboxStyle . sources [ VECTOR_SOURCE_ID ] . data . features . length ) . to . equal ( 15 ) ;
55+ } ) ;
56+ } ) ;
57+
58+ describe ( 'query' , ( ) => {
59+ before ( async ( ) => {
60+ await PageObjects . maps . setAndSubmitQuery ( 'machine.os.raw : "win 8"' ) ;
61+ } ) ;
62+
63+ after ( async ( ) => {
64+ await PageObjects . maps . setAndSubmitQuery ( '' ) ;
65+ } ) ;
66+
67+ it ( 'should apply query to top hits request' , async ( ) => {
68+ await PageObjects . maps . setAndSubmitQuery ( 'machine.os.raw : "win 8"' ) ;
69+ const mapboxStyle = await PageObjects . maps . getMapboxStyle ( ) ;
70+ expect ( mapboxStyle . sources [ VECTOR_SOURCE_ID ] . data . features . length ) . to . equal ( 2 ) ;
71+ } ) ;
6072 } ) ;
73+ } ) ;
6174
62- after ( async ( ) => {
63- await PageObjects . maps . setAndSubmitQuery ( '' ) ;
75+ describe ( 'split on scripted field' , ( ) => {
76+ before ( async ( ) => {
77+ await PageObjects . maps . loadSavedMap ( 'document example top hits split with scripted field' ) ;
6478 } ) ;
6579
66- it ( 'should apply query to top hits request' , async ( ) => {
67- await PageObjects . maps . setAndSubmitQuery ( 'machine.os.raw : "win 8"' ) ;
80+ it ( 'should display top hits per entity' , async ( ) => {
6881 const mapboxStyle = await PageObjects . maps . getMapboxStyle ( ) ;
69- expect ( mapboxStyle . sources [ VECTOR_SOURCE_ID ] . data . features . length ) . to . equal ( 2 ) ;
82+ expect ( mapboxStyle . sources [ VECTOR_SOURCE_ID ] . data . features . length ) . to . equal ( 24 ) ;
7083 } ) ;
7184 } ) ;
7285 } ) ;
0 commit comments