![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@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();
Helper class for providing debug information.
Simulate a user.
object
Get a debug user extending a user class.user.
any
Get the needed property.
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
.
Helper class for providing debug information.
Kind: global class
Setup the class.
Param | Type |
---|---|
...args | any |
Proxy.<object>
Generate a instance using the same class constructor and debug emitter.
Kind: instance method of DebugUser
Param | Type |
---|---|
...args | any |
Emit and log an event.
Kind: instance method of DebugUser
Param | Type |
---|---|
callback | string |
...args | any |
Listen to a debug event.
Kind: instance method of DebugUser
Param | Type |
---|---|
...args | any |
Simulate a user.
Kind: global class
boolean
boolean
SimulateUser
| null
Array.<string>
string
string
SimulateUser
string
string
string
string
Proxy.<SimulateUser>
Promise.<undefined>
Promise.<*>
object
Array.<SimulateUser>
SimulateUser
| null
Array.<SimulateUser>
SimulateUser
| null
SimulateUser
| null
SimulateUser
| null
SimulateUser
SimulateUser
| null
SimulateUser
| null
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
Proxy.<SimulateUser>
Generate a instance using the same class constructor and debug emitter.
Kind: instance method of SimulateUser
Param | Type |
---|---|
...args | any |
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 |
---|---|
func | function |
limit | number |
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 nodes.
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 | any |
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 | Default |
---|---|---|
label | string | |
[findOptions] | object | {} |
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 | Array.<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 |
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
object
Get a debug user extending a user class.user.
Kind: global function
Param | Type |
---|---|
Klass | SimulateUser |
any
Get the needed property.
Kind: global function
Param | Type |
---|---|
target | object |
prop | any |
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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.