@@ -146,6 +146,20 @@ it('should keep dom order with comma separated list', async ({page}) => {
146
146
expect ( await page . $$eval ( `css=section >> *css=div,span >> css=y` , els => els . map ( e => e . nodeName ) . join ( ',' ) ) ) . toBe ( 'SPAN,DIV' ) ;
147
147
} ) ;
148
148
149
+ it ( 'should work with comma separated list in various positions' , async ( { page} ) => {
150
+ await page . setContent ( `<section><span><div><x></x><y></y></div></span></section>` ) ;
151
+ expect ( await page . $$eval ( `css=span,div >> css=x,y` , els => els . map ( e => e . nodeName ) . join ( ',' ) ) ) . toBe ( 'X,Y' ) ;
152
+ expect ( await page . $$eval ( `css=span,div >> css=x` , els => els . map ( e => e . nodeName ) . join ( ',' ) ) ) . toBe ( 'X' ) ;
153
+ expect ( await page . $$eval ( `css=div >> css=x,y` , els => els . map ( e => e . nodeName ) . join ( ',' ) ) ) . toBe ( 'X,Y' ) ;
154
+ expect ( await page . $$eval ( `css=div >> css=x` , els => els . map ( e => e . nodeName ) . join ( ',' ) ) ) . toBe ( 'X' ) ;
155
+
156
+ expect ( await page . $$eval ( `css=section >> css=div >> css=x` , els => els . map ( e => e . nodeName ) . join ( ',' ) ) ) . toBe ( 'X' ) ;
157
+ expect ( await page . $$eval ( `css=section >> css=span >> css=div >> css=y` , els => els . map ( e => e . nodeName ) . join ( ',' ) ) ) . toBe ( 'Y' ) ;
158
+ expect ( await page . $$eval ( `css=section >> css=div >> css=x,y` , els => els . map ( e => e . nodeName ) . join ( ',' ) ) ) . toBe ( 'X,Y' ) ;
159
+ expect ( await page . $$eval ( `css=section >> css=div,span >> css=x,y` , els => els . map ( e => e . nodeName ) . join ( ',' ) ) ) . toBe ( 'X,Y' ) ;
160
+ expect ( await page . $$eval ( `css=section >> css=span >> css=x,y` , els => els . map ( e => e . nodeName ) . join ( ',' ) ) ) . toBe ( 'X,Y' ) ;
161
+ } ) ;
162
+
149
163
it ( 'should work with comma inside text' , async ( { page} ) => {
150
164
await page . setContent ( `<span></span><div attr="hello,world!"></div>` ) ;
151
165
expect ( await page . $eval ( `css=div[attr="hello,world!"]` , e => e . outerHTML ) ) . toBe ( '<div attr="hello,world!"></div>' ) ;
0 commit comments