@@ -18,9 +18,16 @@ import {
1818import { DEFAULT_TIMEOUT , loginAndWaitForPage , waitForTableLoad } from '../../lib/util/helpers' ;
1919
2020describe ( 'Pagination' , ( ) => {
21- it ( 'pagination updates results and page number' , ( ) => {
21+ before ( ( ) => {
2222 loginAndWaitForPage ( HOSTS_PAGE_TAB_URLS . uncommonProcesses ) ;
2323 waitForTableLoad ( UNCOMMON_PROCCESSES_TABLE ) ;
24+ } ) ;
25+
26+ afterEach ( ( ) => {
27+ cy . get ( getPageButtonSelector ( 0 ) ) . click ( { force : true } ) ;
28+ } ) ;
29+
30+ it ( 'pagination updates results and page number' , ( ) => {
2431 cy . get ( getPageButtonSelector ( 0 ) ) . should ( 'have.class' , 'euiPaginationButton-isActive' ) ;
2532
2633 cy . get ( getDraggableField ( 'process.name' ) )
@@ -42,8 +49,6 @@ describe('Pagination', () => {
4249 } ) ;
4350
4451 it ( 'pagination keeps track of page results when tabs change' , ( ) => {
45- loginAndWaitForPage ( HOSTS_PAGE_TAB_URLS . uncommonProcesses ) ;
46- waitForTableLoad ( UNCOMMON_PROCCESSES_TABLE ) ;
4752 cy . get ( getPageButtonSelector ( 0 ) ) . should ( 'have.class' , 'euiPaginationButton-isActive' ) ;
4853 let thirdPageResult : string ;
4954 cy . get ( getPageButtonSelector ( 2 ) ) . click ( { force : true } ) ;
@@ -78,7 +83,6 @@ describe('Pagination', () => {
7883 * when we figure out a way to really mock the data, we should come back to it
7984 */
8085 it ( 'pagination resets results and page number to first page when refresh is clicked' , ( ) => {
81- loginAndWaitForPage ( HOSTS_PAGE_TAB_URLS . uncommonProcesses ) ;
8286 cy . get ( NUMBERED_PAGINATION , { timeout : DEFAULT_TIMEOUT } ) ;
8387 cy . get ( getPageButtonSelector ( 0 ) ) . should ( 'have.class' , 'euiPaginationButton-isActive' ) ;
8488 // let firstResult: string;
0 commit comments