npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

moilate

v1.2.3

Published

Moilate is a element selector which makes element selection easy for e2e testing on mobile platforms. It based on Appium and Webdriverio frameworks.

Downloads

2

Readme

Moilate

Moilate is a element selector which makes element selection easy for e2e testing on mobile platforms. It based on Appium and Webdriverio frameworks.

Table of Content

Overview

Moilate's aim is to simplify the element selection for both android and ios drivers which are UIAutomator, IOS Predicate String etc. It uses those native drivers via webdriverio and translate each of them syntax into perceptible query pattern. In addition, this query pattern provides common functions for both platform with catch syntax. For example;

The following code is to select an element which contains a text by using UIAutomator on Android :

new UiSelector().text("Some Button")

This selection could be done like in following by using IOS Predicate string on ios platform;

-ios predicate string:name CONTAINS 'Some Button'

In moilate this can be done for both platforms by following statement;

this.locator.selector()
			.contains("button_toolbarDone", SelectorProperty)
			.build();

Installation

To install moilate using yarn

yarn add moilate

Or npm

npm install moilate

Concepts

SelectorProperty

SelectorProperty is the one of the vital concept on moilate which is simply a function parameter indicates the property of any mobile platform. Obviously, each platform has its own property such as resourceId, name, text etc. In order to select any element successfuly, selector property must be defined on query pattern. For example, you can select an element by using resourceId property on Android and ,likewise, can select a element by using name property on ios.

this.locator.selector()
.exactMatch("com.app:id/some_id",
SelectorProperty.Android.UIAutomator.RESOURCE_ID)
.build();
this.locator
.selector()
.contains("some_name", SelectorProperty.IOS.IOSPredicate.NAME)
.build();

All selector properties are defined in the GeneralEnumaration for both platforms.

Build a Query

To complete the selection query, each statement should end with the build function. Since moilate support operators like or, and, not, this function indicates that query chain is completed and selection should be done with certain query. For example,

this.locator
.selector()
.contains("some_name", SelectorProperty.IOS.IOSPredicate.NAME)
.or()
.contains("another_name", SelectorProperty.IOS.IOSPredicate.NAME)
.build();

Working with Events

Besides the element selection, moilate also support some basic events for e2e testing. After query building, a event can be triggered by simply adding the certain function end of the build function. For example,

this.locator
.selector()
.contains("some_name", SelectorProperty.IOS.IOSPredicate.NAME)
.click();

Currently supported events as follows;

  • click() : to click selected element.

  • pick(value:string) : to pick a value from selected dropdown.

  • exists() : to check whether selected element is exist or not.

  • wait(timeout: number = 5000): to wait certain time, default waiting time is 5000ms. To use this function query building is not needed like;

    this.locator.wait()

Examples

  • on IOS;

if (browser.isIOS) {
this.locator
.selector()
.contains("example1", SelectorProperty.IOS.IOSPredicate.NAME)
.build()
.click();

this.locator
.selector()
.contains("textField_example", SelectorProperty.IOS.IOSPredicate.NAME)
.build()
.click();

this.locator
.selector()
.exactMatch("XCUIElementTypePickerWheel", SelectorProperty.IOS.IOSPredicate.TYPE)
.build()

this.locator
.selector()
.contains("button_example", SelectorProperty.IOS.IOSPredicate.NAME)
.build()
.click();
this.locator.wait(4000)
}
  • on Android;
if (browser.isAndroid) { // For Android 
this.locator.selector()
.exactMatch("com.app:id/changeCountryLanguageLayout", SelectorProperty.Android.UIAutomator.RESOURCE_ID)
.build()
.click();

let  currentLangOnApp = this.locator.selector()
.exactMatch("com.app:id/language", SelectorProperty.Android.UIAutomator.RESOURCE_ID)
.build().label().slice(0, 2)

this.locator
.selector()
.exactMatch("com.app:id/countryLayout", SelectorProperty.Android.UIAutomator.RESOURCE_ID)
.build()
.click();

this.locator
.selector()
.exactMatch("com.app:id/select_dialog_listview", SelectorProperty.Android.UIAutomator.RESOURCE_ID)
.build()
.pick("Turkey");
}

Contributing

To contribute moilate, you can follow Contribution.md

Credits

License

Moilate is MIT licensed