-->

How can I detect which features are supported in t

2019-09-10 12:48发布

问题:

What's the API to find out "which features and APIs a remote environment supports"? In particular to find out if keyboard actions (like tabbing between form fields) are supported.

Note that http://theintern.github.io/leadfoot/index.html says this is possible:

Enhanced capabilities are also exposed to end-users about which features and APIs a remote environment supports, so you don’t have to browser sniff to decide whether (for example) you’re testing a touch-device or a mouse-device. Optional convenience methods are also available for use, and support for chai-as-promised is built in.

I see http://theintern.github.io/leadfoot/global.html#Capabilities but although it claims they are global variables, I tried if(brokenSendKeys) and it just throws an exception.

回答1:

Session capabilities are available on the remote's environmentType property.

if (this.remote.environmentType.brokenSendKeys) { ... }

The "Globals" section in the Leadfoot docs is just a grouping for definitions that are shared throughout the project.



标签: intern