简体   繁体   中英

check for Protractor truth, toBeTruthy on a Protractor method, click()

I am curious if a click method's ability to click and icon is valid when you have code simiilar to:

expect(element(by.id('elementToClick')).click()).toBeTruthy();

I'm not sure about elementToBeClickable(), anyone try that on an icon that exists, is visible, yet is disabled for a click( style="pointer-events: none;"). I haven't really had a chance to test elementToBeClickable() yet.

Thanks

This might be of help

componentDebugElement.query(By.css('elementToClick')).triggerEventHandler('click', null)

the code:

expect(element(by.id('elementToClick')).click()).toBeTruthy();

seems to work. After I disabled the href with the 'pointer-events:none'. It returned a false. I guess I had to have the correct luck and code. Thanks for an attempt user8019967.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM