For the SelectText function make start and end position part of the options object.
What is your Test Scenario?
I want to pass in some action options to the selectText function, but in order to do so i have to supply the start and end position for select text. the default start position is easy because its just 0 but the default end position states in the documentation: Length of the visible text content.. So in order to pass in the default value for end position I would have to figure out a way to get the length of the current text content, which I am sure is possible, it just seems like alot of work just so I can pass in some other options to this function.
What are you suggesting?
you should move those 2 parameters (start pos and end pos) into the options parameter so that way I don't have to re-pass in the default values.
What alternatives have you considered?
Additional context
My current work around is to simply pass in the value 100 for the end position because I don't think I have any text that will be that long.
You can pass undefined as an argument value to keep it default.
Thank you Alex, I did not know that, is there somewhere in the documentation that states this? or is this something particular to JS I just didn't know about.
You are welcome. It's in JavaScript reference. For example, here:
Default function parameters allow named parameters to be initialized with default values if no value or
undefinedis passed.
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.