![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
@netsells/simulate-user
Advanced tools
Library for simulating user interactions using JavaScript in the browser
Library for simulating user interactions using JavaScript in the browser
yarn add @netsells/simulate-user
import SimulateUser from '@netsells/simulate-user';
const sim = new SimulateUser();
const el = await sim.find({ query: 'a', text: 'Click me' });
await el.click();
Simulate a user
Object
SearchProperties
| String
| Number
A generic value selector. For a textarea
or input
it should always be a
string or number, for a select
it can be a string or a SearchProperties
Simulate a user
Kind: global class
Boolean
Boolean
SimulateUser
| null
Array.<String>
String
String
SimulateUser
String
String
String
String
Promise.<undefined>
Promise.<*>
Object
Array.<SimulateUser>
SimulateUser
| null
Array.<SimulateUser>
SimulateUser
| null
SimulateUser
| null
SimulateUser
| null
SimulateUser
SimulateUser
| null
SimulateUser
| null
SimulateUser
SimulateUser
Create a SimulateUser class for a page element
Param | Type |
---|---|
node | HTMLElement |
Boolean
Check if the node is visible
Kind: instance property of SimulateUser
Boolean
Check if the node is hidden
Kind: instance property of SimulateUser
SimulateUser
| null
nextElementSibling but returns a wrapper
Kind: instance property of SimulateUser
Array.<String>
Get all select option values
Kind: instance property of SimulateUser
String
Get trimmed text content
Kind: instance property of SimulateUser
String
Get text content which is a direct child of this node
Kind: instance property of SimulateUser
SimulateUser
Get the parentElement in a wrapper
Kind: instance property of SimulateUser
String
Proxy for className
Kind: instance property of SimulateUser
String
Proxy for value
Kind: instance property of SimulateUser
String
Proxy for htmlFor
Kind: instance property of SimulateUser
String
tagName but lower case
Kind: instance property of SimulateUser
Promise.<undefined>
Returns a promise which resolves in a certain amount of milliseconds
Kind: instance method of SimulateUser
Param | Type |
---|---|
timeout | Number |
Promise.<*>
Returns a promise which times out if the passed in promise doesn't resolve in time
Kind: instance method of SimulateUser
Param | Type | Default |
---|---|---|
func | function | |
limit | Number | 2000 |
Object
Get options for an event
Kind: instance method of SimulateUser
Param | Type |
---|---|
options | Object |
Array.<SimulateUser>
Proxy for querySelectorAll but returns an array of wrappers instead of nods
Kind: instance method of SimulateUser
Param | Type |
---|---|
query | String | Array.<String> |
SimulateUser
| null
getElementById but returns a wrapper
Kind: instance method of SimulateUser
Param | Type |
---|---|
id | String |
Array.<SimulateUser>
getElementsByName but returns an array of wrappers
Kind: instance method of SimulateUser
Param | Type |
---|---|
name | String |
SimulateUser
| null
closest but returns a wrapper
Kind: instance method of SimulateUser
Param | Type |
---|---|
...args | * |
SimulateUser
| null
Search through page elements as a user would, using text
Kind: instance method of SimulateUser
Param | Type |
---|---|
options | SearchProperties |
SimulateUser
| null
Get the first element of a query to all
Kind: instance method of SimulateUser
Param | Type |
---|---|
options | SearchProperties |
SimulateUser
Get the first element of a query to all
, but throws an error if it's
not found. Will wait for an element to appear (e.g. if a form is
updating)
Kind: instance method of SimulateUser
Throws:
Error
Param | Type | Description |
---|---|---|
options | SearchProperties | |
[options.similar] | Boolean | If no exact matches found, fall back to a fuzzy search |
limit | Number |
SimulateUser
| null
Get a field based on its label
Kind: instance method of SimulateUser
Throws:
Error
Param | Type |
---|---|
label | String |
SimulateUser
| null
Get a fieldset based on its legend
Kind: instance method of SimulateUser
Throws:
Error
Param | Type |
---|---|
legend | String |
Proxy for dispatchEvent
Kind: instance method of SimulateUser
Param | Type |
---|---|
event | Event |
Click this node
Kind: instance method of SimulateUser
Param | Type | Default |
---|---|---|
search | SearchProperties |
|
Attach files to this input element
Kind: instance method of SimulateUser
Param | Type |
---|---|
files | Enumerable.<Files> |
Check this checkbox
Kind: instance method of SimulateUser
Param | Type | Default |
---|---|---|
checked | Boolean | true |
Focus this element
Kind: instance method of SimulateUser
Blur this element
Kind: instance method of SimulateUser
Type a single key on this element
Kind: instance method of SimulateUser
Param | Type |
---|---|
key | String |
Type a string on this element
Kind: instance method of SimulateUser
Param | Type |
---|---|
text | String |
Type into a fields value. Only simulates the final key press then triggers a single change event
Kind: instance method of SimulateUser
Param | Type |
---|---|
text | String | Number |
SimulateUser
Find a field by its label then fill it in
Kind: instance method of SimulateUser
Returns: SimulateUser
- - The field wrapper
Param | Type |
---|---|
label | String |
value | ValueSelector |
Fill in this node as a field
Kind: instance method of SimulateUser
Param | Type |
---|---|
value | ValueSelector |
SimulateUser
Deprecated
Find a select by its label then fill it in
Kind: instance method of SimulateUser
Returns: SimulateUser
- - The field wrapper
Param | Type |
---|---|
label | String |
text | String |
options | SearchProperties |
Change a value by the option text
Kind: instance method of SimulateUser
Param | Type |
---|---|
value | ValueSelector |
Send a change event
Kind: instance method of SimulateUser
SimulateUser
Generate a instance using the same class constructor
Kind: static method of SimulateUser
Param | Type |
---|---|
...args | * |
Object
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
text | String | Text to search on |
query | String | Optional query to filter on |
caseSensitive | Boolean | Whether text is case sensitive |
exact | Boolean | Whether text match should be exact (not including trimmed white space) |
predicate | function | Predicate function wrappers must match |
visible | Boolean | If element must be visible or not |
direct | Boolean | If text should be a direct child or not |
SearchProperties
| String
| Number
A generic value selector. For a textarea
or input
it should always be a
string or number, for a select
it can be a string or a SearchProperties
Kind: global typedef
FAQs
Library for simulating user interactions using JavaScript in the browser
The npm package @netsells/simulate-user receives a total of 2 weekly downloads. As such, @netsells/simulate-user popularity was classified as not popular.
We found that @netsells/simulate-user demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.