File tree Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Original file line number Diff line number Diff line change 11/// <reference types="cypress" />
2-
3- import * as c from '../../support/const' ;
4- import data from './../../../../mocks/loki/flow_records.json' ;
2+ import r from './../../../../mocks/loki/flow_records.json' ;
53
64describe ( 'netflow-table' , ( ) => {
7- function reload ( clearCache = true ) {
5+ beforeEach ( ( ) => {
86 // this test bench only work with mocks
9- cy . intercept ( 'GET' , c . url + '/api/loki/flow/records?*' , ( req ) => {
10- req . continue ( ( res ) => {
11- res . body = data ;
12- } )
7+ cy . intercept ( 'GET' , '/api/loki/flow/records?*' , {
8+ statusCode : 200 ,
9+ body : r . data ,
1310 } ) ;
14-
15- cy . openNetflowTrafficPage ( clearCache ) ;
11+ cy . openNetflowTrafficPage ( true ) ;
1612
1713 //move to table view
1814 cy . get ( '.tableTabButton' ) . click ( ) ;
1915 //clear default app filters
20- if ( clearCache === true ) {
21- cy . get ( '#clear-all-filters-button' ) . click ( ) ;
22- }
23- }
24-
25- beforeEach ( ( ) => {
26- reload ( ) ;
16+ cy . get ( '#clear-all-filters-button' ) . click ( ) ;
2717 } ) ;
2818
2919 it ( 'display content correctly' , ( ) => {
You can’t perform that action at this time.
0 commit comments