@@ -319,11 +319,14 @@ Received: "This is example text"`
319319 { elements : await $$ ( 'sel' ) , title : 'awaited ChainablePromiseArray' } ,
320320 { elements : await $$ ( 'sel' ) . getElements ( ) , title : 'awaited getElements of ChainablePromiseArray (e.g. WebdriverIO.ElementArray)' } ,
321321 { elements : await $$ ( 'sel' ) . filter ( ( t ) => t . isEnabled ( ) ) , title : 'awaited filtered ChainablePromiseArray (e.g. WebdriverIO.Element[])' } ,
322- // Bug that will be fixed later with $$ support
322+
323+ // Bug that will be fixed later with $$ support. Throws `Error: Can't call "getText" on element with selector "label", it is not a function`
323324 // { elements: $$('sel'), title: 'non-awaited of ChainablePromiseArray' }
324- ] ) ( 'given a multiple elements when $title' , ( { elements } ) => {
325+ ] ) ( 'given a multiple elements when $title' , ( { elements, title } ) => {
325326 let els : ChainablePromiseArray | WebdriverIO . ElementArray //| WebdriverIO.Element[] // Bug that will be fixed later with $$ support
326327
328+ const selectorName = title . includes ( 'WebdriverIO.Element[]' ) ? '' : '$$(`sel`)' // Bug to fix where with Element[] selector name is empty
329+
327330 beforeEach ( async ( ) => {
328331 els = elements as ChainablePromiseArray | WebdriverIO . ElementArray // casting, bug that will be fixed later with $$ support
329332
@@ -375,7 +378,7 @@ Received: "This is example text"`
375378 // Expected vs received is wierd, to be fixed later with $$ support
376379 expect ( result . message ( ) ) . toEqual ( `\
377380Test
378- Expect to have text
381+ Expect ${ selectorName } to have text
379382
380383- Expected - 1
381384+ Received + 2
@@ -435,7 +438,7 @@ Expect to have text
435438 expect ( result . pass ) . toBe ( false )
436439 // Buggy error message to fix later with $$ support
437440 expect ( result . message ( ) ) . toEqual ( `\
438- Expect to have text
441+ Expect ${ selectorName } to have text
439442
440443- Expected - 3
441444+ Received + 1
@@ -457,7 +460,7 @@ Expect to have text
457460 // Buggy error message to fix later with $$ support
458461 expect ( result . message ( ) ) . toEqual ( `\
459462Test
460- Expect to have text
463+ Expect ${ selectorName } to have text
461464
462465- Expected - 4
463466+ Received + 2
0 commit comments