xframium / xframium-java

xFramium - Rapid unified test case development
http://www.xframium.org
GNU General Public License v3.0
12 stars 18 forks source link

Add 'context' attribute to <element> tag #21

Closed gregjacobs closed 7 years ago

gregjacobs commented 8 years ago

Hey guys, was just talking to @allengeary and wanted to record a possible suggestion for dealing with native/webview context in a hybrid app: add a 'context' attribute to the <element> tag.

An example:

<model siteName="My App">
    <page name="Login">
        <element name="USERNAME" value=".username" descriptor="CSS" context="WEBVIEW_1" />
        <element name="PASSWORD" value=".password" descriptor="CSS" context="WEBVIEW_1" />
        <element name="SUBMIT" value=".submit" descriptor="CSS" context="WEBVIEW_1" />
        <element name="LOCATION_ALERT_ALLOW_BTN" value="//UIAButton[@name='Allow']" descriptor="XPATH" context="NATIVE" />
    </page>
</model>

This would save developers from needing to add manual steps to tests to switch between contexts.

xframium commented 8 years ago

This is in progress but did not make the 1.0.5 build. It will be released in 1.0.6

xframium commented 7 years ago

devicContext is now an attribute on the element tag automatically switching to the specified context of the underlying web driver is context aware