@fromeroc9/wdio-locators
v0.1.21
Published
WebdriverIO plugin for custom locators
Downloads
160
Readme
@fromeroc9/wdio-locators
A WebdriverIO plugin for custom locators using decorators.
Installation
To install the package, use npm or yarn:
npm install @fromeroc9/wdio-locators
# or
yarn add @fromeroc9/wdio-locators
## Usage
This package provides two global decorators, android and ios, which can be used to define custom locators for Android and iOS elements in your WebdriverIO tests
import { element } from '@fromeroc9/wdio-locators';
class MyPage {
@platform()
btnEnviar = '//XCUIElementTypeButton[@name="SEND_MAIL"]';
@element("//android.view.View[@name='btn-doc-tipo']")
btnTipoDoc: any;
@element({
android: "//android.view.View[@content-desc='celular]",
ios: '//XCUIElementTypeButton[@name="celular"]'
})
btnCelular: any;
@element()
btnSiguiente= {
android: "//android.view.View[@content-desc='NEXT_STEPS']",
ios: '//XCUIElementTypeButton[@name="NEXT_STEPS"]'
};
@element()
btnAceptar = '//XCUIElementTypeButton[@name="ACEPTAR_TERMINOS"]';
}
API
element(locator?: selector): PropertyDecorator Defines a custom locator for an all element.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any changes.