javascript - Is there a less "hacky" way to check an items visibility? -


i testing single page app, navigation page revealed when user clicks appropriate icon. wanted check , see prior clicking if page open. on page company name label. visible naked eye when navigation page displayed.

the problem running .isdisplayed() returning true when use that. have used ec.visibilityof() returns true well. below works, not happy , wondering if there better way.

    navigationopenclick() {     if (this.ec.elementtobeselected(this.navpage.companyname)) {         this.navicon.click();     } } 

my brain had flatulence , forgot .isdisplayed() returns promise. once resolved promise, .isdisplayed() worked should.

my not "hacky" working code below:

   navigationopenclick() {     this.navpage.companyname.isdisplayed().then((displayed) => {         if (!displayed) {             this.navicon.click();         };     }); } 

Comments

Popular posts from this blog

php - trouble displaying mysqli database results in correct order -

depending on nth recurrence of job in control M -

sql server - Cannot query correctly (MSSQL - PHP - JSON) -