@@ -3,8 +3,9 @@ describe('Test the Data view docs page', () => {
33 it ( 'displays a layout with a table and paginates' , ( ) => {
44 const ouiaId = 'LayoutExample' ;
55
6- cy . visit ( 'http://localhost:8006/extensions/data-view/layout ' ) ;
6+ cy . visit ( 'http://localhost:8006/extensions/data-view/data-view ' ) ;
77
8+ cy . get ( `[data-ouia-component-id="${ ouiaId } -th-0"]` ) . scrollIntoView ( ) . contains ( 'Repositories' ) ;
89 cy . get ( `[data-ouia-component-id="${ ouiaId } Header-pagination"]` ) . should ( 'exist' ) ;
910 cy . get ( `[data-ouia-component-id="${ ouiaId } Header-bulk-select"]` ) . should ( 'exist' ) ;
1011
@@ -27,11 +28,17 @@ describe('Test the Data view docs page', () => {
2728 cy . get ( `[data-ouia-component-id="${ ouiaId } -td-0-4"]` ) . contains ( 'Timestamp one' ) ;
2829
2930 // test bulk select
30- cy . get ( `input[type="checkbox"` ) . each ( ( $checkbox ) => { cy . wrap ( $checkbox ) . should ( 'not.be.checked' ) } ) ;
31+ cy . get ( '[data-ouia-component-id="LayoutExample"] input[type="checkbox"]' )
32+ . each ( ( $checkbox ) => {
33+ cy . wrap ( $checkbox ) . should ( 'not.be.checked' ) ;
34+ } ) ;
3135
3236 // page checkbox select
3337 cy . get ( `[data-ouia-component-id="BulkSelect-checkbox"` ) . first ( ) . click ( ) ;
34- cy . get ( `input[type="checkbox"` ) . each ( ( $checkbox ) => { cy . wrap ( $checkbox ) . should ( 'be.checked' ) } ) ;
38+ cy . get ( '[data-ouia-component-id="LayoutExample"] input[type="checkbox"]' )
39+ . each ( ( $checkbox ) => {
40+ cy . wrap ( $checkbox ) . should ( 'be.checked' ) ;
41+ } ) ;
3542 cy . contains ( '5 selected' ) . should ( 'exist' ) ;
3643
3744 // select none
@@ -42,18 +49,27 @@ describe('Test the Data view docs page', () => {
4249 // select all
4350 cy . get ( `[data-ouia-component-id="BulkSelect-toggle"` ) . first ( ) . click ( { force : true } ) ;
4451 cy . get ( `[data-ouia-component-id="BulkSelect-select-all"` ) . first ( ) . click ( ) ;
45- cy . get ( `input[type="checkbox"` ) . each ( ( $checkbox ) => { cy . wrap ( $checkbox ) . should ( 'be.checked' ) } ) ;
52+ cy . get ( '[data-ouia-component-id="LayoutExample"] input[type="checkbox"]' )
53+ . each ( ( $checkbox ) => {
54+ cy . wrap ( $checkbox ) . should ( 'be.checked' ) ;
55+ } ) ;
4656 cy . contains ( '6 selected' ) . should ( 'exist' ) ;
4757
4858 // page checkbox deselect
4959 cy . get ( `[data-ouia-component-id="BulkSelect-checkbox"` ) . first ( ) . click ( ) ;
50- cy . get ( `input[type="checkbox"` ) . each ( ( $checkbox ) => { cy . wrap ( $checkbox ) . should ( 'not.be.checked' ) } ) ;
60+ cy . get ( '[data-ouia-component-id="LayoutExample"] input[type="checkbox"]' )
61+ . each ( ( $checkbox ) => {
62+ cy . wrap ( $checkbox ) . should ( 'not.be.checked' ) ;
63+ } ) ;
5164 cy . contains ( '1 selected' ) . should ( 'exist' ) ;
5265
5366 // select page
5467 cy . get ( `[data-ouia-component-id="BulkSelect-toggle"` ) . first ( ) . click ( { force : true } ) ;
5568 cy . get ( `[data-ouia-component-id="BulkSelect-select-page"` ) . first ( ) . click ( ) ;
56- cy . get ( `input[type="checkbox"` ) . each ( ( $checkbox ) => { cy . wrap ( $checkbox ) . should ( 'be.checked' ) } ) ;
69+ cy . get ( '[data-ouia-component-id="LayoutExample"] input[type="checkbox"]' )
70+ . each ( ( $checkbox ) => {
71+ cy . wrap ( $checkbox ) . should ( 'be.checked' ) ;
72+ } ) ;
5773 cy . contains ( '6 selected' ) . should ( 'exist' ) ;
5874 } )
5975} ) ;
0 commit comments