.text()

  • function
FuncUnit.prototype.text  

text([text] [,timeout] [,success] [,message])

Gets the text from an element or waits until the text is a certain value.

//checks foo's text has "JupiterJS"
ok( /JupiterJS/.test(F('#foo').text() ) )

//waits until bar's text has JupiterJS
F('#foo').text(/JupiterJS/)

//waits until bar's text is JupiterJS
F('#foo').text("JupiterJS")

Parameters

  1. text {String | function()}Optional

    If provided uses this as a check before continuing to the next action.

  2. timeout {Number}Optional

    overrides FuncUnit.timeout. If provided, the wait will fail if not completed before this timeout.

  3. success {function()}Optional

    a callback that will run after this action completes.

  4. message {String}Optional

    if provided, an assertion will be passed when this wait condition completes successfully

Returns

{String | funcUnit}

if the text parameter is provided, returns the funcUnit selector for chaining, otherwise returns the html of the selector.