File tree Expand file tree Collapse file tree 5 files changed +25
-2
lines changed Expand file tree Collapse file tree 5 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -2188,6 +2188,8 @@ class Playwright extends Helper {
21882188 let chunked = chunkArray ( attrs , values . length ) ;
21892189 chunked = chunked . filter ( ( val ) => {
21902190 for ( let i = 0 ; i < val . length ; ++ i ) {
2191+ // the attribute could be a boolean
2192+ if ( typeof val [ i ] === 'boolean' ) return val [ i ] === values [ i ] ;
21912193 // if the attribute doesn't exist, returns false as well
21922194 if ( ! val [ i ] || ! val [ i ] . includes ( values [ i ] ) ) return false ;
21932195 }
Original file line number Diff line number Diff line change @@ -1842,6 +1842,8 @@ class Puppeteer extends Helper {
18421842 for ( let i = 0 ; i < val . length ; ++ i ) {
18431843 const _actual = Number . isNaN ( val [ i ] ) || ( typeof values [ i ] ) === 'string' ? val [ i ] : Number . parseInt ( values [ i ] , 10 ) ;
18441844 const _expected = Number . isNaN ( values [ i ] ) || ( typeof values [ i ] ) === 'string' ? values [ i ] : Number . parseInt ( values [ i ] , 10 ) ;
1845+ // the attribute could be a boolean
1846+ if ( typeof _actual === 'boolean' ) return _actual === _expected ;
18451847 // if the attribute doesn't exist, returns false as well
18461848 if ( ! _actual || ! _actual . includes ( _expected ) ) return false ;
18471849 }
Original file line number Diff line number Diff line change @@ -1631,6 +1631,8 @@ class WebDriver extends Helper {
16311631 for ( let i = 0 ; i < val . length ; ++ i ) {
16321632 const _actual = Number . isNaN ( val [ i ] ) || ( typeof values [ i ] ) === 'string' ? val [ i ] : Number . parseInt ( val [ i ] , 10 ) ;
16331633 const _expected = Number . isNaN ( values [ i ] ) || ( typeof values [ i ] ) === 'string' ? values [ i ] : Number . parseInt ( values [ i ] , 10 ) ;
1634+ // the attribute could be a boolean
1635+ if ( typeof _actual === 'boolean' ) return _actual === _expected ;
16341636 if ( _actual !== _expected ) return false ;
16351637 }
16361638 return true ;
Original file line number Diff line number Diff line change 2525 <a href="/spinner" qa-id = "test" qa-link = "test">Spinner</a>
2626</div>
2727
28+ <div id="area5" qa-id = "test">
29+ <input qa-id = "test" qa-link = "test" disabled>Hidden input</a>
30+ </div>
31+
2832A wise man said: "debug!"
2933
3034<?php print_r ($ _POST ); ?>
Original file line number Diff line number Diff line change @@ -1319,8 +1319,8 @@ module.exports.tests = function () {
13191319 } ) ;
13201320
13211321 describe ( '#seeAttributesOnElements' , ( ) => {
1322- it . skip ( 'should check attributes values for given element' , async function ( ) {
1323- if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
1322+ it ( 'should check attributes values for given element' , async function ( ) {
1323+ if ( isHelper ( 'TestCafe' ) || isHelper ( 'WebDriver' ) ) this . skip ( ) ;
13241324
13251325 try {
13261326 await I . amOnPage ( '/info' ) ;
@@ -1387,6 +1387,19 @@ module.exports.tests = function () {
13871387 e . message . should . include ( 'expected all elements ({css: a[href="/team"]}) to have attributes {"disable":true} "0" to equal "1"' ) ;
13881388 }
13891389 } ) ;
1390+
1391+ it ( 'should verify the boolean attribute' , async function ( ) {
1392+ if ( isHelper ( 'TestCafe' ) || isHelper ( 'WebDriver' ) ) this . skip ( ) ;
1393+
1394+ try {
1395+ await I . amOnPage ( '/' ) ;
1396+ await I . seeAttributesOnElements ( 'input' , {
1397+ disabled : true ,
1398+ } ) ;
1399+ } catch ( e ) {
1400+ e . message . should . include ( 'expected all elements (input) to have attributes {"disabled":true} "0" to equal "1"' ) ;
1401+ }
1402+ } ) ;
13901403 } ) ;
13911404
13921405 describe ( '#seeCssPropertiesOnElements' , ( ) => {
You can’t perform that action at this time.
0 commit comments