File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
tests/cypress/support/pageObjects Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,27 @@ class performancePage {
106
106
this . getDesktopToggle ( ) . should ( 'have.attr' , 'aria-checked' , 'true' ) ;
107
107
}
108
108
109
+ linkPrefetchCapabilityCheck ( type ) {
110
+ this . getDropDownForLinkPrefetch ( ) . click ( ) ;
111
+ this . getDropDownForLinkPrefetch ( )
112
+ . invoke ( 'text' )
113
+ . then ( ( buttonLabel ) => {
114
+ if ( 'onlyMouseDown' === type ) {
115
+ cy . get ( '[data-cy="link-prefetch-behavior-desktop"] .nfd-select__options > li' )
116
+ . should ( 'have.length' , 1 )
117
+ . invoke ( 'text' )
118
+ . then ( itemText => {
119
+ const trimmedText = itemText . trim ( ) ;
120
+ cy . log ( 'Found element text:' , trimmedText ) ;
121
+ expect ( trimmedText ) . to . equal ( 'Prefetch on Mouse Down' ) ;
122
+ } ) ;
123
+ } else {
124
+ cy . get ( '[data-cy="link-prefetch-behavior-desktop"] .nfd-select__options > li' )
125
+ . should ( 'have.length' , 2 ) ;
126
+ }
127
+ } ) ;
128
+ }
129
+
109
130
compareDropdownLabelAndSelectedOption ( ) {
110
131
// Get the text from the dropdown button label
111
132
this . getDropDownForLinkPrefetch ( )
You can’t perform that action at this time.
0 commit comments