Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA 2020 support for webdriverio selectors

I have this kind of code:

get alcoholLink() {
    return $('a=Alcohol');
}  

which is valid webriverio selector for getting an element with text 'Alcohol'.
But IntelliJ IDEA underlines it red and displays "unexpected token" error.
Does anybody know how to tweak IntelliJ settings in order to recognize the code as valid webdriverio selector?

Thanks, mismas

like image 979
mismas Avatar asked Nov 01 '25 11:11

mismas


1 Answers

IDEA treats $ as jQuery and thus jQuery-CSS language is auto-injected in $() calls. And 'a=Alcohol' is not a valid CSS selector syntax - thus the error; deselecting the js: JQuery selectors language injection in Settings | Editor | Language Injections should help to get rid of the issue:

enter image description here

like image 119
lena Avatar answered Nov 04 '25 02:11

lena



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!