File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -1458,16 +1458,18 @@ class WebDriver extends Helper {
14581458 * {{ react }}
14591459 *
14601460 */
1461- async seeElement ( locator ) {
1462- const res = await this . _locate ( locator , true )
1463- assertElementExists ( res , locator )
1464- const selected = await forEachAsync ( res , async el => el . isDisplayed ( ) )
1465- try {
1466- return truth ( `elements of ${ new Locator ( locator ) } ` , 'to be seen' ) . assert ( selected )
1467- } catch ( e ) {
1468- dontSeeElementError ( locator )
1469- }
1461+ async seeElement ( locator ) {
1462+ const elements = await this . _locate ( locator , true ) ;
1463+ assertElementExists ( elements , locator ) ;
1464+
1465+ const visibility = await Promise . all ( elements . map ( el => el . isDisplayed ( ) ) ) ;
1466+
1467+ try {
1468+ return truth ( `elements of ${ new Locator ( locator ) } ` , 'to be seen' ) . assert ( visibility ) ;
1469+ } catch ( error ) {
1470+ dontSeeElementError ( locator ) ;
14701471 }
1472+ }
14711473
14721474 /**
14731475 * {{> dontSeeElement }}
You can’t perform that action at this time.
0 commit comments