Gathering detailed insights and metrics for wdio-mobile-utils
Gathering detailed insights and metrics for wdio-mobile-utils
npm install wdio-mobile-utils
Typescript
Module System
Min. Node Version
Node Version
NPM Version
75.2
Supply Chain
99
Quality
75.8
Maintenance
100
Vulnerability
100
License
TypeScript (98.95%)
JavaScript (1.05%)
Total Downloads
59,463
Last Day
19
Last Week
109
Last Month
619
Last Year
10,364
25 Stars
164 Commits
1 Forks
3 Watching
100 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
8.0.2
Package Id
wdio-mobile-utils@8.0.2
Unpacked Size
208.25 kB
Size
37.09 kB
File Count
60
NPM Version
6.13.4
Node Version
12.16.0
Cumulative downloads
Total Downloads
Last day
-40.6%
19
Compared to previous day
Last week
-43.8%
109
Compared to previous week
Last month
6.7%
619
Compared to previous month
Last year
-42.5%
10,364
Compared to previous year
26
A cross-platform mobile end-to-end testing library for WebdriverIO.
Releases for WebdriverIO v5 are released on the v5
branch, while releases for WebdriverIO v6 are releases on the master
branch.
Check the releases here, the releases for WebdriverIO v6 are prefixed with 6-
, while releases for WebdriverIO v5 are prefixed with 5-
.
npm install -D wdio-mobile-utils@8.0.2 # WebdriverIO v6
npm install -D wdio-mobile-utils@7.0.3 # WebdriverIO v5
You can find documentation for the individual methods here: https://martinfrancois.github.io/wdio-mobile-utils/
In cases where you cannot use accessibilityId
s, it is recommended to use ios predicate
for iOS and UiSelector
for Android.
wdio-mobile-utils provides an abstraction to build mobile selectors easily which are cross-platform.
This means you can build your selectors using mobile$
and mobile$$
and wdio-mobile-utils will automatically convert this into an ios predicate
for iOS and UiSelector
for Android for you automatically, depending on which platform the test is running on.
To select one element, use mobile$
, which is the equivalent to $
in WebdriverIO.
To select all elements use mobile$$
, which is the equivalent to $$
in WebdriverIO.
You can find all of the different Selector
s you can use in the TSDoc for Selector.
For example, to select a button which works on both Android and iOS, we can use the following selector with wdio-mobile-utils:
1mobile$(Selector.type(Type.BUTTON));
Internally, it will convert this into the following ios predicate
and UiSelector
selectors, depending on the platform the test is running on:
1// UiSelector 2$('android=new UiSelector().className("android.widget.Button")'); 3 4// ios predicate 5$("-ios predicate string:type == 'XCUIElementTypeButton'");
You can also use multiple selectors together, combining them either with an AND
(&&
) or an OR
(||
) condition:
1Selector.and(selector1, selector2); // AND (&&) condition 2Selector.or(selector1, selector2); // OR (||) condition
For example, to select a button with the text Login
which works on both Android and iOS, we can use the following selector with wdio-mobile-utils:
1// compact form 2mobile$(Selector.and(Selector.type(Type.BUTTON), Selector.text('Login'))); 3 4// long form 5mobile$( 6 Selector.and( 7 Selector.type(Type.BUTTON), 8 Selector.text('Login') 9 ) 10);
Internally, it will convert this into the following ios predicate
and UiSelector
selectors, depending on the platform the test is running on:
1// UiSelector 2$('android=new UiSelector().className("android.widget.Button").text("Login")'); 3 4// ios predicate 5$("-ios predicate string:type == 'XCUIElementTypeButton' && label == 'Login'");
If you can't find a selector you're looking for, if it's generic enough to be useful for others, consider contributing with a PR here.
If you need to use a very specific selector or one that may only work on one platform and you still want to make use of the easy fluent API of wdio-mobile-utils, you can use a custom selector.
For example:
1mobile$( 2 Selector.custom( 3 AndroidSelector.of(ANDROID_UISELECTOR_PROPERTIES.RESOURCE_ID, 'URL'), 4 IosSelector.of(IOS_PREDICATE_ATTRIBUTES.VALUE, IOS_PREDICATE_COMPARATOR.EQUALS, 'URL') 5 ) 6);
To create a selector which only works on one platform, set one of the selectors to null
, like so:
1mobile$( 2 Selector.custom( 3 null, // no selector on Android 4 IosSelector.of(IOS_PREDICATE_ATTRIBUTES.RECT, IOS_PREDICATE_COMPARATOR.EQUALS, 'URL') 5 ) 6);
Note that when creating a selector which only works on one platform (for example, only for iOS), if a test is executed on the other platform (for example, Android), it will throw an error. This also applies in cases where a selector which only works on one platform is combined with a cross-platform selector, which is used on the other platform.
Check out the recording and the slides of my presentation at SauceCon Online 2020 for detailed information on how to use the library.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/8 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
49 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More